[RFC] drm: atomic mode set API

Jesse Barnes jbarnes at virtuousgeek.org
Thu Feb 16 08:53:54 PST 2012


On Thu, 16 Feb 2012 04:46:39 -0800 (PST)
Jakob Bornecrantz <jakob at vmware.com> wrote:

> ----- Original Message -----
> > Many of us really want (and need) a way to set the whole display
> > configuration atomically, as well as test a global config.
> > 
> > In talking with Rob and Alex here at ELC a bit, I think this may be
> > enough:
> > 
> > diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
> > index 2a2acda..2864b02 100644
> > --- a/include/drm/drm_mode.h
> > +++ b/include/drm/drm_mode.h
> > @@ -157,6 +157,26 @@ struct drm_mode_get_plane_res {
> >  	__u32 count_planes;
> >  };
> >  
> > +#define DRM_SET_CONFIG_TEST (1<<0) /* don't change the config,
> > just test it for validity */ +
> > +struct drm_mode_set_config {
> > +	__u64 crtcs;
> > +	__u64 crtc_fbs;
> > +	__u64 crtc_xpos; /* array of x coords for crtcs */
> > +	__u64 crtc_ypos; /* array of y coords for crtcs */
> > +	__u32 count_crtcs;
> > +
> > +	__u64 plane_sets; /* array of set_plane structs */
> > +
> > +	__u32 count_planes;
> > +
> > +	__u64 connectors;
> > +	__u64 connector_modes;
> > +	__u32 count_connectors;
> 
> How do you do mirroring? Why not just send down a array of
> drm_mode_crtc?

You can pass the same fb for multiple crtcs if you want to mirror.
Using an array of mode_crtcs would fix one problem though; the mode
array should be tied to the crtc, not the connector (i.e. you can't set
two different modes on two different connectors with only a single
crtc).

> > Any comments?  Do we also need to set gamma or other properties as
> > part of this?  What about cursors?
> 
> I would like to see properties added as well.

That's +3 now I think. :)  I'll try to figure out a way to add that...

Jesse


More information about the dri-devel mailing list