From 558a7d92d532efbb6d713c5e826b5715e503c25a Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Thu, 27 Mar 2025 15:11:25 +0100 Subject: [PATCH] llvmpipe: Take offset into account when importing dmabufs Which is necessary for many common YCbCr formats. Fixes: d74ea2c117f (llvmpipe: Implement dmabuf handling) Reviewed-By: Mike Blumenkrantz Signed-off-by: Robert Mader Part-of: (cherry picked from commit 05e7ac6551d53ce848360941acfb9e74b4253a79) --- .pick_status.json | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 1720a9db570..e5bb7bb3590 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2314,7 +2314,7 @@ "description": "llvmpipe: Take offset into account when importing dmabufs", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d74ea2c117fe96e527471e572336f931c3c77da1", "notes": null diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index eddc576ed67..f207738706a 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -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);