frontends/va: add VASurfaceAttribUsageHint attribute
authorLeo Liu <leo.liu@amd.com>
Thu, 22 Apr 2021 18:32:48 +0000 (14:32 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Apr 2021 18:55:15 +0000 (18:55 +0000)
commit35a28e038107410bb6a733c51cbd267aa79a4b20
tree1e27cdb47231d80bfd60321fafe32823e33d7709
parent0cae8d372e644a1d89ec5685781435159ee2d285
frontends/va: add VASurfaceAttribUsageHint attribute

Chrome browser has been calling this attribute to give driver the surface
usage hint. The hints include:
   VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC
   VA_SURFACE_ATTRIB_USAGE_HINT_DECODER
   VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER
   VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ
   VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE
   VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY
   VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT

The surface allocation are generic for us, and we don't need to specify
it. To add the attribute here is because we don't want application which
is calling this attribute to end up returning error and getting no surface
allocated.

Fixes: ebab310987 ("frontends/va: improve surface attribs processing")

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10353>
src/gallium/frontends/va/surface.c