aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_modes.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-05-24 16:51:36 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-05-31 09:59:41 +0200
commit99cdb35e787b277bc66ed9fe7d5f9852de9e0eb0 (patch)
treeb36fde05a9fd70486be58e3617ed0c0a3c8c0c56 /include/drm/drm_modes.h
parentdrm/pl111: select DRM_PANEL (diff)
downloadlinux-dev-99cdb35e787b277bc66ed9fe7d5f9852de9e0eb0.tar.xz
linux-dev-99cdb35e787b277bc66ed9fe7d5f9852de9e0eb0.zip
drm/doc: move printf helpers out of drmP.h
And document them lightly. Unfortunately kernel-doc isn't the most awesome for documenting #defines that don't look like functions, it makes functions out of them :-/ Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-2-daniel.vetter@ffwll.ch Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-3-daniel.vetter@ffwll.ch
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 6dd34280e892..94ac771fe460 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -197,6 +197,8 @@ enum drm_mode_status {
* there's the hardware timings, which are corrected for interlacing,
* double-clocking and similar things. They are provided as a convenience, and
* can be appropriately computed using drm_mode_set_crtcinfo().
+ *
+ * For printing you can use %DRM_MODE_FMT and DRM_MODE_ARG().
*/
struct drm_display_mode {
/**
@@ -407,6 +409,21 @@ struct drm_display_mode {
enum hdmi_picture_aspect picture_aspect_ratio;
};
+/**
+ * DRM_MODE_FMT - printf string for &struct drm_display_mode
+ */
+#define DRM_MODE_FMT "%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x"
+
+/**
+ * DRM_MODE_ARG - printf arguments for &struct drm_display_mode
+ * @m: display mode
+ */
+#define DRM_MODE_ARG(m) \
+ (m)->base.id, (m)->name, (m)->vrefresh, (m)->clock, \
+ (m)->hdisplay, (m)->hsync_start, (m)->hsync_end, (m)->htotal, \
+ (m)->vdisplay, (m)->vsync_start, (m)->vsync_end, (m)->vtotal, \
+ (m)->type, (m)->flags
+
#define obj_to_mode(x) container_of(x, struct drm_display_mode, base)
/**