[PATCH] drm/uapi: Add a warning that mode flags must match the xrandr definitions

Daniel Vetter daniel at ffwll.ch
Tue Nov 8 10:11:00 UTC 2016


On Thu, Nov 03, 2016 at 04:10:01PM +0200, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Existing userspace expected the mode flags to match the xrandr
> definitions 1:1, and even adding new flags in he previously unused
> bits is likely to break existing userspace. Add a comment warning
> people about this potential trap.
> 
> Cc: Shashank Sharma <shashank.sharma at intel.com>
> Cc: "Lin, Jia" <lin.a.jia at intel.com>
> Cc: Akashdeep Sharma <akashdeep.sharma at intel.com>
> Cc: Jim Bride <jim.bride at linux.intel.com>
> Cc: Jose Abreu <Jose.Abreu at synopsys.com>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Cc: Emil Velikov <emil.l.velikov at gmail.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Applied to drm-misc, thanks.
-Daniel

> ---
>  include/uapi/drm/drm_mode.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index 084b50a02dc5..01000c9f7c2c 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -47,7 +47,15 @@ extern "C" {
>  #define DRM_MODE_TYPE_DRIVER	(1<<6)
>  
>  /* Video mode flags */
> -/* bit compatible with the xorg definitions. */
> +/* bit compatible with the xrandr RR_ definitions (bits 0-13)
> + *
> + * ABI warning: Existing userspace really expects
> + * the mode flags to match the xrandr definitions. Any
> + * changes that don't match the xrandr definitions will
> + * likely need a new client cap or some other mechanism
> + * to avoid breaking existing userspace. This includes
> + * allocating new flags in the previously unused bits!
> + */
>  #define DRM_MODE_FLAG_PHSYNC			(1<<0)
>  #define DRM_MODE_FLAG_NHSYNC			(1<<1)
>  #define DRM_MODE_FLAG_PVSYNC			(1<<2)
> -- 
> 2.7.4
> 

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


More information about the dri-devel mailing list