From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915/ibx: check port in infoframe_enabled
Date: Thu, 20 Nov 2014 14:33:23 -0800 [thread overview]
Message-ID: <20141120143323.12ca41aa@jbarnes-t420> (raw)
In-Reply-To: <20141120215732.GM25711@phenom.ffwll.local>
On Thu, 20 Nov 2014 22:57:32 +0100
Daniel Vetter <daniel@ffwll.ch> wrote:
> On Thu, Nov 20, 2014 at 01:24:14PM -0800, Jesse Barnes wrote:
> > Just like on g4x we need to check the port enable bit here.
> >
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> > drivers/gpu/drm/i915/intel_hdmi.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c
> > b/drivers/gpu/drm/i915/intel_hdmi.c index ec87333..cc48b51 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -222,10 +222,15 @@ static bool ibx_infoframe_enabled(struct
> > drm_encoder *encoder) struct drm_device *dev = encoder->dev;
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > struct intel_crtc *intel_crtc =
> > to_intel_crtc(encoder->crtc);
> > + struct intel_digital_port *intel_dig_port =
> > enc_to_dig_port(encoder); int reg =
> > TVIDEO_DIP_CTL(intel_crtc->pipe); u32 val = I915_READ(reg);
> > + u32 port = VIDEO_DIP_PORT(intel_dig_port->port);
> >
> > - return val & VIDEO_DIP_ENABLE;
> > + if (port == (val & VIDEO_DIP_PORT_MASK))
> > + return val & VIDEO_DIP_ENABLE;
>
> I think the only thing that can go wrong is us or the bios making a
> complete mess out of the pipe->port assignment for infoframes here. So
> I've thought more of
>
> if (val & VIDEO_DIP_ENABLE) {
> WARN_ON(port != (val & VIDEO_DIP_PORT_MASK));
> return true;
> }
>
> return false;
>
> I.e. just double-checking that everything is as expected. Otherwise
> we'd need to collect infoframes from all pipes I think. But since we
> don't have any code to clean up such a mess I hope it doesn't exist
> in the real world out there.
So in that case, we'll set the has_infoframes to true even if
infoframes are enabled on the wrong port, which means we might skip a
mode set later which would clean them up and set the right port...
I like the idea of the WARN though.
Jesse
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-20 22:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 21:24 [PATCH 1/2] drm/i915/g4x: fix g4x infoframe readout Jesse Barnes
2014-11-20 21:24 ` [PATCH 2/2] drm/i915/ibx: check port in infoframe_enabled Jesse Barnes
2014-11-20 21:57 ` Daniel Vetter
2014-11-20 22:33 ` Jesse Barnes [this message]
2014-11-22 23:31 ` [PATCH 2/2] drm/i915/ibx: check port in shuang.he
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=20141120143323.12ca41aa@jbarnes-t420 \
--to=jbarnes@virtuousgeek.org \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox