llvmpipe: Take offset into account when importing dmabufs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Which is necessary for many common YCbCr formats.

Fixes: d74ea2c117 (llvmpipe: Implement dmabuf handling)
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34240>
This commit is contained in:
Robert Mader 2025-03-27 15:11:25 +01:00 committed by Marge Bot
parent 1ee884efd7
commit 05e7ac6551

View file

@ -757,7 +757,7 @@ llvmpipe_resource_from_handle(struct pipe_screen *_screen,
_screen->import_memory_fd(_screen, whandle->handle,
(struct pipe_memory_allocation**)&alloc,
&size, true)) {
void *data = alloc->cpu_addr;
void *data = (char*)alloc->cpu_addr + whandle->offset;
lpr->dt = winsys->displaytarget_create_mapped(winsys, template->bind,
template->format, template->width0, template->height0,
whandle->stride, data);