From: Mika Kahola <mika.kahola@intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
Dhinakaran Pandiyan <dhinakaran.pandiyan@gmail.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Check for fused or unused pipes
Date: Fri, 15 Dec 2017 12:05:42 +0200 [thread overview]
Message-ID: <1513332342.6882.96.camel@intel.com> (raw)
In-Reply-To: <87vah8pcih.fsf@intel.com>
On Fri, 2017-12-15 at 11:27 +0200, Jani Nikula wrote:
> On Fri, 15 Dec 2017, Dhinakaran Pandiyan <dhinakaran.pandiyan@gmail.c
> om> wrote:
> >
> > On Friday, December 15, 2017 9:59:02 AM PST Mika Kahola wrote:
> > >
> > > In case of fused or unused pipes, return early with a warning
> > > when reading
> > > information for encoder.
> > >
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103206
> > > Reported-by: Thomas Gleixner <tglx@linutronix.de>
> > > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > > Signed-off-by: Mika Kahola <mika.kahola@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;
> > I think we should remove the WARN_ON() and just return NULL. The
> > error return
> > and the debug message we print in the caller is good enough IMO.
> On the contrary, I think this one is fine with WARN_ON. The commit
> message is inaccurate. This will only become a bounds check with the
> change, and I think it's important to catch the totally out of bounds
> values loudly.
Well, I need to rephrase that commit message.
>
> In case of fused or unused pipes, the code will happily pass that
> check,
> and check the av_enc_map for whether the pipe is available or not.
>
> BR,
> Jani.
>
>
> >
> >
> > >
> > >
> > > /* MST */
> >
--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-12-15 10:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-15 7:59 [PATCH] drm/i915: Check for fused or unused pipes Mika Kahola
2017-12-15 8:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-15 9:02 ` ✓ Fi.CI.IGT: " Patchwork
2017-12-15 9:04 ` [PATCH] " Dhinakaran Pandiyan
2017-12-15 9:27 ` Jani Nikula
2017-12-15 10:05 ` Mika Kahola [this message]
2017-12-15 10:11 ` Dhinakaran Pandiyan
2017-12-15 10:18 ` Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1513332342.6882.96.camel@intel.com \
--to=mika.kahola@intel.com \
--cc=dhinakaran.pandiyan@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.