Skip to content

Commit dd75f6d

Browse files
committed
drm/i915/lspcon: Add dp_to_lspcon helper()
We need to get to LSPCON in the next patch, so factor out the helper for it. While at it also remove the redundant GEN9 check. Cc: Shashank Sharma <[email protected]> Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Shashank Sharma <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent f2b667b commit dd75f6d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4753,14 +4753,13 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp)
47534753
void intel_dp_encoder_reset(struct drm_encoder *encoder)
47544754
{
47554755
struct drm_i915_private *dev_priv = to_i915(encoder->dev);
4756-
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
4757-
struct intel_lspcon *lspcon = &intel_dig_port->lspcon;
4758-
struct intel_dp *intel_dp = &intel_dig_port->dp;
4756+
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
4757+
struct intel_lspcon *lspcon = dp_to_lspcon(intel_dp);
47594758

47604759
if (!HAS_DDI(dev_priv))
47614760
intel_dp->DP = I915_READ(intel_dp->output_reg);
47624761

4763-
if (IS_GEN9(dev_priv) && lspcon->active)
4762+
if (lspcon->active)
47644763
lspcon_resume(lspcon);
47654764

47664765
if (to_intel_encoder(encoder)->type != INTEL_OUTPUT_EDP)

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,12 @@ dp_to_dig_port(struct intel_dp *intel_dp)
10891089
return container_of(intel_dp, struct intel_digital_port, dp);
10901090
}
10911091

1092+
static inline struct intel_lspcon *
1093+
dp_to_lspcon(struct intel_dp *intel_dp)
1094+
{
1095+
return &dp_to_dig_port(intel_dp)->lspcon;
1096+
}
1097+
10921098
static inline struct intel_digital_port *
10931099
hdmi_to_dig_port(struct intel_hdmi *intel_hdmi)
10941100
{

0 commit comments

Comments
 (0)