diff mbox

[21/42] drm/i915: Remove use of crtc->config from intel_overlay.c

Message ID 1431354318-11995-22-git-send-email-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst May 11, 2015, 2:24 p.m. UTC
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_overlay.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Daniel Vetter May 12, 2015, 9:06 a.m. UTC | #1
On Mon, May 11, 2015 at 04:24:57PM +0200, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

General comment: Imo the commit message should have a short explanation
for why it's ok to use the the current or new state respectively in any
given conversion. Can be super-repetive ;-) E.g. here this is about the
legacy overlay code which locks out any other updates unconditionally,
hence the atomic state can't change and we want the current one.

This is somewhat important as soon as we start to queue multiple updates
and commit them asynchronously, there crtc->config and crtc->state can end
up being different ...
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_overlay.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> index 5fd2d5ac02e2..fa0ff6974dcc 100644
> --- a/drivers/gpu/drm/i915/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/intel_overlay.c
> @@ -857,13 +857,13 @@ int intel_overlay_switch_off(struct intel_overlay *overlay)
>  }
>  
>  static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
> -					  struct intel_crtc *crtc)
> +					  struct drm_crtc *crtc)
>  {
> -	if (!crtc->active)
> +	if (!crtc->state->active)
>  		return -EINVAL;
>  
>  	/* can't use the overlay with double wide pipe */
> -	if (crtc->config->double_wide)
> +	if (to_intel_crtc_state(crtc->state)->double_wide)
>  		return -EINVAL;
>  
>  	return 0;
> @@ -1127,7 +1127,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
>  		if (ret != 0)
>  			goto out_unlock;
>  
> -		ret = check_overlay_possible_on_crtc(overlay, crtc);
> +		ret = check_overlay_possible_on_crtc(overlay, &crtc->base);
>  		if (ret != 0)
>  			goto out_unlock;
>  
> -- 
> 2.1.0
> 
> _______________________________________________
> 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_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 5fd2d5ac02e2..fa0ff6974dcc 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -857,13 +857,13 @@  int intel_overlay_switch_off(struct intel_overlay *overlay)
 }
 
 static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
-					  struct intel_crtc *crtc)
+					  struct drm_crtc *crtc)
 {
-	if (!crtc->active)
+	if (!crtc->state->active)
 		return -EINVAL;
 
 	/* can't use the overlay with double wide pipe */
-	if (crtc->config->double_wide)
+	if (to_intel_crtc_state(crtc->state)->double_wide)
 		return -EINVAL;
 
 	return 0;
@@ -1127,7 +1127,7 @@  int intel_overlay_put_image(struct drm_device *dev, void *data,
 		if (ret != 0)
 			goto out_unlock;
 
-		ret = check_overlay_possible_on_crtc(overlay, crtc);
+		ret = check_overlay_possible_on_crtc(overlay, &crtc->base);
 		if (ret != 0)
 			goto out_unlock;