Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept empty packed headers attribute in vaCreateConfig() #358

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

fhvwy
Copy link
Contributor

@fhvwy fhvwy commented Feb 13, 2018

This indicates to the driver that the user will not supply any packed
headers, even though the possibility is available. This was an API/ABI
break in cccf2a3, and existing programs
such as libavcodec do use this pattern.

@uartie
Copy link
Contributor

uartie commented Feb 15, 2018

If the driver reports the attribute as unsupported, then shouldn't unsupported be the only acceptable value?

@uartie
Copy link
Contributor

uartie commented Feb 15, 2018

See fe0cac2

@uartie
Copy link
Contributor

uartie commented Feb 15, 2018

Also, libavcodec already does the right thing... see intel/libva#178 (comment)

@fhvwy
Copy link
Contributor Author

fhvwy commented Feb 15, 2018

If the driver reports the attribute as unsupported, then shouldn't unsupported be the only acceptable value?

Yes. However, the problem here is for VP9 which does report some packed headers as supported.

Also, libavcodec already does the right thing... see intel/libva#178 (comment)

I agree. Unfortunately, the current Intel driver rejects this behaviour and therefore VP9 encoding is broken when using it on all versions of libavcodec. (Hence considering it a ABI compatibility break, because programs which previously worked on the version 1.8 or 2.0 drivers no longer do.)

@uartie
Copy link
Contributor

uartie commented Feb 15, 2018

Ah, I see, so VP9 RAW packed header is optional. And therefore, all packed headers must be treated as optional since there is no way to explicitly relay it otherwise :-/

@uartie
Copy link
Contributor

uartie commented Feb 15, 2018

Would you mind adding a unit test, at least for the VP9 case, so we can detect if this gets broken again in the future?

@fhvwy
Copy link
Contributor Author

fhvwy commented Feb 15, 2018

@uartie Complete test added as #361. I made a separate PR because I don't really know what I'm doing with the test framework and I don't want it to block merging this fix.

(This branch also updated to pass the test.)

@uartie uartie requested a review from xhaihao February 20, 2018 16:37
uartie added a commit to uartie/libva-utils that referenced this pull request Feb 23, 2018
Driver should allow 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE) value
for the VAConfigAttribEncPackedHeaders attribute during
vaCreateConfig when the attribute is supported.

This test supercedes intel/intel-vaapi-driver#361

Also see intel/intel-vaapi-driver#358 and intel/libva#178

Signed-off-by: U. Artie Eoff <[email protected]>
@uartie
Copy link
Contributor

uartie commented Feb 23, 2018

@xhaihao bump

@uartie
Copy link
Contributor

uartie commented Feb 26, 2018

It seems we may want to continue to support VA_ENC_PACKED_HEADER_NONE until it's deprecated and removed.

@fhvwy
Copy link
Contributor Author

fhvwy commented Mar 8, 2018

@xhaihao Updated with a warning for the empty set case.

i965_log_info(ctx, "vaCreateConfig: invalid EncPackedHeaders attribute %#x: "
"packed headers are not supported.\n", attrib_found->value);
vaStatus = VA_STATUS_ERROR_INVALID_VALUE;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the driver doesn't support packed header at all, application should not pass VAConfigAttribEncPackedHeaders to the driver. so I think the driver should return error no matter what is attrib_found->value

@fhvwy
Copy link
Contributor Author

fhvwy commented Mar 13, 2018

@xhaihao Sure, updated.

@xhaihao
Copy link
Contributor

xhaihao commented Mar 14, 2018

Could you update the commit log as well? Per the commit log, vaCreateConfig() can accept VAConfigAttribEncPackedHeaders when packed header is not supported.

If packed headers are supported, then the provided value must be some
(possibly empty) subset of the supported headers.

This fixes config creation with an empty packed header set, which the
user may pass if they don't want to provide any packed headers.  This
pattern is used in at least libavcodec, where VP9 encoding is broken
prior to this change.

Since there is intent to deprecate this behaviour in future, also add
warnings to this case and the other possible failure modes here.

Fixes intel#362.

Signed-off-by: Mark Thompson <[email protected]>
@fhvwy
Copy link
Contributor Author

fhvwy commented Mar 15, 2018

@xhaihao Sure, updated.

@xhaihao xhaihao merged commit 7c5820d into intel:master Mar 15, 2018
@xhaihao
Copy link
Contributor

xhaihao commented Mar 15, 2018

Thanks for the patch, applied. @fhvwy

xhaihao pushed a commit to intel/libva-utils that referenced this pull request Mar 19, 2018
Driver should allow 0x0 (i.e. VA_ENC_PACKED_HEADER_NONE) value
for the VAConfigAttribEncPackedHeaders attribute during
vaCreateConfig when the attribute is supported.

This test supercedes intel/intel-vaapi-driver#361

Also see intel/intel-vaapi-driver#358 and intel/libva#178

Signed-off-by: U. Artie Eoff <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants