diff mbox

[08/11] drm/i915: Bad pixel formats can't reach the sprite code

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

Commit Message

Ville Syrjälä Oct. 31, 2012, 3:50 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The framebuffer pixel format is already checked by the common code.
So there's no way an invalid format could reach the driver. So instead
of falling back to a default format, call BUG().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_sprite.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

Comments

Jesse Barnes Oct. 31, 2012, 8:27 p.m. UTC | #1
On Wed, 31 Oct 2012 17:50:21 +0200
ville.syrjala@linux.intel.com wrote:

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The framebuffer pixel format is already checked by the common code.
> So there's no way an invalid format could reach the driver. So instead
> of falling back to a default format, call BUG().
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_sprite.c |    8 ++------
>  1 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index a4fe7f5..7959e75 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -78,9 +78,7 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
>  		sprctl |= SPRITE_FORMAT_YUV422 | SPRITE_YUV_ORDER_VYUY;
>  		break;
>  	default:
> -		DRM_DEBUG_DRIVER("bad pixel format, assuming RGBX888\n");
> -		sprctl |= SPRITE_FORMAT_RGBX888;
> -		break;
> +		BUG();
>  	}
>  
>  	if (obj->tiling_mode != I915_TILING_NONE)
> @@ -252,9 +250,7 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
>  		dvscntr |= DVS_FORMAT_YUV422 | DVS_YUV_ORDER_VYUY;
>  		break;
>  	default:
> -		DRM_DEBUG_DRIVER("bad pixel format, assuming RGBX888\n");
> -		dvscntr |= DVS_FORMAT_RGBX888;
> -		break;
> +		BUG();
>  	}
>  
>  	if (obj->tiling_mode != I915_TILING_NONE)

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index a4fe7f5..7959e75 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -78,9 +78,7 @@  ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
 		sprctl |= SPRITE_FORMAT_YUV422 | SPRITE_YUV_ORDER_VYUY;
 		break;
 	default:
-		DRM_DEBUG_DRIVER("bad pixel format, assuming RGBX888\n");
-		sprctl |= SPRITE_FORMAT_RGBX888;
-		break;
+		BUG();
 	}
 
 	if (obj->tiling_mode != I915_TILING_NONE)
@@ -252,9 +250,7 @@  ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
 		dvscntr |= DVS_FORMAT_YUV422 | DVS_YUV_ORDER_VYUY;
 		break;
 	default:
-		DRM_DEBUG_DRIVER("bad pixel format, assuming RGBX888\n");
-		dvscntr |= DVS_FORMAT_RGBX888;
-		break;
+		BUG();
 	}
 
 	if (obj->tiling_mode != I915_TILING_NONE)