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

Add new error code to indicate the reset happended in the driver. #714

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions va/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ typedef int VAStatus; /** Return status type from functions */
#define VA_STATUS_ERROR_NOT_ENOUGH_BUFFER 0x00000025
/** \brief Indicate an operation isn't completed because time-out interval elapsed. */
#define VA_STATUS_ERROR_TIMEDOUT 0x00000026
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF

/**
* 1. De-interlacing flags for vaPutSurface()
Expand Down Expand Up @@ -669,8 +669,8 @@ typedef enum {
* at vaBeginPicture() time refers to the decode output surface. The
* target surface for the output of processing needs to be a different
* surface since the decode process requires the original reconstructed buffer.
* The surface member of VAProcPipelineParameterBuffer should be set to the
* same as render_target set in vaBeginPicture(), but the driver may choose
* The "surface" member of VAProcPipelineParameterBuffer should be set to the
* same as "render_target" set in vaBeginPicture(), but the driver may choose
* to ignore this parameter.
*/
VAConfigAttribDecProcessing = 8,
Expand Down Expand Up @@ -4205,6 +4205,7 @@ VAStatus vaQuerySurfaceStatus(
typedef enum {
VADecodeSliceMissing = 0,
VADecodeMBError = 1,
VADecodeReset = 2,
} VADecodeErrorType;

/**
Expand All @@ -4224,9 +4225,15 @@ typedef struct _VASurfaceDecodeMBErrors {
/**
* After the application gets VA_STATUS_ERROR_DECODING_ERROR after calling vaSyncSurface(),
* it can call vaQuerySurfaceError to find out further details on the particular error.
* VA_STATUS_ERROR_DECODING_ERROR should be passed in as "error_status",
* upon the return, error_info will point to an array of _VASurfaceDecodeMBErrors structure,
* which is allocated and filled by libVA with detailed information on the missing or error macroblocks.
* VA_STATUS_ERROR_DECODING_ERROR should be passed in as "error_status".
*
* After the applications get VA_STATUS_HW_BUSY or VA_STATUS_SUCCESSFULL from vaSyncSurface(),
* it still can call vaQuerySurfaceError to find out further details to know if has real hw reset
* happened on this surface since umd and kmd could recover the context from reset with success in sometimes.
* VA_STATUS_HW_BUSY or VA_STATUS_SUCCESSFULL also could be passed in as "error_status".
Copy link
Contributor

Choose a reason for hiding this comment

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

if there are one reset, and after re-run a while, there are another reset. how to know it?
each frame I need call it, first frame it is VADecodeReset, next frames it is invalid, then VADecodeReset again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If user wants to know all the reset frames, then user needs to call vaQuerySurfaceError() for every frame and recode the reset information.
If user don't care about the reset, he can just call vaQuerySurfaceError() when get error from syncSurface().

*
* Upon the return, error_info will point to an array of _VASurfaceDecodeMBErrors structure,
pengxin99 marked this conversation as resolved.
Show resolved Hide resolved
* which is allocated and filled by libVA with detailed information on the VADecodeErrorType.
* The array is terminated if "status==-1" is detected.
*/
VAStatus vaQuerySurfaceError(
Expand Down