All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixes for mgag200 cursors
@ 2019-07-23  7:54 Thomas Zimmermann
  2019-07-23  7:54 ` [PATCH 1/3] drm/mgag200: Pin displayed cursor BO to video memory Thomas Zimmermann
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2019-07-23  7:54 UTC (permalink / raw)
  To: kraxel, daniel, sam, airlied; +Cc: Thomas Zimmermann, dri-devel

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
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] drm/mgag200: Pin displayed cursor BO to video memory
  2019-07-23  7:54 [PATCH 0/3] Fixes for mgag200 cursors Thomas Zimmermann
@ 2019-07-23  7:54 ` Thomas Zimmermann
  2019-07-23  7:54 ` [PATCH 2/3] drm/mgag200: Set cursor scanout address to correct BO Thomas Zimmermann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2019-07-23  7:54 UTC (permalink / raw)
  To: kraxel, daniel, sam, airlied; +Cc: Thomas Zimmermann, dri-devel

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@suse.de>
Fixes: 94dc57b10399 ("drm/mgag200: Rewrite cursor handling")
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.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 13f32df7e357..a19975931c6d 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -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);
-- 
2.22.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] drm/mgag200: Set cursor scanout address to correct BO
  2019-07-23  7:54 [PATCH 0/3] Fixes for mgag200 cursors Thomas Zimmermann
  2019-07-23  7:54 ` [PATCH 1/3] drm/mgag200: Pin displayed cursor BO to video memory Thomas Zimmermann
@ 2019-07-23  7:54 ` Thomas Zimmermann
  2019-07-23  7:54 ` [PATCH 3/3] drm/mgag200: Don't unpin the current cursor image's buffer Thomas Zimmermann
  2019-07-23  8:40 ` [PATCH 0/3] Fixes for mgag200 cursors Sam Ravnborg
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2019-07-23  7:54 UTC (permalink / raw)
  To: kraxel, daniel, sam, airlied; +Cc: Thomas Zimmermann, dri-devel

The 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.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 94dc57b10399 ("drm/mgag200: Rewrite cursor handling")
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.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 a19975931c6d..f11b862cbed9 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -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,
-- 
2.22.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] drm/mgag200: Don't unpin the current cursor image's buffer.
  2019-07-23  7:54 [PATCH 0/3] Fixes for mgag200 cursors Thomas Zimmermann
  2019-07-23  7:54 ` [PATCH 1/3] drm/mgag200: Pin displayed cursor BO to video memory Thomas Zimmermann
  2019-07-23  7:54 ` [PATCH 2/3] drm/mgag200: Set cursor scanout address to correct BO Thomas Zimmermann
@ 2019-07-23  7:54 ` Thomas Zimmermann
  2019-07-23  8:40 ` [PATCH 0/3] Fixes for mgag200 cursors Sam Ravnborg
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2019-07-23  7:54 UTC (permalink / raw)
  To: kraxel, daniel, sam, airlied; +Cc: Thomas Zimmermann, dri-devel

Currently 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.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 94dc57b10399 ("drm/mgag200: Rewrite cursor handling")
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/mgag200/mgag200_cursor.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c
index f11b862cbed9..289ce3e29032 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -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);
-- 
2.22.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Fixes for mgag200 cursors
  2019-07-23  7:54 [PATCH 0/3] Fixes for mgag200 cursors Thomas Zimmermann
                   ` (2 preceding siblings ...)
  2019-07-23  7:54 ` [PATCH 3/3] drm/mgag200: Don't unpin the current cursor image's buffer Thomas Zimmermann
@ 2019-07-23  8:40 ` Sam Ravnborg
  2019-07-24 11:24   ` Thomas Zimmermann
  3 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2019-07-23  8:40 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: airlied, dri-devel, kraxel

Hi Thomas.

On Tue, Jul 23, 2019 at 09:54:22AM +0200, Thomas Zimmermann wrote:
> 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.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Fixes for mgag200 cursors
  2019-07-23  8:40 ` [PATCH 0/3] Fixes for mgag200 cursors Sam Ravnborg
@ 2019-07-24 11:24   ` Thomas Zimmermann
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2019-07-24 11:24 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: airlied, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 776 bytes --]

Am 23.07.19 um 10:40 schrieb Sam Ravnborg:
> Hi Thomas.
> 
> On Tue, Jul 23, 2019 at 09:54:22AM +0200, Thomas Zimmermann wrote:
>> 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.
> 
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 

Thanks!

-- 
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)


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-24 11:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23  7:54 [PATCH 0/3] Fixes for mgag200 cursors Thomas Zimmermann
2019-07-23  7:54 ` [PATCH 1/3] drm/mgag200: Pin displayed cursor BO to video memory Thomas Zimmermann
2019-07-23  7:54 ` [PATCH 2/3] drm/mgag200: Set cursor scanout address to correct BO Thomas Zimmermann
2019-07-23  7:54 ` [PATCH 3/3] drm/mgag200: Don't unpin the current cursor image's buffer Thomas Zimmermann
2019-07-23  8:40 ` [PATCH 0/3] Fixes for mgag200 cursors Sam Ravnborg
2019-07-24 11:24   ` Thomas Zimmermann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.