libva: map buffer as readable when entrypoint is unknown
What does this MR do and why?
Mesa attempts to map a derived image buffer that contains the results of a decode operation as readable. However, derived_surface.entrypoint
is only set to the surface's entrypoint by vaDeriveImage
if surf->ctx
is not NULL, and surf->ctx
is only set to a valid value after vaBeginPicture
has been called. Therefore, if an application does vaDeriveImage
before vaBeginPicture
(which seems likely), it will obtain a derived image that does not have the right entrypoint set.
This leads to the image buffer being incorrectly mapped as write-only, so all reads return 0.
This MR relaxes the check to also map the buffer readably when the entrypoint is still unknown.