Commit 0385ecea authored by Manasi Navare's avatar Manasi Navare

drm/i915: HW state readout for Bigjoiner case

Skip iterating over bigjoiner slaves, only the master has the state we
care about.

Add the width of the bigjoiner slave to the reconstructed fb.

Hide the bigjoiner slave to userspace, and double the mode on bigjoiner
master.

And last, disable bigjoiner slave from primary if reconstruction fails.

v3:
* Fix the ddi_get_config slave error (Ankit Nautiyal)
v2:
* Unsupported bigjoiner config for initial fb (Ville)
Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
[vsyrjala:
* Don't do any hw->uapi state copy for bigjoiner slave
* We still have hw.mode so no need to pass it in
* Appease checkpatch]
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarAnimesh Manna <animesh.manna@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201117194718.11462-7-manasi.d.navare@intel.com
parent 4e3cdb45
...@@ -1492,8 +1492,6 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder, ...@@ -1492,8 +1492,6 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
intel_dsc_get_config(pipe_config);
/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */ /* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */
pipe_config->port_clock = intel_dpll_get_freq(i915, pipe_config->port_clock = intel_dpll_get_freq(i915,
pipe_config->shared_dpll, pipe_config->shared_dpll,
......
...@@ -4577,7 +4577,7 @@ static void bdw_get_trans_port_sync_config(struct intel_crtc_state *crtc_state) ...@@ -4577,7 +4577,7 @@ static void bdw_get_trans_port_sync_config(struct intel_crtc_state *crtc_state)
crtc_state->sync_mode_slaves_mask); crtc_state->sync_mode_slaves_mask);
} }
void intel_ddi_get_config(struct intel_encoder *encoder, static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config) struct intel_crtc_state *pipe_config)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
...@@ -4585,12 +4585,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -4585,12 +4585,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
enum transcoder cpu_transcoder = pipe_config->cpu_transcoder; enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
u32 temp, flags = 0; u32 temp, flags = 0;
/* XXX: DSI transcoder paranoia */
if (drm_WARN_ON(&dev_priv->drm, transcoder_is_dsi(cpu_transcoder)))
return;
intel_dsc_get_config(pipe_config);
temp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder)); temp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder));
if (temp & TRANS_DDI_PHSYNC) if (temp & TRANS_DDI_PHSYNC)
flags |= DRM_MODE_FLAG_PHSYNC; flags |= DRM_MODE_FLAG_PHSYNC;
...@@ -4684,6 +4678,30 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -4684,6 +4678,30 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
default: default:
break; break;
} }
}
void intel_ddi_get_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config)
{
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
/* XXX: DSI transcoder paranoia */
if (drm_WARN_ON(&dev_priv->drm, transcoder_is_dsi(cpu_transcoder)))
return;
if (pipe_config->bigjoiner_slave) {
/* read out pipe settings from master */
enum transcoder save = pipe_config->cpu_transcoder;
/* Our own transcoder needs to be disabled when reading it in intel_ddi_read_func_ctl() */
WARN_ON(pipe_config->output_types);
pipe_config->cpu_transcoder = (enum transcoder)pipe_config->bigjoiner_linked_crtc->pipe;
intel_ddi_read_func_ctl(encoder, pipe_config);
pipe_config->cpu_transcoder = save;
} else {
intel_ddi_read_func_ctl(encoder, pipe_config);
}
pipe_config->has_audio = pipe_config->has_audio =
intel_ddi_is_audio_enabled(dev_priv, cpu_transcoder); intel_ddi_is_audio_enabled(dev_priv, cpu_transcoder);
...@@ -4709,6 +4727,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -4709,6 +4727,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp; dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp;
} }
if (!pipe_config->bigjoiner_slave)
intel_ddi_clock_get(encoder, pipe_config); intel_ddi_clock_get(encoder, pipe_config);
if (IS_GEN9_LP(dev_priv)) if (IS_GEN9_LP(dev_priv))
......
...@@ -850,6 +850,7 @@ struct intel_crtc_state { ...@@ -850,6 +850,7 @@ struct intel_crtc_state {
* accordingly. * accordingly.
*/ */
#define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */ #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */
#define PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE (1<<1) /* bigjoiner slave, partial readout */
unsigned long quirks; unsigned long quirks;
unsigned fb_bits; /* framebuffers to flip */ unsigned fb_bits; /* framebuffers to flip */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment