Fixes for mgag200 cursors
Subsystems (3)
Thomas Zimmermann
maintainercover Fixes for mgag200 cursors
This patch set fixes a number of bugs that where introduced by the recent changes to mgag200's handling of cursor BOs.
Thomas Zimmermann (3):
drm/mgag200: Pin displayed cursor BO to video memory drm/mgag200: Set cursor scanout address to correct BO drm/mgag200: Don't unpin the current cursor image's buffer.
drivers/gpu/drm/mgag200/mgag200_cursor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
--
2.22.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerPATCH 1/3 drm/mgag200: Pin displayed cursor BO to video memory
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.
--- drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_cursor.c +1 -1
@@ -99,7 +99,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);
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerPATCH 2/3 drm/mgag200: Set cursor scanout address to correct BO
In reply to Thomas ZimmermannThe hardware requires the correct memory address of the buffer. Currently the same BO's address is programmed unconditionally, so only every second cursor update actually becomes visible.
--- drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_cursor.c +1 -1
@@ -112,7 +112,7 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc, "failed to kmap cursor updates: %d\n", ret); goto err_drm_gem_vram_unpin_dst; } - gpu_addr =drm_gem_vram_offset (pixels_2); + gpu_addr =drm_gem_vram_offset (pixels_next);if (gpu_addr <0 ) { ret = (int )gpu_addr; dev_err(&dev->pdev->dev,
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerPATCH 3/3 drm/mgag200: Don't unpin the current cursor image's buffer.
In reply to Thomas ZimmermannCurrently the displayed cursor buffer might be evicted from video memory. Not unpinning the BO fixes this problem. At this point, pixels_current also references the BO and it will be unpinned during the next cursor update.
--- drivers/gpu/drm/mgag200/mgag200_cursor.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_cursor.c +0 -1
@@ -213,7 +213,6 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc, mdev->cursor.pixels_current = pixels_next;drm_gem_vram_kunmap (pixels_next); -drm_gem_vram_unpin (pixels_next);drm_gem_vram_kunmap (gbo);drm_gem_vram_unpin (gbo);drm_gem_object_put_unlocked (obj);
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Thomas.
Quoted 7 lines · Thomas Zimmermann
This patch set fixes a number of bugs that where introduced by the recent changes to mgag200's handling of cursor BOs.
Thomas Zimmermann (3):
drm/mgag200: Pin displayed cursor BO to video memory drm/mgag200: Set cursor scanout address to correct BO drm/mgag200: Don't unpin the current cursor image's buffer.
Browsed the fixes - looks good to me.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerAm 23.07.19 um 10:40 schrieb Sam Ravnborg:
Quoted 6 lines
Hi Thomas.
Quoted 3 lines · Thomas Zimmermann
This patch set fixes a number of bugs that where introduced by the recent changes to mgag200's handling of cursor BOs.
Quoted 9 lines
Quoted 4 lines
Thomas Zimmermann (3):
drm/mgag200: Pin displayed cursor BO to video memory drm/mgag200: Set cursor scanout address to correct BO drm/mgag200: Don't unpin the current cursor image's buffer.Browsed the fixes - looks good to me.
Acked-by Sam Ravnborg <[email protected]>
Thanks!
Signature · 5 lines
Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel