Commit d0fc54a2 authored by Jani Nikula's avatar Jani Nikula

drm/i915/lspcon: convert to struct intel_display

Going forward, struct intel_display shall replace struct
drm_i915_private as the main display device data pointer type. Convert
intel_lspcon.[ch] to struct intel_display.
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240813164123.2674462-5-jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent c6cbfc18
...@@ -79,33 +79,33 @@ static const char *lspcon_mode_name(enum drm_lspcon_mode mode) ...@@ -79,33 +79,33 @@ static const char *lspcon_mode_name(enum drm_lspcon_mode mode)
static bool lspcon_detect_vendor(struct intel_lspcon *lspcon) static bool lspcon_detect_vendor(struct intel_lspcon *lspcon)
{ {
struct intel_dp *dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(dp); struct intel_display *display = to_intel_display(intel_dp);
struct drm_dp_dpcd_ident *ident; struct drm_dp_dpcd_ident *ident;
u32 vendor_oui; u32 vendor_oui;
if (drm_dp_read_desc(&dp->aux, &dp->desc, drm_dp_is_branch(dp->dpcd))) { if (drm_dp_read_desc(&intel_dp->aux, &intel_dp->desc, drm_dp_is_branch(intel_dp->dpcd))) {
drm_err(&i915->drm, "Can't read description\n"); drm_err(display->drm, "Can't read description\n");
return false; return false;
} }
ident = &dp->desc.ident; ident = &intel_dp->desc.ident;
vendor_oui = (ident->oui[0] << 16) | (ident->oui[1] << 8) | vendor_oui = (ident->oui[0] << 16) | (ident->oui[1] << 8) |
ident->oui[2]; ident->oui[2];
switch (vendor_oui) { switch (vendor_oui) {
case LSPCON_VENDOR_MCA_OUI: case LSPCON_VENDOR_MCA_OUI:
lspcon->vendor = LSPCON_VENDOR_MCA; lspcon->vendor = LSPCON_VENDOR_MCA;
drm_dbg_kms(&i915->drm, "Vendor: Mega Chips\n"); drm_dbg_kms(display->drm, "Vendor: Mega Chips\n");
break; break;
case LSPCON_VENDOR_PARADE_OUI: case LSPCON_VENDOR_PARADE_OUI:
lspcon->vendor = LSPCON_VENDOR_PARADE; lspcon->vendor = LSPCON_VENDOR_PARADE;
drm_dbg_kms(&i915->drm, "Vendor: Parade Tech\n"); drm_dbg_kms(display->drm, "Vendor: Parade Tech\n");
break; break;
default: default:
drm_err(&i915->drm, "Invalid/Unknown vendor OUI\n"); drm_err(display->drm, "Invalid/Unknown vendor OUI\n");
return false; return false;
} }
...@@ -123,7 +123,7 @@ static u32 get_hdr_status_reg(struct intel_lspcon *lspcon) ...@@ -123,7 +123,7 @@ static u32 get_hdr_status_reg(struct intel_lspcon *lspcon)
void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon) void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon)
{ {
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_display *display = to_intel_display(intel_dp);
u8 hdr_caps; u8 hdr_caps;
int ret; int ret;
...@@ -131,10 +131,10 @@ void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon) ...@@ -131,10 +131,10 @@ void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon)
&hdr_caps, 1); &hdr_caps, 1);
if (ret < 0) { if (ret < 0) {
drm_dbg_kms(&i915->drm, "HDR capability detection failed\n"); drm_dbg_kms(display->drm, "HDR capability detection failed\n");
lspcon->hdr_supported = false; lspcon->hdr_supported = false;
} else if (hdr_caps & 0x1) { } else if (hdr_caps & 0x1) {
drm_dbg_kms(&i915->drm, "LSPCON capable of HDR\n"); drm_dbg_kms(display->drm, "LSPCON capable of HDR\n");
lspcon->hdr_supported = true; lspcon->hdr_supported = true;
} }
} }
...@@ -142,12 +142,12 @@ void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon) ...@@ -142,12 +142,12 @@ void lspcon_detect_hdr_capability(struct intel_lspcon *lspcon)
static enum drm_lspcon_mode lspcon_get_current_mode(struct intel_lspcon *lspcon) static enum drm_lspcon_mode lspcon_get_current_mode(struct intel_lspcon *lspcon)
{ {
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_display *display = to_intel_display(intel_dp);
enum drm_lspcon_mode current_mode; enum drm_lspcon_mode current_mode;
struct i2c_adapter *ddc = &intel_dp->aux.ddc; struct i2c_adapter *ddc = &intel_dp->aux.ddc;
if (drm_lspcon_get_mode(intel_dp->aux.drm_dev, ddc, &current_mode)) { if (drm_lspcon_get_mode(intel_dp->aux.drm_dev, ddc, &current_mode)) {
drm_dbg_kms(&i915->drm, "Error reading LSPCON mode\n"); drm_dbg_kms(display->drm, "Error reading LSPCON mode\n");
return DRM_LSPCON_MODE_INVALID; return DRM_LSPCON_MODE_INVALID;
} }
return current_mode; return current_mode;
...@@ -169,23 +169,23 @@ static enum drm_lspcon_mode lspcon_wait_mode(struct intel_lspcon *lspcon, ...@@ -169,23 +169,23 @@ static enum drm_lspcon_mode lspcon_wait_mode(struct intel_lspcon *lspcon,
enum drm_lspcon_mode mode) enum drm_lspcon_mode mode)
{ {
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_display *display = to_intel_display(intel_dp);
enum drm_lspcon_mode current_mode; enum drm_lspcon_mode current_mode;
current_mode = lspcon_get_current_mode(lspcon); current_mode = lspcon_get_current_mode(lspcon);
if (current_mode == mode) if (current_mode == mode)
goto out; goto out;
drm_dbg_kms(&i915->drm, "Waiting for LSPCON mode %s to settle\n", drm_dbg_kms(display->drm, "Waiting for LSPCON mode %s to settle\n",
lspcon_mode_name(mode)); lspcon_mode_name(mode));
wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode, wait_for((current_mode = lspcon_get_current_mode(lspcon)) == mode,
lspcon_get_mode_settle_timeout(lspcon)); lspcon_get_mode_settle_timeout(lspcon));
if (current_mode != mode) if (current_mode != mode)
drm_err(&i915->drm, "LSPCON mode hasn't settled\n"); drm_err(display->drm, "LSPCON mode hasn't settled\n");
out: out:
drm_dbg_kms(&i915->drm, "Current LSPCON mode %s\n", drm_dbg_kms(display->drm, "Current LSPCON mode %s\n",
lspcon_mode_name(current_mode)); lspcon_mode_name(current_mode));
return current_mode; return current_mode;
...@@ -195,46 +195,46 @@ static int lspcon_change_mode(struct intel_lspcon *lspcon, ...@@ -195,46 +195,46 @@ static int lspcon_change_mode(struct intel_lspcon *lspcon,
enum drm_lspcon_mode mode) enum drm_lspcon_mode mode)
{ {
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_display *display = to_intel_display(intel_dp);
int err; int err;
enum drm_lspcon_mode current_mode; enum drm_lspcon_mode current_mode;
struct i2c_adapter *ddc = &intel_dp->aux.ddc; struct i2c_adapter *ddc = &intel_dp->aux.ddc;
err = drm_lspcon_get_mode(intel_dp->aux.drm_dev, ddc, &current_mode); err = drm_lspcon_get_mode(intel_dp->aux.drm_dev, ddc, &current_mode);
if (err) { if (err) {
drm_err(&i915->drm, "Error reading LSPCON mode\n"); drm_err(display->drm, "Error reading LSPCON mode\n");
return err; return err;
} }
if (current_mode == mode) { if (current_mode == mode) {
drm_dbg_kms(&i915->drm, "Current mode = desired LSPCON mode\n"); drm_dbg_kms(display->drm, "Current mode = desired LSPCON mode\n");
return 0; return 0;
} }
err = drm_lspcon_set_mode(intel_dp->aux.drm_dev, ddc, mode); err = drm_lspcon_set_mode(intel_dp->aux.drm_dev, ddc, mode);
if (err < 0) { if (err < 0) {
drm_err(&i915->drm, "LSPCON mode change failed\n"); drm_err(display->drm, "LSPCON mode change failed\n");
return err; return err;
} }
lspcon->mode = mode; lspcon->mode = mode;
drm_dbg_kms(&i915->drm, "LSPCON mode changed done\n"); drm_dbg_kms(display->drm, "LSPCON mode changed done\n");
return 0; return 0;
} }
static bool lspcon_wake_native_aux_ch(struct intel_lspcon *lspcon) static bool lspcon_wake_native_aux_ch(struct intel_lspcon *lspcon)
{ {
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_display *display = to_intel_display(intel_dp);
u8 rev; u8 rev;
if (drm_dp_dpcd_readb(&lspcon_to_intel_dp(lspcon)->aux, DP_DPCD_REV, if (drm_dp_dpcd_readb(&lspcon_to_intel_dp(lspcon)->aux, DP_DPCD_REV,
&rev) != 1) { &rev) != 1) {
drm_dbg_kms(&i915->drm, "Native AUX CH down\n"); drm_dbg_kms(display->drm, "Native AUX CH down\n");
return false; return false;
} }
drm_dbg_kms(&i915->drm, "Native AUX CH up, DPCD version: %d.%d\n", drm_dbg_kms(display->drm, "Native AUX CH up, DPCD version: %d.%d\n",
rev >> 4, rev & 0xf); rev >> 4, rev & 0xf);
return true; return true;
...@@ -242,12 +242,12 @@ static bool lspcon_wake_native_aux_ch(struct intel_lspcon *lspcon) ...@@ -242,12 +242,12 @@ static bool lspcon_wake_native_aux_ch(struct intel_lspcon *lspcon)
static bool lspcon_probe(struct intel_lspcon *lspcon) static bool lspcon_probe(struct intel_lspcon *lspcon)
{ {
int retry;
enum drm_dp_dual_mode_type adaptor_type;
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_display *display = to_intel_display(intel_dp);
struct i2c_adapter *ddc = &intel_dp->aux.ddc; struct i2c_adapter *ddc = &intel_dp->aux.ddc;
enum drm_dp_dual_mode_type adaptor_type;
enum drm_lspcon_mode expected_mode; enum drm_lspcon_mode expected_mode;
int retry;
expected_mode = lspcon_wake_native_aux_ch(lspcon) ? expected_mode = lspcon_wake_native_aux_ch(lspcon) ?
DRM_LSPCON_MODE_PCON : DRM_LSPCON_MODE_LS; DRM_LSPCON_MODE_PCON : DRM_LSPCON_MODE_LS;
...@@ -263,13 +263,13 @@ static bool lspcon_probe(struct intel_lspcon *lspcon) ...@@ -263,13 +263,13 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
} }
if (adaptor_type != DRM_DP_DUAL_MODE_LSPCON) { if (adaptor_type != DRM_DP_DUAL_MODE_LSPCON) {
drm_dbg_kms(&i915->drm, "No LSPCON detected, found %s\n", drm_dbg_kms(display->drm, "No LSPCON detected, found %s\n",
drm_dp_get_dual_mode_type_name(adaptor_type)); drm_dp_get_dual_mode_type_name(adaptor_type));
return false; return false;
} }
/* Yay ... got a LSPCON device */ /* Yay ... got a LSPCON device */
drm_dbg_kms(&i915->drm, "LSPCON detected\n"); drm_dbg_kms(display->drm, "LSPCON detected\n");
lspcon->mode = lspcon_wait_mode(lspcon, expected_mode); lspcon->mode = lspcon_wait_mode(lspcon, expected_mode);
/* /*
...@@ -279,7 +279,7 @@ static bool lspcon_probe(struct intel_lspcon *lspcon) ...@@ -279,7 +279,7 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
*/ */
if (lspcon->mode != DRM_LSPCON_MODE_PCON) { if (lspcon->mode != DRM_LSPCON_MODE_PCON) {
if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON) < 0) { if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON) < 0) {
drm_err(&i915->drm, "LSPCON mode change to PCON failed\n"); drm_err(display->drm, "LSPCON mode change to PCON failed\n");
return false; return false;
} }
} }
...@@ -289,13 +289,13 @@ static bool lspcon_probe(struct intel_lspcon *lspcon) ...@@ -289,13 +289,13 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon) static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon)
{ {
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct drm_i915_private *i915 = dp_to_i915(intel_dp); struct intel_display *display = to_intel_display(intel_dp);
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
unsigned long start = jiffies; unsigned long start = jiffies;
while (1) { while (1) {
if (intel_digital_port_connected(&dig_port->base)) { if (intel_digital_port_connected(&dig_port->base)) {
drm_dbg_kms(&i915->drm, "LSPCON recovering in PCON mode after %u ms\n", drm_dbg_kms(display->drm, "LSPCON recovering in PCON mode after %u ms\n",
jiffies_to_msecs(jiffies - start)); jiffies_to_msecs(jiffies - start));
return; return;
} }
...@@ -306,7 +306,7 @@ static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon) ...@@ -306,7 +306,7 @@ static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon)
usleep_range(10000, 15000); usleep_range(10000, 15000);
} }
drm_dbg_kms(&i915->drm, "LSPCON DP descriptor mismatch after resume\n"); drm_dbg_kms(display->drm, "LSPCON DP descriptor mismatch after resume\n");
} }
static bool lspcon_parade_fw_ready(struct drm_dp_aux *aux) static bool lspcon_parade_fw_ready(struct drm_dp_aux *aux)
...@@ -477,10 +477,10 @@ void lspcon_write_infoframe(struct intel_encoder *encoder, ...@@ -477,10 +477,10 @@ void lspcon_write_infoframe(struct intel_encoder *encoder,
unsigned int type, unsigned int type,
const void *frame, ssize_t len) const void *frame, ssize_t len)
{ {
bool ret = true; struct intel_display *display = to_intel_display(encoder);
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
struct intel_lspcon *lspcon = enc_to_intel_lspcon(encoder); struct intel_lspcon *lspcon = enc_to_intel_lspcon(encoder);
bool ret = true;
switch (type) { switch (type) {
case HDMI_INFOFRAME_TYPE_AVI: case HDMI_INFOFRAME_TYPE_AVI:
...@@ -492,7 +492,7 @@ void lspcon_write_infoframe(struct intel_encoder *encoder, ...@@ -492,7 +492,7 @@ void lspcon_write_infoframe(struct intel_encoder *encoder,
frame, len); frame, len);
break; break;
case HDMI_PACKET_TYPE_GAMUT_METADATA: case HDMI_PACKET_TYPE_GAMUT_METADATA:
drm_dbg_kms(&i915->drm, "Update HDR metadata for lspcon\n"); drm_dbg_kms(display->drm, "Update HDR metadata for lspcon\n");
/* It uses the legacy hsw implementation for the same */ /* It uses the legacy hsw implementation for the same */
hsw_write_infoframe(encoder, crtc_state, type, frame, len); hsw_write_infoframe(encoder, crtc_state, type, frame, len);
break; break;
...@@ -501,7 +501,7 @@ void lspcon_write_infoframe(struct intel_encoder *encoder, ...@@ -501,7 +501,7 @@ void lspcon_write_infoframe(struct intel_encoder *encoder,
} }
if (!ret) { if (!ret) {
drm_err(&i915->drm, "Failed to write infoframes\n"); drm_err(display->drm, "Failed to write infoframes\n");
return; return;
} }
} }
...@@ -522,17 +522,17 @@ void lspcon_set_infoframes(struct intel_encoder *encoder, ...@@ -522,17 +522,17 @@ void lspcon_set_infoframes(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state) const struct drm_connector_state *conn_state)
{ {
ssize_t ret; struct intel_display *display = to_intel_display(encoder);
union hdmi_infoframe frame;
u8 buf[VIDEO_DIP_DATA_SIZE];
struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
struct intel_lspcon *lspcon = &dig_port->lspcon; struct intel_lspcon *lspcon = &dig_port->lspcon;
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
&crtc_state->hw.adjusted_mode; &crtc_state->hw.adjusted_mode;
union hdmi_infoframe frame;
u8 buf[VIDEO_DIP_DATA_SIZE];
ssize_t ret;
if (!lspcon->active) { if (!lspcon->active) {
drm_err(&i915->drm, "Writing infoframes while LSPCON disabled ?\n"); drm_err(display->drm, "Writing infoframes while LSPCON disabled ?\n");
return; return;
} }
...@@ -542,7 +542,7 @@ void lspcon_set_infoframes(struct intel_encoder *encoder, ...@@ -542,7 +542,7 @@ void lspcon_set_infoframes(struct intel_encoder *encoder,
conn_state->connector, conn_state->connector,
adjusted_mode); adjusted_mode);
if (ret < 0) { if (ret < 0) {
drm_err(&i915->drm, "couldn't fill AVI infoframe\n"); drm_err(display->drm, "couldn't fill AVI infoframe\n");
return; return;
} }
...@@ -583,7 +583,7 @@ void lspcon_set_infoframes(struct intel_encoder *encoder, ...@@ -583,7 +583,7 @@ void lspcon_set_infoframes(struct intel_encoder *encoder,
ret = hdmi_infoframe_pack(&frame, buf, sizeof(buf)); ret = hdmi_infoframe_pack(&frame, buf, sizeof(buf));
if (ret < 0) { if (ret < 0) {
drm_err(&i915->drm, "Failed to pack AVI IF\n"); drm_err(display->drm, "Failed to pack AVI IF\n");
return; return;
} }
...@@ -624,9 +624,9 @@ static bool _lspcon_read_avi_infoframe_enabled_parade(struct drm_dp_aux *aux) ...@@ -624,9 +624,9 @@ static bool _lspcon_read_avi_infoframe_enabled_parade(struct drm_dp_aux *aux)
u32 lspcon_infoframes_enabled(struct intel_encoder *encoder, u32 lspcon_infoframes_enabled(struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config) const struct intel_crtc_state *pipe_config)
{ {
struct intel_display *display = to_intel_display(encoder);
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
struct intel_lspcon *lspcon = enc_to_intel_lspcon(encoder); struct intel_lspcon *lspcon = enc_to_intel_lspcon(encoder);
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
bool infoframes_enabled; bool infoframes_enabled;
u32 val = 0; u32 val = 0;
u32 mask, tmp; u32 mask, tmp;
...@@ -640,8 +640,8 @@ u32 lspcon_infoframes_enabled(struct intel_encoder *encoder, ...@@ -640,8 +640,8 @@ u32 lspcon_infoframes_enabled(struct intel_encoder *encoder,
val |= intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_AVI); val |= intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_AVI);
if (lspcon->hdr_supported) { if (lspcon->hdr_supported) {
tmp = intel_de_read(dev_priv, tmp = intel_de_read(display,
HSW_TVIDEO_DIP_CTL(dev_priv, pipe_config->cpu_transcoder)); HSW_TVIDEO_DIP_CTL(display, pipe_config->cpu_transcoder));
mask = VIDEO_DIP_ENABLE_GMP_HSW; mask = VIDEO_DIP_ENABLE_GMP_HSW;
if (tmp & mask) if (tmp & mask)
...@@ -658,32 +658,32 @@ void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon) ...@@ -658,32 +658,32 @@ void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon)
bool lspcon_init(struct intel_digital_port *dig_port) bool lspcon_init(struct intel_digital_port *dig_port)
{ {
struct intel_display *display = to_intel_display(dig_port);
struct intel_dp *intel_dp = &dig_port->dp; struct intel_dp *intel_dp = &dig_port->dp;
struct intel_lspcon *lspcon = &dig_port->lspcon; struct intel_lspcon *lspcon = &dig_port->lspcon;
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
struct drm_connector *connector = &intel_dp->attached_connector->base; struct drm_connector *connector = &intel_dp->attached_connector->base;
lspcon->active = false; lspcon->active = false;
lspcon->mode = DRM_LSPCON_MODE_INVALID; lspcon->mode = DRM_LSPCON_MODE_INVALID;
if (!lspcon_probe(lspcon)) { if (!lspcon_probe(lspcon)) {
drm_err(&i915->drm, "Failed to probe lspcon\n"); drm_err(display->drm, "Failed to probe lspcon\n");
return false; return false;
} }
if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd) != 0) { if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd) != 0) {
drm_err(&i915->drm, "LSPCON DPCD read failed\n"); drm_err(display->drm, "LSPCON DPCD read failed\n");
return false; return false;
} }
if (!lspcon_detect_vendor(lspcon)) { if (!lspcon_detect_vendor(lspcon)) {
drm_err(&i915->drm, "LSPCON vendor detection failed\n"); drm_err(display->drm, "LSPCON vendor detection failed\n");
return false; return false;
} }
connector->ycbcr_420_allowed = true; connector->ycbcr_420_allowed = true;
lspcon->active = true; lspcon->active = true;
drm_dbg_kms(&i915->drm, "Success: LSPCON init\n"); drm_dbg_kms(display->drm, "Success: LSPCON init\n");
return true; return true;
} }
...@@ -697,9 +697,8 @@ u32 intel_lspcon_infoframes_enabled(struct intel_encoder *encoder, ...@@ -697,9 +697,8 @@ u32 intel_lspcon_infoframes_enabled(struct intel_encoder *encoder,
void lspcon_resume(struct intel_digital_port *dig_port) void lspcon_resume(struct intel_digital_port *dig_port)
{ {
struct intel_display *display = to_intel_display(dig_port);
struct intel_lspcon *lspcon = &dig_port->lspcon; struct intel_lspcon *lspcon = &dig_port->lspcon;
struct drm_device *dev = dig_port->base.base.dev;
struct drm_i915_private *i915 = to_i915(dev);
enum drm_lspcon_mode expected_mode; enum drm_lspcon_mode expected_mode;
if (!intel_bios_encoder_is_lspcon(dig_port->base.devdata)) if (!intel_bios_encoder_is_lspcon(dig_port->base.devdata))
...@@ -707,7 +706,7 @@ void lspcon_resume(struct intel_digital_port *dig_port) ...@@ -707,7 +706,7 @@ void lspcon_resume(struct intel_digital_port *dig_port)
if (!lspcon->active) { if (!lspcon->active) {
if (!lspcon_init(dig_port)) { if (!lspcon_init(dig_port)) {
drm_err(&i915->drm, "LSPCON init failed on port %c\n", drm_err(display->drm, "LSPCON init failed on port %c\n",
port_name(dig_port->base.port)); port_name(dig_port->base.port));
return; return;
} }
...@@ -724,7 +723,7 @@ void lspcon_resume(struct intel_digital_port *dig_port) ...@@ -724,7 +723,7 @@ void lspcon_resume(struct intel_digital_port *dig_port)
return; return;
if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON)) if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON))
drm_err(&i915->drm, "LSPCON resume failed\n"); drm_err(display->drm, "LSPCON resume failed\n");
else else
drm_dbg_kms(&i915->drm, "LSPCON resume success\n"); drm_dbg_kms(display->drm, "LSPCON resume success\n");
} }
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