aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-07-08 01:01:53 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-11 17:43:52 -0400
commitc1df5f3c2d665f1a5b365d1e352e99832f188fda (patch)
tree272bcb546df843d529f827fb36ef77f0d6147fa3
parent7689ffb32fa314cc6f128b433b5a285f2699cb70 (diff)
drm: Add drm_mode_create_rotation_property()
Add a function to create a standards compliant rotation property. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Acked-by: Dave Airlie <airlied@linux.ie> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_crtc.c18
-rw-r--r--include/drm/drm_crtc.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 2fbee61d632d..f224d4d1c0ed 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4959,3 +4959,21 @@ void drm_mode_config_cleanup(struct drm_device *dev)
4959 drm_modeset_lock_fini(&dev->mode_config.connection_mutex); 4959 drm_modeset_lock_fini(&dev->mode_config.connection_mutex);
4960} 4960}
4961EXPORT_SYMBOL(drm_mode_config_cleanup); 4961EXPORT_SYMBOL(drm_mode_config_cleanup);
4962
4963struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
4964 unsigned int supported_rotations)
4965{
4966 static const struct drm_prop_enum_list props[] = {
4967 { DRM_ROTATE_0, "rotate-0" },
4968 { DRM_ROTATE_90, "rotate-90" },
4969 { DRM_ROTATE_180, "rotate-180" },
4970 { DRM_ROTATE_270, "rotate-270" },
4971 { DRM_REFLECT_X, "reflect-x" },
4972 { DRM_REFLECT_Y, "reflect-y" },
4973 };
4974
4975 return drm_property_create_bitmask(dev, 0, "rotation",
4976 props, ARRAY_SIZE(props),
4977 supported_rotations);
4978}
4979EXPORT_SYMBOL(drm_mode_create_rotation_property);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index cb4850a2b0c1..f7b383bcb6b6 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1113,6 +1113,8 @@ extern int drm_format_plane_cpp(uint32_t format, int plane);
1113extern int drm_format_horz_chroma_subsampling(uint32_t format); 1113extern int drm_format_horz_chroma_subsampling(uint32_t format);
1114extern int drm_format_vert_chroma_subsampling(uint32_t format); 1114extern int drm_format_vert_chroma_subsampling(uint32_t format);
1115extern const char *drm_get_format_name(uint32_t format); 1115extern const char *drm_get_format_name(uint32_t format);
1116extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
1117 unsigned int supported_rotations);
1116 1118
1117/* Helpers */ 1119/* Helpers */
1118 1120