[PATCH] drm-backend: for now, on the egl backend, force gl cursors to be used instead of hardware cursors

Daniel Vetter daniel at ffwll.ch
Wed May 20 01:03:44 PDT 2015


On Wed, May 20, 2015 at 10:23:19AM +0300, Pekka Paalanen wrote:
> On Wed, 20 May 2015 09:04:52 +0200
> Daniel Vetter <daniel at ffwll.ch> wrote:
> 
> > On Mon, May 18, 2015 at 10:10:27PM -0400, nerdopolis wrote:
> > > Hardware cursors have been causing some problems with some drivers, mostly i915
> > 
> > What exactly goes wrong with cursor on i915? Working around kernel bugs in
> > userspace is imo bad since it'll perpetuate the bug ...
> 
> Hi,
> 
> the other Daniel explained to me, and I summarized the discussion in
> the this patch that already landed:
> http://cgit.freedesktop.org/wayland/weston/commit/?id=6858383d51b12632481370fdc7d886a1e6bb4ebd

Ah right seen that one too. Yes if you change the bo all the time the
legacy plane interfaces aren't useful since with the default helpers
there'll be a vblank stall when you switch the bo. X generally doesn't do
that.

For cursors specifically we did add a hack though to cut out all vblank
waits unconditionally, so there shouldn't be a reason to blacklist them.
See

commit f02ad907cd9e7fe3a6405d2d005840912f1ed258
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Thu Jan 22 16:36:23 2015 +0100

    drm/atomic-helpers: Recover full cursor plane behaviour
    
    Cursor plane updates have historically been fully async and mutliple
    updates batched together for the next vsync. And userspace relies upon
    that. Since implementing a full queue of async atomic updates is a bit
    of work lets just recover the cursor specific behaviour with a hint
    flag and some hacks to drop the vblank wait.
    
    v2: Fix kerneldoc, reported by Wu Fengguang.
    
    Reviewed-by: Thierry Reding <treding at nvidia.com>
    Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>

And since drivers are switching over to atomic helpers you can even expect
this to be the default behaviour. But ofc it's only for cursors because of
X.

I realized that we've failed to cc: stable this patch, can be fixed if you
want that.
-Daniel

> 
> 
> Cheers,
> pq
> 
> > > 
> > > This will probably be changed once Atomic Mode Setting arrives, to probably only force gl cursors
> > > to always be on when Atomic Mode Setting isn't supported by the driver, or kernel version
> > > ---
> > >  src/compositor-drm.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> > > index 0cdb8f4..0636a37 100644
> > > --- a/src/compositor-drm.c
> > > +++ b/src/compositor-drm.c
> > > @@ -1641,6 +1641,9 @@ drm_output_init_egl(struct drm_output *output, struct drm_compositor *ec)
> > >  		weston_log("cursor buffers unavailable, using gl cursors\n");
> > >  		ec->cursors_are_broken = 1;
> > >  	}
> > > +	/* TODO Remove when atomic mode setting is merged into the mainline kernel, and detect if the
> > > +	 * running kernel supports atomic mode setting instead. */
> > > +	ec->cursors_are_broken = 1;
> > >  
> > >  	return 0;
> > >  }

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the wayland-devel mailing list