Skip to content

Mark the imported dmabuf as cacheable in Media Libva #1929

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vivekkreddy
Copy link

While generating the GMM params, we need to set the cacheable flag to true for imported dmabufs (or prime bos). This allows GmmLib to return the CoherentPATIndex, that is verified by the Xe KMD as part of vm_bind. Otherwise, the Xe KMD will return an error when it finds that the coherency mode for the default PAT index is XE_COH_NONE. This is similar to Mesa's behavior where it selects "cached_coherent" PAT index for imported dmabufs.

This patch fixes the following error (vm_bind failure) seen while running VDI test (Remote Desktop) with Qemu + Spice (uses Gstreamer) on BMG/PTL:
0:00:05.933571208 1868 0x7f27f4000b90 ERROR vadisplay vasurfaceimage.c:171:va_create_surfaces: vaCreateSurfaces: resource allocation failed

while testing with the following GStreamer pipeline: appsrc is-live=true format=time do-timestamp=true name=src ! vapostproc ! video/x-raw(memory:VAMemory),format=NV12 ! vah264enc name=encoder rate-control=16 b-frames=0 target-usage=7 min-qp=15 max-qp=35 ! appsink name=sink

While generating the GMM params, we need to set the cacheable flag
to true for imported dmabufs (or prime bos). This allows GmmLib to
return the CoherentPATIndex, that is verified by the Xe KMD as part
of vm_bind. Otherwise, the Xe KMD will return an error when it finds
that the coherency mode for the default PAT index is XE_COH_NONE.
This is similar to Mesa's behavior where it selects "cached_coherent"
PAT index for imported dmabufs.

This patch fixes the following error (vm_bind failure) seen while
running VDI test (Remote Desktop) with Qemu + Spice (uses Gstreamer)
on BMG/PTL:
0:00:05.933571208  1868 0x7f27f4000b90 ERROR vadisplay
vasurfaceimage.c:171:va_create_surfaces: vaCreateSurfaces: resource
allocation failed

while testing with the following GStreamer pipeline:
appsrc is-live=true format=time do-timestamp=true name=src !
vapostproc ! video/x-raw(memory:VAMemory),format=NV12 !
vah264enc name=encoder rate-control=16 b-frames=0 target-usage=7
min-qp=15 max-qp=35 ! appsink name=sink

Signed-off-by: Vivek Kasireddy <[email protected]>
@vivekkreddy vivekkreddy requested a review from XinfengZhang as a code owner May 9, 2025 00:40
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.

1 participant