From e2cd09b202c5d32804f72bc28a9ed5a7d8a34452 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 6 Mar 2015 17:16:43 +0200 Subject: drm: omapdrm: Store the rotation property in dev->mode_config Rotation is a standard property, store it in dev->mode_config.rotation_property. While at it, extract the properties initialization code to a separate function instead of running it for every plane. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_plane.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'drivers/gpu/drm/omapdrm/omap_plane.c') diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index 1c6b63f39474..a1c9c08db345 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -297,33 +297,14 @@ void omap_plane_install_properties(struct drm_plane *plane, { struct drm_device *dev = plane->dev; struct omap_drm_private *priv = dev->dev_private; - struct drm_property *prop; if (priv->has_dmm) { - prop = priv->rotation_prop; - if (!prop) { - prop = drm_mode_create_rotation_property(dev, - BIT(DRM_ROTATE_0) | - BIT(DRM_ROTATE_90) | - BIT(DRM_ROTATE_180) | - BIT(DRM_ROTATE_270) | - BIT(DRM_REFLECT_X) | - BIT(DRM_REFLECT_Y)); - if (prop == NULL) - return; - priv->rotation_prop = prop; - } + struct drm_property *prop = dev->mode_config.rotation_property; + drm_object_attach_property(obj, prop, 0); } - prop = priv->zorder_prop; - if (!prop) { - prop = drm_property_create_range(dev, 0, "zorder", 0, 3); - if (prop == NULL) - return; - priv->zorder_prop = prop; - } - drm_object_attach_property(obj, prop, 0); + drm_object_attach_property(obj, priv->zorder_prop, 0); } int omap_plane_set_property(struct drm_plane *plane, @@ -333,7 +314,7 @@ int omap_plane_set_property(struct drm_plane *plane, struct omap_drm_private *priv = plane->dev->dev_private; int ret = -EINVAL; - if (property == priv->rotation_prop) { + if (property == plane->dev->mode_config.rotation_property) { DBG("%s: rotation: %02x", omap_plane->name, (uint32_t)val); omap_plane->win.rotation = val; ret = omap_plane_apply(plane); -- cgit