Re: [PATCH 3/3] drm: Resetting rotation property

Damien Lespiau
2014-06-24T10:27:56Z

On Mon, Jun 23, 2014 at 11:06:01AM +0530, sonika.jindal@intel.com wrote:
> From: Sonika Jindal <sonika.jindal@intel.com>
>
> Reset rotation property to 0 wherever applicable
>
> v2: Also calling set_property of the plane to set the rotation in the plane
> structure. Removed few unused variables.
>
> Cc: damien.lespiau@intel.com
> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
> ---
> drivers/gpu/drm/drm_fb_helper.c | 14 +++++++++++++-
> drivers/gpu/drm/i915/intel_display.c | 1 -
> drivers/gpu/drm/i915/intel_sprite.c | 2 --
> 3 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index d5d8cea..91e611a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -282,9 +282,21 @@ static bool restore_fbdev_mode(struct drm_fb_helper *fb_helper)
>
> drm_warn_on_modeset_not_all_locked(dev);
>
> - list_for_each_entry(plane, &dev->mode_config.plane_list, head)
> + list_for_each_entry(plane, &dev->mode_config.plane_list, head) {
> +
> + if (plane->rotation_property) {
> + int ret = 0;
> + if (plane->funcs->set_property)
> + ret = plane->funcs->set_property(plane,
> + plane->rotation_property, BIT(DRM_ROTATE_0));
> + if (!ret)
> + drm_object_property_set_value(&plane->base,
> + plane->rotation_property, BIT(DRM_ROTATE_0));
> + }
> +
> if (plane->type != DRM_PLANE_TYPE_PRIMARY)
> drm_plane_force_disable(plane);
> + }
>
> for (i = 0; i < fb_helper->crtc_count; i++) {
> struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 85bd3b8..2006e91 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11405,7 +11405,6 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
> {
> struct intel_plane *primary;
> const uint32_t *intel_primary_formats;
> - struct drm_i915_private *dev_priv = dev->dev_private;
> int num_formats;
>
> primary = kzalloc(sizeof(*primary), GFP_KERNEL);
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index aa94f67..aa63027 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1206,7 +1206,6 @@ static int intel_plane_set_property(struct drm_plane *plane,
> struct drm_property *prop,
> uint64_t val)
> {
> - struct drm_i915_private *dev_priv = plane->dev->dev_private;
> struct intel_plane *intel_plane = to_intel_plane(plane);
> uint64_t old_val;
> int ret = -ENOENT;
> @@ -1289,7 +1288,6 @@ static uint32_t vlv_plane_formats[] = {
> int
> intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
> {
> - struct drm_i915_private *dev_priv = dev->dev_private;
> struct intel_plane *intel_plane;
> unsigned long possible_crtcs;
> const uint32_t *plane_formats;

The removal of dev_priv doesn't belong to this patch.

--
Damien