* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-19 10:51 ` Daniel Vetter
0 siblings, 0 replies; 24+ messages in thread
From: Daniel Vetter @ 2015-01-19 10:51 UTC (permalink / raw)
To: Ville Syrjälä, Jeremiah Mahler, Matt Roper, Jani Nikula,
David Airlie, Alex Deucher, Dave Airlie,
Ander Conselvan de Oliveira, linux-kernel, intel-gfx, dri-devel
On 19/01/2015 10:08, Ville Syrjälä wrote:
> On Sat, Jan 17, 2015 at 02:06:35AM -0800, Jeremiah Mahler wrote:
>> Matt, all,
>>
>> Commit ea2c67bb4aff introduces a bug which causes the mouse to move in a
>> very unusual way, as if it has a lot of inertia. It will lag behind and
>> then overshoot the expected position.
>>
>> I reproduced this bug on all my machines which use the drm/i915 drivers
>> and it affects all forms of mouse pointers including both touchpads and
>> usb mice. The patch is present in linux-next 20150116.
>>
>> commit ea2c67bb4affa84080c616920f3899f123786e56
>> Author: Matt Roper <matthew.d.roper@intel.com>
>> Date: Tue Dec 23 10:41:52 2014 -0800
>>
>> drm/i915: Move to atomic plane helpers (v9)
> I guess this is caused by the atomic code refusing to update the plane
> more than once per vrefresh. So we need to allow the fps>vrefresh rate
> case to remove the regression.
>
> The old cursor code had basically a gross hack to allow this. It just
> unpinned the old fb before the display engine was done with it, and
> _after_ unpinning it flipped to the new buffer (with the obvious extra
> delay of the flip happening on the next vblank). So there was no
> guarantee the old buffer was still around (or had the correct content)
> while the display engine was still scanning it out. So to fix this
> properly we need a vblank worker of some sort.
>
> The other issues we nee to know which fb is being scanned out at which
> point to unpin the correct old buffer. For that we can use the hardware
> frame counter. We could use some other mechanims too (SURFLIVE, flip
> counter etc.) but the frame counter is the most ubiqitious method we
> have.
>
> The one extra problem is gen2 doesn't have even the frame counter, so
> some extra care would be needed there. I'm thinking for gen2 we might
> allow the driver to call into the vblank core code to update the cooked
> counter at any time based on the scanline counter and monotonic timestamp.
> That combined with the vblank evade mechanism should make reasonably sure
> we have an up to date notion of which frame is currently getting scanned
> out.
>
> We need the extra call into the vblank core since just after the vblank
> start, the vblank interrupt handler may not have executed yet (especially
> since gen2 vblank irq fires actually at the frame start which is a delayed
> version of the vblank start, even though the flip happes at vblank start).
> So we need an explicit call to make sure the cooked counter is already
> updated before the irq handler has executed. I have some changes lined
> up for the vblank code which I think could help make sure he extra call
> won't increment the counter spuriously, but I have to clean those up a
> bit before sending them out.
>
There's also an issue in (most) X drivers which exaberates this issues:
When changing the cursor buffer the X cursor code does a a) disable
cursor b) update cursor image c) enable cursor cycle. With latest
upstream we /should/ be able to not block for just moving the cursor
though when nothing crazy happens. Checking for that would be good.
For the real thing: Rob Clark also noticed this on msm with his atomic,
I think we need a hint flag (only used internally) so that the
legacy2atomic helpers and the driver core can correctly pass around
semantics and we could recover the optimization. As long as we don't
allow this hint flag to be set by userspace we could just completely
drop the vblank wait - that would be buggy, but so is the old legacy
implementation.
-Daniel
Intel Semiconductor AG
Registered No. 020.30.913.786-7
Registered Office: Badenerstrasse 549, 8048 Zurich, Switzerland
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-19 10:51 ` [Intel-gfx] " Daniel Vetter
@ 2015-01-19 11:04 ` Chris Wilson
-1 siblings, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2015-01-19 11:04 UTC (permalink / raw)
To: Daniel Vetter
Cc: David Airlie, intel-gfx, linux-kernel, dri-devel, Alex Deucher,
Dave Airlie, Jeremiah Mahler
On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> There's also an issue in (most) X drivers which exaberates this
> issues: When changing the cursor buffer the X cursor code does a a)
> disable cursor b) update cursor image c) enable cursor cycle.
Notably not -intel on which the bug has been observed. And more
importantly, the slow downs don't seem to correlate with cursor change,
just cursor movement.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-19 11:04 ` Chris Wilson
0 siblings, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2015-01-19 11:04 UTC (permalink / raw)
To: Daniel Vetter
Cc: Ville Syrjälä, Jeremiah Mahler, Matt Roper, Jani Nikula,
David Airlie, Alex Deucher, Dave Airlie,
Ander Conselvan de Oliveira, linux-kernel, intel-gfx, dri-devel
On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> There's also an issue in (most) X drivers which exaberates this
> issues: When changing the cursor buffer the X cursor code does a a)
> disable cursor b) update cursor image c) enable cursor cycle.
Notably not -intel on which the bug has been observed. And more
importantly, the slow downs don't seem to correlate with cursor change,
just cursor movement.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-19 11:04 ` [Intel-gfx] " Chris Wilson
@ 2015-01-19 16:40 ` Matt Roper
-1 siblings, 0 replies; 24+ messages in thread
From: Matt Roper @ 2015-01-19 16:40 UTC (permalink / raw)
To: Chris Wilson, Daniel Vetter, Ville Syrjälä,
Jeremiah Mahler, Jani Nikula, David Airlie, Alex Deucher,
Dave Airlie, Ander Conselvan de Oliveira, linux-kernel, intel-gfx,
dri-devel
On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > There's also an issue in (most) X drivers which exaberates this
> > issues: When changing the cursor buffer the X cursor code does a a)
> > disable cursor b) update cursor image c) enable cursor cycle.
>
> Notably not -intel on which the bug has been observed. And more
> importantly, the slow downs don't seem to correlate with cursor change,
> just cursor movement.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
It seems that the simple fix for this case (movement only) is to just
skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
the transitional plane helper when newfb == oldfb. I just posted a
small patch that makes that change (and solves the cursor lag for me).
This won't solve the case if userspace uses a different framebuffer for
each update (while trying to update faster than the refresh rate). Is
there any existing userspace that behaves this way that we can test
with?
Matt
--
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-19 16:40 ` Matt Roper
0 siblings, 0 replies; 24+ messages in thread
From: Matt Roper @ 2015-01-19 16:40 UTC (permalink / raw)
To: Chris Wilson, Daniel Vetter, Ville Syrjälä,
Jeremiah Mahler, Jani Nikula, David Airlie, Alex Deucher,
Dave Airlie, Ander Conselvan de Oliveira, linux-kernel, intel-gfx,
dri-devel
On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > There's also an issue in (most) X drivers which exaberates this
> > issues: When changing the cursor buffer the X cursor code does a a)
> > disable cursor b) update cursor image c) enable cursor cycle.
>
> Notably not -intel on which the bug has been observed. And more
> importantly, the slow downs don't seem to correlate with cursor change,
> just cursor movement.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
It seems that the simple fix for this case (movement only) is to just
skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
the transitional plane helper when newfb == oldfb. I just posted a
small patch that makes that change (and solves the cursor lag for me).
This won't solve the case if userspace uses a different framebuffer for
each update (while trying to update faster than the refresh rate). Is
there any existing userspace that behaves this way that we can test
with?
Matt
--
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-19 16:40 ` [Intel-gfx] " Matt Roper
@ 2015-01-19 20:43 ` Chris Wilson
-1 siblings, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2015-01-19 20:43 UTC (permalink / raw)
To: Matt Roper
Cc: David Airlie, intel-gfx, linux-kernel, dri-devel, Dave Airlie,
Alex Deucher, Daniel Vetter, Jeremiah Mahler
On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > There's also an issue in (most) X drivers which exaberates this
> > > issues: When changing the cursor buffer the X cursor code does a a)
> > > disable cursor b) update cursor image c) enable cursor cycle.
> >
> > Notably not -intel on which the bug has been observed. And more
> > importantly, the slow downs don't seem to correlate with cursor change,
> > just cursor movement.
> > -Chris
> >
> > --
> > Chris Wilson, Intel Open Source Technology Centre
>
> It seems that the simple fix for this case (movement only) is to just
> skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> the transitional plane helper when newfb == oldfb. I just posted a
> small patch that makes that change (and solves the cursor lag for me).
>
> This won't solve the case if userspace uses a different framebuffer for
> each update (while trying to update faster than the refresh rate). Is
> there any existing userspace that behaves this way that we can test
> with?
-modesetting and say moving the cursor in/out of an xterm very fast. or
similarly with
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5b45618..3873893 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5182,7 +5182,6 @@ sna_cursors_init(ScreenPtr screen, struct sna *sna)
cursor_info->MaxWidth = sna->cursor.max_size;
cursor_info->MaxHeight = sna->cursor.max_size;
cursor_info->Flags = (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
- HARDWARE_CURSOR_UPDATE_UNHIDDEN |
HARDWARE_CURSOR_ARGB);
cursor_info->RealizeCursor = sna_realize_cursor;
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-19 20:43 ` Chris Wilson
0 siblings, 0 replies; 24+ messages in thread
From: Chris Wilson @ 2015-01-19 20:43 UTC (permalink / raw)
To: Matt Roper
Cc: Daniel Vetter, Ville Syrjälä, Jeremiah Mahler,
Jani Nikula, David Airlie, Alex Deucher, Dave Airlie,
Ander Conselvan de Oliveira, linux-kernel, intel-gfx, dri-devel
On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > There's also an issue in (most) X drivers which exaberates this
> > > issues: When changing the cursor buffer the X cursor code does a a)
> > > disable cursor b) update cursor image c) enable cursor cycle.
> >
> > Notably not -intel on which the bug has been observed. And more
> > importantly, the slow downs don't seem to correlate with cursor change,
> > just cursor movement.
> > -Chris
> >
> > --
> > Chris Wilson, Intel Open Source Technology Centre
>
> It seems that the simple fix for this case (movement only) is to just
> skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> the transitional plane helper when newfb == oldfb. I just posted a
> small patch that makes that change (and solves the cursor lag for me).
>
> This won't solve the case if userspace uses a different framebuffer for
> each update (while trying to update faster than the refresh rate). Is
> there any existing userspace that behaves this way that we can test
> with?
-modesetting and say moving the cursor in/out of an xterm very fast. or
similarly with
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5b45618..3873893 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5182,7 +5182,6 @@ sna_cursors_init(ScreenPtr screen, struct sna *sna)
cursor_info->MaxWidth = sna->cursor.max_size;
cursor_info->MaxHeight = sna->cursor.max_size;
cursor_info->Flags = (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
- HARDWARE_CURSOR_UPDATE_UNHIDDEN |
HARDWARE_CURSOR_ARGB);
cursor_info->RealizeCursor = sna_realize_cursor;
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-19 16:40 ` [Intel-gfx] " Matt Roper
@ 2015-01-20 5:48 ` Daniel Vetter
-1 siblings, 0 replies; 24+ messages in thread
From: Daniel Vetter @ 2015-01-20 5:48 UTC (permalink / raw)
To: Matt Roper
Cc: intel-gfx, linux-kernel, dri-devel, Dave Airlie, Alex Deucher,
Daniel Vetter, Jeremiah Mahler
On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > There's also an issue in (most) X drivers which exaberates this
> > > issues: When changing the cursor buffer the X cursor code does a a)
> > > disable cursor b) update cursor image c) enable cursor cycle.
> >
> > Notably not -intel on which the bug has been observed. And more
> > importantly, the slow downs don't seem to correlate with cursor change,
> > just cursor movement.
> > -Chris
> >
> > --
> > Chris Wilson, Intel Open Source Technology Centre
>
> It seems that the simple fix for this case (movement only) is to just
> skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> the transitional plane helper when newfb == oldfb. I just posted a
> small patch that makes that change (and solves the cursor lag for me).
>
> This won't solve the case if userspace uses a different framebuffer for
> each update (while trying to update faster than the refresh rate). Is
> there any existing userspace that behaves this way that we can test
> with?
Hm, I've thought I've merged that patch already:
commit ab58e3384b9f9863bfd029b458ff337d381bf6d2
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Mon Nov 24 20:42:42 2014 +0100
drm/atomic-helper: Skip vblank waits for unchanged fbs
Or is the problem here that the transitional plane helpers aren't up to
the task? If so please reference that in your patch.
And we still need a hack for the "changed fb cursor" issue, I'll whip
something up.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-20 5:48 ` Daniel Vetter
0 siblings, 0 replies; 24+ messages in thread
From: Daniel Vetter @ 2015-01-20 5:48 UTC (permalink / raw)
To: Matt Roper
Cc: Chris Wilson, Daniel Vetter, Ville Syrjälä,
Jeremiah Mahler, Jani Nikula, David Airlie, Alex Deucher,
Dave Airlie, Ander Conselvan de Oliveira, linux-kernel, intel-gfx,
dri-devel
On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > There's also an issue in (most) X drivers which exaberates this
> > > issues: When changing the cursor buffer the X cursor code does a a)
> > > disable cursor b) update cursor image c) enable cursor cycle.
> >
> > Notably not -intel on which the bug has been observed. And more
> > importantly, the slow downs don't seem to correlate with cursor change,
> > just cursor movement.
> > -Chris
> >
> > --
> > Chris Wilson, Intel Open Source Technology Centre
>
> It seems that the simple fix for this case (movement only) is to just
> skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> the transitional plane helper when newfb == oldfb. I just posted a
> small patch that makes that change (and solves the cursor lag for me).
>
> This won't solve the case if userspace uses a different framebuffer for
> each update (while trying to update faster than the refresh rate). Is
> there any existing userspace that behaves this way that we can test
> with?
Hm, I've thought I've merged that patch already:
commit ab58e3384b9f9863bfd029b458ff337d381bf6d2
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Mon Nov 24 20:42:42 2014 +0100
drm/atomic-helper: Skip vblank waits for unchanged fbs
Or is the problem here that the transitional plane helpers aren't up to
the task? If so please reference that in your patch.
And we still need a hack for the "changed fb cursor" issue, I'll whip
something up.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-20 5:48 ` Daniel Vetter
@ 2015-01-24 6:57 ` Jeremiah Mahler
-1 siblings, 0 replies; 24+ messages in thread
From: Jeremiah Mahler @ 2015-01-24 6:57 UTC (permalink / raw)
To: Matt Roper, Chris Wilson, Daniel Vetter, Ville Syrjälä,
Jani Nikula, David Airlie, Alex Deucher, Dave Airlie,
Ander Conselvan de Oliveira, linux-kernel, intel-gfx, dri-devel
all,
On Tue, Jan 20, 2015 at 06:48:42AM +0100, Daniel Vetter wrote:
> On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> > On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > > There's also an issue in (most) X drivers which exaberates this
> > > > issues: When changing the cursor buffer the X cursor code does a a)
> > > > disable cursor b) update cursor image c) enable cursor cycle.
> > >
> > > Notably not -intel on which the bug has been observed. And more
> > > importantly, the slow downs don't seem to correlate with cursor change,
> > > just cursor movement.
> > > -Chris
> > >
> > > --
> > > Chris Wilson, Intel Open Source Technology Centre
> >
> > It seems that the simple fix for this case (movement only) is to just
> > skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> > the transitional plane helper when newfb == oldfb. I just posted a
> > small patch that makes that change (and solves the cursor lag for me).
> >
> > This won't solve the case if userspace uses a different framebuffer for
> > each update (while trying to update faster than the refresh rate). Is
> > there any existing userspace that behaves this way that we can test
> > with?
>
> Hm, I've thought I've merged that patch already:
>
> commit ab58e3384b9f9863bfd029b458ff337d381bf6d2
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Mon Nov 24 20:42:42 2014 +0100
>
> drm/atomic-helper: Skip vblank waits for unchanged fbs
>
> Or is the problem here that the transitional plane helpers aren't up to
> the task? If so please reference that in your patch.
>
> And we still need a hack for the "changed fb cursor" issue, I'll whip
> something up.
> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Just checking if anyone has come up with a fix. I am still stuck at
next-20150112 because of this bug.
--
- Jeremiah Mahler
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-24 6:57 ` Jeremiah Mahler
0 siblings, 0 replies; 24+ messages in thread
From: Jeremiah Mahler @ 2015-01-24 6:57 UTC (permalink / raw)
To: Matt Roper, Chris Wilson, Daniel Vetter, Ville Syrjälä,
Jani Nikula, David Airlie, Alex Deucher, Dave Airlie,
Ander Conselvan de Oliveira, linux-kernel, intel-gfx, dri-devel
all,
On Tue, Jan 20, 2015 at 06:48:42AM +0100, Daniel Vetter wrote:
> On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> > On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > > There's also an issue in (most) X drivers which exaberates this
> > > > issues: When changing the cursor buffer the X cursor code does a a)
> > > > disable cursor b) update cursor image c) enable cursor cycle.
> > >
> > > Notably not -intel on which the bug has been observed. And more
> > > importantly, the slow downs don't seem to correlate with cursor change,
> > > just cursor movement.
> > > -Chris
> > >
> > > --
> > > Chris Wilson, Intel Open Source Technology Centre
> >
> > It seems that the simple fix for this case (movement only) is to just
> > skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> > the transitional plane helper when newfb == oldfb. I just posted a
> > small patch that makes that change (and solves the cursor lag for me).
> >
> > This won't solve the case if userspace uses a different framebuffer for
> > each update (while trying to update faster than the refresh rate). Is
> > there any existing userspace that behaves this way that we can test
> > with?
>
> Hm, I've thought I've merged that patch already:
>
> commit ab58e3384b9f9863bfd029b458ff337d381bf6d2
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Mon Nov 24 20:42:42 2014 +0100
>
> drm/atomic-helper: Skip vblank waits for unchanged fbs
>
> Or is the problem here that the transitional plane helpers aren't up to
> the task? If so please reference that in your patch.
>
> And we still need a hack for the "changed fb cursor" issue, I'll whip
> something up.
> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Just checking if anyone has come up with a fix. I am still stuck at
next-20150112 because of this bug.
--
- Jeremiah Mahler
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-24 6:57 ` [Intel-gfx] " Jeremiah Mahler
@ 2015-01-24 11:24 ` Daniel Vetter
-1 siblings, 0 replies; 24+ messages in thread
From: Daniel Vetter @ 2015-01-24 11:24 UTC (permalink / raw)
To: Jeremiah Mahler, Matt Roper, Chris Wilson, Daniel Vetter,
Ville Syrjälä, Jani Nikula, David Airlie, Alex Deucher,
Dave Airlie, Ander Conselvan de Oliveira, linux-kernel, intel-gfx,
dri-devel
On Fri, Jan 23, 2015 at 10:57:32PM -0800, Jeremiah Mahler wrote:
> all,
>
> On Tue, Jan 20, 2015 at 06:48:42AM +0100, Daniel Vetter wrote:
> > On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> > > On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > > > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > > > There's also an issue in (most) X drivers which exaberates this
> > > > > issues: When changing the cursor buffer the X cursor code does a a)
> > > > > disable cursor b) update cursor image c) enable cursor cycle.
> > > >
> > > > Notably not -intel on which the bug has been observed. And more
> > > > importantly, the slow downs don't seem to correlate with cursor change,
> > > > just cursor movement.
> > > > -Chris
> > > >
> > > > --
> > > > Chris Wilson, Intel Open Source Technology Centre
> > >
> > > It seems that the simple fix for this case (movement only) is to just
> > > skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> > > the transitional plane helper when newfb == oldfb. I just posted a
> > > small patch that makes that change (and solves the cursor lag for me).
> > >
> > > This won't solve the case if userspace uses a different framebuffer for
> > > each update (while trying to update faster than the refresh rate). Is
> > > there any existing userspace that behaves this way that we can test
> > > with?
> >
> > Hm, I've thought I've merged that patch already:
> >
> > commit ab58e3384b9f9863bfd029b458ff337d381bf6d2
> > Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Date: Mon Nov 24 20:42:42 2014 +0100
> >
> > drm/atomic-helper: Skip vblank waits for unchanged fbs
> >
> > Or is the problem here that the transitional plane helpers aren't up to
> > the task? If so please reference that in your patch.
> >
> > And we still need a hack for the "changed fb cursor" issue, I'll whip
> > something up.
> > -Daniel
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch
>
> Just checking if anyone has come up with a fix. I am still stuck at
> next-20150112 because of this bug.
I've merged a patch from Matt Roper:
commit d99b70ce7d73d78a88311453ccdd0fa0a670dd50
Author: Matt Roper <matthew.d.roper@intel.com>
Date: Mon Jan 19 08:31:49 2015 -0800
drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb
that should rectify the sluggish i915 cursor. But it's in a separate topic
branch which isn't in linux-next. Should show up in drm-next next week
though.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-24 11:24 ` Daniel Vetter
0 siblings, 0 replies; 24+ messages in thread
From: Daniel Vetter @ 2015-01-24 11:24 UTC (permalink / raw)
To: Jeremiah Mahler, Matt Roper, Chris Wilson, Daniel Vetter,
Ville Syrjälä, Jani Nikula, David Airlie, Alex Deucher,
Dave Airlie, Ander Conselvan de Oliveira, linux-kernel, intel-gfx,
dri-devel
On Fri, Jan 23, 2015 at 10:57:32PM -0800, Jeremiah Mahler wrote:
> all,
>
> On Tue, Jan 20, 2015 at 06:48:42AM +0100, Daniel Vetter wrote:
> > On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> > > On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > > > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> > > > > There's also an issue in (most) X drivers which exaberates this
> > > > > issues: When changing the cursor buffer the X cursor code does a a)
> > > > > disable cursor b) update cursor image c) enable cursor cycle.
> > > >
> > > > Notably not -intel on which the bug has been observed. And more
> > > > importantly, the slow downs don't seem to correlate with cursor change,
> > > > just cursor movement.
> > > > -Chris
> > > >
> > > > --
> > > > Chris Wilson, Intel Open Source Technology Centre
> > >
> > > It seems that the simple fix for this case (movement only) is to just
> > > skip the prepare_fb/cleanup_fb calls (and the associated vblank wait) in
> > > the transitional plane helper when newfb == oldfb. I just posted a
> > > small patch that makes that change (and solves the cursor lag for me).
> > >
> > > This won't solve the case if userspace uses a different framebuffer for
> > > each update (while trying to update faster than the refresh rate). Is
> > > there any existing userspace that behaves this way that we can test
> > > with?
> >
> > Hm, I've thought I've merged that patch already:
> >
> > commit ab58e3384b9f9863bfd029b458ff337d381bf6d2
> > Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Date: Mon Nov 24 20:42:42 2014 +0100
> >
> > drm/atomic-helper: Skip vblank waits for unchanged fbs
> >
> > Or is the problem here that the transitional plane helpers aren't up to
> > the task? If so please reference that in your patch.
> >
> > And we still need a hack for the "changed fb cursor" issue, I'll whip
> > something up.
> > -Daniel
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch
>
> Just checking if anyone has come up with a fix. I am still stuck at
> next-20150112 because of this bug.
I've merged a patch from Matt Roper:
commit d99b70ce7d73d78a88311453ccdd0fa0a670dd50
Author: Matt Roper <matthew.d.roper@intel.com>
Date: Mon Jan 19 08:31:49 2015 -0800
drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb
that should rectify the sluggish i915 cursor. But it's in a separate topic
branch which isn't in linux-next. Should show up in drm-next next week
though.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-24 11:24 ` Daniel Vetter
@ 2015-01-24 20:27 ` Jeremiah Mahler
-1 siblings, 0 replies; 24+ messages in thread
From: Jeremiah Mahler @ 2015-01-24 20:27 UTC (permalink / raw)
To: Matt Roper, Chris Wilson, Daniel Vetter, Ville Syrjälä,
Jani Nikula, David Airlie, Alex Deucher, Dave Airlie,
Ander Conselvan de Oliveira, linux-kernel, intel-gfx, dri-devel
Daniel, Matt,
On Sat, Jan 24, 2015 at 12:24:55PM +0100, Daniel Vetter wrote:
> On Fri, Jan 23, 2015 at 10:57:32PM -0800, Jeremiah Mahler wrote:
> > all,
> >
> > On Tue, Jan 20, 2015 at 06:48:42AM +0100, Daniel Vetter wrote:
> > > On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> > > > On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > > > > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
[...]
> drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb
>
> that should rectify the sluggish i915 cursor. But it's in a separate topic
> branch which isn't in linux-next. Should show up in drm-next next week
> though.
> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
I found the patch and tried it out. It does fix the mouse pointer
problem. Thanks for the fix.
--
- Jeremiah Mahler
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-24 20:27 ` Jeremiah Mahler
0 siblings, 0 replies; 24+ messages in thread
From: Jeremiah Mahler @ 2015-01-24 20:27 UTC (permalink / raw)
To: Matt Roper, Chris Wilson, Daniel Vetter, Ville Syrjälä,
Jani Nikula, David Airlie, Alex Deucher, Dave Airlie,
Ander Conselvan de Oliveira, linux-kernel, intel-gfx, dri-devel
Daniel, Matt,
On Sat, Jan 24, 2015 at 12:24:55PM +0100, Daniel Vetter wrote:
> On Fri, Jan 23, 2015 at 10:57:32PM -0800, Jeremiah Mahler wrote:
> > all,
> >
> > On Tue, Jan 20, 2015 at 06:48:42AM +0100, Daniel Vetter wrote:
> > > On Mon, Jan 19, 2015 at 08:40:24AM -0800, Matt Roper wrote:
> > > > On Mon, Jan 19, 2015 at 11:04:04AM +0000, Chris Wilson wrote:
> > > > > On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
[...]
> drm/plane-helper: Skip prepare_fb/cleanup_fb when newfb==oldfb
>
> that should rectify the sluggish i915 cursor. But it's in a separate topic
> branch which isn't in linux-next. Should show up in drm-next next week
> though.
> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
I found the patch and tried it out. It does fix the mouse pointer
problem. Thanks for the fix.
--
- Jeremiah Mahler
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [BUG, bisect] drm/i915: mouse pointer lags and overshoots
2015-01-19 10:51 ` [Intel-gfx] " Daniel Vetter
@ 2015-01-19 11:14 ` Ville Syrjälä
-1 siblings, 0 replies; 24+ messages in thread
From: Ville Syrjälä @ 2015-01-19 11:14 UTC (permalink / raw)
To: Daniel Vetter
Cc: David Airlie, intel-gfx, linux-kernel, dri-devel, Alex Deucher,
Dave Airlie, Jeremiah Mahler
On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> On 19/01/2015 10:08, Ville Syrjälä wrote:
> > On Sat, Jan 17, 2015 at 02:06:35AM -0800, Jeremiah Mahler wrote:
> >> Matt, all,
> >>
> >> Commit ea2c67bb4aff introduces a bug which causes the mouse to move in a
> >> very unusual way, as if it has a lot of inertia. It will lag behind and
> >> then overshoot the expected position.
> >>
> >> I reproduced this bug on all my machines which use the drm/i915 drivers
> >> and it affects all forms of mouse pointers including both touchpads and
> >> usb mice. The patch is present in linux-next 20150116.
> >>
> >> commit ea2c67bb4affa84080c616920f3899f123786e56
> >> Author: Matt Roper <matthew.d.roper@intel.com>
> >> Date: Tue Dec 23 10:41:52 2014 -0800
> >>
> >> drm/i915: Move to atomic plane helpers (v9)
> > I guess this is caused by the atomic code refusing to update the plane
> > more than once per vrefresh. So we need to allow the fps>vrefresh rate
> > case to remove the regression.
> >
> > The old cursor code had basically a gross hack to allow this. It just
> > unpinned the old fb before the display engine was done with it, and
> > _after_ unpinning it flipped to the new buffer (with the obvious extra
> > delay of the flip happening on the next vblank). So there was no
> > guarantee the old buffer was still around (or had the correct content)
> > while the display engine was still scanning it out. So to fix this
> > properly we need a vblank worker of some sort.
> >
> > The other issues we nee to know which fb is being scanned out at which
> > point to unpin the correct old buffer. For that we can use the hardware
> > frame counter. We could use some other mechanims too (SURFLIVE, flip
> > counter etc.) but the frame counter is the most ubiqitious method we
> > have.
> >
> > The one extra problem is gen2 doesn't have even the frame counter, so
> > some extra care would be needed there. I'm thinking for gen2 we might
> > allow the driver to call into the vblank core code to update the cooked
> > counter at any time based on the scanline counter and monotonic timestamp.
> > That combined with the vblank evade mechanism should make reasonably sure
> > we have an up to date notion of which frame is currently getting scanned
> > out.
> >
> > We need the extra call into the vblank core since just after the vblank
> > start, the vblank interrupt handler may not have executed yet (especially
> > since gen2 vblank irq fires actually at the frame start which is a delayed
> > version of the vblank start, even though the flip happes at vblank start).
> > So we need an explicit call to make sure the cooked counter is already
> > updated before the irq handler has executed. I have some changes lined
> > up for the vblank code which I think could help make sure he extra call
> > won't increment the counter spuriously, but I have to clean those up a
> > bit before sending them out.
> >
> There's also an issue in (most) X drivers which exaberates this issues:
> When changing the cursor buffer the X cursor code does a a) disable
> cursor b) update cursor image c) enable cursor cycle. With latest
> upstream we /should/ be able to not block for just moving the cursor
> though when nothing crazy happens. Checking for that would be good.
>
> For the real thing: Rob Clark also noticed this on msm with his atomic,
> I think we need a hint flag (only used internally) so that the
> legacy2atomic helpers and the driver core can correctly pass around
> semantics and we could recover the optimization. As long as we don't
> allow this hint flag to be set by userspace we could just completely
> drop the vblank wait - that would be buggy, but so is the old legacy
> implementation.
Yeah, I suppose some kind of quick kludge to restore the old behaviour
would an acceptable short term solution. And as long as it's not visible
to the outside world, we can replace it anytime with a more robust
solution.
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [Intel-gfx] [BUG, bisect] drm/i915: mouse pointer lags and overshoots
@ 2015-01-19 11:14 ` Ville Syrjälä
0 siblings, 0 replies; 24+ messages in thread
From: Ville Syrjälä @ 2015-01-19 11:14 UTC (permalink / raw)
To: Daniel Vetter
Cc: Jeremiah Mahler, Matt Roper, Jani Nikula, David Airlie,
Alex Deucher, Dave Airlie, Ander Conselvan de Oliveira,
linux-kernel, intel-gfx, dri-devel
On Mon, Jan 19, 2015 at 11:51:43AM +0100, Daniel Vetter wrote:
> On 19/01/2015 10:08, Ville Syrjälä wrote:
> > On Sat, Jan 17, 2015 at 02:06:35AM -0800, Jeremiah Mahler wrote:
> >> Matt, all,
> >>
> >> Commit ea2c67bb4aff introduces a bug which causes the mouse to move in a
> >> very unusual way, as if it has a lot of inertia. It will lag behind and
> >> then overshoot the expected position.
> >>
> >> I reproduced this bug on all my machines which use the drm/i915 drivers
> >> and it affects all forms of mouse pointers including both touchpads and
> >> usb mice. The patch is present in linux-next 20150116.
> >>
> >> commit ea2c67bb4affa84080c616920f3899f123786e56
> >> Author: Matt Roper <matthew.d.roper@intel.com>
> >> Date: Tue Dec 23 10:41:52 2014 -0800
> >>
> >> drm/i915: Move to atomic plane helpers (v9)
> > I guess this is caused by the atomic code refusing to update the plane
> > more than once per vrefresh. So we need to allow the fps>vrefresh rate
> > case to remove the regression.
> >
> > The old cursor code had basically a gross hack to allow this. It just
> > unpinned the old fb before the display engine was done with it, and
> > _after_ unpinning it flipped to the new buffer (with the obvious extra
> > delay of the flip happening on the next vblank). So there was no
> > guarantee the old buffer was still around (or had the correct content)
> > while the display engine was still scanning it out. So to fix this
> > properly we need a vblank worker of some sort.
> >
> > The other issues we nee to know which fb is being scanned out at which
> > point to unpin the correct old buffer. For that we can use the hardware
> > frame counter. We could use some other mechanims too (SURFLIVE, flip
> > counter etc.) but the frame counter is the most ubiqitious method we
> > have.
> >
> > The one extra problem is gen2 doesn't have even the frame counter, so
> > some extra care would be needed there. I'm thinking for gen2 we might
> > allow the driver to call into the vblank core code to update the cooked
> > counter at any time based on the scanline counter and monotonic timestamp.
> > That combined with the vblank evade mechanism should make reasonably sure
> > we have an up to date notion of which frame is currently getting scanned
> > out.
> >
> > We need the extra call into the vblank core since just after the vblank
> > start, the vblank interrupt handler may not have executed yet (especially
> > since gen2 vblank irq fires actually at the frame start which is a delayed
> > version of the vblank start, even though the flip happes at vblank start).
> > So we need an explicit call to make sure the cooked counter is already
> > updated before the irq handler has executed. I have some changes lined
> > up for the vblank code which I think could help make sure he extra call
> > won't increment the counter spuriously, but I have to clean those up a
> > bit before sending them out.
> >
> There's also an issue in (most) X drivers which exaberates this issues:
> When changing the cursor buffer the X cursor code does a a) disable
> cursor b) update cursor image c) enable cursor cycle. With latest
> upstream we /should/ be able to not block for just moving the cursor
> though when nothing crazy happens. Checking for that would be good.
>
> For the real thing: Rob Clark also noticed this on msm with his atomic,
> I think we need a hint flag (only used internally) so that the
> legacy2atomic helpers and the driver core can correctly pass around
> semantics and we could recover the optimization. As long as we don't
> allow this hint flag to be set by userspace we could just completely
> drop the vblank wait - that would be buggy, but so is the old legacy
> implementation.
Yeah, I suppose some kind of quick kludge to restore the old behaviour
would an acceptable short term solution. And as long as it's not visible
to the outside world, we can replace it anytime with a more robust
solution.
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 24+ messages in thread