summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vboxvideo/vbox_mode.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/vboxvideo/vbox_mode.c')
-rw-r--r--drivers/gpu/drm/vboxvideo/vbox_mode.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c
index 322bf7133ba1..dbc0dd53c69e 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
@@ -9,6 +9,8 @@
* Michael Thayer <michael.thayer@oracle.com,
* Hans de Goede <hdegoede@redhat.com>
*/
+
+#include <linux/dma-buf-map.h>
#include <linux/export.h>
#include <drm/drm_atomic.h>
@@ -384,6 +386,8 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
u32 height = plane->state->crtc_h;
size_t data_size, mask_size;
u32 flags;
+ struct dma_buf_map map;
+ int ret;
u8 *src;
/*
@@ -397,8 +401,8 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
vbox_crtc->cursor_enabled = true;
- src = drm_gem_vram_vmap(gbo);
- if (IS_ERR(src)) {
+ ret = drm_gem_vram_vmap(gbo, &map);
+ if (ret) {
/*
* BUG: we should have pinned the BO in prepare_fb().
*/
@@ -406,6 +410,7 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
DRM_WARN("Could not map cursor bo, skipping update\n");
return;
}
+ src = map.vaddr; /* TODO: Use mapping abstraction properly */
/*
* The mask must be calculated based on the alpha
@@ -416,7 +421,7 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
data_size = width * height * 4 + mask_size;
copy_cursor_image(src, vbox->cursor_data, width, height, mask_size);
- drm_gem_vram_vunmap(gbo, src);
+ drm_gem_vram_vunmap(gbo, &map);
flags = VBOX_MOUSE_POINTER_VISIBLE | VBOX_MOUSE_POINTER_SHAPE |
VBOX_MOUSE_POINTER_ALPHA;