All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: vc4: Don't wait for vblank when updating the cursor
@ 2017-02-24  1:54 Michael Zoran
  2017-02-28  7:42 ` Michel Dänzer
  2017-02-28 20:55 ` Eric Anholt
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Zoran @ 2017-02-24  1:54 UTC (permalink / raw)
  To: airlied-cv59FeDIM0c, eric-WhKQ6XTQaPysTnJN9+BGXg
  Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Commonly used desktop environments such as xfce4 and gnome
on debian sid can flood the graphics drivers with cursor
updates.  Because the current implementation is waiting
for a vblank between cursor updates, this will cause the
display to hang for a long time since a typical refresh
rate is only 60Hz.

This is unnecessary and unexpected by user mode software,
so simply swap out the cursor frame buffer without waiting.

Signed-off-by: Michael Zoran <mzoran-O+n0w2l5AFbk1uMJSBkQmQ@public.gmane.org>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index f7a229df572d..110224c3a3ac 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -20,6 +20,7 @@
 
 #include "vc4_drv.h"
 #include "vc4_regs.h"
+#include "drm_atomic.h"
 #include "drm_atomic_helper.h"
 #include "drm_fb_cma_helper.h"
 #include "drm_plane_helper.h"
@@ -769,12 +770,6 @@ vc4_update_plane(struct drm_plane *plane,
 	if (!plane_state)
 		goto out;
 
-	/* If we're changing the cursor contents, do that in the
-	 * normal vblank-synced atomic path.
-	 */
-	if (fb != plane_state->fb)
-		goto out;
-
 	/* No configuring new scaling in the fast path. */
 	if (crtc_w != plane_state->crtc_w ||
 	    crtc_h != plane_state->crtc_h ||
@@ -783,6 +778,11 @@ vc4_update_plane(struct drm_plane *plane,
 		goto out;
 	}
 
+	if (fb != plane_state->fb) {
+		drm_atomic_set_fb_for_plane(plane->state, fb);
+		vc4_plane_async_set_fb(plane, fb);
+	}
+
 	/* Set the cursor's position on the screen.  This is the
 	 * expected change from the drm_mode_cursor_universal()
 	 * helper.
-- 
2.11.0

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

* Re: [PATCH] drm: vc4: Don't wait for vblank when updating the cursor
  2017-02-24  1:54 [PATCH] drm: vc4: Don't wait for vblank when updating the cursor Michael Zoran
@ 2017-02-28  7:42 ` Michel Dänzer
       [not found]   ` <2396e747-a8fe-8bba-3d9b-8d16f268a30e-otUistvHUpPR7s880joybQ@public.gmane.org>
  2017-02-28 20:55 ` Eric Anholt
  1 sibling, 1 reply; 7+ messages in thread
From: Michel Dänzer @ 2017-02-28  7:42 UTC (permalink / raw)
  To: Michael Zoran, airlied, eric; +Cc: linux-rpi-kernel, dri-devel

On 24/02/17 10:54 AM, Michael Zoran wrote:
> Commonly used desktop environments such as xfce4 and gnome
> on debian sid can flood the graphics drivers with cursor
> updates.

FWIW, this has nothing to do with the desktop environment or indeed the
client side at all. Translating input to HW cursor movement is handled
entirely inside the X server.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: vc4: Don't wait for vblank when updating the cursor
       [not found]   ` <2396e747-a8fe-8bba-3d9b-8d16f268a30e-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-02-28 15:45     ` Michael Zoran
  2017-03-01  1:48       ` Michel Dänzer
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Zoran @ 2017-02-28 15:45 UTC (permalink / raw)
  To: Michel Dänzer, airlied-cv59FeDIM0c, eric-WhKQ6XTQaPysTnJN9+BGXg
  Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Tue, 2017-02-28 at 16:42 +0900, Michel Dänzer wrote:
> On 24/02/17 10:54 AM, Michael Zoran wrote:
> > Commonly used desktop environments such as xfce4 and gnome
> > on debian sid can flood the graphics drivers with cursor
> > updates.
> 
> FWIW, this has nothing to do with the desktop environment or indeed
> the
> client side at all. Translating input to HW cursor movement is
> handled
> entirely inside the X server.
> 
> 

Yes, as your point out it may well be the x server that is causing
this.  I wasn't sure if it was the windows manager or the x server that
was doing this.

Either way, when opening a new application the driver gets flooded with
cursor updates as something is animating a spinning cursor.  Since the
refresh rate is only 60Hz, I see a very long hang in the
desktop(several minutes) where nothing responds.  SSHing into the RPI
still works though even though it appears hung.

I had a few people on the net test the changes and they all report that
without the change xfce4 and gnome are both unusable on the RPI.  With
the change, things work fine.  Not waiting for the vblank on cursor
updates is what other drivers appears to do as well...






_______________________________________________
linux-rpi-kernel mailing list
linux-rpi-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel

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

* Re: [PATCH] drm: vc4: Don't wait for vblank when updating the cursor
  2017-02-24  1:54 [PATCH] drm: vc4: Don't wait for vblank when updating the cursor Michael Zoran
  2017-02-28  7:42 ` Michel Dänzer
@ 2017-02-28 20:55 ` Eric Anholt
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Anholt @ 2017-02-28 20:55 UTC (permalink / raw)
  To: airlied; +Cc: mzoran, linux-rpi-kernel, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 588 bytes --]

Michael Zoran <mzoran@crowfest.net> writes:

> Commonly used desktop environments such as xfce4 and gnome
> on debian sid can flood the graphics drivers with cursor
> updates.  Because the current implementation is waiting
> for a vblank between cursor updates, this will cause the
> display to hang for a long time since a typical refresh
> rate is only 60Hz.
>
> This is unnecessary and unexpected by user mode software,
> so simply swap out the cursor frame buffer without waiting.
>
> Signed-off-by: Michael Zoran <mzoran@crowfest.net>

Reviewed and pushed to drm-misc-next.  Thanks!

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

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

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

* Re: [PATCH] drm: vc4: Don't wait for vblank when updating the cursor
  2017-02-28 15:45     ` Michael Zoran
@ 2017-03-01  1:48       ` Michel Dänzer
       [not found]         ` <fbf20389-13a7-430c-6bc8-5484d37c629a-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Michel Dänzer @ 2017-03-01  1:48 UTC (permalink / raw)
  To: Michael Zoran, airlied, eric; +Cc: linux-rpi-kernel, dri-devel

On 01/03/17 12:45 AM, Michael Zoran wrote:
> On Tue, 2017-02-28 at 16:42 +0900, Michel Dänzer wrote:
>> On 24/02/17 10:54 AM, Michael Zoran wrote:
>>> Commonly used desktop environments such as xfce4 and gnome
>>> on debian sid can flood the graphics drivers with cursor
>>> updates.
>>
>> FWIW, this has nothing to do with the desktop environment or indeed
>> the
>> client side at all. Translating input to HW cursor movement is
>> handled
>> entirely inside the X server.
>>
>>
> 
> Yes, as your point out it may well be the x server that is causing
> this.  I wasn't sure if it was the windows manager or the x server that
> was doing this.
> 
> Either way, when opening a new application the driver gets flooded with
> cursor updates as something is animating a spinning cursor.  Since the
> refresh rate is only 60Hz, I see a very long hang in the
> desktop(several minutes) where nothing responds.  SSHing into the RPI
> still works though even though it appears hung.
> 
> I had a few people on the net test the changes and they all report that
> without the change xfce4 and gnome are both unusable on the RPI.  With
> the change, things work fine.  Not waiting for the vblank on cursor
> updates is what other drivers appears to do as well...

Sure. My point is merely that the commit log should say "Xorg can flood
[...]" instead of "Commonly used desktop environments such as xfce4 and
gnome on debian sid can flood [...]".


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: vc4: Don't wait for vblank when updating the cursor
       [not found]         ` <fbf20389-13a7-430c-6bc8-5484d37c629a-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-03-01  2:00           ` Michael Zoran
       [not found]             ` <1488333657.15859.1.camel-O+n0w2l5AFbk1uMJSBkQmQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Zoran @ 2017-03-01  2:00 UTC (permalink / raw)
  To: Michel Dänzer, airlied-cv59FeDIM0c, eric-WhKQ6XTQaPysTnJN9+BGXg
  Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Wed, 2017-03-01 at 10:48 +0900, Michel Dänzer wrote:
> On 01/03/17 12:45 AM, Michael Zoran wrote:
> > On Tue, 2017-02-28 at 16:42 +0900, Michel Dänzer wrote:
> > > On 24/02/17 10:54 AM, Michael Zoran wrote:
> > > > Commonly used desktop environments such as xfce4 and gnome
> > > > on debian sid can flood the graphics drivers with cursor
> > > > updates.
> > > 
> > > FWIW, this has nothing to do with the desktop environment or
> > > indeed
> > > the
> > > client side at all. Translating input to HW cursor movement is
> > > handled
> > > entirely inside the X server.
> > > 
> > > 
> > 
> > Yes, as your point out it may well be the x server that is causing
> > this.  I wasn't sure if it was the windows manager or the x server
> > that
> > was doing this.
> > 
> > Either way, when opening a new application the driver gets flooded
> > with
> > cursor updates as something is animating a spinning cursor.  Since
> > the
> > refresh rate is only 60Hz, I see a very long hang in the
> > desktop(several minutes) where nothing responds.  SSHing into the
> > RPI
> > still works though even though it appears hung.
> > 
> > I had a few people on the net test the changes and they all report
> > that
> > without the change xfce4 and gnome are both unusable on the
> > RPI.  With
> > the change, things work fine.  Not waiting for the vblank on cursor
> > updates is what other drivers appears to do as well...
> 
> Sure. My point is merely that the commit log should say "Xorg can
> flood
> [...]" instead of "Commonly used desktop environments such as xfce4
> and
> gnome on debian sid can flood [...]".
> 

Thanks for the tip.  I don't plan to submit many vc4 changes, but it's
good to know.

BTW, you wouldn't happen to know what component is animating the
spinning cursor?  I still highly suspect it's either the window
manager(xfwm or mutter) or possibly the application that's drawing the
taskbar.



_______________________________________________
linux-rpi-kernel mailing list
linux-rpi-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel

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

* Re: [PATCH] drm: vc4: Don't wait for vblank when updating the cursor
       [not found]             ` <1488333657.15859.1.camel-O+n0w2l5AFbk1uMJSBkQmQ@public.gmane.org>
@ 2017-03-01  3:38               ` Michel Dänzer
  0 siblings, 0 replies; 7+ messages in thread
From: Michel Dänzer @ 2017-03-01  3:38 UTC (permalink / raw)
  To: Michael Zoran, eric-WhKQ6XTQaPysTnJN9+BGXg
  Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 01/03/17 11:00 AM, Michael Zoran wrote:
> On Wed, 2017-03-01 at 10:48 +0900, Michel Dänzer wrote:
>> On 01/03/17 12:45 AM, Michael Zoran wrote:
>>> On Tue, 2017-02-28 at 16:42 +0900, Michel Dänzer wrote:
>>>> On 24/02/17 10:54 AM, Michael Zoran wrote:
>>>>> Commonly used desktop environments such as xfce4 and gnome
>>>>> on debian sid can flood the graphics drivers with cursor
>>>>> updates.
>>>>
>>>> FWIW, this has nothing to do with the desktop environment or
>>>> indeed
>>>> the
>>>> client side at all. Translating input to HW cursor movement is
>>>> handled
>>>> entirely inside the X server.
>>>
>>> Yes, as your point out it may well be the x server that is causing
>>> this.  I wasn't sure if it was the windows manager or the x server
>>> that
>>> was doing this.
>>>
>>> Either way, when opening a new application the driver gets flooded
>>> with
>>> cursor updates as something is animating a spinning cursor.  Since
>>> the
>>> refresh rate is only 60Hz, I see a very long hang in the
>>> desktop(several minutes) where nothing responds.  SSHing into the
>>> RPI
>>> still works though even though it appears hung.
>>>
>>> I had a few people on the net test the changes and they all report
>>> that
>>> without the change xfce4 and gnome are both unusable on the
>>> RPI.  With
>>> the change, things work fine.  Not waiting for the vblank on cursor
>>> updates is what other drivers appears to do as well...
>>
>> Sure. My point is merely that the commit log should say "Xorg can
>> flood
>> [...]" instead of "Commonly used desktop environments such as xfce4
>> and
>> gnome on debian sid can flood [...]".
>>
> 
> Thanks for the tip.  I don't plan to submit many vc4 changes, but it's
> good to know.
> 
> BTW, you wouldn't happen to know what component is animating the
> spinning cursor?  I still highly suspect it's either the window
> manager(xfwm or mutter) or possibly the application that's drawing the
> taskbar.

A client asks the X server to use the spinning cursor, but the actual
animation and corresponding DRM_IOCTL_MODE_CURSOR(2) calls are performed
by the X server itself.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

_______________________________________________
linux-rpi-kernel mailing list
linux-rpi-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel

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

end of thread, other threads:[~2017-03-01  3:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-24  1:54 [PATCH] drm: vc4: Don't wait for vblank when updating the cursor Michael Zoran
2017-02-28  7:42 ` Michel Dänzer
     [not found]   ` <2396e747-a8fe-8bba-3d9b-8d16f268a30e-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-02-28 15:45     ` Michael Zoran
2017-03-01  1:48       ` Michel Dänzer
     [not found]         ` <fbf20389-13a7-430c-6bc8-5484d37c629a-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-01  2:00           ` Michael Zoran
     [not found]             ` <1488333657.15859.1.camel-O+n0w2l5AFbk1uMJSBkQmQ@public.gmane.org>
2017-03-01  3:38               ` Michel Dänzer
2017-02-28 20:55 ` Eric Anholt

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.