From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Allow rotation properties to have custom names. TODO: maybe squash into "drm: Add drm_mode_create_rotation_property()" Cc: Sagar Kamble <sagar.a.kamble@xxxxxxxxx> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> --- drivers/gpu/drm/drm_crtc.c | 3 ++- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_sprite.c | 2 +- drivers/gpu/drm/omapdrm/omap_plane.c | 2 +- include/drm/drm_crtc.h | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index fe04889..7077676 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -4179,6 +4179,7 @@ void drm_mode_config_cleanup(struct drm_device *dev) EXPORT_SYMBOL(drm_mode_config_cleanup); struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, + const char *name, unsigned int supported_rotations) { static const struct drm_prop_enum_list props[] = { @@ -4190,7 +4191,7 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, { DRM_REFLECT_Y, "reflect-y" }, }; - return drm_property_create_bitmask(dev, 0, "rotation", + return drm_property_create_bitmask(dev, 0, name, props, ARRAY_SIZE(props), supported_rotations); } diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 050b249..bab17fd 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10401,7 +10401,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) if (INTEL_INFO(dev)->gen >= 4) { if (!dev_priv->rotation_property) dev_priv->rotation_property = - drm_mode_create_rotation_property(dev, + drm_mode_create_rotation_property(dev, "rotation", BIT(DRM_ROTATE_0) | BIT(DRM_ROTATE_180)); if (dev_priv->rotation_property) diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 7dcce4e..2936007 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c @@ -1216,7 +1216,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) if (!dev_priv->rotation_property) dev_priv->rotation_property = - drm_mode_create_rotation_property(dev, + drm_mode_create_rotation_property(dev, "rotation", BIT(DRM_ROTATE_0) | BIT(DRM_ROTATE_180)); diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index e4a3fd1..72b9dc7 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -300,7 +300,7 @@ void omap_plane_install_properties(struct drm_plane *plane, if (priv->has_dmm) { prop = priv->rotation_prop; if (!prop) { - prop = drm_mode_create_rotation_property(dev, + prop = drm_mode_create_rotation_property(dev, "rotation", BIT(DRM_ROTATE_0) | BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_X) | BIT(DRM_REFLECT_Y)); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index e1c0aba..ee84a4a 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -1185,6 +1185,7 @@ extern int drm_format_horz_chroma_subsampling(uint32_t format); extern int drm_format_vert_chroma_subsampling(uint32_t format); extern const char *drm_get_format_name(uint32_t format); extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, + const char *name, unsigned int supported_rotations); extern unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations); -- 1.8.3.2 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel