summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/gud
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2021-08-03 14:59:20 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2021-08-08 20:27:24 +0200
commit6d463aaf5632ed9e409fcc72eb90f862341e4d95 (patch)
tree2eb0ee6840596a58b05b830d8db323f65e0d021e /drivers/gpu/drm/gud
parentadd8b6a9a568b57b3f61d59cc09b3157a275257e (diff)
drm/gud: Get offset-adjusted mapping from drm_gem_fb_vmap()
Pass the data parameter to drm_gem_fb_vmap() to retrieve pointers to the data. This address is different from the mapping addresses for framebuffers with non-zero offsets. Replaces gud's internal computation. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210803125928.27780-4-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/gud')
-rw-r--r--drivers/gpu/drm/gud/gud_pipe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c
index 6270a1a32a65..b9b0e435ea0f 100644
--- a/drivers/gpu/drm/gud/gud_pipe.c
+++ b/drivers/gpu/drm/gud/gud_pipe.c
@@ -153,6 +153,7 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach;
u8 compression = gdrm->compression;
struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
+ struct dma_buf_map map_data[DRM_FORMAT_MAX_PLANES];
void *vaddr, *buf;
size_t pitch, len;
int ret = 0;
@@ -162,11 +163,11 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
if (len > gdrm->bulk_len)
return -E2BIG;
- ret = drm_gem_fb_vmap(fb, map, NULL);
+ ret = drm_gem_fb_vmap(fb, map, map_data);
if (ret)
return ret;
- vaddr = map[0].vaddr + fb->offsets[0];
+ vaddr = map_data[0].vaddr;
ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
if (ret)