From: Manasi Navare <manasi.d.navare@intel.com>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: Jani Nikula <jani.nikula@intel.com>,
Intel Graphics <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v3 8/8] drm/i915/display/icl: In port sync mode disable slaves first then masters
Date: Tue, 25 Jun 2019 12:02:11 -0700 [thread overview]
Message-ID: <20190625190210.GA23633@intel.com> (raw)
In-Reply-To: <CAKi4VAL-tKKmqETqUTtp8zfZ=aAawEvmxesvT9sPBhTg=TY_gA@mail.gmail.com>
On Mon, Jun 24, 2019 at 11:34:42PM -0700, Lucas De Marchi wrote:
> On Mon, Jun 24, 2019 at 2:07 PM Manasi Navare <manasi.d.navare@intel.com> wrote:
> >
> > In the transcoder port sync mode, the slave transcoders mask their vblanks
> > until master transcoder's vblank so while disabling them, make
> > sure slaves are disabled first and then the masters.
> >
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Matt Roper <matthew.d.roper@intel.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_display.c | 117 ++++++++++++++++++-
> > 1 file changed, 111 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 0a0d97ef03d6..85746a26d0e0 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -13901,6 +13901,106 @@ static void intel_commit_modeset_disables(struct drm_atomic_state *state)
> > }
> > }
> >
> > +static void icl_commit_modeset_disables(struct drm_atomic_state *state)
> > +{
> > + struct drm_device *dev = state->dev;
> > + struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
> > + struct drm_i915_private *dev_priv = to_i915(dev);
> > + struct drm_crtc_state *old_crtc_state, *new_crtc_state;
> > + struct intel_crtc_state *new_intel_crtc_state, *old_intel_crtc_state;
> > + struct drm_crtc *crtc;
> > + struct intel_crtc *intel_crtc;
> > + int i;
> > +
> > + /*
> > + * Disable all the Port Sync Slaves first
> > + */
> > + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
> > + old_intel_crtc_state = to_intel_crtc_state(old_crtc_state);
> > + new_intel_crtc_state = to_intel_crtc_state(new_crtc_state);
> > + intel_crtc = to_intel_crtc(crtc);
> > +
> > + if (!needs_modeset(new_crtc_state) ||
> > + !is_trans_port_sync_slave(old_intel_crtc_state))
> > + continue;
> > +
> > + intel_pre_plane_update(old_intel_crtc_state, new_intel_crtc_state);
> > +
> > + if (old_crtc_state->active) {
> > + intel_crtc_disable_planes(intel_state, intel_crtc);
> > +
> > + /*
> > + * We need to disable pipe CRC before disabling the pipe,
> > + * or we race against vblank off.
> > + */
> > + intel_crtc_disable_pipe_crc(intel_crtc);
> > +
> > + dev_priv->display.crtc_disable(old_intel_crtc_state, state);
> > + intel_crtc->active = false;
> > + intel_fbc_disable(intel_crtc);
> > + intel_disable_shared_dpll(old_intel_crtc_state);
> > +
> > + /*
> > + * Underruns don't always raise interrupts,
> > + * so check manually.
> > + */
> > + intel_check_cpu_fifo_underruns(dev_priv);
> > + intel_check_pch_fifo_underruns(dev_priv);
> > +
> > + /* FIXME unify this for all platforms */
> > + if (!new_crtc_state->active &&
> > + !HAS_GMCH(dev_priv) &&
> > + dev_priv->display.initial_watermarks)
> > + dev_priv->display.initial_watermarks(intel_state,
> > + new_intel_crtc_state);
> > + }
> > + }
> > +
> > + /*
> > + * Disable rest of the CRTCs other than slaves
> > + */
> > + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
> > + old_intel_crtc_state = to_intel_crtc_state(old_crtc_state);
> > + new_intel_crtc_state = to_intel_crtc_state(new_crtc_state);
> > + intel_crtc = to_intel_crtc(crtc);
> > +
> > + if (!needs_modeset(new_crtc_state) ||
> > + is_trans_port_sync_slave(old_intel_crtc_state))
> > + continue;
> > +
> > + intel_pre_plane_update(old_intel_crtc_state, new_intel_crtc_state);
> > +
> > + if (old_crtc_state->active) {
> > + intel_crtc_disable_planes(intel_state, intel_crtc);
> > +
> > + /*
> > + * We need to disable pipe CRC before disabling the pipe,
> > + * or we race against vblank off.
> > + */
> > + intel_crtc_disable_pipe_crc(intel_crtc);
> > +
> > + dev_priv->display.crtc_disable(old_intel_crtc_state, state);
> > + intel_crtc->active = false;
> > + intel_fbc_disable(intel_crtc);
> > + intel_disable_shared_dpll(old_intel_crtc_state);
> > +
> > + /*
> > + * Underruns don't always raise interrupts,
> > + * so check manually.
> > + */
> > + intel_check_cpu_fifo_underruns(dev_priv);
> > + intel_check_pch_fifo_underruns(dev_priv);
> > +
> > + /* FIXME unify this for all platforms */
> > + if (!new_crtc_state->active &&
> > + !HAS_GMCH(dev_priv) &&
> > + dev_priv->display.initial_watermarks)
> > + dev_priv->display.initial_watermarks(intel_state,
> > + new_intel_crtc_state);
> > + }
> > + }
>
> Not a fan of this duplicate code here. At least a helper function
> would be needed.
Hmm yea creating a helper is a good idea, will do that
>
> Jose, didn't you have a pending patch to disable in reverse order to
> solve this same problem?
This is not necessarily in the reverse order, it just does it for all slaves
first and then all masters
Manasi
>
> Lucas De Marchi
>
> > +}
> > +
> > static void intel_commit_modeset_enables(struct drm_atomic_state *state)
> > {
> > struct drm_crtc *crtc;
> > @@ -14257,6 +14357,11 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
> >
> > intel_atomic_commit_fence_wait(intel_state);
> >
> > + drm_atomic_helper_wait_for_dependencies(state);
> > +
> > + if (intel_state->modeset)
> > + wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_MODESET);
> > +
> > for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
> > new_intel_crtc_state = to_intel_crtc_state(new_crtc_state);
> > intel_crtc = to_intel_crtc(crtc);
> > @@ -14269,11 +14374,6 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
> > }
> > }
> >
> > - drm_atomic_helper_wait_for_dependencies(state);
> > -
> > - if (intel_state->modeset)
> > - wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_MODESET);
> > -
> > dev_priv->display.commit_modeset_disables(state);
> >
> > /* FIXME: Eventually get rid of our intel_crtc->config pointer */
> > @@ -16170,7 +16270,12 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv)
> > else
> > dev_priv->display.commit_modeset_enables = intel_commit_modeset_enables;
> >
> > - dev_priv->display.commit_modeset_disables = intel_commit_modeset_disables;
> > + if (INTEL_GEN(dev_priv) >= 11)
> > + dev_priv->display.commit_modeset_disables =
> > + icl_commit_modeset_disables;
> > + else
> > + dev_priv->display.commit_modeset_disables =
> > + intel_commit_modeset_disables;
> >
> > }
> >
> > --
> > 2.19.1
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
>
> --
> Lucas De Marchi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-06-25 19:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 21:08 [PATCH v3 0/8] Enable Transcoder Port Sync feature for tiled displays Manasi Navare
2019-06-24 21:08 ` [PATCH v3 1/8] drm/i915/display: Rename update_crtcs() to commit_modeset_enables() Manasi Navare
2019-08-05 22:19 ` Manasi Navare
2019-08-07 0:11 ` Tolakanahalli Pradeep, Madhumitha
2019-08-23 0:20 ` Manasi Navare
2019-08-23 6:20 ` Jani Nikula
2019-08-23 17:53 ` Manasi Navare
2019-06-24 21:08 ` [PATCH v3 2/8] drm/i915/display: Move the commit_tail() disable sequence to commit_modeset_disables() hook Manasi Navare
2019-06-27 22:57 ` [PATCH v4 " Manasi Navare
2019-08-05 22:21 ` Manasi Navare
2019-08-23 0:22 ` Manasi Navare
2019-06-24 21:08 ` [PATCH v3 3/8] drm/i915/display/icl: Save Master transcoder in slave's crtc_state for Transcoder Port Sync Manasi Navare
2019-06-24 21:08 ` [PATCH v3 4/8] drm/i915/display/icl: Enable TRANSCODER PORT SYNC for tiled displays across separate ports Manasi Navare
2019-06-24 21:08 ` [PATCH v3 5/8] drm/i915/display/icl: HW state readout for transcoder port sync config Manasi Navare
2019-06-24 21:08 ` [PATCH v3 6/8] drm/i915/display/icl: Enable master-slaves in trans port sync mode in correct order Manasi Navare
2019-07-30 10:53 ` Maarten Lankhorst
2019-07-31 23:24 ` Manasi Navare
2019-08-01 15:07 ` Maarten Lankhorst
2019-08-01 23:51 ` Manasi Navare
2019-08-20 21:12 ` Manasi Navare
2019-06-24 21:08 ` [PATCH v3 7/8] drm/i915/display/icl: Disable transcoder port sync as part of crtc_disable() sequence Manasi Navare
2019-06-24 21:08 ` [PATCH v3 8/8] drm/i915/display/icl: In port sync mode disable slaves first then masters Manasi Navare
2019-06-25 6:34 ` Lucas De Marchi
2019-06-25 19:02 ` Manasi Navare [this message]
2019-06-27 20:01 ` Manasi Navare
2019-06-27 22:57 ` [PATCH v4 " Manasi Navare
2019-07-30 9:44 ` Maarten Lankhorst
2019-06-24 21:27 ` ✗ Fi.CI.CHECKPATCH: warning for Enable Transcoder Port Sync feature for Tiled displays (rev2) Patchwork
2019-06-24 21:47 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-06-27 23:38 ` ✗ Fi.CI.CHECKPATCH: warning for Enable Transcoder Port Sync feature for Tiled displays (rev4) Patchwork
2019-06-28 10:42 ` ✓ Fi.CI.BAT: success " Patchwork
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=20190625190210.GA23633@intel.com \
--to=manasi.d.navare@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=lucas.de.marchi@gmail.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.