drm/i915/display: Cache adpative sync caps to use it later
Add new member to struct intel_dp to cache support of Adaptive Sync SDP capabilities and use it whenever required to avoid HW access to read capability during each atomic commit. -v2: - Squash both the patches Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240704082638.2302092-2-mitulkumar.ajitkumar.golani@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
9fc97277eb
commit
b2013783c4
5 changed files with 15 additions and 14 deletions
|
@ -280,7 +280,7 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
|
||||||
if (DISPLAY_VER(i915) < 20)
|
if (DISPLAY_VER(i915) < 20)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!intel_dp_as_sdp_supported(intel_dp))
|
if (!intel_dp->as_sdp_supported)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (crtc_state->has_psr)
|
if (crtc_state->has_psr)
|
||||||
|
|
|
@ -1806,6 +1806,7 @@ struct intel_dp {
|
||||||
|
|
||||||
/* connector directly attached - won't be use for modeset in mst world */
|
/* connector directly attached - won't be use for modeset in mst world */
|
||||||
struct intel_connector *attached_connector;
|
struct intel_connector *attached_connector;
|
||||||
|
bool as_sdp_supported;
|
||||||
|
|
||||||
struct drm_dp_tunnel *tunnel;
|
struct drm_dp_tunnel *tunnel;
|
||||||
bool tunnel_suspended:1;
|
bool tunnel_suspended:1;
|
||||||
|
|
|
@ -129,14 +129,6 @@ bool intel_dp_is_edp(struct intel_dp *intel_dp)
|
||||||
return dig_port->base.type == INTEL_OUTPUT_EDP;
|
return dig_port->base.type == INTEL_OUTPUT_EDP;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool intel_dp_as_sdp_supported(struct intel_dp *intel_dp)
|
|
||||||
{
|
|
||||||
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
|
|
||||||
|
|
||||||
return HAS_AS_SDP(i915) &&
|
|
||||||
drm_dp_as_sdp_supported(&intel_dp->aux, intel_dp->dpcd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void intel_dp_unset_edid(struct intel_dp *intel_dp);
|
static void intel_dp_unset_edid(struct intel_dp *intel_dp);
|
||||||
|
|
||||||
/* Is link rate UHBR and thus 128b/132b? */
|
/* Is link rate UHBR and thus 128b/132b? */
|
||||||
|
@ -2625,8 +2617,7 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
|
||||||
const struct drm_display_mode *adjusted_mode =
|
const struct drm_display_mode *adjusted_mode =
|
||||||
&crtc_state->hw.adjusted_mode;
|
&crtc_state->hw.adjusted_mode;
|
||||||
|
|
||||||
if (!crtc_state->vrr.enable ||
|
if (!crtc_state->vrr.enable || intel_dp->as_sdp_supported)
|
||||||
!intel_dp_as_sdp_supported(intel_dp))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);
|
crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);
|
||||||
|
@ -5900,6 +5891,15 @@ intel_dp_detect_dsc_caps(struct intel_dp *intel_dp, struct intel_connector *conn
|
||||||
connector);
|
connector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
intel_dp_detect_sdp_caps(struct intel_dp *intel_dp)
|
||||||
|
{
|
||||||
|
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
|
||||||
|
|
||||||
|
intel_dp->as_sdp_supported = HAS_AS_SDP(i915) &&
|
||||||
|
drm_dp_as_sdp_supported(&intel_dp->aux, intel_dp->dpcd);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
intel_dp_detect(struct drm_connector *connector,
|
intel_dp_detect(struct drm_connector *connector,
|
||||||
struct drm_modeset_acquire_ctx *ctx,
|
struct drm_modeset_acquire_ctx *ctx,
|
||||||
|
@ -5958,6 +5958,8 @@ intel_dp_detect(struct drm_connector *connector,
|
||||||
|
|
||||||
intel_dp_detect_dsc_caps(intel_dp, intel_connector);
|
intel_dp_detect_dsc_caps(intel_dp, intel_connector);
|
||||||
|
|
||||||
|
intel_dp_detect_sdp_caps(intel_dp);
|
||||||
|
|
||||||
intel_dp_mst_configure(intel_dp);
|
intel_dp_mst_configure(intel_dp);
|
||||||
|
|
||||||
if (intel_dp->reset_link_params) {
|
if (intel_dp->reset_link_params) {
|
||||||
|
|
|
@ -85,7 +85,6 @@ void intel_dp_audio_compute_config(struct intel_encoder *encoder,
|
||||||
struct drm_connector_state *conn_state);
|
struct drm_connector_state *conn_state);
|
||||||
bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp);
|
bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp);
|
||||||
bool intel_dp_is_edp(struct intel_dp *intel_dp);
|
bool intel_dp_is_edp(struct intel_dp *intel_dp);
|
||||||
bool intel_dp_as_sdp_supported(struct intel_dp *intel_dp);
|
|
||||||
bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);
|
bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);
|
||||||
bool intel_dp_has_dsc(const struct intel_connector *connector);
|
bool intel_dp_has_dsc(const struct intel_connector *connector);
|
||||||
int intel_dp_link_symbol_size(int rate);
|
int intel_dp_link_symbol_size(int rate);
|
||||||
|
|
|
@ -233,8 +233,7 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
|
||||||
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
|
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intel_dp_as_sdp_supported(intel_dp) &&
|
if (intel_dp->as_sdp_supported && crtc_state->vrr.enable) {
|
||||||
crtc_state->vrr.enable) {
|
|
||||||
crtc_state->vrr.vsync_start =
|
crtc_state->vrr.vsync_start =
|
||||||
(crtc_state->hw.adjusted_mode.crtc_vtotal -
|
(crtc_state->hw.adjusted_mode.crtc_vtotal -
|
||||||
crtc_state->hw.adjusted_mode.vsync_start);
|
crtc_state->hw.adjusted_mode.vsync_start);
|
||||||
|
|
Loading…
Add table
Reference in a new issue