Skip to content

Commit 0029d31

Browse files
author
Thomas Zimmermann
committed
drm/gud: Map framebuffer BOs with drm_gem_fb_vmap()
Abstract the framebuffer details by mapping its BOs with a call to drm_gem_fb_vmap(). Unmap with drm_gem_fb_vunmap(). The call to drm_gem_fb_vmap() ensures that all BOs are mapped correctly. Gud still only supports single-plane formats. No functional changes. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Noralf Trønnes <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0ec77bd commit 0029d31

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/gud/gud_pipe.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <drm/drm_format_helper.h>
1515
#include <drm/drm_fourcc.h>
1616
#include <drm/drm_framebuffer.h>
17+
#include <drm/drm_gem.h>
1718
#include <drm/drm_gem_framebuffer_helper.h>
18-
#include <drm/drm_gem_shmem_helper.h>
1919
#include <drm/drm_print.h>
2020
#include <drm/drm_rect.h>
2121
#include <drm/drm_simple_kms_helper.h>
@@ -152,7 +152,7 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
152152
{
153153
struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach;
154154
u8 compression = gdrm->compression;
155-
struct dma_buf_map map;
155+
struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
156156
void *vaddr, *buf;
157157
size_t pitch, len;
158158
int ret = 0;
@@ -162,11 +162,11 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
162162
if (len > gdrm->bulk_len)
163163
return -E2BIG;
164164

165-
ret = drm_gem_shmem_vmap(fb->obj[0], &map);
165+
ret = drm_gem_fb_vmap(fb, map);
166166
if (ret)
167167
return ret;
168168

169-
vaddr = map.vaddr + fb->offsets[0];
169+
vaddr = map[0].vaddr + fb->offsets[0];
170170

171171
ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
172172
if (ret)
@@ -225,7 +225,7 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
225225
end_cpu_access:
226226
drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
227227
vunmap:
228-
drm_gem_shmem_vunmap(fb->obj[0], &map);
228+
drm_gem_fb_vunmap(fb, map);
229229

230230
return ret;
231231
}

0 commit comments

Comments
 (0)