Re: [Intel-gfx] [PATCH 9/9] drm/i915/gen9: fail the modeset instead of WARNing on unsuported config

2016-09-15 Thread Ville Syrjälä
On Tue, Sep 13, 2016 at 09:38:22PM -0300, Paulo Zanoni wrote:
> Now that this code is part of the compute stage we can return -EINVAL
> to prevent the modeset instead of giving a WARN and trying anyway.
> 
> Reported-by: Lyude 
> Signed-off-by: Paulo Zanoni 
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 9edc8ce..6394db7 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3589,11 +3589,11 @@ static int skl_compute_plane_wm(const struct 
> drm_i915_private *dev_priv,
>   case 2:
>   y_min_scanlines = 8;
>   break;
> - default:
> - WARN(1, "Unsupported pixel depth for rotation");
>   case 4:
>   y_min_scanlines = 4;
>   break;
> + default:
> + return -EINVAL;

Considering this should never happen, MISSING_CASE() would be the
appropriate choice here.

>   }
>   } else {
>   y_min_scanlines = 4;
> -- 
> 2.7.4
> 
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 9/9] drm/i915/gen9: fail the modeset instead of WARNing on unsuported config

2016-09-13 Thread Paulo Zanoni
Now that this code is part of the compute stage we can return -EINVAL
to prevent the modeset instead of giving a WARN and trying anyway.

Reported-by: Lyude 
Signed-off-by: Paulo Zanoni 
---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 9edc8ce..6394db7 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3589,11 +3589,11 @@ static int skl_compute_plane_wm(const struct 
drm_i915_private *dev_priv,
case 2:
y_min_scanlines = 8;
break;
-   default:
-   WARN(1, "Unsupported pixel depth for rotation");
case 4:
y_min_scanlines = 4;
break;
+   default:
+   return -EINVAL;
}
} else {
y_min_scanlines = 4;
-- 
2.7.4

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx