Skip to content

Commit 7ffa2f2

Browse files
committed
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
1 parent 28da4f8 commit 7ffa2f2

4 files changed

Lines changed: 15 additions & 14 deletions

File tree

drivers/gpu/drm/i915/display/intel_ddi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2801,7 +2801,7 @@ static void intel_ddi_pre_enable(struct intel_atomic_state *state,
28012801

28022802
/* FIXME precompute everything properly */
28032803
/* FIXME how do we turn infoframes off again? */
2804-
if (dig_port->lspcon.active && dig_port->dp.has_hdmi_sink)
2804+
if (dig_port->lspcon.active && intel_dp_has_hdmi_sink(&dig_port->dp))
28052805
dig_port->set_infoframes(encoder,
28062806
crtc_state->has_infoframe,
28072807
crtc_state, conn_state);
@@ -3110,7 +3110,7 @@ static void intel_enable_ddi_dp(struct intel_atomic_state *state,
31103110
drm_connector_update_privacy_screen(conn_state);
31113111
intel_edp_backlight_on(crtc_state, conn_state);
31123112

3113-
if (!dig_port->lspcon.active || dig_port->dp.has_hdmi_sink)
3113+
if (!dig_port->lspcon.active || intel_dp_has_hdmi_sink(&dig_port->dp))
31143114
intel_dp_set_infoframes(encoder, true, crtc_state, conn_state);
31153115

31163116
intel_audio_codec_enable(encoder, crtc_state, conn_state);
@@ -3738,7 +3738,7 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
37383738
pipe_config->fec_enable);
37393739
}
37403740

3741-
if (dig_port->lspcon.active && dig_port->dp.has_hdmi_sink)
3741+
if (dig_port->lspcon.active && intel_dp_has_hdmi_sink(&dig_port->dp))
37423742
pipe_config->infoframes.enable |=
37433743
intel_lspcon_infoframes_enabled(encoder, pipe_config);
37443744
else

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,6 @@ struct intel_dp {
17071707
u8 lane_count;
17081708
u8 sink_count;
17091709
bool link_trained;
1710-
bool has_hdmi_sink;
17111710
bool reset_link_params;
17121711
bool use_max_params;
17131712
u8 dpcd[DP_RECEIVER_CAP_SIZE];

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,13 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
12871287
}
12881288
}
12891289

1290+
bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp)
1291+
{
1292+
struct intel_connector *connector = intel_dp->attached_connector;
1293+
1294+
return connector->base.display_info.is_hdmi;
1295+
}
1296+
12901297
static bool intel_dp_source_supports_fec(struct intel_dp *intel_dp,
12911298
const struct intel_crtc_state *pipe_config)
12921299
{
@@ -1342,7 +1349,7 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,
13421349

13431350
for (; bpc >= 8; bpc -= 2) {
13441351
if (intel_hdmi_bpc_possible(crtc_state, bpc,
1345-
intel_dp->has_hdmi_sink) &&
1352+
intel_dp_has_hdmi_sink(intel_dp)) &&
13461353
intel_dp_tmds_clock_valid(intel_dp, clock, bpc, crtc_state->sink_format,
13471354
respect_downstream_limits) == MODE_OK)
13481355
return bpc;
@@ -2732,7 +2739,7 @@ static int intel_dp_pcon_start_frl_training(struct intel_dp *intel_dp)
27322739
static bool intel_dp_is_hdmi_2_1_sink(struct intel_dp *intel_dp)
27332740
{
27342741
if (drm_dp_is_branch(intel_dp->dpcd) &&
2735-
intel_dp->has_hdmi_sink &&
2742+
intel_dp_has_hdmi_sink(intel_dp) &&
27362743
intel_dp_hdmi_sink_max_frl(intel_dp) > 0)
27372744
return true;
27382745

@@ -2900,13 +2907,12 @@ void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp,
29002907
if (!drm_dp_is_branch(intel_dp->dpcd))
29012908
return;
29022909

2903-
tmp = intel_dp->has_hdmi_sink ?
2904-
DP_HDMI_DVI_OUTPUT_CONFIG : 0;
2910+
tmp = intel_dp_has_hdmi_sink(intel_dp) ? DP_HDMI_DVI_OUTPUT_CONFIG : 0;
29052911

29062912
if (drm_dp_dpcd_writeb(&intel_dp->aux,
29072913
DP_PROTOCOL_CONVERTER_CONTROL_0, tmp) != 1)
29082914
drm_dbg_kms(&i915->drm, "Failed to %s protocol converter HDMI mode\n",
2909-
str_enable_disable(intel_dp->has_hdmi_sink));
2915+
str_enable_disable(intel_dp_has_hdmi_sink(intel_dp)));
29102916

29112917
if (crtc_state->sink_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
29122918
switch (crtc_state->output_format) {
@@ -4812,9 +4818,6 @@ intel_dp_set_edid(struct intel_dp *intel_dp)
48124818

48134819
/* FIXME: Get rid of drm_edid_raw() */
48144820
edid = drm_edid_raw(drm_edid);
4815-
if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) {
4816-
intel_dp->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
4817-
}
48184821

48194822
drm_dp_cec_set_edid(&intel_dp->aux, edid);
48204823
}
@@ -4828,8 +4831,6 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
48284831
drm_edid_free(connector->detect_edid);
48294832
connector->detect_edid = NULL;
48304833

4831-
intel_dp->has_hdmi_sink = false;
4832-
48334834
intel_dp->dfp.max_bpc = 0;
48344835
intel_dp->dfp.max_dotclock = 0;
48354836
intel_dp->dfp.min_tmds_clock = 0;

drivers/gpu/drm/i915/display/intel_dp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
6565
struct link_config_limits *limits,
6666
int timeslots,
6767
bool recompute_pipe_bpp);
68+
bool intel_dp_has_hdmi_sink(struct intel_dp *intel_dp);
6869
bool intel_dp_is_edp(struct intel_dp *intel_dp);
6970
bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);
7071
bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);

0 commit comments

Comments
 (0)