diff mbox

[v2,02/10] drm/i915: remove leftover from pre-universal planes days

Message ID 1411424597-31662-2-git-send-email-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan Sept. 22, 2014, 10:23 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Now that universal planes are in place we don't need this plane unref on
failures.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Ville Syrjälä Sept. 23, 2014, 7:52 a.m. UTC | #1
On Mon, Sep 22, 2014 at 07:23:09PM -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Now that universal planes are in place we don't need this plane unref on
> failures.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index bef37dc..2ef1836 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8362,8 +8362,7 @@ static bool cursor_size_ok(struct drm_device *dev,
>  /*
>   * intel_crtc_cursor_set_obj - Set cursor to specified GEM object
>   *
> - * Note that the object's reference will be consumed if the update fails.  If
> - * the update succeeds, the reference of the old object (if any) will be
> + * If the update succeeds, the reference of the old object (if any) will be
>   * consumed.

The rest of this comment should be removed as well. With universal
planes the fb holds the gem obj reference so we don't frob with
gem obj references at all here.

With that fixed this patch is
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>   */
>  static int intel_crtc_cursor_set_obj(struct drm_crtc *crtc,
> @@ -8395,8 +8394,7 @@ static int intel_crtc_cursor_set_obj(struct drm_crtc *crtc,
>  	stride = roundup_pow_of_two(width) * 4;
>  	if (obj->base.size < stride * height) {
>  		DRM_DEBUG_KMS("buffer is too small\n");
> -		ret = -ENOMEM;
> -		goto fail;
> +		return -ENOMEM;
>  	}
>  
>  	/* we only need to pin inside GTT if cursor is non-phy */
> @@ -8485,8 +8483,6 @@ fail_unpin:
>  	i915_gem_object_unpin_from_display_plane(obj);
>  fail_locked:
>  	mutex_unlock(&dev->struct_mutex);
> -fail:
> -	drm_gem_object_unreference_unlocked(&obj->base);
>  	return ret;
>  }
>  
> -- 
> 1.9.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index bef37dc..2ef1836 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8362,8 +8362,7 @@  static bool cursor_size_ok(struct drm_device *dev,
 /*
  * intel_crtc_cursor_set_obj - Set cursor to specified GEM object
  *
- * Note that the object's reference will be consumed if the update fails.  If
- * the update succeeds, the reference of the old object (if any) will be
+ * If the update succeeds, the reference of the old object (if any) will be
  * consumed.
  */
 static int intel_crtc_cursor_set_obj(struct drm_crtc *crtc,
@@ -8395,8 +8394,7 @@  static int intel_crtc_cursor_set_obj(struct drm_crtc *crtc,
 	stride = roundup_pow_of_two(width) * 4;
 	if (obj->base.size < stride * height) {
 		DRM_DEBUG_KMS("buffer is too small\n");
-		ret = -ENOMEM;
-		goto fail;
+		return -ENOMEM;
 	}
 
 	/* we only need to pin inside GTT if cursor is non-phy */
@@ -8485,8 +8483,6 @@  fail_unpin:
 	i915_gem_object_unpin_from_display_plane(obj);
 fail_locked:
 	mutex_unlock(&dev->struct_mutex);
-fail:
-	drm_gem_object_unreference_unlocked(&obj->base);
 	return ret;
 }