Skip to content

Commit b7245cc

Browse files
committed
drm/uapi: Deprecate nonsense kms mode types
BUILTIN, CRTC_C, CLOCK_C, and DEFULT mode types are unused. Let's refuse to generate them or accept them from userspace either. A cursory check didn't reveal any userspace code that would depend on these. v2: Recommend DRIVER instead of BUILTIN (ajax) Cc: Jose Abreu <Jose.Abreu@synopsys.com> Cc: Adam Jackson <ajax@redhat.com> Cc: Keith Packard <keithp@keithp.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171115154504.14338-1-ville.syrjala@linux.intel.com Reviewed-by: Jose Abreu <joabreu@synopsys.com>
1 parent 538af6c commit b7245cc

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

‎include/drm/drm_modes.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ struct drm_display_mode {
242242
* A bitmask of flags, mostly about the source of a mode. Possible flags
243243
* are:
244244
*
245-
* - DRM_MODE_TYPE_BUILTIN: Meant for hard-coded modes, effectively
246-
* unused.
247245
* - DRM_MODE_TYPE_PREFERRED: Preferred mode, usually the native
248246
* resolution of an LCD panel. There should only be one preferred
249247
* mode per connector at any given time.
@@ -253,8 +251,11 @@ struct drm_display_mode {
253251
* - DRM_MODE_TYPE_USERDEF: Mode defined via kernel command line
254252
*
255253
* Plus a big list of flags which shouldn't be used at all, but are
256-
* still around since these flags are also used in the userspace ABI:
254+
* still around since these flags are also used in the userspace ABI.
255+
* We no longer accept modes with these types though:
257256
*
257+
* - DRM_MODE_TYPE_BUILTIN: Meant for hard-coded modes, unused.
258+
* Use DRM_MODE_TYPE_DRIVER instead.
258259
* - DRM_MODE_TYPE_DEFAULT: Again a leftover, use
259260
* DRM_MODE_TYPE_PREFERRED instead.
260261
* - DRM_MODE_TYPE_CLOCK_C and DRM_MODE_TYPE_CRTC_C: Define leftovers

‎include/uapi/drm/drm_mode.h‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,15 @@ extern "C" {
3838
#define DRM_DISPLAY_MODE_LEN 32
3939
#define DRM_PROP_NAME_LEN 32
4040

41-
#define DRM_MODE_TYPE_BUILTIN (1<<0)
42-
#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN)
43-
#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN)
41+
#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */
42+
#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
43+
#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */
4444
#define DRM_MODE_TYPE_PREFERRED (1<<3)
45-
#define DRM_MODE_TYPE_DEFAULT (1<<4)
45+
#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */
4646
#define DRM_MODE_TYPE_USERDEF (1<<5)
4747
#define DRM_MODE_TYPE_DRIVER (1<<6)
4848

49-
#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_BUILTIN | \
50-
DRM_MODE_TYPE_CLOCK_C | \
51-
DRM_MODE_TYPE_CRTC_C | \
52-
DRM_MODE_TYPE_PREFERRED | \
53-
DRM_MODE_TYPE_DEFAULT | \
49+
#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \
5450
DRM_MODE_TYPE_USERDEF | \
5551
DRM_MODE_TYPE_DRIVER)
5652

0 commit comments

Comments
 (0)