Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ville Syrjälä and committed by
Daniel Vetter
c1df5f3c 7689ffb3

+20
+18
drivers/gpu/drm/drm_crtc.c
··· 4959 4959 drm_modeset_lock_fini(&dev->mode_config.connection_mutex); 4960 4960 } 4961 4961 EXPORT_SYMBOL(drm_mode_config_cleanup); 4962 + 4963 + struct 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 + } 4979 + EXPORT_SYMBOL(drm_mode_create_rotation_property);
+2
include/drm/drm_crtc.h
··· 1113 1113 extern int drm_format_horz_chroma_subsampling(uint32_t format); 1114 1114 extern int drm_format_vert_chroma_subsampling(uint32_t format); 1115 1115 extern const char *drm_get_format_name(uint32_t format); 1116 + extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, 1117 + unsigned int supported_rotations); 1116 1118 1117 1119 /* Helpers */ 1118 1120