From: Daniel Vetter <daniel@ffwll.ch>
To: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 12/31] drm/i915: Fix PSR initialization.
Date: Thu, 19 Nov 2015 10:34:50 +0100 [thread overview]
Message-ID: <20151119093450.GQ20799@phenom.ffwll.local> (raw)
In-Reply-To: <1447872025.15751.100.camel@intel.com>
On Wed, Nov 18, 2015 at 06:39:45PM +0000, Vivi, Rodrigo wrote:
> On Wed, 2015-11-18 at 11:12 +0100, Daniel Vetter wrote:
> > On Thu, Nov 05, 2015 at 10:50:04AM -0800, Rodrigo Vivi wrote:
> > > PSR is still disabled by default, but even passing
> > > i915.enable_psr=1
> > > at this point we weren't able to get PSR working because with
> > > fastboot by default in place we weren't executing the path that
> > > enables
> > > encoder and consequently PSR.
> > >
> > > Now with psr_ready in place and PSR using crtc signature we can
> > > move
> > > its enable/disable sequences from the encoder enable to the post
> > > atomic modeset functions.
> > >
> > > i915.enable_psr parameter is still used to enable/disable psr
> > > feature
> > > on the next primary plane update. So current test cases that relies
> > > on this flow still works.
> > >
> > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/intel_ddi.c | 2 --
> > > drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++
> > > drivers/gpu/drm/i915/intel_dp.c | 5 -----
> > > drivers/gpu/drm/i915/intel_drv.h | 2 ++
> > > 4 files changed, 17 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> > > b/drivers/gpu/drm/i915/intel_ddi.c
> > > index b8f8dee..36db970 100644
> > > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > > @@ -2404,7 +2404,6 @@ static void intel_enable_ddi(struct
> > > intel_encoder *intel_encoder)
> > > intel_dp_stop_link_train(intel_dp);
> > >
> > > intel_edp_backlight_on(intel_dp);
> > > - intel_psr_enable(intel_crtc);
> > > intel_edp_drrs_enable(intel_dp);
> > > }
> > >
> > > @@ -2432,7 +2431,6 @@ static void intel_disable_ddi(struct
> > > intel_encoder *intel_encoder)
> > > struct intel_dp *intel_dp =
> > > enc_to_intel_dp(encoder);
> > >
> > > intel_edp_drrs_disable(intel_dp);
> > > - intel_psr_disable(intel_crtc);
> > > intel_edp_backlight_off(intel_dp);
> > > }
> > > }
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > > b/drivers/gpu/drm/i915/intel_display.c
> > > index 869929d..f67e2ee 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -4687,6 +4687,9 @@ static void intel_post_plane_update(struct
> > > intel_crtc *crtc)
> > > if (atomic->enable_ips)
> > > intel_ips_enable(crtc);
> > >
> > > + if (atomic->enable_psr)
> > > + intel_psr_enable(crtc);
> >
> > What we need here is a post-modeset fixup hook for
> > encoders/connectors.
> > That would avoid the layering violation of going through a crtc and
> > then
> > doing the crtc->encoder lookup you do in the previous patch. And we
> > have
> > other uses for this, e.g. mipi self refresh, fixing up infoframes and
> > all
> > those things.
>
> I see your point but I'm not sure if I totally got your idea.
>
> So would it be a generic hook when we detect encoder/connector being
> enabled/disabled?
>
> and how to determine that? could you please elaborate your idea a bit
> more?
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c3bc6ab77508..427daac480f5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13273,6 +13273,11 @@ static int intel_atomic_commit(struct drm_device *dev,
modeset_put_power_domains(dev_priv, put_domains);
intel_post_plane_update(intel_crtc);
+
+ if (needs_modeset || update_pipe) {
+ for_each_encoder_on_crtc(dev, crtc, encoder)
+ encoder->enable_fixup(encoder);
+ }
}
/* FIXME: add subpixel order */
With this enable_fixup (maybe we should call it post_plane_enable) will
will get called both when we do a full modeset, but also when we just do a
fast modeset/pipe update. Then we can move everything that we're currently
doing in ->enable which also must be done for fastboot into
->post_plane_enable, like infoframes, DRRS, psr or whatever.
The only tricky part is that the core won't do the book-keeping for us
anymore, i.e. we need to check ourselves in this new hook whether we need
to do the setup or not, since if userspace only changes the scaling a lot
we might get a lot of ->post_plane_enable calls without any ->disable
calls in between. So that's also where you have to put your checks:
intel_dp_post_plane_enable()
{
if (!psr_enabled)
enable_psr();
if (!DRRS_on)
enable_drrs();
/* maybe in the future */
if (!audio_enabled)
enable_audio();
}
intel_hdmi_post_plane_enable()
{
/* ifxup infoframes if they're crap from the bios */
}
Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-19 9:34 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 18:49 [PATCH 00/31] IPS/DRRS/PSR rework with PSR enabled by default Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 01/31] drm/i915: Rename IPS ready variable at pipe config Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 02/31] drm/i915: Move IPS related stuff to intel_ips.c Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 03/31] drm/i915: Add IPS DockBook Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 04/31] drm/i915: Handle actual IPS enabled state Rodrigo Vivi
2015-11-07 19:19 ` Daniel Stone
2015-11-13 18:20 ` Daniel Stone
2015-11-13 18:38 ` Ville Syrjälä
2015-11-13 18:55 ` Daniel Stone
2015-11-13 20:28 ` Ville Syrjälä
2015-11-13 21:42 ` Daniel Stone
2015-11-05 18:49 ` [PATCH 05/31] drm/i915: Fix IPS initialization Rodrigo Vivi
2015-11-05 18:49 ` [PATCH 06/31] drm/i915: Fix IPS disable sequence Rodrigo Vivi
2015-11-10 16:34 ` Daniel Stone
2015-11-11 23:31 ` Vivi, Rodrigo
2015-11-12 11:24 ` Daniel Stone
2015-11-05 18:49 ` [PATCH 07/31] drm/i915: IPS Sysfs interface Rodrigo Vivi
2015-11-05 21:04 ` Chris Wilson
2015-11-18 10:04 ` Daniel Vetter
2015-11-18 18:32 ` Vivi, Rodrigo
2015-11-09 11:37 ` Daniel Stone
2015-11-05 18:50 ` [PATCH 08/31] drm/i915: Add psr_ready on pipe_config Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 09/31] drm/i915: Only enable DRRS if PSR won't be enabled on this pipe Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 10/31] drm/i915: Detatch i915.enable_psr from psr_ready Rodrigo Vivi
2015-11-18 10:07 ` Daniel Vetter
2015-11-18 18:35 ` Vivi, Rodrigo
2015-11-19 9:19 ` Daniel Vetter
2015-11-05 18:50 ` [PATCH 11/31] drm/i915: Use intel_crtc instead of intel_dp on PSR enable/disable functions Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 12/31] drm/i915: Fix PSR initialization Rodrigo Vivi
2015-11-18 10:12 ` Daniel Vetter
2015-11-18 18:39 ` Vivi, Rodrigo
2015-11-19 9:34 ` Daniel Vetter [this message]
2015-11-05 18:50 ` [PATCH 13/31] drm/i915: Organize Makefile new display pm group Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 14/31] drm/i915: Create intel_drrs.c Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 15/31] drm/i915: Use intel_crtc instead of intel_dp on DRRS enable/disable functions Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 16/31] drm/i915: Fix DRRS initialization Rodrigo Vivi
2015-11-18 10:13 ` Daniel Vetter
2015-11-05 18:50 ` [PATCH 17/31] drm/i915: Add sys PSR toggle interface Rodrigo Vivi
2015-11-05 21:03 ` Chris Wilson
2015-11-05 18:50 ` [PATCH 18/31] drm/i915: Force PSR exit when IRQ_HPD is detected on eDP Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 19/31] drm/i915: Remove duplicated dpcd write on hsw_psr_enable_sink Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 20/31] drm/i915: PSR: Let's rely more on frontbuffer tracking Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 21/31] drm/i915: PSR: Mask LPSP hw tracking back again Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 22/31] drm/i915: Delay first PSR activation Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 23/31] drm/i915: Reduce PSR re-activation time for VLV/CHV Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 24/31] drm/i915: PSR: Don't Skip aux handshake on DP_PSR_NO_TRAIN_ON_EXIT Rodrigo Vivi
2015-11-09 10:38 ` Jani Nikula
2015-11-10 15:41 ` Vivi, Rodrigo
2015-11-05 18:50 ` [PATCH 25/31] drm/i915: Send TP1 TP2/3 even when panel claims no NO_TRAIN_ON_EXIT Rodrigo Vivi
2015-11-09 10:39 ` Jani Nikula
2015-11-10 15:42 ` Vivi, Rodrigo
2015-11-05 18:50 ` [PATCH 26/31] drm/i915: Fix idle_frames counter Rodrigo Vivi
2015-11-05 18:50 ` [PATCH 27/31] drm/i915: Allow 1 vblank to let Sink CRC calculation to start or stop Rodrigo Vivi
2015-11-10 20:12 ` Paulo Zanoni
2015-11-05 18:50 ` [PATCH 28/31] drm/i915: Make Sink crc calculation waiting for counter to reset Rodrigo Vivi
2015-11-10 20:31 ` Paulo Zanoni
2015-11-10 21:49 ` Paulo Zanoni
2015-11-18 10:25 ` Daniel Vetter
2015-11-18 18:42 ` Vivi, Rodrigo
2015-11-05 18:50 ` [PATCH 29/31] drm/i915: Stop tracking last calculated Sink CRC Rodrigo Vivi
2015-11-10 21:36 ` Paulo Zanoni
2015-11-05 18:50 ` [PATCH 30/31] drm/i915: Rely on TEST_SINK_START instead of tracking Sink CRC state on dev_priv Rodrigo Vivi
2015-11-10 21:44 ` Paulo Zanoni
2015-11-05 18:50 ` [PATCH 31/31] drm/i915: Enable PSR by default Rodrigo Vivi
2015-11-05 21:07 ` Chris Wilson
2015-11-05 21:30 ` Vivi, Rodrigo
2015-11-09 11:47 ` [PATCH 00/31] IPS/DRRS/PSR rework with PSR enabled " Daniel Stone
2015-11-10 15:57 ` Vivi, Rodrigo
2015-11-10 16:26 ` Daniel Stone
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=20151119093450.GQ20799@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox