From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 17/20] drm/i915: Use adjusted_mode in the fastboot hack to disable pfit
Date: Fri, 20 Sep 2013 10:01:03 -0700 [thread overview]
Message-ID: <20130920100103.7ef456d4@jbarnes-desktop> (raw)
In-Reply-To: <20130920153347.GD24822@strange.amr.corp.intel.com>
On Fri, 20 Sep 2013 16:33:47 +0100
Damien Lespiau <damien.lespiau@intel.com> wrote:
> On Fri, Sep 20, 2013 at 05:54:55PM +0300, Ville Syrjälä wrote:
> > On Thu, Sep 19, 2013 at 05:40:32PM +0100, Damien Lespiau wrote:
> > > When booting with i915.fastboot=1, we always take tha code path and end
> > > up undoing what we're trying to do with adjusted_mode.
> > >
> > > Hopefully, as the fastboot hardware readout code is using adjusted_mode
> > > as well, it should be equivalent.
> > >
> > > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/intel_display.c | 7 +++++--
> > > 1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index f868266..2b9f80b 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -2288,9 +2288,12 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
> > >
> > > /* Update pipe size and adjust fitter if needed */
> > > if (i915_fastboot) {
> > > + const struct drm_display_mode *adjusted_mode =
> > > + &intel_crtc->config.adjusted_mode;
> > > +
> > > I915_WRITE(PIPESRC(intel_crtc->pipe),
> > > - ((crtc->mode.hdisplay - 1) << 16) |
> > > - (crtc->mode.vdisplay - 1));
> > > + ((adjusted_mode->crtc_hdisplay - 1) << 16) |
> > > + (adjusted_mode->crtc_vdisplay - 1));
> > > if (!intel_crtc->config.pch_pfit.enabled &&
> > > (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) ||
> > > intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) {
> >
> > OK, I'm offically confused by this thing. Maybe it got a bit broken
> > by the pfit.enabled change?
> >
> > I must assume that the original intention of this was to turn off the
> > panel fitter in case the BIOS had left it enabled w/ 0x0 size, but
> > I'm not sure how that would even work. Anyways, now it will turn it
> > off if it's already off, which doesn't make much sense.
> >
> > And I guess the PIPESRC write is there because we assume the BIOS left
> > it wrong for the non-pfit case. We have explicit readout for it now,
> > so we could actually check if that's the case.
>
> Well, I didn't even read beyond the PIPESRC write, but yes, now that you
> mention it, it looks dodgy.
>
> Jesse, do you remember what was the original intention? neither the
> commit introducing the change nor the comment are very verbose.
Just for the record, I'll capture what we discussed on IRC.
The reason for this is that in compute_mode_changes we check the native
mode (not the pfit mode) to see if we can flip rather than do a full
mode set. In the fastboot case, we'll flip, but if we don't update the
pipesrc and pfit state, we'll end up with a big fb scanned out into the
wrong sized surface.
To fix this properly, we need to hoist the checks up into
compute_mode_changes (or above), check the actual pfit state and
whether the platform allows pfit disable with pipe active, and only
then update the pipesrc and pfit state, even on the flip path.
On top of that, other state like info frames and audio state needs to
be tracked and preserved for fastboot as applicable. Then we can
remove the parameter hacks.
--
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2013-09-20 17:01 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 16:40 HDMI stereo support v5 Damien Lespiau
2013-09-19 16:40 ` [PATCH 01/20] drm: Add a SET_CLIENT_CAP ioctl Damien Lespiau
2013-09-19 16:40 ` [PATCH 02/20] drm: Add HDMI stereo 3D flags to struct drm_mode_modeinfo Damien Lespiau
2013-09-19 16:40 ` [PATCH 03/20] drm: Add a STEREO_3D capability to the SET_CLIENT_CAP ioctl Damien Lespiau
2013-09-19 16:40 ` [PATCH 04/20] drm/edid: Expose mandatory stereo modes for HDMI sinks Damien Lespiau
2013-09-19 16:40 ` [PATCH 05/20] drm: Extract add_hdmi_mode() out of do_hdmi_vsdb_modes() Damien Lespiau
2013-09-19 16:40 ` [PATCH 06/20] drm: Reject modes with more than 1 stereo flags set Damien Lespiau
2013-09-19 16:40 ` [PATCH 07/20] drm: Set the relevant infoframe field when scanning out a 3D mode Damien Lespiau
2013-09-19 16:40 ` [PATCH 08/20] drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modes Damien Lespiau
2013-09-19 16:40 ` [PATCH 09/20] drm: Carry over the stereo flags when adding the alternate mode Damien Lespiau
2013-09-19 16:40 ` [PATCH 10/20] drm: Make exposing stereo modes a per-connector opt-in Damien Lespiau
2013-09-19 16:40 ` [PATCH 11/20] drm: Remove clock_index from struct drm_display_mode Damien Lespiau
2013-09-19 22:20 ` Ben Skeggs
2013-09-19 16:40 ` [PATCH 12/20] drm: Remove synth_clock " Damien Lespiau
2013-09-19 16:40 ` [PATCH 13/20] drm: Introduce a crtc_clock for " Damien Lespiau
2013-09-19 16:40 ` [PATCH 14/20] drm: Implement timings adjustments for frame packing Damien Lespiau
2013-09-20 13:47 ` Ville Syrjälä
2013-09-23 15:09 ` [PATCH] " Damien Lespiau
2013-09-19 16:40 ` [PATCH 15/20] drm/i915: Use crtc_clock in intel_dump_crtc_timings() Damien Lespiau
2013-09-19 16:40 ` [PATCH 16/20] drm/i915: Use crtc_clock with the adjusted mode Damien Lespiau
2013-09-19 16:40 ` [PATCH 17/20] drm/i915: Use adjusted_mode in the fastboot hack to disable pfit Damien Lespiau
2013-09-20 14:54 ` Ville Syrjälä
2013-09-20 15:33 ` Damien Lespiau
2013-09-20 17:01 ` Jesse Barnes [this message]
2013-09-19 16:40 ` [PATCH 18/20] drm/i915: Ask the DRM core do make stereo timings adjustements Damien Lespiau
2013-09-19 16:40 ` [PATCH 19/20] drm/i915: Prefer crtc_{h|v}display for pipe src dimensions Damien Lespiau
2013-09-19 18:49 ` [Intel-gfx] " Daniel Vetter
2013-09-19 16:40 ` [PATCH 20/20] drm/i915: Allow stereo modes on HDMI Damien Lespiau
2013-09-20 15:18 ` HDMI stereo support v5 Ville Syrjälä
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=20130920100103.7ef456d4@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=damien.lespiau@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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;
as well as URLs for NNTP newsgroup(s).