[PATCH 10/11] drm/vmwgfx: Switch over to internal atomic API for STDU

Daniel Vetter daniel at ffwll.ch
Thu Mar 30 07:42:04 UTC 2017


On Wed, Mar 29, 2017 at 02:05:26PM -0700, Sinclair Yeh wrote:
> Hi Daniel,
> 
> On Tue, Mar 28, 2017 at 09:49:38AM +0200, Daniel Vetter wrote:
> > On Mon, Mar 27, 2017 at 03:01:03PM -0700, Sinclair Yeh wrote:
> > > Switch over to using internal atomic API for mode set.
> > > 
> > > This removes the legacy set_config API, replacing it with
> > > drm_atomic_helper_set_config().  The DRM helper will use various
> > > vmwgfx-specific atomic functions to set a mode.
> > > 
> > > DRIVER_ATOMIC capability flag is not yet set, so the user mode
> > > will still use the legacy mode set IOCTL.
> > > 
> > > v2:
> > > * Avoid a clash between page-flip pinning and setcrtc pinning, modify
> > > the page-flip code to use the page-flip helper and the atomic callbacks.
> > > To enable this, we will need to add a wrapper around atomic_commit.
> > > 
> > > * Add vmw_kms_set_config() to work around vmwgfx xorg driver bug
> > > 
> > > Signed-off-by: Sinclair Yeh <syeh at vmware.com>
> > > Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> > > Reviewed-by: Thomas Hellstrom <thellstrom at vmware.com>
> > > ---
> > >  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c  |  20 +++
> > >  drivers/gpu/drm/vmwgfx/vmwgfx_kms.h  |   1 +
> > >  drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 325 ++++-------------------------------
> > >  3 files changed, 51 insertions(+), 295 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > > index 6b593aaf..7104796 100644
> > > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > > @@ -2923,3 +2923,23 @@ vmw_kms_create_implicit_placement_property(struct vmw_private *dev_priv,
> > >  					  "implicit_placement", 0, 1);
> > >  
> > >  }
> > > +
> > > +
> > > +/**
> > > + * vmw_kms_set_config - Wrapper around drm_atomic_helper_set_config
> > > + *
> > > + * @set: The configuration to set.
> > > + *
> > > + * The vmwgfx Xorg driver doesn't assign the mode::type member, which
> > > + * when drm_mode_set_crtcinfo is called as part of the configuration setting
> > > + * causes it to return incorrect crtc dimensions causing severe problems in
> > > + * the vmwgfx modesetting. So explicitly clear that member before calling
> > > + * into drm_atomic_helper_set_config.
> > > + */
> > > +int vmw_kms_set_config(struct drm_mode_set *set)
> > > +{
> > > +	if (set && set->mode)
> > > +		set->mode->type = 0;
> > 
> > ugh :( Looking at set_crtcinfo the only thing I can see it look at ->type
> > is to check for built-in modes. Not a single driver is using that afaics,
> > we might as well remove this and and void the vmw special case here too.
> 
> Do you mean remove drm_display_mode->type field altogether or just
> the check in drm_mode_set_crtcinfo?

I only checked whether we could remove the check from
drm_mode_set_crtcinfo. I thought we need ->type still for stuff like
preferred modes. But there's definitely a pile of #defines for that field
which go back to the original kms commit in 2.6.32 and seem to have not
ever been used. Cleaning out that garbage would be good (since it's all
internal stuff afaics).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list