From: Jesse Barnes Subject: [RFC] drm: atomic mode set API Date: Wed, 15 Feb 2012 14:42:30 -0800 Message-ID: <20120215144230.648f4349@jbarnes-x220> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy7-pub.bluehost.com (oproxy7-pub.bluehost.com [67.222.55.9]) by gabe.freedesktop.org (Postfix) with SMTP id 8CE659E7FE for ; Wed, 15 Feb 2012 14:42:36 -0800 (PST) Received: from [108.60.121.129] (helo=jbarnes-x220) by box514.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1RxnYZ-0002TB-Iu for dri-devel@lists.freedesktop.org; Wed, 15 Feb 2012 15:42:35 -0700 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org 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; + + __u32 flags; +}; + #define DRM_MODE_ENCODER_NONE 0 #define DRM_MODE_ENCODER_DAC 1 #define DRM_MODE_ENCODER_TMDS 2 This allows you to bind a bunch of fbs to crtcs with independent positions, as well as set a bunch of planes to specific fbs and layouts. Finally, it lets you change the connector config at the same time, with a flag to simply test a config instead of actually setting it. Any comments? Do we also need to set gamma or other properties as part of this? What about cursors? Thanks, Jesse