From: Manasi Navare <manasi.d.navare@intel.com>
To: "Srivatsa, Anusha" <anusha.srivatsa@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/4] drm/i915/icl: Assign Master slave crtc links for Transcoder Port Sync
Date: Wed, 22 May 2019 14:40:49 -0700 [thread overview]
Message-ID: <20190522214048.GC2502@intel.com> (raw)
In-Reply-To: <83F5C7385F545743AD4FB2A62F75B07348062085@ORSMSX108.amr.corp.intel.com>
On Fri, May 03, 2019 at 05:09:20PM -0700, Srivatsa, Anusha wrote:
>
>
> >-----Original Message-----
> >From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> >Manasi Navare
> >Sent: Tuesday, April 23, 2019 8:49 AM
> >To: intel-gfx@lists.freedesktop.org
> >Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >Subject: [Intel-gfx] [PATCH v2 1/4] drm/i915/icl: Assign Master slave crtc links for
> >Transcoder Port Sync
> >
> >In case of tiled displays when the two tiles are sent across two CRTCs over two
> >separate DP SST connectors, we need a mechanism to synchronize the two CRTCs
> >and their corresponding transcoders.
> >So use the master-slave mode where there is one master corresponding to last
> >horizontal and vertical tile that needs to be genlocked with all other slave tiles.
> >This patch identifies saves the master CRTC pointer in all the slave CRTC states.
> >This pointer is needed to select the master CRTC/transcoder while configuring
> >transcoder port sync for the corresponding slaves.
> >
> >v2:
> >* Move this to intel_mode_set_pipe_config(Jani N, Ville)
> >* Use slave_bitmask to save associated slaves in master crtc state (Ville)
> >
> >Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >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>
> >Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> >---
> > drivers/gpu/drm/i915/intel_display.c | 89 ++++++++++++++++++++++++++++
> > drivers/gpu/drm/i915/intel_drv.h | 6 ++
> > 2 files changed, 95 insertions(+)
> >
> >diff --git a/drivers/gpu/drm/i915/intel_display.c
> >b/drivers/gpu/drm/i915/intel_display.c
> >index b276345779e6..92dea2231499 100644
> >--- a/drivers/gpu/drm/i915/intel_display.c
> >+++ b/drivers/gpu/drm/i915/intel_display.c
> >@@ -11316,6 +11316,86 @@ static int icl_check_nv12_planes(struct
> >intel_crtc_state *crtc_state)
> > return 0;
> > }
> >
> >+static int icl_add_genlock_crtcs(struct drm_crtc *crtc,
> >+ struct intel_crtc_state *crtc_state,
> >+ struct drm_atomic_state *state)
> >+{
> >+ struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
> >+ struct drm_connector *master_connector, *connector;
> >+ struct drm_connector_state *connector_state;
> >+ struct drm_connector_list_iter conn_iter;
> >+ struct drm_crtc *master_crtc = NULL;
> >+ struct drm_crtc_state *master_crtc_state;
> >+ int i, tile_group_id;
> >+
> >+ if (INTEL_GEN(dev_priv) < 11)
> >+ return 0;
> >+
> >+ /*
> >+ * In case of tiled displays there could be one or more slaves but there is
> >+ * only one master. Lets make the CRTC used by the connector
> >corresponding
> >+ * to the last horizonal and last vertical tile a master/genlock CRTC.
> >+ * All the other CRTCs corresponding to other tiles of the same Tile group
> >+ * are the slave CRTCs and hold a pointer to their genlock CRTC.
> >+ */
> >+ for_each_new_connector_in_state(state, connector, connector_state, i)
> >{
> >+ if (connector_state->crtc != crtc)
> >+ continue;
> >+ if (!connector->has_tile)
> >+ continue;
> >+ if (connector->tile_h_loc == connector->num_h_tile - 1 &&
> >+ connector->tile_v_loc == connector->num_v_tile - 1)
> >+ continue;
> >+ crtc_state->master_crtc = NULL;
> >+ tile_group_id = connector->tile_group->id;
> >+ drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter);
> >+ drm_for_each_connector_iter(master_connector, &conn_iter) {
> >+ struct drm_connector_state *master_conn_state =
> >NULL;
> >+
> >+ if (!master_connector->has_tile)
> >+ continue;
> >+ if (master_connector->tile_h_loc != master_connector-
> >>num_h_tile - 1 ||
> >+ master_connector->tile_v_loc != master_connector-
> >>num_v_tile - 1)
>
> Will this ever be true? With the checks above (for slaves) we have iterated over all slaves and potentially left with only master/last tile right?
>
> Anusha
Actually its the other way around. So like the comment says the last tile is the master and all others are slaves,
so here in for_each_connector(), we skip the master and call drm_for_each_connector_iter() for each slave to find its
corresponding master. So if its not the last tile then we continue until we find the last tile which becomes the master.
Makes sense?
Manasi
>
> >+ continue;
> >+ if (master_connector->tile_group->id != tile_group_id)
> >+ continue;
> >+
> >+ master_conn_state =
> >drm_atomic_get_connector_state(state,
> >+
> >master_connector);
> >+ if (IS_ERR(master_conn_state)) {
> >+ drm_connector_list_iter_end(&conn_iter);
> >+ return PTR_ERR(master_conn_state);
> >+ }
> >+ if (master_conn_state->crtc) {
> >+ master_crtc = master_conn_state->crtc;
> >+ break;
> >+ }
> >+ }
> >+ drm_connector_list_iter_end(&conn_iter);
> >+
> >+ if (!master_crtc) {
> >+ DRM_DEBUG_KMS("Could not add Master CRTC for
> >Slave CRTC %d\n",
> >+ connector_state->crtc->base.id);
> >+ return -EINVAL;
> >+ }
> >+
> >+ master_crtc_state = drm_atomic_get_crtc_state(state,
> >+ master_crtc);
> >+ if (IS_ERR(master_crtc_state))
> >+ return PTR_ERR(master_crtc_state);
> >+
> >+ crtc_state->master_crtc = to_intel_crtc(master_crtc);
> >+ to_intel_crtc_state(master_crtc_state)->trans_port_sync_slaves
> >|=
> >+ BIT(to_intel_crtc(crtc)->pipe);
> >+ DRM_DEBUG_KMS("Master CRTC = %d added for Slave CRTC =
> >%d\n, slave bitmast = %d",
> >+ master_crtc->base.id,
> >+ crtc_state->base.crtc->base.id,
> >+ to_intel_crtc_state(master_crtc_state)-
> >>trans_port_sync_slaves);
> >+ }
> >+
> >+ return 0;
> >+}
> >+
> > static int intel_crtc_atomic_check(struct drm_crtc *crtc,
> > struct drm_crtc_state *crtc_state) { @@ -
> >11795,6 +11875,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
> > if (IS_G4X(dev_priv) ||
> > IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> > saved_state->wm = crtc_state->wm;
> >+ if (INTEL_GEN(dev_priv) >= 11)
> >+ saved_state->trans_port_sync_slaves =
> >+ crtc_state->trans_port_sync_slaves;
> >
> > /* Keep base drm_crtc_state intact, only clear our extended struct */
> > BUILD_BUG_ON(offsetof(struct intel_crtc_state, base)); @@ -11888,6
> >+11971,12 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
> > drm_mode_set_crtcinfo(&pipe_config->base.adjusted_mode,
> > CRTC_STEREO_DOUBLE);
> >
> >+ ret = icl_add_genlock_crtcs(crtc, pipe_config, state);
> >+ if (ret) {
> >+ DRM_DEBUG_KMS("\n8K Debug: Cannot assign genlock crtcs");
> >+ return ret;
> >+ }
> >+
> > /* Pass our mode to the connectors and the CRTC to give them a chance
> >to
> > * adjust it according to limitations or connector properties, and also
> > * a chance to reject the mode entirely.
> >diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> >index a38b9cff5cd0..8ae9cb662e28 100644
> >--- a/drivers/gpu/drm/i915/intel_drv.h
> >+++ b/drivers/gpu/drm/i915/intel_drv.h
> >@@ -1082,6 +1082,12 @@ struct intel_crtc_state {
> >
> > /* Forward Error correction State */
> > bool fec_enable;
> >+
> >+ /* Pointer to master crtc in case of tiled displays */
> >+ struct intel_crtc *master_crtc;
> >+
> >+ /* Bitmask to indicate slaves attached */
> >+ u8 trans_port_sync_slaves;
> > };
> >
> > struct intel_crtc {
> >--
> >2.19.1
> >
> >_______________________________________________
> >Intel-gfx mailing list
> >Intel-gfx@lists.freedesktop.org
> >https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-05-22 21:38 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 15:48 [PATCH v2 0/4] Enable Transcoder Port Sync feature for Tiled displays Manasi Navare
2019-04-23 15:48 ` [PATCH v2 1/4] drm/i915/icl: Assign Master slave crtc links for Transcoder Port Sync Manasi Navare
2019-05-04 0:09 ` Srivatsa, Anusha
2019-05-22 21:40 ` Manasi Navare [this message]
2019-06-11 23:28 ` Manasi Navare
2019-06-12 9:39 ` Maarten Lankhorst
2019-06-12 19:04 ` Ville Syrjälä
2019-06-12 19:11 ` Manasi Navare
2019-06-12 19:30 ` Ville Syrjälä
2019-06-12 20:59 ` Manasi Navare
2019-06-13 9:10 ` Ville Syrjälä
2019-06-13 16:41 ` Manasi Navare
2019-06-13 17:12 ` Ville Syrjälä
2019-06-13 20:13 ` Manasi Navare
2019-06-21 18:40 ` Manasi Navare
2019-04-23 15:48 ` [PATCH v2 2/4] drm/i915/icl: Enable TRANSCODER PORT SYNC for tiled displays across separate ports Manasi Navare
2019-05-04 0:13 ` Srivatsa, Anusha
2019-05-22 21:42 ` Manasi Navare
2019-06-12 8:30 ` Maarten Lankhorst
2019-04-23 15:49 ` [PATCH v2 3/4] drm/i915/dp: Trigger modeset if master_crtc or slaves bitmask changes Manasi Navare
2019-05-04 0:14 ` Srivatsa, Anusha
2019-06-12 8:32 ` Maarten Lankhorst
2019-06-12 18:36 ` Manasi Navare
2019-04-23 15:49 ` [PATCH v2 4/4] drm/i915/dp: Enable master-slaves in trans port sync mode in correct order Manasi Navare
2019-06-12 8:41 ` Maarten Lankhorst
2019-06-13 21:36 ` Manasi Navare
2019-04-23 16:04 ` ✗ Fi.CI.CHECKPATCH: warning for Enable Transcoder Port Sync feature for Tiled displays Patchwork
2019-04-23 16:58 ` ✗ Fi.CI.BAT: failure " 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=20190522214048.GC2502@intel.com \
--to=manasi.d.navare@intel.com \
--cc=anusha.srivatsa@intel.com \
--cc=daniel.vetter@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;
as well as URLs for NNTP newsgroup(s).