[Eoan][SRU][PATCH 4/4] drm/mgag200: Pin displayed cursor BO to video memory

Po-Hsu Lin po-hsu.lin at canonical.com
Mon Dec 30 03:15:21 UTC 2019


From: Thomas Zimmermann <tzimmermann at suse.de>

BugLink: https://bugs.launchpad.net/bugs/1851340

The cursor BO has to be pinned to video ram while it's being displayed.
With the current code, the BO might be pinned to system memory instead.
The patch fixes this problem.

Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
Acked-by: Sam Ravnborg <sam at ravnborg.org>
Fixes: 94dc57b10399 ("drm/mgag200: Rewrite cursor handling")
Cc: Gerd Hoffmann <kraxel at redhat.com>
Cc: Dave Airlie <airlied at redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723075425.24028-2-tzimmermann@suse.de
(cherry picked from commit a0fd72d2c95b56c78feec0867f2077b5ff5991e6)
Signed-off-by: Po-Hsu Lin <po-hsu.lin at canonical.com>
---
 drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c
index 7588d90..29ef932 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -98,7 +98,7 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
 	}
 
 	/* Pin and map up-coming buffer to write colour indices */
-	ret = drm_gem_vram_pin(pixels_next, 0);
+	ret = drm_gem_vram_pin(pixels_next, DRM_GEM_VRAM_PL_FLAG_VRAM);
 	if (ret) {
 		dev_err(&dev->pdev->dev,
 			"failed to pin cursor buffer: %d\n", ret);
-- 
2.7.4




More information about the kernel-team mailing list