mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 09:56:25 -04:00
drm/i915/dp: stop caching has_hdmi_sink in struct intel_dp
Use the information stored in display info. Add intel_dp_has_hdmi_sink() helper to access it. v2: Rebased Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/748103fda572b3552e5bbdafb300d8508d4eeaf4.1685437500.git.jani.nikula@intel.com
This commit is contained in:
@@ -2801,7 +2801,7 @@ static void intel_ddi_pre_enable(struct intel_atomic_state *state,
|
||||
|
||||
/* FIXME precompute everything properly */
|
||||
/* FIXME how do we turn infoframes off again? */
|
||||
if (dig_port->lspcon.active && dig_port->dp.has_hdmi_sink)
|
||||
if (dig_port->lspcon.active && intel_dp_has_hdmi_sink(&dig_port->dp))
|
||||
dig_port->set_infoframes(encoder,
|
||||
crtc_state->has_infoframe,
|
||||
crtc_state, conn_state);
|
||||
@@ -3110,7 +3110,7 @@ static void intel_enable_ddi_dp(struct intel_atomic_state *state,
|
||||
drm_connector_update_privacy_screen(conn_state);
|
||||
intel_edp_backlight_on(crtc_state, conn_state);
|
||||
|
||||
if (!dig_port->lspcon.active || dig_port->dp.has_hdmi_sink)
|
||||
if (!dig_port->lspcon.active || intel_dp_has_hdmi_sink(&dig_port->dp))
|
||||
intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
|
||||
|
||||
intel_audio_codec_enable(encoder, crtc_state, conn_state);
|
||||
@@ -3738,7 +3738,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
|
||||
pipe_config->fec_enable);
|
||||
}
|
||||
|
||||
if (dig_port->lspcon.active && dig_port->dp.has_hdmi_sink)
|
||||
if (dig_port->lspcon.active && intel_dp_has_hdmi_sink(&dig_port->dp))
|
||||
pipe_config->infoframes.enable |=
|
||||
intel_lspcon_infoframes_enabled(encoder, pipe_config);
|
||||
else
|
||||
|
||||
@@ -1707,7 +1707,6 @@ struct intel_dp {
|
||||
u8 lane_count;
|
||||
u8 sink_count;
|
||||
bool link_trained;
|
||||
bool has_hdmi_sink;
|
||||
bool reset_link_params;
|
||||
bool use_max_params;
|
||||
u8 dpcd[DP_RECEIVER_CAP_SIZE];
|
||||
|
||||
@@ -1287,6 +1287,13 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
|
||||
}
|
||||
}
|
||||
|
||||
bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_connector *connector = intel_dp->attached_connector;
|
||||
|
||||
return connector->base.display_info.is_hdmi;
|
||||
}
|
||||
|
||||
static bool intel_dp_source_supports_fec(struct intel_dp *intel_dp,
|
||||
const struct intel_crtc_state *pipe_config)
|
||||
{
|
||||
@@ -1342,7 +1349,7 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,
|
||||
|
||||
for (; bpc >= 8; bpc -= 2) {
|
||||
if (intel_hdmi_bpc_possible(crtc_state, bpc,
|
||||
intel_dp->has_hdmi_sink) &&
|
||||
intel_dp_has_hdmi_sink(intel_dp)) &&
|
||||
intel_dp_tmds_clock_valid(intel_dp, clock, bpc, crtc_state->sink_format,
|
||||
respect_downstream_limits) == MODE_OK)
|
||||
return bpc;
|
||||
@@ -2732,7 +2739,7 @@ static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp)
|
||||
static bool intel_dp_is_hdmi_2_1_sink(struct intel_dp *intel_dp)
|
||||
{
|
||||
if (drm_dp_is_branch(intel_dp->dpcd) &&
|
||||
intel_dp->has_hdmi_sink &&
|
||||
intel_dp_has_hdmi_sink(intel_dp) &&
|
||||
intel_dp_hdmi_sink_max_frl(intel_dp) > 0)
|
||||
return true;
|
||||
|
||||
@@ -2900,13 +2907,12 @@ void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp,
|
||||
if (!drm_dp_is_branch(intel_dp->dpcd))
|
||||
return;
|
||||
|
||||
tmp = intel_dp->has_hdmi_sink ?
|
||||
DP_HDMI_DVI_OUTPUT_CONFIG : 0;
|
||||
tmp = intel_dp_has_hdmi_sink(intel_dp) ? DP_HDMI_DVI_OUTPUT_CONFIG : 0;
|
||||
|
||||
if (drm_dp_dpcd_writeb(&intel_dp->aux,
|
||||
DP_PROTOCOL_CONVERTER_CONTROL_0, tmp) != 1)
|
||||
drm_dbg_kms(&i915->drm, "Failed to %s protocol converter HDMI mode\n",
|
||||
str_enable_disable(intel_dp->has_hdmi_sink));
|
||||
str_enable_disable(intel_dp_has_hdmi_sink(intel_dp)));
|
||||
|
||||
if (crtc_state->sink_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
|
||||
switch (crtc_state->output_format) {
|
||||
@@ -4812,9 +4818,6 @@ intel_dp_set_edid(struct intel_dp *intel_dp)
|
||||
|
||||
/* FIXME: Get rid of drm_edid_raw() */
|
||||
edid = drm_edid_raw(drm_edid);
|
||||
if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) {
|
||||
intel_dp->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
|
||||
}
|
||||
|
||||
drm_dp_cec_set_edid(&intel_dp->aux, edid);
|
||||
}
|
||||
@@ -4828,8 +4831,6 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
|
||||
drm_edid_free(connector->detect_edid);
|
||||
connector->detect_edid = NULL;
|
||||
|
||||
intel_dp->has_hdmi_sink = false;
|
||||
|
||||
intel_dp->dfp.max_bpc = 0;
|
||||
intel_dp->dfp.max_dotclock = 0;
|
||||
intel_dp->dfp.min_tmds_clock = 0;
|
||||
|
||||
@@ -65,6 +65,7 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
|
||||
struct link_config_limits *limits,
|
||||
int timeslots,
|
||||
bool recompute_pipe_bpp);
|
||||
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_uhbr(const struct intel_crtc_state *crtc_state);
|
||||
bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
|
||||
|
||||
Reference in New Issue
Block a user