aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_modes.h
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2019-02-10 14:10:31 +0100
committerNoralf Trønnes <noralf@tronnes.org>2019-02-21 12:13:42 +0100
commit06db4b8b26284133333bd01504a029139ccf872c (patch)
tree98670101b4a083437e25b4a64c1173b6ab4c0b51 /include/drm/drm_modes.h
parentdrm/drv: drm_dev_unplug(): Move out drm_dev_put() call (diff)
downloadlinux-dev-06db4b8b26284133333bd01504a029139ccf872c.tar.xz
linux-dev-06db4b8b26284133333bd01504a029139ccf872c.zip
drm/modes: Add DRM_SIMPLE_MODE()
This adds a helper macro to specify modes that only contain info about resolution. v2: Actually set the width and height (Ilia Mirkin) Cc: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190210131039.52664-5-noralf@tronnes.org
Diffstat (limited to 'include/drm/drm_modes.h')
-rw-r--r--include/drm/drm_modes.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index be4fed97e727..083f16747369 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -138,6 +138,23 @@ enum drm_mode_status {
.vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
.vscan = (vs), .flags = (f)
+/**
+ * DRM_SIMPLE_MODE - Simple display mode
+ * @hd: Horizontal resolution, width
+ * @vd: Vertical resolution, height
+ * @hd_mm: Display width in millimeters
+ * @vd_mm: Display height in millimeters
+ *
+ * This macro initializes a &drm_display_mode that only contains info about
+ * resolution and physical size.
+ */
+#define DRM_SIMPLE_MODE(hd, vd, hd_mm, vd_mm) \
+ .type = DRM_MODE_TYPE_DRIVER, .clock = 1 /* pass validation */, \
+ .hdisplay = (hd), .hsync_start = (hd), .hsync_end = (hd), \
+ .htotal = (hd), .vdisplay = (vd), .vsync_start = (vd), \
+ .vsync_end = (vd), .vtotal = (vd), .width_mm = (hd_mm), \
+ .height_mm = (vd_mm)
+
#define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */
#define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */
#define CRTC_NO_DBLSCAN (1 << 2) /* don't adjust doublescan */