diff mbox

[7/7] drm/i915: Use enum plane instaad of numbers

Message ID 1396279290-29435-8-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä March 31, 2014, 3:21 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Change the update_plane() plane checks to use enum plane, and
also fix up the error message to say something that's not total
nonsense.

FIXME killing the checks entirely is probably a better idea

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Daniel Vetter March 31, 2014, 5:31 p.m. UTC | #1
On Mon, Mar 31, 2014 at 06:21:30PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Change the update_plane() plane checks to use enum plane, and
> also fix up the error message to say something that's not total
> nonsense.
> 
> FIXME killing the checks entirely is probably a better idea

At least killing the totally outdated SAREA comment would be good ;-) But
yeah I really don't see much point in this, especially since we'll
happily frob plane C on ilk/snb despite that we're only supporting it on
ivb+ really.

Looking through git history with git blame it seems like this went defunct
somewhere in the large modesetting rewrite. Or even earlier ... in any
case very confusing history and ripe for the bin.
-Daniel

> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index add940c..9a50b64 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2167,11 +2167,11 @@ static int i9xx_update_primary_plane(struct drm_crtc *crtc,
>  	u32 reg;
>  
>  	switch (plane) {
> -	case 0:
> -	case 1:
> +	case PLANE_A:
> +	case PLANE_B:
>  		break;
>  	default:
> -		DRM_ERROR("Can't update plane %c in SAREA\n", plane_name(plane));
> +		DRM_ERROR("Can't update plane %c\n", plane_name(plane));
>  		return -EINVAL;
>  	}
>  
> @@ -2268,12 +2268,12 @@ static int ironlake_update_primary_plane(struct drm_crtc *crtc,
>  	u32 reg;
>  
>  	switch (plane) {
> -	case 0:
> -	case 1:
> -	case 2:
> +	case PLANE_A:
> +	case PLANE_B:
> +	case PLANE_C:
>  		break;
>  	default:
> -		DRM_ERROR("Can't update plane %c in SAREA\n", plane_name(plane));
> +		DRM_ERROR("Can't update plane %c\n", plane_name(plane));
>  		return -EINVAL;
>  	}
>  
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter March 31, 2014, 5:33 p.m. UTC | #2
On Mon, Mar 31, 2014 at 07:31:04PM +0200, Daniel Vetter wrote:
> On Mon, Mar 31, 2014 at 06:21:30PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Change the update_plane() plane checks to use enum plane, and
> > also fix up the error message to say something that's not total
> > nonsense.
> > 
> > FIXME killing the checks entirely is probably a better idea
> 
> At least killing the totally outdated SAREA comment would be good ;-) But
> yeah I really don't see much point in this, especially since we'll
> happily frob plane C on ilk/snb despite that we're only supporting it on
> ivb+ really.
> 
> Looking through git history with git blame it seems like this went defunct
> somewhere in the large modesetting rewrite. Or even earlier ... in any
> case very confusing history and ripe for the bin.

Forgotten to add: The actually still working "can we update SAREA?" test
is in intel_crtc_update_sarea. That should be mentioned in the commit
message.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index add940c..9a50b64 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2167,11 +2167,11 @@  static int i9xx_update_primary_plane(struct drm_crtc *crtc,
 	u32 reg;
 
 	switch (plane) {
-	case 0:
-	case 1:
+	case PLANE_A:
+	case PLANE_B:
 		break;
 	default:
-		DRM_ERROR("Can't update plane %c in SAREA\n", plane_name(plane));
+		DRM_ERROR("Can't update plane %c\n", plane_name(plane));
 		return -EINVAL;
 	}
 
@@ -2268,12 +2268,12 @@  static int ironlake_update_primary_plane(struct drm_crtc *crtc,
 	u32 reg;
 
 	switch (plane) {
-	case 0:
-	case 1:
-	case 2:
+	case PLANE_A:
+	case PLANE_B:
+	case PLANE_C:
 		break;
 	default:
-		DRM_ERROR("Can't update plane %c in SAREA\n", plane_name(plane));
+		DRM_ERROR("Can't update plane %c\n", plane_name(plane));
 		return -EINVAL;
 	}