[PATCH] drm/i915: Check for fused or unused pipes
Jani Nikula
jani.nikula at intel.com
Thu Dec 14 12:11:05 UTC 2017
On Thu, 14 Dec 2017, Mika Kahola <mika.kahola at intel.com> wrote:
> In case of fused or unused pipes, return early with a warning when
> reading information for encoder.
That description is a bit off actually. With this change, you do *not*
return early with a warning for fused/unused pipes. Instead you just do
range check on the av_enc_map as normal input validation, and let the
av_enc_map decide whether the pipe is valid or not.
I think the change itself is good. (Which should not be a surprise since
I suggested it! ;)
BR,
Jani.
>
> Reported-by: Thomas Gleixner <tglx at linutronix.de>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Mika Kahola <mika.kahola at intel.com>
> ---
> drivers/gpu/drm/i915/intel_audio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index f1502a0..522d54f 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -779,7 +779,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv,
> {
> struct intel_encoder *encoder;
>
> - if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes))
> + if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map)))
> return NULL;
>
> /* MST */
--
Jani Nikula, Intel Open Source Technology Center
More information about the Intel-gfx-trybot
mailing list