mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
drm/i915/display: prefer dig_port to reference intel_digital_port
We have a mix of dport, intel_dport, intel_dig_port and dig_port to reference a intel_digital_port struct. Numbers are around 5 intel_dport 36 dport 479 intel_dig_port 352 dig_port Since we already removed the intel_ prefix from most of our other structs, do the same here and prefer dig_port. v2: rename everything in i915, not just a few display sources and reword commit message (from Matt Roper) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200701045054.23357-1-lucas.demarchi@intel.com
This commit is contained in:
parent
d524b87f77
commit
7801f3b792
18 changed files with 533 additions and 536 deletions
|
@ -1394,10 +1394,9 @@ void hsw_fdi_link_train(struct intel_encoder *encoder,
|
||||||
static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder)
|
static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||||
struct intel_digital_port *intel_dig_port =
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
enc_to_dig_port(encoder);
|
|
||||||
|
|
||||||
intel_dp->DP = intel_dig_port->saved_port_bits |
|
intel_dp->DP = dig_port->saved_port_bits |
|
||||||
DDI_BUF_CTL_ENABLE | DDI_BUF_TRANS_SELECT(0);
|
DDI_BUF_CTL_ENABLE | DDI_BUF_TRANS_SELECT(0);
|
||||||
intel_dp->DP |= DDI_PORT_WIDTH(intel_dp->lane_count);
|
intel_dp->DP |= DDI_PORT_WIDTH(intel_dp->lane_count);
|
||||||
}
|
}
|
||||||
|
@ -2070,7 +2069,7 @@ static void _skl_ddi_set_iboost(struct drm_i915_private *dev_priv,
|
||||||
static void skl_ddi_set_iboost(struct intel_encoder *encoder,
|
static void skl_ddi_set_iboost(struct intel_encoder *encoder,
|
||||||
int level, enum intel_output_type type)
|
int level, enum intel_output_type type)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
enum port port = encoder->port;
|
enum port port = encoder->port;
|
||||||
u8 iboost;
|
u8 iboost;
|
||||||
|
@ -2107,7 +2106,7 @@ static void skl_ddi_set_iboost(struct intel_encoder *encoder,
|
||||||
|
|
||||||
_skl_ddi_set_iboost(dev_priv, port, iboost);
|
_skl_ddi_set_iboost(dev_priv, port, iboost);
|
||||||
|
|
||||||
if (port == PORT_A && intel_dig_port->max_lanes == 4)
|
if (port == PORT_A && dig_port->max_lanes == 4)
|
||||||
_skl_ddi_set_iboost(dev_priv, PORT_E, iboost);
|
_skl_ddi_set_iboost(dev_priv, PORT_E, iboost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3000,15 +2999,15 @@ static void intel_ddi_clk_disable(struct intel_encoder *encoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
icl_program_mg_dp_mode(struct intel_digital_port *intel_dig_port,
|
icl_program_mg_dp_mode(struct intel_digital_port *dig_port,
|
||||||
const struct intel_crtc_state *crtc_state)
|
const struct intel_crtc_state *crtc_state)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
||||||
enum tc_port tc_port = intel_port_to_tc(dev_priv, intel_dig_port->base.port);
|
enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port);
|
||||||
u32 ln0, ln1, pin_assignment;
|
u32 ln0, ln1, pin_assignment;
|
||||||
u8 width;
|
u8 width;
|
||||||
|
|
||||||
if (intel_dig_port->tc_mode == TC_PORT_TBT_ALT)
|
if (dig_port->tc_mode == TC_PORT_TBT_ALT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 12) {
|
if (INTEL_GEN(dev_priv) >= 12) {
|
||||||
|
@ -3027,13 +3026,13 @@ icl_program_mg_dp_mode(struct intel_digital_port *intel_dig_port,
|
||||||
ln1 &= ~(MG_DP_MODE_CFG_DP_X1_MODE | MG_DP_MODE_CFG_DP_X2_MODE);
|
ln1 &= ~(MG_DP_MODE_CFG_DP_X1_MODE | MG_DP_MODE_CFG_DP_X2_MODE);
|
||||||
|
|
||||||
/* DPPATC */
|
/* DPPATC */
|
||||||
pin_assignment = intel_tc_port_get_pin_assignment_mask(intel_dig_port);
|
pin_assignment = intel_tc_port_get_pin_assignment_mask(dig_port);
|
||||||
width = crtc_state->lane_count;
|
width = crtc_state->lane_count;
|
||||||
|
|
||||||
switch (pin_assignment) {
|
switch (pin_assignment) {
|
||||||
case 0x0:
|
case 0x0:
|
||||||
drm_WARN_ON(&dev_priv->drm,
|
drm_WARN_ON(&dev_priv->drm,
|
||||||
intel_dig_port->tc_mode != TC_PORT_LEGACY);
|
dig_port->tc_mode != TC_PORT_LEGACY);
|
||||||
if (width == 1) {
|
if (width == 1) {
|
||||||
ln1 |= MG_DP_MODE_CFG_DP_X1_MODE;
|
ln1 |= MG_DP_MODE_CFG_DP_X1_MODE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3978,10 +3977,9 @@ intel_ddi_pre_pll_enable(struct intel_atomic_state *state,
|
||||||
|
|
||||||
static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
|
static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_i915_private *dev_priv =
|
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
||||||
to_i915(intel_dig_port->base.base.dev);
|
enum port port = dig_port->base.port;
|
||||||
enum port port = intel_dig_port->base.port;
|
|
||||||
u32 dp_tp_ctl, ddi_buf_ctl;
|
u32 dp_tp_ctl, ddi_buf_ctl;
|
||||||
bool wait = false;
|
bool wait = false;
|
||||||
|
|
||||||
|
@ -4536,42 +4534,41 @@ static const struct drm_encoder_funcs intel_ddi_funcs = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct intel_connector *
|
static struct intel_connector *
|
||||||
intel_ddi_init_dp_connector(struct intel_digital_port *intel_dig_port)
|
intel_ddi_init_dp_connector(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_connector *connector;
|
struct intel_connector *connector;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
|
|
||||||
connector = intel_connector_alloc();
|
connector = intel_connector_alloc();
|
||||||
if (!connector)
|
if (!connector)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
|
dig_port->dp.output_reg = DDI_BUF_CTL(port);
|
||||||
intel_dig_port->dp.prepare_link_retrain =
|
dig_port->dp.prepare_link_retrain = intel_ddi_prepare_link_retrain;
|
||||||
intel_ddi_prepare_link_retrain;
|
dig_port->dp.set_link_train = intel_ddi_set_link_train;
|
||||||
intel_dig_port->dp.set_link_train = intel_ddi_set_link_train;
|
dig_port->dp.set_idle_link_train = intel_ddi_set_idle_link_train;
|
||||||
intel_dig_port->dp.set_idle_link_train = intel_ddi_set_idle_link_train;
|
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 12)
|
if (INTEL_GEN(dev_priv) >= 12)
|
||||||
intel_dig_port->dp.set_signal_levels = tgl_set_signal_levels;
|
dig_port->dp.set_signal_levels = tgl_set_signal_levels;
|
||||||
else if (INTEL_GEN(dev_priv) >= 11)
|
else if (INTEL_GEN(dev_priv) >= 11)
|
||||||
intel_dig_port->dp.set_signal_levels = icl_set_signal_levels;
|
dig_port->dp.set_signal_levels = icl_set_signal_levels;
|
||||||
else if (IS_CANNONLAKE(dev_priv))
|
else if (IS_CANNONLAKE(dev_priv))
|
||||||
intel_dig_port->dp.set_signal_levels = cnl_set_signal_levels;
|
dig_port->dp.set_signal_levels = cnl_set_signal_levels;
|
||||||
else if (IS_GEN9_LP(dev_priv))
|
else if (IS_GEN9_LP(dev_priv))
|
||||||
intel_dig_port->dp.set_signal_levels = bxt_set_signal_levels;
|
dig_port->dp.set_signal_levels = bxt_set_signal_levels;
|
||||||
else
|
else
|
||||||
intel_dig_port->dp.set_signal_levels = hsw_set_signal_levels;
|
dig_port->dp.set_signal_levels = hsw_set_signal_levels;
|
||||||
|
|
||||||
intel_dig_port->dp.voltage_max = intel_ddi_dp_voltage_max;
|
dig_port->dp.voltage_max = intel_ddi_dp_voltage_max;
|
||||||
intel_dig_port->dp.preemph_max = intel_ddi_dp_preemph_max;
|
dig_port->dp.preemph_max = intel_ddi_dp_preemph_max;
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) < 12) {
|
if (INTEL_GEN(dev_priv) < 12) {
|
||||||
intel_dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
|
dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
|
||||||
intel_dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);
|
dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!intel_dp_init_connector(intel_dig_port, connector)) {
|
if (!intel_dp_init_connector(dig_port, connector)) {
|
||||||
kfree(connector);
|
kfree(connector);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -4770,29 +4767,29 @@ static bool bdw_digital_port_connected(struct intel_encoder *encoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct intel_connector *
|
static struct intel_connector *
|
||||||
intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
|
intel_ddi_init_hdmi_connector(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct intel_connector *connector;
|
struct intel_connector *connector;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
|
|
||||||
connector = intel_connector_alloc();
|
connector = intel_connector_alloc();
|
||||||
if (!connector)
|
if (!connector)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
intel_dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(port);
|
dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(port);
|
||||||
intel_hdmi_init_connector(intel_dig_port, connector);
|
intel_hdmi_init_connector(dig_port, connector);
|
||||||
|
|
||||||
return connector;
|
return connector;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
|
static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
|
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
||||||
|
|
||||||
if (dport->base.port != PORT_A)
|
if (dig_port->base.port != PORT_A)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (dport->saved_port_bits & DDI_A_4_LANES)
|
if (dig_port->saved_port_bits & DDI_A_4_LANES)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Broxton/Geminilake: Bspec says that DDI_A_4_LANES is the only
|
/* Broxton/Geminilake: Bspec says that DDI_A_4_LANES is the only
|
||||||
|
@ -4814,10 +4811,10 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
intel_ddi_max_lanes(struct intel_digital_port *intel_dport)
|
intel_ddi_max_lanes(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(intel_dport->base.base.dev);
|
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
||||||
enum port port = intel_dport->base.port;
|
enum port port = dig_port->base.port;
|
||||||
int max_lanes = 4;
|
int max_lanes = 4;
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 11)
|
if (INTEL_GEN(dev_priv) >= 11)
|
||||||
|
@ -4836,10 +4833,10 @@ intel_ddi_max_lanes(struct intel_digital_port *intel_dport)
|
||||||
* wasn't lit up at boot. Force this bit set when needed
|
* wasn't lit up at boot. Force this bit set when needed
|
||||||
* so we use the proper lane count for our calculations.
|
* so we use the proper lane count for our calculations.
|
||||||
*/
|
*/
|
||||||
if (intel_ddi_a_force_4_lanes(intel_dport)) {
|
if (intel_ddi_a_force_4_lanes(dig_port)) {
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"Forcing DDI_A_4_LANES for port A\n");
|
"Forcing DDI_A_4_LANES for port A\n");
|
||||||
intel_dport->saved_port_bits |= DDI_A_4_LANES;
|
dig_port->saved_port_bits |= DDI_A_4_LANES;
|
||||||
max_lanes = 4;
|
max_lanes = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4848,7 +4845,7 @@ intel_ddi_max_lanes(struct intel_digital_port *intel_dport)
|
||||||
|
|
||||||
void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
|
void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port;
|
struct intel_digital_port *dig_port;
|
||||||
struct intel_encoder *encoder;
|
struct intel_encoder *encoder;
|
||||||
bool init_hdmi, init_dp, init_lspcon = false;
|
bool init_hdmi, init_dp, init_lspcon = false;
|
||||||
enum phy phy = intel_port_to_phy(dev_priv, port);
|
enum phy phy = intel_port_to_phy(dev_priv, port);
|
||||||
|
@ -4877,11 +4874,11 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_dig_port = kzalloc(sizeof(*intel_dig_port), GFP_KERNEL);
|
dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL);
|
||||||
if (!intel_dig_port)
|
if (!dig_port)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
encoder = &intel_dig_port->base;
|
encoder = &dig_port->base;
|
||||||
|
|
||||||
drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_ddi_funcs,
|
drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_ddi_funcs,
|
||||||
DRM_MODE_ENCODER_TMDS, "DDI %c", port_name(port));
|
DRM_MODE_ENCODER_TMDS, "DDI %c", port_name(port));
|
||||||
|
@ -4908,49 +4905,49 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
|
||||||
encoder->pipe_mask = ~0;
|
encoder->pipe_mask = ~0;
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 11)
|
if (INTEL_GEN(dev_priv) >= 11)
|
||||||
intel_dig_port->saved_port_bits = intel_de_read(dev_priv,
|
dig_port->saved_port_bits =
|
||||||
DDI_BUF_CTL(port)) &
|
intel_de_read(dev_priv, DDI_BUF_CTL(port))
|
||||||
DDI_BUF_PORT_REVERSAL;
|
& DDI_BUF_PORT_REVERSAL;
|
||||||
else
|
else
|
||||||
intel_dig_port->saved_port_bits = intel_de_read(dev_priv,
|
dig_port->saved_port_bits =
|
||||||
DDI_BUF_CTL(port)) &
|
intel_de_read(dev_priv, DDI_BUF_CTL(port))
|
||||||
(DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES);
|
& (DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES);
|
||||||
|
|
||||||
intel_dig_port->dp.output_reg = INVALID_MMIO_REG;
|
dig_port->dp.output_reg = INVALID_MMIO_REG;
|
||||||
intel_dig_port->max_lanes = intel_ddi_max_lanes(intel_dig_port);
|
dig_port->max_lanes = intel_ddi_max_lanes(dig_port);
|
||||||
intel_dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
|
dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
|
||||||
|
|
||||||
if (intel_phy_is_tc(dev_priv, phy)) {
|
if (intel_phy_is_tc(dev_priv, phy)) {
|
||||||
bool is_legacy =
|
bool is_legacy =
|
||||||
!intel_bios_port_supports_typec_usb(dev_priv, port) &&
|
!intel_bios_port_supports_typec_usb(dev_priv, port) &&
|
||||||
!intel_bios_port_supports_tbt(dev_priv, port);
|
!intel_bios_port_supports_tbt(dev_priv, port);
|
||||||
|
|
||||||
intel_tc_port_init(intel_dig_port, is_legacy);
|
intel_tc_port_init(dig_port, is_legacy);
|
||||||
|
|
||||||
encoder->update_prepare = intel_ddi_update_prepare;
|
encoder->update_prepare = intel_ddi_update_prepare;
|
||||||
encoder->update_complete = intel_ddi_update_complete;
|
encoder->update_complete = intel_ddi_update_complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_WARN_ON(&dev_priv->drm, port > PORT_I);
|
drm_WARN_ON(&dev_priv->drm, port > PORT_I);
|
||||||
intel_dig_port->ddi_io_power_domain = POWER_DOMAIN_PORT_DDI_A_IO +
|
dig_port->ddi_io_power_domain = POWER_DOMAIN_PORT_DDI_A_IO +
|
||||||
port - PORT_A;
|
port - PORT_A;
|
||||||
|
|
||||||
if (init_dp) {
|
if (init_dp) {
|
||||||
if (!intel_ddi_init_dp_connector(intel_dig_port))
|
if (!intel_ddi_init_dp_connector(dig_port))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
|
dig_port->hpd_pulse = intel_dp_hpd_pulse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In theory we don't need the encoder->type check, but leave it just in
|
/* In theory we don't need the encoder->type check, but leave it just in
|
||||||
* case we have some really bad VBTs... */
|
* case we have some really bad VBTs... */
|
||||||
if (encoder->type != INTEL_OUTPUT_EDP && init_hdmi) {
|
if (encoder->type != INTEL_OUTPUT_EDP && init_hdmi) {
|
||||||
if (!intel_ddi_init_hdmi_connector(intel_dig_port))
|
if (!intel_ddi_init_hdmi_connector(dig_port))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (init_lspcon) {
|
if (init_lspcon) {
|
||||||
if (lspcon_init(intel_dig_port))
|
if (lspcon_init(dig_port))
|
||||||
/* TODO: handle hdmi info frame part */
|
/* TODO: handle hdmi info frame part */
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"LSPCON init success on port %c\n",
|
"LSPCON init success on port %c\n",
|
||||||
|
@ -4967,26 +4964,26 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 11) {
|
if (INTEL_GEN(dev_priv) >= 11) {
|
||||||
if (intel_phy_is_tc(dev_priv, phy))
|
if (intel_phy_is_tc(dev_priv, phy))
|
||||||
intel_dig_port->connected = intel_tc_port_connected;
|
dig_port->connected = intel_tc_port_connected;
|
||||||
else
|
else
|
||||||
intel_dig_port->connected = lpt_digital_port_connected;
|
dig_port->connected = lpt_digital_port_connected;
|
||||||
} else if (INTEL_GEN(dev_priv) >= 8) {
|
} else if (INTEL_GEN(dev_priv) >= 8) {
|
||||||
if (port == PORT_A || IS_GEN9_LP(dev_priv))
|
if (port == PORT_A || IS_GEN9_LP(dev_priv))
|
||||||
intel_dig_port->connected = bdw_digital_port_connected;
|
dig_port->connected = bdw_digital_port_connected;
|
||||||
else
|
else
|
||||||
intel_dig_port->connected = lpt_digital_port_connected;
|
dig_port->connected = lpt_digital_port_connected;
|
||||||
} else {
|
} else {
|
||||||
if (port == PORT_A)
|
if (port == PORT_A)
|
||||||
intel_dig_port->connected = hsw_digital_port_connected;
|
dig_port->connected = hsw_digital_port_connected;
|
||||||
else
|
else
|
||||||
intel_dig_port->connected = lpt_digital_port_connected;
|
dig_port->connected = lpt_digital_port_connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_infoframe_init(intel_dig_port);
|
intel_infoframe_init(dig_port);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
drm_encoder_cleanup(&encoder->base);
|
drm_encoder_cleanup(&encoder->base);
|
||||||
kfree(intel_dig_port);
|
kfree(dig_port);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1612,13 +1612,13 @@ static void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||||
}
|
}
|
||||||
|
|
||||||
void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
|
void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
|
||||||
struct intel_digital_port *dport,
|
struct intel_digital_port *dig_port,
|
||||||
unsigned int expected_mask)
|
unsigned int expected_mask)
|
||||||
{
|
{
|
||||||
u32 port_mask;
|
u32 port_mask;
|
||||||
i915_reg_t dpll_reg;
|
i915_reg_t dpll_reg;
|
||||||
|
|
||||||
switch (dport->base.port) {
|
switch (dig_port->base.port) {
|
||||||
case PORT_B:
|
case PORT_B:
|
||||||
port_mask = DPLL_PORTB_READY_MASK;
|
port_mask = DPLL_PORTB_READY_MASK;
|
||||||
dpll_reg = DPLL(0);
|
dpll_reg = DPLL(0);
|
||||||
|
@ -1640,7 +1640,7 @@ void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
|
||||||
port_mask, expected_mask, 1000))
|
port_mask, expected_mask, 1000))
|
||||||
drm_WARN(&dev_priv->drm, 1,
|
drm_WARN(&dev_priv->drm, 1,
|
||||||
"timed out waiting for [ENCODER:%d:%s] port ready: got 0x%x, expected 0x%x\n",
|
"timed out waiting for [ENCODER:%d:%s] port ready: got 0x%x, expected 0x%x\n",
|
||||||
dport->base.base.base.id, dport->base.base.name,
|
dig_port->base.base.base.id, dig_port->base.base.name,
|
||||||
intel_de_read(dev_priv, dpll_reg) & port_mask,
|
intel_de_read(dev_priv, dpll_reg) & port_mask,
|
||||||
expected_mask);
|
expected_mask);
|
||||||
}
|
}
|
||||||
|
|
|
@ -542,7 +542,7 @@ void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);
|
||||||
|
|
||||||
int ilk_get_lanes_required(int target_clock, int link_bw, int bpp);
|
int ilk_get_lanes_required(int target_clock, int link_bw, int bpp);
|
||||||
void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
|
void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
|
||||||
struct intel_digital_port *dport,
|
struct intel_digital_port *dig_port,
|
||||||
unsigned int expected_mask);
|
unsigned int expected_mask);
|
||||||
int intel_get_load_detect_pipe(struct drm_connector *connector,
|
int intel_get_load_detect_pipe(struct drm_connector *connector,
|
||||||
struct intel_load_detect_pipe *old,
|
struct intel_load_detect_pipe *old,
|
||||||
|
|
|
@ -1194,7 +1194,7 @@ static int i915_dp_mst_info(struct seq_file *m, void *unused)
|
||||||
struct drm_i915_private *dev_priv = node_to_i915(m->private);
|
struct drm_i915_private *dev_priv = node_to_i915(m->private);
|
||||||
struct drm_device *dev = &dev_priv->drm;
|
struct drm_device *dev = &dev_priv->drm;
|
||||||
struct intel_encoder *intel_encoder;
|
struct intel_encoder *intel_encoder;
|
||||||
struct intel_digital_port *intel_dig_port;
|
struct intel_digital_port *dig_port;
|
||||||
struct drm_connector *connector;
|
struct drm_connector *connector;
|
||||||
struct drm_connector_list_iter conn_iter;
|
struct drm_connector_list_iter conn_iter;
|
||||||
|
|
||||||
|
@ -1207,14 +1207,14 @@ static int i915_dp_mst_info(struct seq_file *m, void *unused)
|
||||||
if (!intel_encoder || intel_encoder->type == INTEL_OUTPUT_DP_MST)
|
if (!intel_encoder || intel_encoder->type == INTEL_OUTPUT_DP_MST)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
intel_dig_port = enc_to_dig_port(intel_encoder);
|
dig_port = enc_to_dig_port(intel_encoder);
|
||||||
if (!intel_dig_port->dp.can_mst)
|
if (!dig_port->dp.can_mst)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
seq_printf(m, "MST Source Port [ENCODER:%d:%s]\n",
|
seq_printf(m, "MST Source Port [ENCODER:%d:%s]\n",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
drm_dp_mst_dump_topology(m, &intel_dig_port->dp.mst_mgr);
|
drm_dp_mst_dump_topology(m, &dig_port->dp.mst_mgr);
|
||||||
}
|
}
|
||||||
drm_connector_list_iter_end(&conn_iter);
|
drm_connector_list_iter_end(&conn_iter);
|
||||||
|
|
||||||
|
|
|
@ -1817,8 +1817,8 @@ void chv_phy_powergate_lanes(struct intel_encoder *encoder,
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct i915_power_domains *power_domains = &dev_priv->power_domains;
|
struct i915_power_domains *power_domains = &dev_priv->power_domains;
|
||||||
enum dpio_phy phy = vlv_dport_to_phy(enc_to_dig_port(encoder));
|
enum dpio_phy phy = vlv_dig_port_to_phy(enc_to_dig_port(encoder));
|
||||||
enum dpio_channel ch = vlv_dport_to_channel(enc_to_dig_port(encoder));
|
enum dpio_channel ch = vlv_dig_port_to_channel(enc_to_dig_port(encoder));
|
||||||
|
|
||||||
mutex_lock(&power_domains->lock);
|
mutex_lock(&power_domains->lock);
|
||||||
|
|
||||||
|
|
|
@ -279,10 +279,10 @@ enum check_link_response {
|
||||||
*/
|
*/
|
||||||
struct intel_hdcp_shim {
|
struct intel_hdcp_shim {
|
||||||
/* Outputs the transmitter's An and Aksv values to the receiver. */
|
/* Outputs the transmitter's An and Aksv values to the receiver. */
|
||||||
int (*write_an_aksv)(struct intel_digital_port *intel_dig_port, u8 *an);
|
int (*write_an_aksv)(struct intel_digital_port *dig_port, u8 *an);
|
||||||
|
|
||||||
/* Reads the receiver's key selection vector */
|
/* Reads the receiver's key selection vector */
|
||||||
int (*read_bksv)(struct intel_digital_port *intel_dig_port, u8 *bksv);
|
int (*read_bksv)(struct intel_digital_port *dig_port, u8 *bksv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reads BINFO from DP receivers and BSTATUS from HDMI receivers. The
|
* Reads BINFO from DP receivers and BSTATUS from HDMI receivers. The
|
||||||
|
@ -290,52 +290,52 @@ struct intel_hdcp_shim {
|
||||||
* different. Call it BSTATUS since that's the name the HDMI spec
|
* different. Call it BSTATUS since that's the name the HDMI spec
|
||||||
* uses and it was there first.
|
* uses and it was there first.
|
||||||
*/
|
*/
|
||||||
int (*read_bstatus)(struct intel_digital_port *intel_dig_port,
|
int (*read_bstatus)(struct intel_digital_port *dig_port,
|
||||||
u8 *bstatus);
|
u8 *bstatus);
|
||||||
|
|
||||||
/* Determines whether a repeater is present downstream */
|
/* Determines whether a repeater is present downstream */
|
||||||
int (*repeater_present)(struct intel_digital_port *intel_dig_port,
|
int (*repeater_present)(struct intel_digital_port *dig_port,
|
||||||
bool *repeater_present);
|
bool *repeater_present);
|
||||||
|
|
||||||
/* Reads the receiver's Ri' value */
|
/* Reads the receiver's Ri' value */
|
||||||
int (*read_ri_prime)(struct intel_digital_port *intel_dig_port, u8 *ri);
|
int (*read_ri_prime)(struct intel_digital_port *dig_port, u8 *ri);
|
||||||
|
|
||||||
/* Determines if the receiver's KSV FIFO is ready for consumption */
|
/* Determines if the receiver's KSV FIFO is ready for consumption */
|
||||||
int (*read_ksv_ready)(struct intel_digital_port *intel_dig_port,
|
int (*read_ksv_ready)(struct intel_digital_port *dig_port,
|
||||||
bool *ksv_ready);
|
bool *ksv_ready);
|
||||||
|
|
||||||
/* Reads the ksv fifo for num_downstream devices */
|
/* Reads the ksv fifo for num_downstream devices */
|
||||||
int (*read_ksv_fifo)(struct intel_digital_port *intel_dig_port,
|
int (*read_ksv_fifo)(struct intel_digital_port *dig_port,
|
||||||
int num_downstream, u8 *ksv_fifo);
|
int num_downstream, u8 *ksv_fifo);
|
||||||
|
|
||||||
/* Reads a 32-bit part of V' from the receiver */
|
/* Reads a 32-bit part of V' from the receiver */
|
||||||
int (*read_v_prime_part)(struct intel_digital_port *intel_dig_port,
|
int (*read_v_prime_part)(struct intel_digital_port *dig_port,
|
||||||
int i, u32 *part);
|
int i, u32 *part);
|
||||||
|
|
||||||
/* Enables HDCP signalling on the port */
|
/* Enables HDCP signalling on the port */
|
||||||
int (*toggle_signalling)(struct intel_digital_port *intel_dig_port,
|
int (*toggle_signalling)(struct intel_digital_port *dig_port,
|
||||||
bool enable);
|
bool enable);
|
||||||
|
|
||||||
/* Ensures the link is still protected */
|
/* Ensures the link is still protected */
|
||||||
bool (*check_link)(struct intel_digital_port *intel_dig_port);
|
bool (*check_link)(struct intel_digital_port *dig_port);
|
||||||
|
|
||||||
/* Detects panel's hdcp capability. This is optional for HDMI. */
|
/* Detects panel's hdcp capability. This is optional for HDMI. */
|
||||||
int (*hdcp_capable)(struct intel_digital_port *intel_dig_port,
|
int (*hdcp_capable)(struct intel_digital_port *dig_port,
|
||||||
bool *hdcp_capable);
|
bool *hdcp_capable);
|
||||||
|
|
||||||
/* HDCP adaptation(DP/HDMI) required on the port */
|
/* HDCP adaptation(DP/HDMI) required on the port */
|
||||||
enum hdcp_wired_protocol protocol;
|
enum hdcp_wired_protocol protocol;
|
||||||
|
|
||||||
/* Detects whether sink is HDCP2.2 capable */
|
/* Detects whether sink is HDCP2.2 capable */
|
||||||
int (*hdcp_2_2_capable)(struct intel_digital_port *intel_dig_port,
|
int (*hdcp_2_2_capable)(struct intel_digital_port *dig_port,
|
||||||
bool *capable);
|
bool *capable);
|
||||||
|
|
||||||
/* Write HDCP2.2 messages */
|
/* Write HDCP2.2 messages */
|
||||||
int (*write_2_2_msg)(struct intel_digital_port *intel_dig_port,
|
int (*write_2_2_msg)(struct intel_digital_port *dig_port,
|
||||||
void *buf, size_t size);
|
void *buf, size_t size);
|
||||||
|
|
||||||
/* Read HDCP2.2 messages */
|
/* Read HDCP2.2 messages */
|
||||||
int (*read_2_2_msg)(struct intel_digital_port *intel_dig_port,
|
int (*read_2_2_msg)(struct intel_digital_port *dig_port,
|
||||||
u8 msg_id, void *buf, size_t size);
|
u8 msg_id, void *buf, size_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -343,11 +343,11 @@ struct intel_hdcp_shim {
|
||||||
* type to Receivers. In DP HDCP2.2 Stream type is one of the input to
|
* type to Receivers. In DP HDCP2.2 Stream type is one of the input to
|
||||||
* the HDCP2.2 Cipher for En/De-Cryption. Not applicable for HDMI.
|
* the HDCP2.2 Cipher for En/De-Cryption. Not applicable for HDMI.
|
||||||
*/
|
*/
|
||||||
int (*config_stream_type)(struct intel_digital_port *intel_dig_port,
|
int (*config_stream_type)(struct intel_digital_port *dig_port,
|
||||||
bool is_repeater, u8 type);
|
bool is_repeater, u8 type);
|
||||||
|
|
||||||
/* HDCP2.2 Link Integrity Check */
|
/* HDCP2.2 Link Integrity Check */
|
||||||
int (*check_2_2_link)(struct intel_digital_port *intel_dig_port);
|
int (*check_2_2_link)(struct intel_digital_port *dig_port);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct intel_hdcp {
|
struct intel_hdcp {
|
||||||
|
@ -1434,9 +1434,9 @@ struct intel_dp_mst_encoder {
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline enum dpio_channel
|
static inline enum dpio_channel
|
||||||
vlv_dport_to_channel(struct intel_digital_port *dport)
|
vlv_dig_port_to_channel(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
switch (dport->base.port) {
|
switch (dig_port->base.port) {
|
||||||
case PORT_B:
|
case PORT_B:
|
||||||
case PORT_D:
|
case PORT_D:
|
||||||
return DPIO_CH0;
|
return DPIO_CH0;
|
||||||
|
@ -1448,9 +1448,9 @@ vlv_dport_to_channel(struct intel_digital_port *dport)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline enum dpio_phy
|
static inline enum dpio_phy
|
||||||
vlv_dport_to_phy(struct intel_digital_port *dport)
|
vlv_dig_port_to_phy(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
switch (dport->base.port) {
|
switch (dig_port->base.port) {
|
||||||
case PORT_B:
|
case PORT_B:
|
||||||
case PORT_C:
|
case PORT_C:
|
||||||
return DPIO_PHY0;
|
return DPIO_PHY0;
|
||||||
|
|
|
@ -142,9 +142,9 @@ static const u8 valid_dsc_slicecount[] = {1, 2, 4};
|
||||||
*/
|
*/
|
||||||
bool intel_dp_is_edp(struct intel_dp *intel_dp)
|
bool intel_dp_is_edp(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
|
|
||||||
return intel_dig_port->base.type == INTEL_OUTPUT_EDP;
|
return dig_port->base.type == INTEL_OUTPUT_EDP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void intel_dp_link_down(struct intel_encoder *encoder,
|
static void intel_dp_link_down(struct intel_encoder *encoder,
|
||||||
|
@ -218,10 +218,10 @@ static int intel_dp_max_common_rate(struct intel_dp *intel_dp)
|
||||||
/* Theoretical max between source and sink */
|
/* Theoretical max between source and sink */
|
||||||
static int intel_dp_max_common_lane_count(struct intel_dp *intel_dp)
|
static int intel_dp_max_common_lane_count(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
int source_max = intel_dig_port->max_lanes;
|
int source_max = dig_port->max_lanes;
|
||||||
int sink_max = drm_dp_max_lane_count(intel_dp->dpcd);
|
int sink_max = drm_dp_max_lane_count(intel_dp->dpcd);
|
||||||
int fia_max = intel_tc_port_fia_max_lane_count(intel_dig_port);
|
int fia_max = intel_tc_port_fia_max_lane_count(dig_port);
|
||||||
|
|
||||||
return min3(source_max, sink_max, fia_max);
|
return min3(source_max, sink_max, fia_max);
|
||||||
}
|
}
|
||||||
|
@ -253,8 +253,8 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes)
|
||||||
static int
|
static int
|
||||||
intel_dp_downstream_max_dotclock(struct intel_dp *intel_dp)
|
intel_dp_downstream_max_dotclock(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct intel_encoder *encoder = &intel_dig_port->base;
|
struct intel_encoder *encoder = &dig_port->base;
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
int max_dotclk = dev_priv->max_dotclk_freq;
|
int max_dotclk = dev_priv->max_dotclk_freq;
|
||||||
int ds_max_dotclk;
|
int ds_max_dotclk;
|
||||||
|
@ -780,7 +780,7 @@ static void
|
||||||
vlv_power_sequencer_kick(struct intel_dp *intel_dp)
|
vlv_power_sequencer_kick(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
enum pipe pipe = intel_dp->pps_pipe;
|
enum pipe pipe = intel_dp->pps_pipe;
|
||||||
bool pll_enabled, release_cl_override = false;
|
bool pll_enabled, release_cl_override = false;
|
||||||
enum dpio_phy phy = DPIO_PHY(pipe);
|
enum dpio_phy phy = DPIO_PHY(pipe);
|
||||||
|
@ -790,14 +790,14 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
|
||||||
if (drm_WARN(&dev_priv->drm,
|
if (drm_WARN(&dev_priv->drm,
|
||||||
intel_de_read(dev_priv, intel_dp->output_reg) & DP_PORT_EN,
|
intel_de_read(dev_priv, intel_dp->output_reg) & DP_PORT_EN,
|
||||||
"skipping pipe %c power sequencer kick due to [ENCODER:%d:%s] being active\n",
|
"skipping pipe %c power sequencer kick due to [ENCODER:%d:%s] being active\n",
|
||||||
pipe_name(pipe), intel_dig_port->base.base.base.id,
|
pipe_name(pipe), dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name))
|
dig_port->base.base.name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"kicking pipe %c power sequencer for [ENCODER:%d:%s]\n",
|
"kicking pipe %c power sequencer for [ENCODER:%d:%s]\n",
|
||||||
pipe_name(pipe), intel_dig_port->base.base.base.id,
|
pipe_name(pipe), dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
|
|
||||||
/* Preserve the BIOS-computed detected bit. This is
|
/* Preserve the BIOS-computed detected bit. This is
|
||||||
* supposed to be read-only.
|
* supposed to be read-only.
|
||||||
|
@ -893,7 +893,7 @@ static enum pipe
|
||||||
vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
|
vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
enum pipe pipe;
|
enum pipe pipe;
|
||||||
|
|
||||||
lockdep_assert_held(&dev_priv->pps_mutex);
|
lockdep_assert_held(&dev_priv->pps_mutex);
|
||||||
|
@ -922,8 +922,8 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"picked pipe %c power sequencer for [ENCODER:%d:%s]\n",
|
"picked pipe %c power sequencer for [ENCODER:%d:%s]\n",
|
||||||
pipe_name(intel_dp->pps_pipe),
|
pipe_name(intel_dp->pps_pipe),
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
|
|
||||||
/* init power sequencer on this pipe and port */
|
/* init power sequencer on this pipe and port */
|
||||||
intel_dp_init_panel_power_sequencer(intel_dp);
|
intel_dp_init_panel_power_sequencer(intel_dp);
|
||||||
|
@ -1011,8 +1011,8 @@ static void
|
||||||
vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
|
vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
|
|
||||||
lockdep_assert_held(&dev_priv->pps_mutex);
|
lockdep_assert_held(&dev_priv->pps_mutex);
|
||||||
|
|
||||||
|
@ -1033,15 +1033,15 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
|
||||||
if (intel_dp->pps_pipe == INVALID_PIPE) {
|
if (intel_dp->pps_pipe == INVALID_PIPE) {
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"no initial power sequencer for [ENCODER:%d:%s]\n",
|
"no initial power sequencer for [ENCODER:%d:%s]\n",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"initial power sequencer for [ENCODER:%d:%s]: pipe %c\n",
|
"initial power sequencer for [ENCODER:%d:%s]: pipe %c\n",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name,
|
dig_port->base.base.name,
|
||||||
pipe_name(intel_dp->pps_pipe));
|
pipe_name(intel_dp->pps_pipe));
|
||||||
|
|
||||||
intel_dp_init_panel_power_sequencer(intel_dp);
|
intel_dp_init_panel_power_sequencer(intel_dp);
|
||||||
|
@ -1306,9 +1306,9 @@ static u32 g4x_get_aux_send_ctl(struct intel_dp *intel_dp,
|
||||||
int send_bytes,
|
int send_bytes,
|
||||||
u32 aux_clock_divider)
|
u32 aux_clock_divider)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_i915_private *dev_priv =
|
struct drm_i915_private *dev_priv =
|
||||||
to_i915(intel_dig_port->base.base.dev);
|
to_i915(dig_port->base.base.dev);
|
||||||
u32 precharge, timeout;
|
u32 precharge, timeout;
|
||||||
|
|
||||||
if (IS_GEN(dev_priv, 6))
|
if (IS_GEN(dev_priv, 6))
|
||||||
|
@ -1336,10 +1336,10 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp,
|
||||||
int send_bytes,
|
int send_bytes,
|
||||||
u32 unused)
|
u32 unused)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_i915_private *i915 =
|
struct drm_i915_private *i915 =
|
||||||
to_i915(intel_dig_port->base.base.dev);
|
to_i915(dig_port->base.base.dev);
|
||||||
enum phy phy = intel_port_to_phy(i915, intel_dig_port->base.port);
|
enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
|
||||||
u32 ret;
|
u32 ret;
|
||||||
|
|
||||||
ret = DP_AUX_CH_CTL_SEND_BUSY |
|
ret = DP_AUX_CH_CTL_SEND_BUSY |
|
||||||
|
@ -1353,7 +1353,7 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp,
|
||||||
DP_AUX_CH_CTL_SYNC_PULSE_SKL(32);
|
DP_AUX_CH_CTL_SYNC_PULSE_SKL(32);
|
||||||
|
|
||||||
if (intel_phy_is_tc(i915, phy) &&
|
if (intel_phy_is_tc(i915, phy) &&
|
||||||
intel_dig_port->tc_mode == TC_PORT_TBT_ALT)
|
dig_port->tc_mode == TC_PORT_TBT_ALT)
|
||||||
ret |= DP_AUX_CH_CTL_TBT_IO;
|
ret |= DP_AUX_CH_CTL_TBT_IO;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1365,11 +1365,11 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
||||||
u8 *recv, int recv_size,
|
u8 *recv, int recv_size,
|
||||||
u32 aux_send_ctl_flags)
|
u32 aux_send_ctl_flags)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_i915_private *i915 =
|
struct drm_i915_private *i915 =
|
||||||
to_i915(intel_dig_port->base.base.dev);
|
to_i915(dig_port->base.base.dev);
|
||||||
struct intel_uncore *uncore = &i915->uncore;
|
struct intel_uncore *uncore = &i915->uncore;
|
||||||
enum phy phy = intel_port_to_phy(i915, intel_dig_port->base.port);
|
enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
|
||||||
bool is_tc_port = intel_phy_is_tc(i915, phy);
|
bool is_tc_port = intel_phy_is_tc(i915, phy);
|
||||||
i915_reg_t ch_ctl, ch_data[5];
|
i915_reg_t ch_ctl, ch_data[5];
|
||||||
u32 aux_clock_divider;
|
u32 aux_clock_divider;
|
||||||
|
@ -1386,9 +1386,9 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
||||||
ch_data[i] = intel_dp->aux_ch_data_reg(intel_dp, i);
|
ch_data[i] = intel_dp->aux_ch_data_reg(intel_dp, i);
|
||||||
|
|
||||||
if (is_tc_port)
|
if (is_tc_port)
|
||||||
intel_tc_port_lock(intel_dig_port);
|
intel_tc_port_lock(dig_port);
|
||||||
|
|
||||||
aux_domain = intel_aux_power_domain(intel_dig_port);
|
aux_domain = intel_aux_power_domain(dig_port);
|
||||||
|
|
||||||
aux_wakeref = intel_display_power_get(i915, aux_domain);
|
aux_wakeref = intel_display_power_get(i915, aux_domain);
|
||||||
pps_wakeref = pps_lock(intel_dp);
|
pps_wakeref = pps_lock(intel_dp);
|
||||||
|
@ -1547,7 +1547,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
||||||
intel_display_power_put_async(i915, aux_domain, aux_wakeref);
|
intel_display_power_put_async(i915, aux_domain, aux_wakeref);
|
||||||
|
|
||||||
if (is_tc_port)
|
if (is_tc_port)
|
||||||
intel_tc_port_unlock(intel_dig_port);
|
intel_tc_port_unlock(dig_port);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2893,7 +2893,7 @@ static u32 ilk_get_pp_control(struct intel_dp *intel_dp)
|
||||||
static bool edp_panel_vdd_on(struct intel_dp *intel_dp)
|
static bool edp_panel_vdd_on(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
u32 pp;
|
u32 pp;
|
||||||
i915_reg_t pp_stat_reg, pp_ctrl_reg;
|
i915_reg_t pp_stat_reg, pp_ctrl_reg;
|
||||||
bool need_to_disable = !intel_dp->want_panel_vdd;
|
bool need_to_disable = !intel_dp->want_panel_vdd;
|
||||||
|
@ -2910,11 +2910,11 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp)
|
||||||
return need_to_disable;
|
return need_to_disable;
|
||||||
|
|
||||||
intel_display_power_get(dev_priv,
|
intel_display_power_get(dev_priv,
|
||||||
intel_aux_power_domain(intel_dig_port));
|
intel_aux_power_domain(dig_port));
|
||||||
|
|
||||||
drm_dbg_kms(&dev_priv->drm, "Turning [ENCODER:%d:%s] VDD on\n",
|
drm_dbg_kms(&dev_priv->drm, "Turning [ENCODER:%d:%s] VDD on\n",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
|
|
||||||
if (!edp_have_panel_power(intel_dp))
|
if (!edp_have_panel_power(intel_dp))
|
||||||
wait_panel_power_cycle(intel_dp);
|
wait_panel_power_cycle(intel_dp);
|
||||||
|
@ -2936,8 +2936,8 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp)
|
||||||
if (!edp_have_panel_power(intel_dp)) {
|
if (!edp_have_panel_power(intel_dp)) {
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"[ENCODER:%d:%s] panel power wasn't enabled\n",
|
"[ENCODER:%d:%s] panel power wasn't enabled\n",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
msleep(intel_dp->panel_power_up_delay);
|
msleep(intel_dp->panel_power_up_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2970,7 +2970,7 @@ void intel_edp_panel_vdd_on(struct intel_dp *intel_dp)
|
||||||
static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
|
static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
||||||
struct intel_digital_port *intel_dig_port =
|
struct intel_digital_port *dig_port =
|
||||||
dp_to_dig_port(intel_dp);
|
dp_to_dig_port(intel_dp);
|
||||||
u32 pp;
|
u32 pp;
|
||||||
i915_reg_t pp_stat_reg, pp_ctrl_reg;
|
i915_reg_t pp_stat_reg, pp_ctrl_reg;
|
||||||
|
@ -2983,8 +2983,8 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drm_dbg_kms(&dev_priv->drm, "Turning [ENCODER:%d:%s] VDD off\n",
|
drm_dbg_kms(&dev_priv->drm, "Turning [ENCODER:%d:%s] VDD off\n",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
|
|
||||||
pp = ilk_get_pp_control(intel_dp);
|
pp = ilk_get_pp_control(intel_dp);
|
||||||
pp &= ~EDP_FORCE_VDD;
|
pp &= ~EDP_FORCE_VDD;
|
||||||
|
@ -3004,7 +3004,7 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
|
||||||
intel_dp->panel_power_off_time = ktime_get_boottime();
|
intel_dp->panel_power_off_time = ktime_get_boottime();
|
||||||
|
|
||||||
intel_display_power_put_unchecked(dev_priv,
|
intel_display_power_put_unchecked(dev_priv,
|
||||||
intel_aux_power_domain(intel_dig_port));
|
intel_aux_power_domain(dig_port));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void edp_panel_vdd_work(struct work_struct *__work)
|
static void edp_panel_vdd_work(struct work_struct *__work)
|
||||||
|
@ -3835,8 +3835,8 @@ static void g4x_pre_enable_dp(struct intel_atomic_state *state,
|
||||||
|
|
||||||
static void vlv_detach_power_sequencer(struct intel_dp *intel_dp)
|
static void vlv_detach_power_sequencer(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
||||||
enum pipe pipe = intel_dp->pps_pipe;
|
enum pipe pipe = intel_dp->pps_pipe;
|
||||||
i915_reg_t pp_on_reg = PP_ON_DELAYS(pipe);
|
i915_reg_t pp_on_reg = PP_ON_DELAYS(pipe);
|
||||||
|
|
||||||
|
@ -3858,8 +3858,8 @@ static void vlv_detach_power_sequencer(struct intel_dp *intel_dp)
|
||||||
*/
|
*/
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"detaching pipe %c power sequencer from [ENCODER:%d:%s]\n",
|
"detaching pipe %c power sequencer from [ENCODER:%d:%s]\n",
|
||||||
pipe_name(pipe), intel_dig_port->base.base.base.id,
|
pipe_name(pipe), dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
intel_de_write(dev_priv, pp_on_reg, 0);
|
intel_de_write(dev_priv, pp_on_reg, 0);
|
||||||
intel_de_posting_read(dev_priv, pp_on_reg);
|
intel_de_posting_read(dev_priv, pp_on_reg);
|
||||||
|
|
||||||
|
@ -4925,7 +4925,7 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state,
|
const struct intel_crtc_state *crtc_state,
|
||||||
unsigned int type)
|
unsigned int type)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct dp_sdp sdp = {};
|
struct dp_sdp sdp = {};
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
|
@ -4951,14 +4951,14 @@ static void intel_write_dp_sdp(struct intel_encoder *encoder,
|
||||||
if (drm_WARN_ON(&dev_priv->drm, len < 0))
|
if (drm_WARN_ON(&dev_priv->drm, len < 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_dig_port->write_infoframe(encoder, crtc_state, type, &sdp, len);
|
dig_port->write_infoframe(encoder, crtc_state, type, &sdp, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_write_dp_vsc_sdp(struct intel_encoder *encoder,
|
void intel_write_dp_vsc_sdp(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state,
|
const struct intel_crtc_state *crtc_state,
|
||||||
struct drm_dp_vsc_sdp *vsc)
|
struct drm_dp_vsc_sdp *vsc)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct dp_sdp sdp = {};
|
struct dp_sdp sdp = {};
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
|
@ -4968,7 +4968,7 @@ void intel_write_dp_vsc_sdp(struct intel_encoder *encoder,
|
||||||
if (drm_WARN_ON(&dev_priv->drm, len < 0))
|
if (drm_WARN_ON(&dev_priv->drm, len < 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_dig_port->write_infoframe(encoder, crtc_state, DP_SDP_VSC,
|
dig_port->write_infoframe(encoder, crtc_state, DP_SDP_VSC,
|
||||||
&sdp, len);
|
&sdp, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5128,7 +5128,7 @@ static void intel_read_dp_vsc_sdp(struct intel_encoder *encoder,
|
||||||
struct intel_crtc_state *crtc_state,
|
struct intel_crtc_state *crtc_state,
|
||||||
struct drm_dp_vsc_sdp *vsc)
|
struct drm_dp_vsc_sdp *vsc)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(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 *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
unsigned int type = DP_SDP_VSC;
|
unsigned int type = DP_SDP_VSC;
|
||||||
|
@ -5143,7 +5143,7 @@ static void intel_read_dp_vsc_sdp(struct intel_encoder *encoder,
|
||||||
intel_hdmi_infoframe_enable(type)) == 0)
|
intel_hdmi_infoframe_enable(type)) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_dig_port->read_infoframe(encoder, crtc_state, type, &sdp, sizeof(sdp));
|
dig_port->read_infoframe(encoder, crtc_state, type, &sdp, sizeof(sdp));
|
||||||
|
|
||||||
ret = intel_dp_vsc_sdp_unpack(vsc, &sdp, sizeof(sdp));
|
ret = intel_dp_vsc_sdp_unpack(vsc, &sdp, sizeof(sdp));
|
||||||
|
|
||||||
|
@ -5155,7 +5155,7 @@ static void intel_read_dp_hdr_metadata_infoframe_sdp(struct intel_encoder *encod
|
||||||
struct intel_crtc_state *crtc_state,
|
struct intel_crtc_state *crtc_state,
|
||||||
struct hdmi_drm_infoframe *drm_infoframe)
|
struct hdmi_drm_infoframe *drm_infoframe)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
unsigned int type = HDMI_PACKET_TYPE_GAMUT_METADATA;
|
unsigned int type = HDMI_PACKET_TYPE_GAMUT_METADATA;
|
||||||
struct dp_sdp sdp = {};
|
struct dp_sdp sdp = {};
|
||||||
|
@ -5165,7 +5165,7 @@ static void intel_read_dp_hdr_metadata_infoframe_sdp(struct intel_encoder *encod
|
||||||
intel_hdmi_infoframe_enable(type)) == 0)
|
intel_hdmi_infoframe_enable(type)) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_dig_port->read_infoframe(encoder, crtc_state, type, &sdp,
|
dig_port->read_infoframe(encoder, crtc_state, type, &sdp,
|
||||||
sizeof(sdp));
|
sizeof(sdp));
|
||||||
|
|
||||||
ret = intel_dp_hdr_metadata_infoframe_sdp_unpack(drm_infoframe, &sdp,
|
ret = intel_dp_hdr_metadata_infoframe_sdp_unpack(drm_infoframe, &sdp,
|
||||||
|
@ -5368,10 +5368,10 @@ static void intel_dp_phy_pattern_update(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv =
|
struct drm_i915_private *dev_priv =
|
||||||
to_i915(dp_to_dig_port(intel_dp)->base.base.dev);
|
to_i915(dp_to_dig_port(intel_dp)->base.base.dev);
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_dp_phy_test_params *data =
|
struct drm_dp_phy_test_params *data =
|
||||||
&intel_dp->compliance.test_data.phytest;
|
&intel_dp->compliance.test_data.phytest;
|
||||||
struct intel_crtc *crtc = to_intel_crtc(intel_dig_port->base.base.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(dig_port->base.base.crtc);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
u32 pattern_val;
|
u32 pattern_val;
|
||||||
|
|
||||||
|
@ -5433,10 +5433,10 @@ static void intel_dp_phy_pattern_update(struct intel_dp *intel_dp)
|
||||||
static void
|
static void
|
||||||
intel_dp_autotest_phy_ddi_disable(struct intel_dp *intel_dp)
|
intel_dp_autotest_phy_ddi_disable(struct intel_dp *intel_dp)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_device *dev = intel_dig_port->base.base.dev;
|
struct drm_device *dev = dig_port->base.base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
struct intel_crtc *crtc = to_intel_crtc(intel_dig_port->base.base.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(dig_port->base.base.crtc);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
u32 trans_ddi_func_ctl_value, trans_conf_value, dp_tp_ctl_value;
|
u32 trans_ddi_func_ctl_value, trans_conf_value, dp_tp_ctl_value;
|
||||||
|
|
||||||
|
@ -5459,11 +5459,11 @@ intel_dp_autotest_phy_ddi_disable(struct intel_dp *intel_dp)
|
||||||
static void
|
static void
|
||||||
intel_dp_autotest_phy_ddi_enable(struct intel_dp *intel_dp, uint8_t lane_cnt)
|
intel_dp_autotest_phy_ddi_enable(struct intel_dp *intel_dp, uint8_t lane_cnt)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_device *dev = intel_dig_port->base.base.dev;
|
struct drm_device *dev = dig_port->base.base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
struct intel_crtc *crtc = to_intel_crtc(intel_dig_port->base.base.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(dig_port->base.base.crtc);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
u32 trans_ddi_func_ctl_value, trans_conf_value, dp_tp_ctl_value;
|
u32 trans_ddi_func_ctl_value, trans_conf_value, dp_tp_ctl_value;
|
||||||
|
|
||||||
|
@ -6334,10 +6334,10 @@ intel_dp_connector_unregister(struct drm_connector *connector)
|
||||||
|
|
||||||
void intel_dp_encoder_flush_work(struct drm_encoder *encoder)
|
void intel_dp_encoder_flush_work(struct drm_encoder *encoder)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(to_intel_encoder(encoder));
|
struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder));
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
|
|
||||||
intel_dp_mst_encoder_cleanup(intel_dig_port);
|
intel_dp_mst_encoder_cleanup(dig_port);
|
||||||
if (intel_dp_is_edp(intel_dp)) {
|
if (intel_dp_is_edp(intel_dp)) {
|
||||||
intel_wakeref_t wakeref;
|
intel_wakeref_t wakeref;
|
||||||
|
|
||||||
|
@ -6396,11 +6396,11 @@ static void intel_dp_hdcp_wait_for_cp_irq(struct intel_hdcp *hdcp, int timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_write_an_aksv(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_write_an_aksv(struct intel_digital_port *dig_port,
|
||||||
u8 *an)
|
u8 *an)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_dp *intel_dp = enc_to_intel_dp(to_intel_encoder(&intel_dig_port->base.base));
|
struct intel_dp *intel_dp = enc_to_intel_dp(to_intel_encoder(&dig_port->base.base));
|
||||||
static const struct drm_dp_aux_msg msg = {
|
static const struct drm_dp_aux_msg msg = {
|
||||||
.request = DP_AUX_NATIVE_WRITE,
|
.request = DP_AUX_NATIVE_WRITE,
|
||||||
.address = DP_AUX_HDCP_AKSV,
|
.address = DP_AUX_HDCP_AKSV,
|
||||||
|
@ -6411,7 +6411,7 @@ int intel_dp_hdcp_write_an_aksv(struct intel_digital_port *intel_dig_port,
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Output An first, that's easy */
|
/* Output An first, that's easy */
|
||||||
dpcd_ret = drm_dp_dpcd_write(&intel_dig_port->dp.aux, DP_AUX_HDCP_AN,
|
dpcd_ret = drm_dp_dpcd_write(&dig_port->dp.aux, DP_AUX_HDCP_AN,
|
||||||
an, DRM_HDCP_AN_LEN);
|
an, DRM_HDCP_AN_LEN);
|
||||||
if (dpcd_ret != DRM_HDCP_AN_LEN) {
|
if (dpcd_ret != DRM_HDCP_AN_LEN) {
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
|
@ -6450,13 +6450,13 @@ int intel_dp_hdcp_write_an_aksv(struct intel_digital_port *intel_dig_port,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_dp_hdcp_read_bksv(struct intel_digital_port *intel_dig_port,
|
static int intel_dp_hdcp_read_bksv(struct intel_digital_port *dig_port,
|
||||||
u8 *bksv)
|
u8 *bksv)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, DP_AUX_HDCP_BKSV, bksv,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_BKSV, bksv,
|
||||||
DRM_HDCP_KSV_LEN);
|
DRM_HDCP_KSV_LEN);
|
||||||
if (ret != DRM_HDCP_KSV_LEN) {
|
if (ret != DRM_HDCP_KSV_LEN) {
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
|
@ -6466,10 +6466,10 @@ static int intel_dp_hdcp_read_bksv(struct intel_digital_port *intel_dig_port,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_dp_hdcp_read_bstatus(struct intel_digital_port *intel_dig_port,
|
static int intel_dp_hdcp_read_bstatus(struct intel_digital_port *dig_port,
|
||||||
u8 *bstatus)
|
u8 *bstatus)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -6477,7 +6477,7 @@ static int intel_dp_hdcp_read_bstatus(struct intel_digital_port *intel_dig_port,
|
||||||
* definition by different names. In the HDMI spec, it's called BSTATUS,
|
* definition by different names. In the HDMI spec, it's called BSTATUS,
|
||||||
* but in DP it's called BINFO.
|
* but in DP it's called BINFO.
|
||||||
*/
|
*/
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, DP_AUX_HDCP_BINFO,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_BINFO,
|
||||||
bstatus, DRM_HDCP_BSTATUS_LEN);
|
bstatus, DRM_HDCP_BSTATUS_LEN);
|
||||||
if (ret != DRM_HDCP_BSTATUS_LEN) {
|
if (ret != DRM_HDCP_BSTATUS_LEN) {
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
|
@ -6488,13 +6488,13 @@ static int intel_dp_hdcp_read_bstatus(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_read_bcaps(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_read_bcaps(struct intel_digital_port *dig_port,
|
||||||
u8 *bcaps)
|
u8 *bcaps)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, DP_AUX_HDCP_BCAPS,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_BCAPS,
|
||||||
bcaps, 1);
|
bcaps, 1);
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
|
@ -6506,13 +6506,13 @@ int intel_dp_hdcp_read_bcaps(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_repeater_present(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_repeater_present(struct intel_digital_port *dig_port,
|
||||||
bool *repeater_present)
|
bool *repeater_present)
|
||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
u8 bcaps;
|
u8 bcaps;
|
||||||
|
|
||||||
ret = intel_dp_hdcp_read_bcaps(intel_dig_port, &bcaps);
|
ret = intel_dp_hdcp_read_bcaps(dig_port, &bcaps);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -6521,13 +6521,13 @@ int intel_dp_hdcp_repeater_present(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_read_ri_prime(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_read_ri_prime(struct intel_digital_port *dig_port,
|
||||||
u8 *ri_prime)
|
u8 *ri_prime)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, DP_AUX_HDCP_RI_PRIME,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_RI_PRIME,
|
||||||
ri_prime, DRM_HDCP_RI_LEN);
|
ri_prime, DRM_HDCP_RI_LEN);
|
||||||
if (ret != DRM_HDCP_RI_LEN) {
|
if (ret != DRM_HDCP_RI_LEN) {
|
||||||
drm_dbg_kms(&i915->drm, "Read Ri' from DP/AUX failed (%zd)\n",
|
drm_dbg_kms(&i915->drm, "Read Ri' from DP/AUX failed (%zd)\n",
|
||||||
|
@ -6538,14 +6538,14 @@ int intel_dp_hdcp_read_ri_prime(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_read_ksv_ready(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_read_ksv_ready(struct intel_digital_port *dig_port,
|
||||||
bool *ksv_ready)
|
bool *ksv_ready)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
u8 bstatus;
|
u8 bstatus;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, DP_AUX_HDCP_BSTATUS,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_BSTATUS,
|
||||||
&bstatus, 1);
|
&bstatus, 1);
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
|
@ -6557,17 +6557,17 @@ int intel_dp_hdcp_read_ksv_ready(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_read_ksv_fifo(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_read_ksv_fifo(struct intel_digital_port *dig_port,
|
||||||
int num_downstream, u8 *ksv_fifo)
|
int num_downstream, u8 *ksv_fifo)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* KSV list is read via 15 byte window (3 entries @ 5 bytes each) */
|
/* KSV list is read via 15 byte window (3 entries @ 5 bytes each) */
|
||||||
for (i = 0; i < num_downstream; i += 3) {
|
for (i = 0; i < num_downstream; i += 3) {
|
||||||
size_t len = min(num_downstream - i, 3) * DRM_HDCP_KSV_LEN;
|
size_t len = min(num_downstream - i, 3) * DRM_HDCP_KSV_LEN;
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux,
|
||||||
DP_AUX_HDCP_KSV_FIFO,
|
DP_AUX_HDCP_KSV_FIFO,
|
||||||
ksv_fifo + i * DRM_HDCP_KSV_LEN,
|
ksv_fifo + i * DRM_HDCP_KSV_LEN,
|
||||||
len);
|
len);
|
||||||
|
@ -6582,16 +6582,16 @@ int intel_dp_hdcp_read_ksv_fifo(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_read_v_prime_part(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_read_v_prime_part(struct intel_digital_port *dig_port,
|
||||||
int i, u32 *part)
|
int i, u32 *part)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
if (i >= DRM_HDCP_V_PRIME_NUM_PARTS)
|
if (i >= DRM_HDCP_V_PRIME_NUM_PARTS)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux,
|
||||||
DP_AUX_HDCP_V_PRIME(i), part,
|
DP_AUX_HDCP_V_PRIME(i), part,
|
||||||
DRM_HDCP_V_PRIME_PART_LEN);
|
DRM_HDCP_V_PRIME_PART_LEN);
|
||||||
if (ret != DRM_HDCP_V_PRIME_PART_LEN) {
|
if (ret != DRM_HDCP_V_PRIME_PART_LEN) {
|
||||||
|
@ -6603,7 +6603,7 @@ int intel_dp_hdcp_read_v_prime_part(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_toggle_signalling(struct intel_digital_port *dig_port,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
/* Not used for single stream DisplayPort setups */
|
/* Not used for single stream DisplayPort setups */
|
||||||
|
@ -6611,13 +6611,13 @@ int intel_dp_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
bool intel_dp_hdcp_check_link(struct intel_digital_port *intel_dig_port)
|
bool intel_dp_hdcp_check_link(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
u8 bstatus;
|
u8 bstatus;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, DP_AUX_HDCP_BSTATUS,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux, DP_AUX_HDCP_BSTATUS,
|
||||||
&bstatus, 1);
|
&bstatus, 1);
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
|
@ -6629,13 +6629,13 @@ bool intel_dp_hdcp_check_link(struct intel_digital_port *intel_dig_port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp_capable(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp_capable(struct intel_digital_port *dig_port,
|
||||||
bool *hdcp_capable)
|
bool *hdcp_capable)
|
||||||
{
|
{
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
u8 bcaps;
|
u8 bcaps;
|
||||||
|
|
||||||
ret = intel_dp_hdcp_read_bcaps(intel_dig_port, &bcaps);
|
ret = intel_dp_hdcp_read_bcaps(dig_port, &bcaps);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -6693,13 +6693,13 @@ static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
intel_dp_hdcp2_read_rx_status(struct intel_digital_port *intel_dig_port,
|
intel_dp_hdcp2_read_rx_status(struct intel_digital_port *dig_port,
|
||||||
u8 *rx_status)
|
u8 *rx_status)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux,
|
||||||
DP_HDCP_2_2_REG_RXSTATUS_OFFSET, rx_status,
|
DP_HDCP_2_2_REG_RXSTATUS_OFFSET, rx_status,
|
||||||
HDCP_2_2_DP_RXSTATUS_LEN);
|
HDCP_2_2_DP_RXSTATUS_LEN);
|
||||||
if (ret != HDCP_2_2_DP_RXSTATUS_LEN) {
|
if (ret != HDCP_2_2_DP_RXSTATUS_LEN) {
|
||||||
|
@ -6712,14 +6712,14 @@ intel_dp_hdcp2_read_rx_status(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int hdcp2_detect_msg_availability(struct intel_digital_port *intel_dig_port,
|
int hdcp2_detect_msg_availability(struct intel_digital_port *dig_port,
|
||||||
u8 msg_id, bool *msg_ready)
|
u8 msg_id, bool *msg_ready)
|
||||||
{
|
{
|
||||||
u8 rx_status;
|
u8 rx_status;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
*msg_ready = false;
|
*msg_ready = false;
|
||||||
ret = intel_dp_hdcp2_read_rx_status(intel_dig_port, &rx_status);
|
ret = intel_dp_hdcp2_read_rx_status(dig_port, &rx_status);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -6745,11 +6745,11 @@ int hdcp2_detect_msg_availability(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
intel_dp_hdcp2_wait_for_msg(struct intel_digital_port *intel_dig_port,
|
intel_dp_hdcp2_wait_for_msg(struct intel_digital_port *dig_port,
|
||||||
const struct hdcp2_dp_msg_data *hdcp2_msg_data)
|
const struct hdcp2_dp_msg_data *hdcp2_msg_data)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_dp *dp = &intel_dig_port->dp;
|
struct intel_dp *dp = &dig_port->dp;
|
||||||
struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
|
struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
|
||||||
u8 msg_id = hdcp2_msg_data->msg_id;
|
u8 msg_id = hdcp2_msg_data->msg_id;
|
||||||
int ret, timeout;
|
int ret, timeout;
|
||||||
|
@ -6773,7 +6773,7 @@ intel_dp_hdcp2_wait_for_msg(struct intel_digital_port *intel_dig_port,
|
||||||
* the timeout at wait for CP_IRQ.
|
* the timeout at wait for CP_IRQ.
|
||||||
*/
|
*/
|
||||||
intel_dp_hdcp_wait_for_cp_irq(hdcp, timeout);
|
intel_dp_hdcp_wait_for_cp_irq(hdcp, timeout);
|
||||||
ret = hdcp2_detect_msg_availability(intel_dig_port,
|
ret = hdcp2_detect_msg_availability(dig_port,
|
||||||
msg_id, &msg_ready);
|
msg_id, &msg_ready);
|
||||||
if (!msg_ready)
|
if (!msg_ready)
|
||||||
ret = -ETIMEDOUT;
|
ret = -ETIMEDOUT;
|
||||||
|
@ -6799,10 +6799,10 @@ static const struct hdcp2_dp_msg_data *get_hdcp2_dp_msg_data(u8 msg_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp2_write_msg(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp2_write_msg(struct intel_digital_port *dig_port,
|
||||||
void *buf, size_t size)
|
void *buf, size_t size)
|
||||||
{
|
{
|
||||||
struct intel_dp *dp = &intel_dig_port->dp;
|
struct intel_dp *dp = &dig_port->dp;
|
||||||
struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
|
struct intel_hdcp *hdcp = &dp->attached_connector->hdcp;
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
u8 *byte = buf;
|
u8 *byte = buf;
|
||||||
|
@ -6825,7 +6825,7 @@ int intel_dp_hdcp2_write_msg(struct intel_digital_port *intel_dig_port,
|
||||||
len = bytes_to_write > DP_AUX_MAX_PAYLOAD_BYTES ?
|
len = bytes_to_write > DP_AUX_MAX_PAYLOAD_BYTES ?
|
||||||
DP_AUX_MAX_PAYLOAD_BYTES : bytes_to_write;
|
DP_AUX_MAX_PAYLOAD_BYTES : bytes_to_write;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_write(&intel_dig_port->dp.aux,
|
ret = drm_dp_dpcd_write(&dig_port->dp.aux,
|
||||||
offset, (void *)byte, len);
|
offset, (void *)byte, len);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -6839,13 +6839,13 @@ int intel_dp_hdcp2_write_msg(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
ssize_t get_receiver_id_list_size(struct intel_digital_port *intel_dig_port)
|
ssize_t get_receiver_id_list_size(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
u8 rx_info[HDCP_2_2_RXINFO_LEN];
|
u8 rx_info[HDCP_2_2_RXINFO_LEN];
|
||||||
u32 dev_cnt;
|
u32 dev_cnt;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux,
|
||||||
DP_HDCP_2_2_REG_RXINFO_OFFSET,
|
DP_HDCP_2_2_REG_RXINFO_OFFSET,
|
||||||
(void *)rx_info, HDCP_2_2_RXINFO_LEN);
|
(void *)rx_info, HDCP_2_2_RXINFO_LEN);
|
||||||
if (ret != HDCP_2_2_RXINFO_LEN)
|
if (ret != HDCP_2_2_RXINFO_LEN)
|
||||||
|
@ -6865,10 +6865,10 @@ ssize_t get_receiver_id_list_size(struct intel_digital_port *intel_dig_port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp2_read_msg(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp2_read_msg(struct intel_digital_port *dig_port,
|
||||||
u8 msg_id, void *buf, size_t size)
|
u8 msg_id, void *buf, size_t size)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
u8 *byte = buf;
|
u8 *byte = buf;
|
||||||
ssize_t ret, bytes_to_recv, len;
|
ssize_t ret, bytes_to_recv, len;
|
||||||
|
@ -6879,12 +6879,12 @@ int intel_dp_hdcp2_read_msg(struct intel_digital_port *intel_dig_port,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
offset = hdcp2_msg_data->offset;
|
offset = hdcp2_msg_data->offset;
|
||||||
|
|
||||||
ret = intel_dp_hdcp2_wait_for_msg(intel_dig_port, hdcp2_msg_data);
|
ret = intel_dp_hdcp2_wait_for_msg(dig_port, hdcp2_msg_data);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (msg_id == HDCP_2_2_REP_SEND_RECVID_LIST) {
|
if (msg_id == HDCP_2_2_REP_SEND_RECVID_LIST) {
|
||||||
ret = get_receiver_id_list_size(intel_dig_port);
|
ret = get_receiver_id_list_size(dig_port);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -6899,7 +6899,7 @@ int intel_dp_hdcp2_read_msg(struct intel_digital_port *intel_dig_port,
|
||||||
len = bytes_to_recv > DP_AUX_MAX_PAYLOAD_BYTES ?
|
len = bytes_to_recv > DP_AUX_MAX_PAYLOAD_BYTES ?
|
||||||
DP_AUX_MAX_PAYLOAD_BYTES : bytes_to_recv;
|
DP_AUX_MAX_PAYLOAD_BYTES : bytes_to_recv;
|
||||||
|
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux, offset,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux, offset,
|
||||||
(void *)byte, len);
|
(void *)byte, len);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
drm_dbg_kms(&i915->drm, "msg_id %d, ret %zd\n",
|
drm_dbg_kms(&i915->drm, "msg_id %d, ret %zd\n",
|
||||||
|
@ -6918,7 +6918,7 @@ int intel_dp_hdcp2_read_msg(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *dig_port,
|
||||||
bool is_repeater, u8 content_type)
|
bool is_repeater, u8 content_type)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -6937,7 +6937,7 @@ int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *intel_dig_port,
|
||||||
stream_type_msg.msg_id = HDCP_2_2_ERRATA_DP_STREAM_TYPE;
|
stream_type_msg.msg_id = HDCP_2_2_ERRATA_DP_STREAM_TYPE;
|
||||||
stream_type_msg.stream_type = content_type;
|
stream_type_msg.stream_type = content_type;
|
||||||
|
|
||||||
ret = intel_dp_hdcp2_write_msg(intel_dig_port, &stream_type_msg,
|
ret = intel_dp_hdcp2_write_msg(dig_port, &stream_type_msg,
|
||||||
sizeof(stream_type_msg));
|
sizeof(stream_type_msg));
|
||||||
|
|
||||||
return ret < 0 ? ret : 0;
|
return ret < 0 ? ret : 0;
|
||||||
|
@ -6945,12 +6945,12 @@ int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp2_check_link(struct intel_digital_port *intel_dig_port)
|
int intel_dp_hdcp2_check_link(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
u8 rx_status;
|
u8 rx_status;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = intel_dp_hdcp2_read_rx_status(intel_dig_port, &rx_status);
|
ret = intel_dp_hdcp2_read_rx_status(dig_port, &rx_status);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -6965,14 +6965,14 @@ int intel_dp_hdcp2_check_link(struct intel_digital_port *intel_dig_port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_dp_hdcp2_capable(struct intel_digital_port *intel_dig_port,
|
int intel_dp_hdcp2_capable(struct intel_digital_port *dig_port,
|
||||||
bool *capable)
|
bool *capable)
|
||||||
{
|
{
|
||||||
u8 rx_caps[3];
|
u8 rx_caps[3];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
*capable = false;
|
*capable = false;
|
||||||
ret = drm_dp_dpcd_read(&intel_dig_port->dp.aux,
|
ret = drm_dp_dpcd_read(&dig_port->dp.aux,
|
||||||
DP_HDCP_2_2_REG_RX_CAPS_OFFSET,
|
DP_HDCP_2_2_REG_RX_CAPS_OFFSET,
|
||||||
rx_caps, HDCP_2_2_RXCAPS_LEN);
|
rx_caps, HDCP_2_2_RXCAPS_LEN);
|
||||||
if (ret != HDCP_2_2_RXCAPS_LEN)
|
if (ret != HDCP_2_2_RXCAPS_LEN)
|
||||||
|
@ -7251,12 +7251,12 @@ static bool intel_edp_have_power(struct intel_dp *intel_dp)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum irqreturn
|
enum irqreturn
|
||||||
intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
|
intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
|
|
||||||
if (intel_dig_port->base.type == INTEL_OUTPUT_EDP &&
|
if (dig_port->base.type == INTEL_OUTPUT_EDP &&
|
||||||
(long_hpd || !intel_edp_have_power(intel_dp))) {
|
(long_hpd || !intel_edp_have_power(intel_dp))) {
|
||||||
/*
|
/*
|
||||||
* vdd off can generate a long/short pulse on eDP which
|
* vdd off can generate a long/short pulse on eDP which
|
||||||
|
@ -7267,14 +7267,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
"ignoring %s hpd on eDP [ENCODER:%d:%s]\n",
|
"ignoring %s hpd on eDP [ENCODER:%d:%s]\n",
|
||||||
long_hpd ? "long" : "short",
|
long_hpd ? "long" : "short",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name);
|
dig_port->base.base.name);
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_dbg_kms(&i915->drm, "got hpd irq on [ENCODER:%d:%s] - %s\n",
|
drm_dbg_kms(&i915->drm, "got hpd irq on [ENCODER:%d:%s] - %s\n",
|
||||||
intel_dig_port->base.base.base.id,
|
dig_port->base.base.base.id,
|
||||||
intel_dig_port->base.base.name,
|
dig_port->base.base.name,
|
||||||
long_hpd ? "long" : "short");
|
long_hpd ? "long" : "short");
|
||||||
|
|
||||||
if (long_hpd) {
|
if (long_hpd) {
|
||||||
|
@ -8137,12 +8137,12 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
|
intel_dp_init_connector(struct intel_digital_port *dig_port,
|
||||||
struct intel_connector *intel_connector)
|
struct intel_connector *intel_connector)
|
||||||
{
|
{
|
||||||
struct drm_connector *connector = &intel_connector->base;
|
struct drm_connector *connector = &intel_connector->base;
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
struct intel_encoder *intel_encoder = &intel_dig_port->base;
|
struct intel_encoder *intel_encoder = &dig_port->base;
|
||||||
struct drm_device *dev = intel_encoder->base.dev;
|
struct drm_device *dev = intel_encoder->base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
enum port port = intel_encoder->port;
|
enum port port = intel_encoder->port;
|
||||||
|
@ -8153,9 +8153,9 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
|
||||||
INIT_WORK(&intel_connector->modeset_retry_work,
|
INIT_WORK(&intel_connector->modeset_retry_work,
|
||||||
intel_dp_modeset_retry_work_fn);
|
intel_dp_modeset_retry_work_fn);
|
||||||
|
|
||||||
if (drm_WARN(dev, intel_dig_port->max_lanes < 1,
|
if (drm_WARN(dev, dig_port->max_lanes < 1,
|
||||||
"Not enough lanes (%d) for DP on [ENCODER:%d:%s]\n",
|
"Not enough lanes (%d) for DP on [ENCODER:%d:%s]\n",
|
||||||
intel_dig_port->max_lanes, intel_encoder->base.base.id,
|
dig_port->max_lanes, intel_encoder->base.base.id,
|
||||||
intel_encoder->base.name))
|
intel_encoder->base.name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -8218,12 +8218,12 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
|
||||||
intel_connector->get_hw_state = intel_connector_get_hw_state;
|
intel_connector->get_hw_state = intel_connector_get_hw_state;
|
||||||
|
|
||||||
/* init MST on ports that can support it */
|
/* init MST on ports that can support it */
|
||||||
intel_dp_mst_encoder_init(intel_dig_port,
|
intel_dp_mst_encoder_init(dig_port,
|
||||||
intel_connector->base.base.id);
|
intel_connector->base.base.id);
|
||||||
|
|
||||||
if (!intel_edp_init_connector(intel_dp, intel_connector)) {
|
if (!intel_edp_init_connector(intel_dp, intel_connector)) {
|
||||||
intel_dp_aux_fini(intel_dp);
|
intel_dp_aux_fini(intel_dp);
|
||||||
intel_dp_mst_encoder_cleanup(intel_dig_port);
|
intel_dp_mst_encoder_cleanup(dig_port);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8258,20 +8258,20 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
|
||||||
i915_reg_t output_reg,
|
i915_reg_t output_reg,
|
||||||
enum port port)
|
enum port port)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port;
|
struct intel_digital_port *dig_port;
|
||||||
struct intel_encoder *intel_encoder;
|
struct intel_encoder *intel_encoder;
|
||||||
struct drm_encoder *encoder;
|
struct drm_encoder *encoder;
|
||||||
struct intel_connector *intel_connector;
|
struct intel_connector *intel_connector;
|
||||||
|
|
||||||
intel_dig_port = kzalloc(sizeof(*intel_dig_port), GFP_KERNEL);
|
dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL);
|
||||||
if (!intel_dig_port)
|
if (!dig_port)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
intel_connector = intel_connector_alloc();
|
intel_connector = intel_connector_alloc();
|
||||||
if (!intel_connector)
|
if (!intel_connector)
|
||||||
goto err_connector_alloc;
|
goto err_connector_alloc;
|
||||||
|
|
||||||
intel_encoder = &intel_dig_port->base;
|
intel_encoder = &dig_port->base;
|
||||||
encoder = &intel_encoder->base;
|
encoder = &intel_encoder->base;
|
||||||
|
|
||||||
if (drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
|
if (drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
|
||||||
|
@ -8307,34 +8307,34 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
|
||||||
|
|
||||||
if ((IS_IVYBRIDGE(dev_priv) && port == PORT_A) ||
|
if ((IS_IVYBRIDGE(dev_priv) && port == PORT_A) ||
|
||||||
(HAS_PCH_CPT(dev_priv) && port != PORT_A))
|
(HAS_PCH_CPT(dev_priv) && port != PORT_A))
|
||||||
intel_dig_port->dp.set_link_train = cpt_set_link_train;
|
dig_port->dp.set_link_train = cpt_set_link_train;
|
||||||
else
|
else
|
||||||
intel_dig_port->dp.set_link_train = g4x_set_link_train;
|
dig_port->dp.set_link_train = g4x_set_link_train;
|
||||||
|
|
||||||
if (IS_CHERRYVIEW(dev_priv))
|
if (IS_CHERRYVIEW(dev_priv))
|
||||||
intel_dig_port->dp.set_signal_levels = chv_set_signal_levels;
|
dig_port->dp.set_signal_levels = chv_set_signal_levels;
|
||||||
else if (IS_VALLEYVIEW(dev_priv))
|
else if (IS_VALLEYVIEW(dev_priv))
|
||||||
intel_dig_port->dp.set_signal_levels = vlv_set_signal_levels;
|
dig_port->dp.set_signal_levels = vlv_set_signal_levels;
|
||||||
else if (IS_IVYBRIDGE(dev_priv) && port == PORT_A)
|
else if (IS_IVYBRIDGE(dev_priv) && port == PORT_A)
|
||||||
intel_dig_port->dp.set_signal_levels = ivb_cpu_edp_set_signal_levels;
|
dig_port->dp.set_signal_levels = ivb_cpu_edp_set_signal_levels;
|
||||||
else if (IS_GEN(dev_priv, 6) && port == PORT_A)
|
else if (IS_GEN(dev_priv, 6) && port == PORT_A)
|
||||||
intel_dig_port->dp.set_signal_levels = snb_cpu_edp_set_signal_levels;
|
dig_port->dp.set_signal_levels = snb_cpu_edp_set_signal_levels;
|
||||||
else
|
else
|
||||||
intel_dig_port->dp.set_signal_levels = g4x_set_signal_levels;
|
dig_port->dp.set_signal_levels = g4x_set_signal_levels;
|
||||||
|
|
||||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv) ||
|
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv) ||
|
||||||
(HAS_PCH_SPLIT(dev_priv) && port != PORT_A)) {
|
(HAS_PCH_SPLIT(dev_priv) && port != PORT_A)) {
|
||||||
intel_dig_port->dp.preemph_max = intel_dp_pre_empemph_max_3;
|
dig_port->dp.preemph_max = intel_dp_pre_empemph_max_3;
|
||||||
intel_dig_port->dp.voltage_max = intel_dp_voltage_max_3;
|
dig_port->dp.voltage_max = intel_dp_voltage_max_3;
|
||||||
} else {
|
} else {
|
||||||
intel_dig_port->dp.preemph_max = intel_dp_pre_empemph_max_2;
|
dig_port->dp.preemph_max = intel_dp_pre_empemph_max_2;
|
||||||
intel_dig_port->dp.voltage_max = intel_dp_voltage_max_2;
|
dig_port->dp.voltage_max = intel_dp_voltage_max_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_dig_port->dp.output_reg = output_reg;
|
dig_port->dp.output_reg = output_reg;
|
||||||
intel_dig_port->max_lanes = 4;
|
dig_port->max_lanes = 4;
|
||||||
intel_dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
|
dig_port->dp.regs.dp_tp_ctl = DP_TP_CTL(port);
|
||||||
intel_dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);
|
dig_port->dp.regs.dp_tp_status = DP_TP_STATUS(port);
|
||||||
|
|
||||||
intel_encoder->type = INTEL_OUTPUT_DP;
|
intel_encoder->type = INTEL_OUTPUT_DP;
|
||||||
intel_encoder->power_domain = intel_port_to_power_domain(port);
|
intel_encoder->power_domain = intel_port_to_power_domain(port);
|
||||||
|
@ -8349,25 +8349,25 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
|
||||||
intel_encoder->cloneable = 0;
|
intel_encoder->cloneable = 0;
|
||||||
intel_encoder->port = port;
|
intel_encoder->port = port;
|
||||||
|
|
||||||
intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
|
dig_port->hpd_pulse = intel_dp_hpd_pulse;
|
||||||
|
|
||||||
if (HAS_GMCH(dev_priv)) {
|
if (HAS_GMCH(dev_priv)) {
|
||||||
if (IS_GM45(dev_priv))
|
if (IS_GM45(dev_priv))
|
||||||
intel_dig_port->connected = gm45_digital_port_connected;
|
dig_port->connected = gm45_digital_port_connected;
|
||||||
else
|
else
|
||||||
intel_dig_port->connected = g4x_digital_port_connected;
|
dig_port->connected = g4x_digital_port_connected;
|
||||||
} else {
|
} else {
|
||||||
if (port == PORT_A)
|
if (port == PORT_A)
|
||||||
intel_dig_port->connected = ilk_digital_port_connected;
|
dig_port->connected = ilk_digital_port_connected;
|
||||||
else
|
else
|
||||||
intel_dig_port->connected = ibx_digital_port_connected;
|
dig_port->connected = ibx_digital_port_connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (port != PORT_A)
|
if (port != PORT_A)
|
||||||
intel_infoframe_init(intel_dig_port);
|
intel_infoframe_init(dig_port);
|
||||||
|
|
||||||
intel_dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
|
dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
|
||||||
if (!intel_dp_init_connector(intel_dig_port, intel_connector))
|
if (!intel_dp_init_connector(dig_port, intel_connector))
|
||||||
goto err_init_connector;
|
goto err_init_connector;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -8377,7 +8377,7 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
|
||||||
err_encoder_init:
|
err_encoder_init:
|
||||||
kfree(intel_connector);
|
kfree(intel_connector);
|
||||||
err_connector_alloc:
|
err_connector_alloc:
|
||||||
kfree(intel_dig_port);
|
kfree(dig_port);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ bool intel_dp_port_enabled(struct drm_i915_private *dev_priv,
|
||||||
enum pipe *pipe);
|
enum pipe *pipe);
|
||||||
bool intel_dp_init(struct drm_i915_private *dev_priv, i915_reg_t output_reg,
|
bool intel_dp_init(struct drm_i915_private *dev_priv, i915_reg_t output_reg,
|
||||||
enum port port);
|
enum port port);
|
||||||
bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
|
bool intel_dp_init_connector(struct intel_digital_port *dig_port,
|
||||||
struct intel_connector *intel_connector);
|
struct intel_connector *intel_connector);
|
||||||
void intel_dp_set_link_params(struct intel_dp *intel_dp,
|
void intel_dp_set_link_params(struct intel_dp *intel_dp,
|
||||||
int link_rate, u8 lane_count,
|
int link_rate, u8 lane_count,
|
||||||
|
@ -61,7 +61,7 @@ int intel_dp_compute_config(struct intel_encoder *encoder,
|
||||||
struct drm_connector_state *conn_state);
|
struct drm_connector_state *conn_state);
|
||||||
bool intel_dp_is_edp(struct intel_dp *intel_dp);
|
bool intel_dp_is_edp(struct intel_dp *intel_dp);
|
||||||
bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
|
bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
|
||||||
enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
|
enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *dig_port,
|
||||||
bool long_hpd);
|
bool long_hpd);
|
||||||
void intel_edp_backlight_on(const struct intel_crtc_state *crtc_state,
|
void intel_edp_backlight_on(const struct intel_crtc_state *crtc_state,
|
||||||
const struct drm_connector_state *conn_state);
|
const struct drm_connector_state *conn_state);
|
||||||
|
|
|
@ -342,8 +342,8 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state,
|
||||||
const struct drm_connector_state *old_conn_state)
|
const struct drm_connector_state *old_conn_state)
|
||||||
{
|
{
|
||||||
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
||||||
struct intel_digital_port *intel_dig_port = intel_mst->primary;
|
struct intel_digital_port *dig_port = intel_mst->primary;
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
struct intel_connector *connector =
|
struct intel_connector *connector =
|
||||||
to_intel_connector(old_conn_state->connector);
|
to_intel_connector(old_conn_state->connector);
|
||||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||||
|
@ -369,8 +369,8 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state,
|
||||||
const struct drm_connector_state *old_conn_state)
|
const struct drm_connector_state *old_conn_state)
|
||||||
{
|
{
|
||||||
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
||||||
struct intel_digital_port *intel_dig_port = intel_mst->primary;
|
struct intel_digital_port *dig_port = intel_mst->primary;
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
struct intel_connector *connector =
|
struct intel_connector *connector =
|
||||||
to_intel_connector(old_conn_state->connector);
|
to_intel_connector(old_conn_state->connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
|
@ -421,7 +421,7 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state,
|
||||||
* the transcoder clock select is set to none.
|
* the transcoder clock select is set to none.
|
||||||
*/
|
*/
|
||||||
if (last_mst_stream)
|
if (last_mst_stream)
|
||||||
intel_dp_set_infoframes(&intel_dig_port->base, false,
|
intel_dp_set_infoframes(&dig_port->base, false,
|
||||||
old_crtc_state, NULL);
|
old_crtc_state, NULL);
|
||||||
/*
|
/*
|
||||||
* From TGL spec: "If multi-stream slave transcoder: Configure
|
* From TGL spec: "If multi-stream slave transcoder: Configure
|
||||||
|
@ -436,7 +436,7 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state,
|
||||||
|
|
||||||
intel_mst->connector = NULL;
|
intel_mst->connector = NULL;
|
||||||
if (last_mst_stream)
|
if (last_mst_stream)
|
||||||
intel_dig_port->base.post_disable(state, &intel_dig_port->base,
|
dig_port->base.post_disable(state, &dig_port->base,
|
||||||
old_crtc_state, NULL);
|
old_crtc_state, NULL);
|
||||||
|
|
||||||
drm_dbg_kms(&dev_priv->drm, "active links %d\n",
|
drm_dbg_kms(&dev_priv->drm, "active links %d\n",
|
||||||
|
@ -449,11 +449,11 @@ static void intel_mst_pre_pll_enable_dp(struct intel_atomic_state *state,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
||||||
struct intel_digital_port *intel_dig_port = intel_mst->primary;
|
struct intel_digital_port *dig_port = intel_mst->primary;
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
|
|
||||||
if (intel_dp->active_mst_links == 0)
|
if (intel_dp->active_mst_links == 0)
|
||||||
intel_dig_port->base.pre_pll_enable(state, &intel_dig_port->base,
|
dig_port->base.pre_pll_enable(state, &dig_port->base,
|
||||||
pipe_config, NULL);
|
pipe_config, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,8 +463,8 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
||||||
struct intel_digital_port *intel_dig_port = intel_mst->primary;
|
struct intel_digital_port *dig_port = intel_mst->primary;
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_connector *connector =
|
struct intel_connector *connector =
|
||||||
to_intel_connector(conn_state->connector);
|
to_intel_connector(conn_state->connector);
|
||||||
|
@ -490,7 +490,7 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state,
|
||||||
drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
|
drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
|
||||||
|
|
||||||
if (first_mst_stream)
|
if (first_mst_stream)
|
||||||
intel_dig_port->base.pre_enable(state, &intel_dig_port->base,
|
dig_port->base.pre_enable(state, &dig_port->base,
|
||||||
pipe_config, NULL);
|
pipe_config, NULL);
|
||||||
|
|
||||||
ret = drm_dp_mst_allocate_vcpi(&intel_dp->mst_mgr,
|
ret = drm_dp_mst_allocate_vcpi(&intel_dp->mst_mgr,
|
||||||
|
@ -506,7 +506,7 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Before Gen 12 this is not done as part of
|
* Before Gen 12 this is not done as part of
|
||||||
* intel_dig_port->base.pre_enable() and should be done here. For
|
* dig_port->base.pre_enable() and should be done here. For
|
||||||
* Gen 12+ the step in which this should be done is different for the
|
* Gen 12+ the step in which this should be done is different for the
|
||||||
* first MST stream, so it's done on the DDI for the first stream and
|
* first MST stream, so it's done on the DDI for the first stream and
|
||||||
* here for the following ones.
|
* here for the following ones.
|
||||||
|
@ -525,8 +525,8 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
||||||
struct intel_digital_port *intel_dig_port = intel_mst->primary;
|
struct intel_digital_port *dig_port = intel_mst->primary;
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
|
@ -572,9 +572,9 @@ static void intel_dp_mst_enc_get_config(struct intel_encoder *encoder,
|
||||||
struct intel_crtc_state *pipe_config)
|
struct intel_crtc_state *pipe_config)
|
||||||
{
|
{
|
||||||
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder);
|
||||||
struct intel_digital_port *intel_dig_port = intel_mst->primary;
|
struct intel_digital_port *dig_port = intel_mst->primary;
|
||||||
|
|
||||||
intel_ddi_get_config(&intel_dig_port->base, pipe_config);
|
intel_ddi_get_config(&dig_port->base, pipe_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_dp_mst_get_ddc_modes(struct drm_connector *connector)
|
static int intel_dp_mst_get_ddc_modes(struct drm_connector *connector)
|
||||||
|
@ -732,8 +732,8 @@ static bool intel_dp_mst_get_hw_state(struct intel_connector *connector)
|
||||||
static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *pathprop)
|
static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *pathprop)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr);
|
struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr);
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_device *dev = intel_dig_port->base.base.dev;
|
struct drm_device *dev = dig_port->base.base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
struct intel_connector *intel_connector;
|
struct intel_connector *intel_connector;
|
||||||
struct drm_connector *connector;
|
struct drm_connector *connector;
|
||||||
|
@ -808,11 +808,11 @@ static const struct drm_dp_mst_topology_cbs mst_cbs = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct intel_dp_mst_encoder *
|
static struct intel_dp_mst_encoder *
|
||||||
intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum pipe pipe)
|
intel_dp_create_fake_mst_encoder(struct intel_digital_port *dig_port, enum pipe pipe)
|
||||||
{
|
{
|
||||||
struct intel_dp_mst_encoder *intel_mst;
|
struct intel_dp_mst_encoder *intel_mst;
|
||||||
struct intel_encoder *intel_encoder;
|
struct intel_encoder *intel_encoder;
|
||||||
struct drm_device *dev = intel_dig_port->base.base.dev;
|
struct drm_device *dev = dig_port->base.base.dev;
|
||||||
|
|
||||||
intel_mst = kzalloc(sizeof(*intel_mst), GFP_KERNEL);
|
intel_mst = kzalloc(sizeof(*intel_mst), GFP_KERNEL);
|
||||||
|
|
||||||
|
@ -821,14 +821,14 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum
|
||||||
|
|
||||||
intel_mst->pipe = pipe;
|
intel_mst->pipe = pipe;
|
||||||
intel_encoder = &intel_mst->base;
|
intel_encoder = &intel_mst->base;
|
||||||
intel_mst->primary = intel_dig_port;
|
intel_mst->primary = dig_port;
|
||||||
|
|
||||||
drm_encoder_init(dev, &intel_encoder->base, &intel_dp_mst_enc_funcs,
|
drm_encoder_init(dev, &intel_encoder->base, &intel_dp_mst_enc_funcs,
|
||||||
DRM_MODE_ENCODER_DPMST, "DP-MST %c", pipe_name(pipe));
|
DRM_MODE_ENCODER_DPMST, "DP-MST %c", pipe_name(pipe));
|
||||||
|
|
||||||
intel_encoder->type = INTEL_OUTPUT_DP_MST;
|
intel_encoder->type = INTEL_OUTPUT_DP_MST;
|
||||||
intel_encoder->power_domain = intel_dig_port->base.power_domain;
|
intel_encoder->power_domain = dig_port->base.power_domain;
|
||||||
intel_encoder->port = intel_dig_port->base.port;
|
intel_encoder->port = dig_port->base.port;
|
||||||
intel_encoder->cloneable = 0;
|
intel_encoder->cloneable = 0;
|
||||||
/*
|
/*
|
||||||
* This is wrong, but broken userspace uses the intersection
|
* This is wrong, but broken userspace uses the intersection
|
||||||
|
@ -855,29 +855,29 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *intel_dig_port, enum
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
intel_dp_create_fake_mst_encoders(struct intel_digital_port *intel_dig_port)
|
intel_dp_create_fake_mst_encoders(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
struct drm_i915_private *dev_priv = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
||||||
enum pipe pipe;
|
enum pipe pipe;
|
||||||
|
|
||||||
for_each_pipe(dev_priv, pipe)
|
for_each_pipe(dev_priv, pipe)
|
||||||
intel_dp->mst_encoders[pipe] = intel_dp_create_fake_mst_encoder(intel_dig_port, pipe);
|
intel_dp->mst_encoders[pipe] = intel_dp_create_fake_mst_encoder(dig_port, pipe);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
intel_dp_mst_encoder_active_links(struct intel_digital_port *intel_dig_port)
|
intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
return intel_dig_port->dp.active_mst_links;
|
return dig_port->dp.active_mst_links;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_base_id)
|
intel_dp_mst_encoder_init(struct intel_digital_port *dig_port, int conn_base_id)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!HAS_DP_MST(i915) || intel_dp_is_edp(intel_dp))
|
if (!HAS_DP_MST(i915) || intel_dp_is_edp(intel_dp))
|
||||||
|
@ -892,7 +892,7 @@ intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_ba
|
||||||
intel_dp->mst_mgr.cbs = &mst_cbs;
|
intel_dp->mst_mgr.cbs = &mst_cbs;
|
||||||
|
|
||||||
/* create encoders */
|
/* create encoders */
|
||||||
intel_dp_create_fake_mst_encoders(intel_dig_port);
|
intel_dp_create_fake_mst_encoders(dig_port);
|
||||||
ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, &i915->drm,
|
ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, &i915->drm,
|
||||||
&intel_dp->aux, 16, 3, conn_base_id);
|
&intel_dp->aux, 16, 3, conn_base_id);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -904,9 +904,9 @@ intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_ba
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port)
|
intel_dp_mst_encoder_cleanup(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = &intel_dig_port->dp;
|
struct intel_dp *intel_dp = &dig_port->dp;
|
||||||
|
|
||||||
if (!intel_dp->can_mst)
|
if (!intel_dp->can_mst)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
struct intel_digital_port;
|
struct intel_digital_port;
|
||||||
struct intel_crtc_state;
|
struct intel_crtc_state;
|
||||||
|
|
||||||
int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
|
int intel_dp_mst_encoder_init(struct intel_digital_port *dig_port, int conn_id);
|
||||||
void intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port);
|
void intel_dp_mst_encoder_cleanup(struct intel_digital_port *dig_port);
|
||||||
int intel_dp_mst_encoder_active_links(struct intel_digital_port *intel_dig_port);
|
int intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port);
|
||||||
bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
|
bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
|
||||||
bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
|
bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
|
||||||
|
|
||||||
|
|
|
@ -650,9 +650,9 @@ void chv_set_phy_signal_level(struct intel_encoder *encoder,
|
||||||
bool uniq_trans_scale)
|
bool uniq_trans_scale)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
|
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
|
||||||
enum dpio_channel ch = vlv_dport_to_channel(dport);
|
enum dpio_channel ch = vlv_dig_port_to_channel(dig_port);
|
||||||
enum pipe pipe = intel_crtc->pipe;
|
enum pipe pipe = intel_crtc->pipe;
|
||||||
u32 val;
|
u32 val;
|
||||||
int i;
|
int i;
|
||||||
|
@ -746,7 +746,7 @@ void chv_data_lane_soft_reset(struct intel_encoder *encoder,
|
||||||
bool reset)
|
bool reset)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
enum dpio_channel ch = vlv_dport_to_channel(enc_to_dig_port(encoder));
|
enum dpio_channel ch = vlv_dig_port_to_channel(enc_to_dig_port(encoder));
|
||||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
@ -789,10 +789,10 @@ void chv_data_lane_soft_reset(struct intel_encoder *encoder,
|
||||||
void chv_phy_pre_pll_enable(struct intel_encoder *encoder,
|
void chv_phy_pre_pll_enable(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state)
|
const struct intel_crtc_state *crtc_state)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||||
enum dpio_channel ch = vlv_dport_to_channel(dport);
|
enum dpio_channel ch = vlv_dig_port_to_channel(dig_port);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
unsigned int lane_mask =
|
unsigned int lane_mask =
|
||||||
intel_dp_unused_lane_mask(crtc_state->lane_count);
|
intel_dp_unused_lane_mask(crtc_state->lane_count);
|
||||||
|
@ -803,7 +803,7 @@ void chv_phy_pre_pll_enable(struct intel_encoder *encoder,
|
||||||
* Otherwise we can't even access the PLL.
|
* Otherwise we can't even access the PLL.
|
||||||
*/
|
*/
|
||||||
if (ch == DPIO_CH0 && pipe == PIPE_B)
|
if (ch == DPIO_CH0 && pipe == PIPE_B)
|
||||||
dport->release_cl2_override =
|
dig_port->release_cl2_override =
|
||||||
!chv_phy_powergate_ch(dev_priv, DPIO_PHY0, DPIO_CH1, true);
|
!chv_phy_powergate_ch(dev_priv, DPIO_PHY0, DPIO_CH1, true);
|
||||||
|
|
||||||
chv_phy_powergate_lanes(encoder, true, lane_mask);
|
chv_phy_powergate_lanes(encoder, true, lane_mask);
|
||||||
|
@ -870,10 +870,10 @@ void chv_phy_pre_encoder_enable(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state)
|
const struct intel_crtc_state *crtc_state)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||||
struct intel_digital_port *dport = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||||
enum dpio_channel ch = vlv_dport_to_channel(dport);
|
enum dpio_channel ch = vlv_dig_port_to_channel(dig_port);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
int data, i, stagger;
|
int data, i, stagger;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
@ -948,12 +948,12 @@ void chv_phy_pre_encoder_enable(struct intel_encoder *encoder,
|
||||||
|
|
||||||
void chv_phy_release_cl2_override(struct intel_encoder *encoder)
|
void chv_phy_release_cl2_override(struct intel_encoder *encoder)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
|
|
||||||
if (dport->release_cl2_override) {
|
if (dig_port->release_cl2_override) {
|
||||||
chv_phy_powergate_ch(dev_priv, DPIO_PHY0, DPIO_CH1, false);
|
chv_phy_powergate_ch(dev_priv, DPIO_PHY0, DPIO_CH1, false);
|
||||||
dport->release_cl2_override = false;
|
dig_port->release_cl2_override = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -997,8 +997,8 @@ void vlv_set_phy_signal_level(struct intel_encoder *encoder,
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
|
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
enum dpio_channel port = vlv_dport_to_channel(dport);
|
enum dpio_channel port = vlv_dig_port_to_channel(dig_port);
|
||||||
enum pipe pipe = intel_crtc->pipe;
|
enum pipe pipe = intel_crtc->pipe;
|
||||||
|
|
||||||
vlv_dpio_get(dev_priv);
|
vlv_dpio_get(dev_priv);
|
||||||
|
@ -1022,10 +1022,10 @@ void vlv_set_phy_signal_level(struct intel_encoder *encoder,
|
||||||
void vlv_phy_pre_pll_enable(struct intel_encoder *encoder,
|
void vlv_phy_pre_pll_enable(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state)
|
const struct intel_crtc_state *crtc_state)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||||
enum dpio_channel port = vlv_dport_to_channel(dport);
|
enum dpio_channel port = vlv_dig_port_to_channel(dig_port);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
|
|
||||||
/* Program Tx lane resets to default */
|
/* Program Tx lane resets to default */
|
||||||
|
@ -1052,10 +1052,10 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state)
|
const struct intel_crtc_state *crtc_state)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||||
struct intel_digital_port *dport = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||||
enum dpio_channel port = vlv_dport_to_channel(dport);
|
enum dpio_channel port = vlv_dig_port_to_channel(dig_port);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
|
@ -1081,10 +1081,10 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder,
|
||||||
void vlv_phy_reset_lanes(struct intel_encoder *encoder,
|
void vlv_phy_reset_lanes(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *old_crtc_state)
|
const struct intel_crtc_state *old_crtc_state)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
|
||||||
enum dpio_channel port = vlv_dport_to_channel(dport);
|
enum dpio_channel port = vlv_dig_port_to_channel(dig_port);
|
||||||
enum pipe pipe = crtc->pipe;
|
enum pipe pipe = crtc->pipe;
|
||||||
|
|
||||||
vlv_dpio_get(dev_priv);
|
vlv_dpio_get(dev_priv);
|
||||||
|
|
|
@ -40,15 +40,15 @@ bool intel_hdcp_is_ksv_valid(u8 *ksv)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdcp_read_valid_bksv(struct intel_digital_port *intel_dig_port,
|
int intel_hdcp_read_valid_bksv(struct intel_digital_port *dig_port,
|
||||||
const struct intel_hdcp_shim *shim, u8 *bksv)
|
const struct intel_hdcp_shim *shim, u8 *bksv)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
int ret, i, tries = 2;
|
int ret, i, tries = 2;
|
||||||
|
|
||||||
/* HDCP spec states that we must retry the bksv if it is invalid */
|
/* HDCP spec states that we must retry the bksv if it is invalid */
|
||||||
for (i = 0; i < tries; i++) {
|
for (i = 0; i < tries; i++) {
|
||||||
ret = shim->read_bksv(intel_dig_port, bksv);
|
ret = shim->read_bksv(dig_port, bksv);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (intel_hdcp_is_ksv_valid(bksv))
|
if (intel_hdcp_is_ksv_valid(bksv))
|
||||||
|
@ -65,7 +65,7 @@ int intel_hdcp_read_valid_bksv(struct intel_digital_port *intel_dig_port,
|
||||||
/* Is HDCP1.4 capable on Platform and Sink */
|
/* Is HDCP1.4 capable on Platform and Sink */
|
||||||
bool intel_hdcp_capable(struct intel_connector *connector)
|
bool intel_hdcp_capable(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
const struct intel_hdcp_shim *shim = connector->hdcp.shim;
|
const struct intel_hdcp_shim *shim = connector->hdcp.shim;
|
||||||
bool capable = false;
|
bool capable = false;
|
||||||
u8 bksv[5];
|
u8 bksv[5];
|
||||||
|
@ -74,9 +74,9 @@ bool intel_hdcp_capable(struct intel_connector *connector)
|
||||||
return capable;
|
return capable;
|
||||||
|
|
||||||
if (shim->hdcp_capable) {
|
if (shim->hdcp_capable) {
|
||||||
shim->hdcp_capable(intel_dig_port, &capable);
|
shim->hdcp_capable(dig_port, &capable);
|
||||||
} else {
|
} else {
|
||||||
if (!intel_hdcp_read_valid_bksv(intel_dig_port, shim, bksv))
|
if (!intel_hdcp_read_valid_bksv(dig_port, shim, bksv))
|
||||||
capable = true;
|
capable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ bool intel_hdcp_capable(struct intel_connector *connector)
|
||||||
/* Is HDCP2.2 capable on Platform and Sink */
|
/* Is HDCP2.2 capable on Platform and Sink */
|
||||||
bool intel_hdcp2_capable(struct intel_connector *connector)
|
bool intel_hdcp2_capable(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
bool capable = false;
|
bool capable = false;
|
||||||
|
@ -104,7 +104,7 @@ bool intel_hdcp2_capable(struct intel_connector *connector)
|
||||||
mutex_unlock(&dev_priv->hdcp_comp_mutex);
|
mutex_unlock(&dev_priv->hdcp_comp_mutex);
|
||||||
|
|
||||||
/* Sink's capability for HDCP2.2 */
|
/* Sink's capability for HDCP2.2 */
|
||||||
hdcp->shim->hdcp_2_2_capable(intel_dig_port, &capable);
|
hdcp->shim->hdcp_2_2_capable(dig_port, &capable);
|
||||||
|
|
||||||
return capable;
|
return capable;
|
||||||
}
|
}
|
||||||
|
@ -125,14 +125,14 @@ static bool intel_hdcp2_in_use(struct drm_i915_private *dev_priv,
|
||||||
LINK_ENCRYPTION_STATUS;
|
LINK_ENCRYPTION_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *intel_dig_port,
|
static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *dig_port,
|
||||||
const struct intel_hdcp_shim *shim)
|
const struct intel_hdcp_shim *shim)
|
||||||
{
|
{
|
||||||
int ret, read_ret;
|
int ret, read_ret;
|
||||||
bool ksv_ready;
|
bool ksv_ready;
|
||||||
|
|
||||||
/* Poll for ksv list ready (spec says max time allowed is 5s) */
|
/* Poll for ksv list ready (spec says max time allowed is 5s) */
|
||||||
ret = __wait_for(read_ret = shim->read_ksv_ready(intel_dig_port,
|
ret = __wait_for(read_ret = shim->read_ksv_ready(dig_port,
|
||||||
&ksv_ready),
|
&ksv_ready),
|
||||||
read_ret || ksv_ready, 5 * 1000 * 1000, 1000,
|
read_ret || ksv_ready, 5 * 1000 * 1000, 1000,
|
||||||
100 * 1000);
|
100 * 1000);
|
||||||
|
@ -300,16 +300,16 @@ int intel_hdcp_validate_v_prime(struct intel_connector *connector,
|
||||||
const struct intel_hdcp_shim *shim,
|
const struct intel_hdcp_shim *shim,
|
||||||
u8 *ksv_fifo, u8 num_downstream, u8 *bstatus)
|
u8 *ksv_fifo, u8 num_downstream, u8 *bstatus)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
|
enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
u32 vprime, sha_text, sha_leftovers, rep_ctl;
|
u32 vprime, sha_text, sha_leftovers, rep_ctl;
|
||||||
int ret, i, j, sha_idx;
|
int ret, i, j, sha_idx;
|
||||||
|
|
||||||
/* Process V' values from the receiver */
|
/* Process V' values from the receiver */
|
||||||
for (i = 0; i < DRM_HDCP_V_PRIME_NUM_PARTS; i++) {
|
for (i = 0; i < DRM_HDCP_V_PRIME_NUM_PARTS; i++) {
|
||||||
ret = shim->read_v_prime_part(intel_dig_port, i, &vprime);
|
ret = shim->read_v_prime_part(dig_port, i, &vprime);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
intel_de_write(dev_priv, HDCP_SHA_V_PRIME(i), vprime);
|
intel_de_write(dev_priv, HDCP_SHA_V_PRIME(i), vprime);
|
||||||
|
@ -528,20 +528,20 @@ int intel_hdcp_validate_v_prime(struct intel_connector *connector,
|
||||||
static
|
static
|
||||||
int intel_hdcp_auth_downstream(struct intel_connector *connector)
|
int intel_hdcp_auth_downstream(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
const struct intel_hdcp_shim *shim = connector->hdcp.shim;
|
const struct intel_hdcp_shim *shim = connector->hdcp.shim;
|
||||||
u8 bstatus[2], num_downstream, *ksv_fifo;
|
u8 bstatus[2], num_downstream, *ksv_fifo;
|
||||||
int ret, i, tries = 3;
|
int ret, i, tries = 3;
|
||||||
|
|
||||||
ret = intel_hdcp_poll_ksv_fifo(intel_dig_port, shim);
|
ret = intel_hdcp_poll_ksv_fifo(dig_port, shim);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_dbg_kms(&dev_priv->drm,
|
drm_dbg_kms(&dev_priv->drm,
|
||||||
"KSV list failed to become ready (%d)\n", ret);
|
"KSV list failed to become ready (%d)\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = shim->read_bstatus(intel_dig_port, bstatus);
|
ret = shim->read_bstatus(dig_port, bstatus);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ int intel_hdcp_auth_downstream(struct intel_connector *connector)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = shim->read_ksv_fifo(intel_dig_port, num_downstream, ksv_fifo);
|
ret = shim->read_ksv_fifo(dig_port, num_downstream, ksv_fifo);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -611,12 +611,12 @@ int intel_hdcp_auth_downstream(struct intel_connector *connector)
|
||||||
/* Implements Part 1 of the HDCP authorization procedure */
|
/* Implements Part 1 of the HDCP authorization procedure */
|
||||||
static int intel_hdcp_auth(struct intel_connector *connector)
|
static int intel_hdcp_auth(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
const struct intel_hdcp_shim *shim = hdcp->shim;
|
const struct intel_hdcp_shim *shim = hdcp->shim;
|
||||||
enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
|
enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
unsigned long r0_prime_gen_start;
|
unsigned long r0_prime_gen_start;
|
||||||
int ret, i, tries = 2;
|
int ret, i, tries = 2;
|
||||||
union {
|
union {
|
||||||
|
@ -640,7 +640,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)
|
||||||
* displays, this is not necessary.
|
* displays, this is not necessary.
|
||||||
*/
|
*/
|
||||||
if (shim->hdcp_capable) {
|
if (shim->hdcp_capable) {
|
||||||
ret = shim->hdcp_capable(intel_dig_port, &hdcp_capable);
|
ret = shim->hdcp_capable(dig_port, &hdcp_capable);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (!hdcp_capable) {
|
if (!hdcp_capable) {
|
||||||
|
@ -670,7 +670,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)
|
||||||
HDCP_ANLO(dev_priv, cpu_transcoder, port));
|
HDCP_ANLO(dev_priv, cpu_transcoder, port));
|
||||||
an.reg[1] = intel_de_read(dev_priv,
|
an.reg[1] = intel_de_read(dev_priv,
|
||||||
HDCP_ANHI(dev_priv, cpu_transcoder, port));
|
HDCP_ANHI(dev_priv, cpu_transcoder, port));
|
||||||
ret = shim->write_an_aksv(intel_dig_port, an.shim);
|
ret = shim->write_an_aksv(dig_port, an.shim);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -678,7 +678,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)
|
||||||
|
|
||||||
memset(&bksv, 0, sizeof(bksv));
|
memset(&bksv, 0, sizeof(bksv));
|
||||||
|
|
||||||
ret = intel_hdcp_read_valid_bksv(intel_dig_port, shim, bksv.shim);
|
ret = intel_hdcp_read_valid_bksv(dig_port, shim, bksv.shim);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -692,14 +692,14 @@ static int intel_hdcp_auth(struct intel_connector *connector)
|
||||||
intel_de_write(dev_priv, HDCP_BKSVHI(dev_priv, cpu_transcoder, port),
|
intel_de_write(dev_priv, HDCP_BKSVHI(dev_priv, cpu_transcoder, port),
|
||||||
bksv.reg[1]);
|
bksv.reg[1]);
|
||||||
|
|
||||||
ret = shim->repeater_present(intel_dig_port, &repeater_present);
|
ret = shim->repeater_present(dig_port, &repeater_present);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (repeater_present)
|
if (repeater_present)
|
||||||
intel_de_write(dev_priv, HDCP_REP_CTL,
|
intel_de_write(dev_priv, HDCP_REP_CTL,
|
||||||
intel_hdcp_get_repeater_ctl(dev_priv, cpu_transcoder, port));
|
intel_hdcp_get_repeater_ctl(dev_priv, cpu_transcoder, port));
|
||||||
|
|
||||||
ret = shim->toggle_signalling(intel_dig_port, true);
|
ret = shim->toggle_signalling(dig_port, true);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -732,7 +732,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < tries; i++) {
|
for (i = 0; i < tries; i++) {
|
||||||
ri.reg = 0;
|
ri.reg = 0;
|
||||||
ret = shim->read_ri_prime(intel_dig_port, ri.shim);
|
ret = shim->read_ri_prime(dig_port, ri.shim);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
intel_de_write(dev_priv,
|
intel_de_write(dev_priv,
|
||||||
|
@ -776,10 +776,10 @@ static int intel_hdcp_auth(struct intel_connector *connector)
|
||||||
|
|
||||||
static int _intel_hdcp_disable(struct intel_connector *connector)
|
static int _intel_hdcp_disable(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -796,7 +796,7 @@ static int _intel_hdcp_disable(struct intel_connector *connector)
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = hdcp->shim->toggle_signalling(intel_dig_port, false);
|
ret = hdcp->shim->toggle_signalling(dig_port, false);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(&dev_priv->drm, "Failed to disable HDCP signalling\n");
|
drm_err(&dev_priv->drm, "Failed to disable HDCP signalling\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -859,10 +859,10 @@ static struct intel_connector *intel_hdcp_to_connector(struct intel_hdcp *hdcp)
|
||||||
/* Implements Part 3 of the HDCP authorization procedure */
|
/* Implements Part 3 of the HDCP authorization procedure */
|
||||||
static int intel_hdcp_check_link(struct intel_connector *connector)
|
static int intel_hdcp_check_link(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
enum transcoder cpu_transcoder;
|
enum transcoder cpu_transcoder;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
@ -888,7 +888,7 @@ static int intel_hdcp_check_link(struct intel_connector *connector)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hdcp->shim->check_link(intel_dig_port)) {
|
if (hdcp->shim->check_link(dig_port)) {
|
||||||
if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
|
if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
|
||||||
hdcp->value = DRM_MODE_CONTENT_PROTECTION_ENABLED;
|
hdcp->value = DRM_MODE_CONTENT_PROTECTION_ENABLED;
|
||||||
schedule_work(&hdcp->prop_work);
|
schedule_work(&hdcp->prop_work);
|
||||||
|
@ -1242,7 +1242,7 @@ static int hdcp2_deauthenticate_port(struct intel_connector *connector)
|
||||||
/* Authentication flow starts from here */
|
/* Authentication flow starts from here */
|
||||||
static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
|
static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
union {
|
union {
|
||||||
|
@ -1264,12 +1264,12 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = shim->write_2_2_msg(intel_dig_port, &msgs.ake_init,
|
ret = shim->write_2_2_msg(dig_port, &msgs.ake_init,
|
||||||
sizeof(msgs.ake_init));
|
sizeof(msgs.ake_init));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = shim->read_2_2_msg(intel_dig_port, HDCP_2_2_AKE_SEND_CERT,
|
ret = shim->read_2_2_msg(dig_port, HDCP_2_2_AKE_SEND_CERT,
|
||||||
&msgs.send_cert, sizeof(msgs.send_cert));
|
&msgs.send_cert, sizeof(msgs.send_cert));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1298,11 +1298,11 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = shim->write_2_2_msg(intel_dig_port, &msgs.no_stored_km, size);
|
ret = shim->write_2_2_msg(dig_port, &msgs.no_stored_km, size);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = shim->read_2_2_msg(intel_dig_port, HDCP_2_2_AKE_SEND_HPRIME,
|
ret = shim->read_2_2_msg(dig_port, HDCP_2_2_AKE_SEND_HPRIME,
|
||||||
&msgs.send_hprime, sizeof(msgs.send_hprime));
|
&msgs.send_hprime, sizeof(msgs.send_hprime));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1313,7 +1313,7 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
|
||||||
|
|
||||||
if (!hdcp->is_paired) {
|
if (!hdcp->is_paired) {
|
||||||
/* Pairing is required */
|
/* Pairing is required */
|
||||||
ret = shim->read_2_2_msg(intel_dig_port,
|
ret = shim->read_2_2_msg(dig_port,
|
||||||
HDCP_2_2_AKE_SEND_PAIRING_INFO,
|
HDCP_2_2_AKE_SEND_PAIRING_INFO,
|
||||||
&msgs.pairing_info,
|
&msgs.pairing_info,
|
||||||
sizeof(msgs.pairing_info));
|
sizeof(msgs.pairing_info));
|
||||||
|
@ -1331,7 +1331,7 @@ static int hdcp2_authentication_key_exchange(struct intel_connector *connector)
|
||||||
|
|
||||||
static int hdcp2_locality_check(struct intel_connector *connector)
|
static int hdcp2_locality_check(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
union {
|
union {
|
||||||
struct hdcp2_lc_init lc_init;
|
struct hdcp2_lc_init lc_init;
|
||||||
|
@ -1345,12 +1345,12 @@ static int hdcp2_locality_check(struct intel_connector *connector)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = shim->write_2_2_msg(intel_dig_port, &msgs.lc_init,
|
ret = shim->write_2_2_msg(dig_port, &msgs.lc_init,
|
||||||
sizeof(msgs.lc_init));
|
sizeof(msgs.lc_init));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = shim->read_2_2_msg(intel_dig_port,
|
ret = shim->read_2_2_msg(dig_port,
|
||||||
HDCP_2_2_LC_SEND_LPRIME,
|
HDCP_2_2_LC_SEND_LPRIME,
|
||||||
&msgs.send_lprime,
|
&msgs.send_lprime,
|
||||||
sizeof(msgs.send_lprime));
|
sizeof(msgs.send_lprime));
|
||||||
|
@ -1367,7 +1367,7 @@ static int hdcp2_locality_check(struct intel_connector *connector)
|
||||||
|
|
||||||
static int hdcp2_session_key_exchange(struct intel_connector *connector)
|
static int hdcp2_session_key_exchange(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
struct hdcp2_ske_send_eks send_eks;
|
struct hdcp2_ske_send_eks send_eks;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -1376,7 +1376,7 @@ static int hdcp2_session_key_exchange(struct intel_connector *connector)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = hdcp->shim->write_2_2_msg(intel_dig_port, &send_eks,
|
ret = hdcp->shim->write_2_2_msg(dig_port, &send_eks,
|
||||||
sizeof(send_eks));
|
sizeof(send_eks));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1387,7 +1387,7 @@ static int hdcp2_session_key_exchange(struct intel_connector *connector)
|
||||||
static
|
static
|
||||||
int hdcp2_propagate_stream_management_info(struct intel_connector *connector)
|
int hdcp2_propagate_stream_management_info(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
union {
|
union {
|
||||||
|
@ -1409,12 +1409,12 @@ int hdcp2_propagate_stream_management_info(struct intel_connector *connector)
|
||||||
msgs.stream_manage.streams[0].stream_type = hdcp->content_type;
|
msgs.stream_manage.streams[0].stream_type = hdcp->content_type;
|
||||||
|
|
||||||
/* Send it to Repeater */
|
/* Send it to Repeater */
|
||||||
ret = shim->write_2_2_msg(intel_dig_port, &msgs.stream_manage,
|
ret = shim->write_2_2_msg(dig_port, &msgs.stream_manage,
|
||||||
sizeof(msgs.stream_manage));
|
sizeof(msgs.stream_manage));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = shim->read_2_2_msg(intel_dig_port, HDCP_2_2_REP_STREAM_READY,
|
ret = shim->read_2_2_msg(dig_port, HDCP_2_2_REP_STREAM_READY,
|
||||||
&msgs.stream_ready, sizeof(msgs.stream_ready));
|
&msgs.stream_ready, sizeof(msgs.stream_ready));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1439,7 +1439,7 @@ int hdcp2_propagate_stream_management_info(struct intel_connector *connector)
|
||||||
static
|
static
|
||||||
int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
|
int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
union {
|
union {
|
||||||
|
@ -1451,7 +1451,7 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
|
||||||
u8 *rx_info;
|
u8 *rx_info;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = shim->read_2_2_msg(intel_dig_port, HDCP_2_2_REP_SEND_RECVID_LIST,
|
ret = shim->read_2_2_msg(dig_port, HDCP_2_2_REP_SEND_RECVID_LIST,
|
||||||
&msgs.recvid_list, sizeof(msgs.recvid_list));
|
&msgs.recvid_list, sizeof(msgs.recvid_list));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1496,7 +1496,7 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
hdcp->seq_num_v = seq_num_v;
|
hdcp->seq_num_v = seq_num_v;
|
||||||
ret = shim->write_2_2_msg(intel_dig_port, &msgs.rep_ack,
|
ret = shim->write_2_2_msg(dig_port, &msgs.rep_ack,
|
||||||
sizeof(msgs.rep_ack));
|
sizeof(msgs.rep_ack));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1517,7 +1517,7 @@ static int hdcp2_authenticate_repeater(struct intel_connector *connector)
|
||||||
|
|
||||||
static int hdcp2_authenticate_sink(struct intel_connector *connector)
|
static int hdcp2_authenticate_sink(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
const struct intel_hdcp_shim *shim = hdcp->shim;
|
const struct intel_hdcp_shim *shim = hdcp->shim;
|
||||||
|
@ -1543,7 +1543,7 @@ static int hdcp2_authenticate_sink(struct intel_connector *connector)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shim->config_stream_type) {
|
if (shim->config_stream_type) {
|
||||||
ret = shim->config_stream_type(intel_dig_port,
|
ret = shim->config_stream_type(dig_port,
|
||||||
hdcp->is_repeater,
|
hdcp->is_repeater,
|
||||||
hdcp->content_type);
|
hdcp->content_type);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -1569,10 +1569,10 @@ static int hdcp2_authenticate_sink(struct intel_connector *connector)
|
||||||
|
|
||||||
static int hdcp2_enable_encryption(struct intel_connector *connector)
|
static int hdcp2_enable_encryption(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -1580,7 +1580,7 @@ static int hdcp2_enable_encryption(struct intel_connector *connector)
|
||||||
intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)) &
|
intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)) &
|
||||||
LINK_ENCRYPTION_STATUS);
|
LINK_ENCRYPTION_STATUS);
|
||||||
if (hdcp->shim->toggle_signalling) {
|
if (hdcp->shim->toggle_signalling) {
|
||||||
ret = hdcp->shim->toggle_signalling(intel_dig_port, true);
|
ret = hdcp->shim->toggle_signalling(dig_port, true);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(&dev_priv->drm,
|
drm_err(&dev_priv->drm,
|
||||||
"Failed to enable HDCP signalling. %d\n",
|
"Failed to enable HDCP signalling. %d\n",
|
||||||
|
@ -1608,10 +1608,10 @@ static int hdcp2_enable_encryption(struct intel_connector *connector)
|
||||||
|
|
||||||
static int hdcp2_disable_encryption(struct intel_connector *connector)
|
static int hdcp2_disable_encryption(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
enum transcoder cpu_transcoder = hdcp->cpu_transcoder;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -1630,7 +1630,7 @@ static int hdcp2_disable_encryption(struct intel_connector *connector)
|
||||||
drm_dbg_kms(&dev_priv->drm, "Disable Encryption Timedout");
|
drm_dbg_kms(&dev_priv->drm, "Disable Encryption Timedout");
|
||||||
|
|
||||||
if (hdcp->shim->toggle_signalling) {
|
if (hdcp->shim->toggle_signalling) {
|
||||||
ret = hdcp->shim->toggle_signalling(intel_dig_port, false);
|
ret = hdcp->shim->toggle_signalling(dig_port, false);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(&dev_priv->drm,
|
drm_err(&dev_priv->drm,
|
||||||
"Failed to disable HDCP signalling. %d\n",
|
"Failed to disable HDCP signalling. %d\n",
|
||||||
|
@ -1723,10 +1723,10 @@ static int _intel_hdcp2_disable(struct intel_connector *connector)
|
||||||
/* Implements the Link Integrity Check for HDCP2.2 */
|
/* Implements the Link Integrity Check for HDCP2.2 */
|
||||||
static int intel_hdcp2_check_link(struct intel_connector *connector)
|
static int intel_hdcp2_check_link(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_hdcp *hdcp = &connector->hdcp;
|
struct intel_hdcp *hdcp = &connector->hdcp;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
enum transcoder cpu_transcoder;
|
enum transcoder cpu_transcoder;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
@ -1751,7 +1751,7 @@ static int intel_hdcp2_check_link(struct intel_connector *connector)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = hdcp->shim->check_2_2_link(intel_dig_port);
|
ret = hdcp->shim->check_2_2_link(dig_port);
|
||||||
if (ret == HDCP_LINK_PROTECTED) {
|
if (ret == HDCP_LINK_PROTECTED) {
|
||||||
if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
|
if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
|
||||||
hdcp->value = DRM_MODE_CONTENT_PROTECTION_ENABLED;
|
hdcp->value = DRM_MODE_CONTENT_PROTECTION_ENABLED;
|
||||||
|
|
|
@ -88,10 +88,10 @@ assert_hdmi_transcoder_func_disabled(struct drm_i915_private *dev_priv,
|
||||||
|
|
||||||
struct intel_hdmi *enc_to_intel_hdmi(struct intel_encoder *encoder)
|
struct intel_hdmi *enc_to_intel_hdmi(struct intel_encoder *encoder)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port =
|
struct intel_digital_port *dig_port =
|
||||||
container_of(&encoder->base, struct intel_digital_port,
|
container_of(&encoder->base, struct intel_digital_port,
|
||||||
base.base);
|
base.base);
|
||||||
return &intel_dig_port->hdmi;
|
return &dig_port->hdmi;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct intel_hdmi *intel_attached_hdmi(struct intel_connector *connector)
|
static struct intel_hdmi *intel_attached_hdmi(struct intel_connector *connector)
|
||||||
|
@ -660,7 +660,7 @@ static void intel_write_infoframe(struct intel_encoder *encoder,
|
||||||
enum hdmi_infoframe_type type,
|
enum hdmi_infoframe_type type,
|
||||||
const union hdmi_infoframe *frame)
|
const union hdmi_infoframe *frame)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
u8 buffer[VIDEO_DIP_DATA_SIZE];
|
u8 buffer[VIDEO_DIP_DATA_SIZE];
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ static void intel_write_infoframe(struct intel_encoder *encoder,
|
||||||
buffer[3] = 0;
|
buffer[3] = 0;
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
intel_dig_port->write_infoframe(encoder, crtc_state, type, buffer, len);
|
dig_port->write_infoframe(encoder, crtc_state, type, buffer, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_read_infoframe(struct intel_encoder *encoder,
|
void intel_read_infoframe(struct intel_encoder *encoder,
|
||||||
|
@ -689,7 +689,7 @@ void intel_read_infoframe(struct intel_encoder *encoder,
|
||||||
enum hdmi_infoframe_type type,
|
enum hdmi_infoframe_type type,
|
||||||
union hdmi_infoframe *frame)
|
union hdmi_infoframe *frame)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
u8 buffer[VIDEO_DIP_DATA_SIZE];
|
u8 buffer[VIDEO_DIP_DATA_SIZE];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ void intel_read_infoframe(struct intel_encoder *encoder,
|
||||||
intel_hdmi_infoframe_enable(type)) == 0)
|
intel_hdmi_infoframe_enable(type)) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_dig_port->read_infoframe(encoder, crtc_state,
|
dig_port->read_infoframe(encoder, crtc_state,
|
||||||
type, buffer, sizeof(buffer));
|
type, buffer, sizeof(buffer));
|
||||||
|
|
||||||
/* Fill the 'hole' (see big comment above) at position 3 */
|
/* Fill the 'hole' (see big comment above) at position 3 */
|
||||||
|
@ -872,8 +872,8 @@ static void g4x_set_infoframes(struct intel_encoder *encoder,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *intel_hdmi = &dig_port->hdmi;
|
||||||
i915_reg_t reg = VIDEO_DIP_CTL;
|
i915_reg_t reg = VIDEO_DIP_CTL;
|
||||||
u32 val = intel_de_read(dev_priv, reg);
|
u32 val = intel_de_read(dev_priv, reg);
|
||||||
u32 port = VIDEO_DIP_PORT(encoder->port);
|
u32 port = VIDEO_DIP_PORT(encoder->port);
|
||||||
|
@ -1057,8 +1057,8 @@ static void ibx_set_infoframes(struct intel_encoder *encoder,
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||||
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *intel_hdmi = &dig_port->hdmi;
|
||||||
i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
|
i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
|
||||||
u32 val = intel_de_read(dev_priv, reg);
|
u32 val = intel_de_read(dev_priv, reg);
|
||||||
u32 port = VIDEO_DIP_PORT(encoder->port);
|
u32 port = VIDEO_DIP_PORT(encoder->port);
|
||||||
|
@ -1275,11 +1275,11 @@ void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
|
||||||
adapter, enable);
|
adapter, enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_hdmi_hdcp_read(struct intel_digital_port *intel_dig_port,
|
static int intel_hdmi_hdcp_read(struct intel_digital_port *dig_port,
|
||||||
unsigned int offset, void *buffer, size_t size)
|
unsigned int offset, void *buffer, size_t size)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_hdmi *hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *hdmi = &dig_port->hdmi;
|
||||||
struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915,
|
struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915,
|
||||||
hdmi->ddc_bus);
|
hdmi->ddc_bus);
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -1304,11 +1304,11 @@ static int intel_hdmi_hdcp_read(struct intel_digital_port *intel_dig_port,
|
||||||
return ret >= 0 ? -EIO : ret;
|
return ret >= 0 ? -EIO : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_hdmi_hdcp_write(struct intel_digital_port *intel_dig_port,
|
static int intel_hdmi_hdcp_write(struct intel_digital_port *dig_port,
|
||||||
unsigned int offset, void *buffer, size_t size)
|
unsigned int offset, void *buffer, size_t size)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_hdmi *hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *hdmi = &dig_port->hdmi;
|
||||||
struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915,
|
struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915,
|
||||||
hdmi->ddc_bus);
|
hdmi->ddc_bus);
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -1338,16 +1338,16 @@ static int intel_hdmi_hdcp_write(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_write_an_aksv(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_write_an_aksv(struct intel_digital_port *dig_port,
|
||||||
u8 *an)
|
u8 *an)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_hdmi *hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *hdmi = &dig_port->hdmi;
|
||||||
struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915,
|
struct i2c_adapter *adapter = intel_gmbus_get_adapter(i915,
|
||||||
hdmi->ddc_bus);
|
hdmi->ddc_bus);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp_write(intel_dig_port, DRM_HDCP_DDC_AN, an,
|
ret = intel_hdmi_hdcp_write(dig_port, DRM_HDCP_DDC_AN, an,
|
||||||
DRM_HDCP_AN_LEN);
|
DRM_HDCP_AN_LEN);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_dbg_kms(&i915->drm, "Write An over DDC failed (%d)\n",
|
drm_dbg_kms(&i915->drm, "Write An over DDC failed (%d)\n",
|
||||||
|
@ -1363,13 +1363,13 @@ int intel_hdmi_hdcp_write_an_aksv(struct intel_digital_port *intel_dig_port,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_hdmi_hdcp_read_bksv(struct intel_digital_port *intel_dig_port,
|
static int intel_hdmi_hdcp_read_bksv(struct intel_digital_port *dig_port,
|
||||||
u8 *bksv)
|
u8 *bksv)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, DRM_HDCP_DDC_BKSV, bksv,
|
ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_BKSV, bksv,
|
||||||
DRM_HDCP_KSV_LEN);
|
DRM_HDCP_KSV_LEN);
|
||||||
if (ret)
|
if (ret)
|
||||||
drm_dbg_kms(&i915->drm, "Read Bksv over DDC failed (%d)\n",
|
drm_dbg_kms(&i915->drm, "Read Bksv over DDC failed (%d)\n",
|
||||||
|
@ -1378,13 +1378,13 @@ static int intel_hdmi_hdcp_read_bksv(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_read_bstatus(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_read_bstatus(struct intel_digital_port *dig_port,
|
||||||
u8 *bstatus)
|
u8 *bstatus)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, DRM_HDCP_DDC_BSTATUS,
|
ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_BSTATUS,
|
||||||
bstatus, DRM_HDCP_BSTATUS_LEN);
|
bstatus, DRM_HDCP_BSTATUS_LEN);
|
||||||
if (ret)
|
if (ret)
|
||||||
drm_dbg_kms(&i915->drm, "Read bstatus over DDC failed (%d)\n",
|
drm_dbg_kms(&i915->drm, "Read bstatus over DDC failed (%d)\n",
|
||||||
|
@ -1393,14 +1393,14 @@ int intel_hdmi_hdcp_read_bstatus(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_repeater_present(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_repeater_present(struct intel_digital_port *dig_port,
|
||||||
bool *repeater_present)
|
bool *repeater_present)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
int ret;
|
int ret;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, DRM_HDCP_DDC_BCAPS, &val, 1);
|
ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_BCAPS, &val, 1);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_dbg_kms(&i915->drm, "Read bcaps over DDC failed (%d)\n",
|
drm_dbg_kms(&i915->drm, "Read bcaps over DDC failed (%d)\n",
|
||||||
ret);
|
ret);
|
||||||
|
@ -1411,13 +1411,13 @@ int intel_hdmi_hdcp_repeater_present(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_read_ri_prime(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_read_ri_prime(struct intel_digital_port *dig_port,
|
||||||
u8 *ri_prime)
|
u8 *ri_prime)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, DRM_HDCP_DDC_RI_PRIME,
|
ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_RI_PRIME,
|
||||||
ri_prime, DRM_HDCP_RI_LEN);
|
ri_prime, DRM_HDCP_RI_LEN);
|
||||||
if (ret)
|
if (ret)
|
||||||
drm_dbg_kms(&i915->drm, "Read Ri' over DDC failed (%d)\n",
|
drm_dbg_kms(&i915->drm, "Read Ri' over DDC failed (%d)\n",
|
||||||
|
@ -1426,14 +1426,14 @@ int intel_hdmi_hdcp_read_ri_prime(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_read_ksv_ready(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_read_ksv_ready(struct intel_digital_port *dig_port,
|
||||||
bool *ksv_ready)
|
bool *ksv_ready)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
int ret;
|
int ret;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, DRM_HDCP_DDC_BCAPS, &val, 1);
|
ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_BCAPS, &val, 1);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_dbg_kms(&i915->drm, "Read bcaps over DDC failed (%d)\n",
|
drm_dbg_kms(&i915->drm, "Read bcaps over DDC failed (%d)\n",
|
||||||
ret);
|
ret);
|
||||||
|
@ -1444,12 +1444,12 @@ int intel_hdmi_hdcp_read_ksv_ready(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_read_ksv_fifo(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_read_ksv_fifo(struct intel_digital_port *dig_port,
|
||||||
int num_downstream, u8 *ksv_fifo)
|
int num_downstream, u8 *ksv_fifo)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
int ret;
|
int ret;
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, DRM_HDCP_DDC_KSV_FIFO,
|
ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_KSV_FIFO,
|
||||||
ksv_fifo, num_downstream * DRM_HDCP_KSV_LEN);
|
ksv_fifo, num_downstream * DRM_HDCP_KSV_LEN);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_dbg_kms(&i915->drm,
|
drm_dbg_kms(&i915->drm,
|
||||||
|
@ -1460,16 +1460,16 @@ int intel_hdmi_hdcp_read_ksv_fifo(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_read_v_prime_part(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_read_v_prime_part(struct intel_digital_port *dig_port,
|
||||||
int i, u32 *part)
|
int i, u32 *part)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (i >= DRM_HDCP_V_PRIME_NUM_PARTS)
|
if (i >= DRM_HDCP_V_PRIME_NUM_PARTS)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, DRM_HDCP_DDC_V_PRIME(i),
|
ret = intel_hdmi_hdcp_read(dig_port, DRM_HDCP_DDC_V_PRIME(i),
|
||||||
part, DRM_HDCP_V_PRIME_PART_LEN);
|
part, DRM_HDCP_V_PRIME_PART_LEN);
|
||||||
if (ret)
|
if (ret)
|
||||||
drm_dbg_kms(&i915->drm, "Read V'[%d] over DDC failed (%d)\n",
|
drm_dbg_kms(&i915->drm, "Read V'[%d] over DDC failed (%d)\n",
|
||||||
|
@ -1480,7 +1480,7 @@ int intel_hdmi_hdcp_read_v_prime_part(struct intel_digital_port *intel_dig_port,
|
||||||
static int kbl_repositioning_enc_en_signal(struct intel_connector *connector)
|
static int kbl_repositioning_enc_en_signal(struct intel_connector *connector)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
struct intel_digital_port *intel_dig_port = intel_attached_dig_port(connector);
|
struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
|
||||||
struct drm_crtc *crtc = connector->base.state->crtc;
|
struct drm_crtc *crtc = connector->base.state->crtc;
|
||||||
struct intel_crtc *intel_crtc = container_of(crtc,
|
struct intel_crtc *intel_crtc = container_of(crtc,
|
||||||
struct intel_crtc, base);
|
struct intel_crtc, base);
|
||||||
|
@ -1494,13 +1494,13 @@ static int kbl_repositioning_enc_en_signal(struct intel_connector *connector)
|
||||||
usleep_range(25, 50);
|
usleep_range(25, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = intel_ddi_toggle_hdcp_signalling(&intel_dig_port->base, false);
|
ret = intel_ddi_toggle_hdcp_signalling(&dig_port->base, false);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(&dev_priv->drm,
|
drm_err(&dev_priv->drm,
|
||||||
"Disable HDCP signalling failed (%d)\n", ret);
|
"Disable HDCP signalling failed (%d)\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = intel_ddi_toggle_hdcp_signalling(&intel_dig_port->base, true);
|
ret = intel_ddi_toggle_hdcp_signalling(&dig_port->base, true);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(&dev_priv->drm,
|
drm_err(&dev_priv->drm,
|
||||||
"Enable HDCP signalling failed (%d)\n", ret);
|
"Enable HDCP signalling failed (%d)\n", ret);
|
||||||
|
@ -1511,10 +1511,10 @@ static int kbl_repositioning_enc_en_signal(struct intel_connector *connector)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *dig_port,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
struct intel_hdmi *hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *hdmi = &dig_port->hdmi;
|
||||||
struct intel_connector *connector = hdmi->attached_connector;
|
struct intel_connector *connector = hdmi->attached_connector;
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -1522,7 +1522,7 @@ int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port,
|
||||||
if (!enable)
|
if (!enable)
|
||||||
usleep_range(6, 60); /* Bspec says >= 6us */
|
usleep_range(6, 60); /* Bspec says >= 6us */
|
||||||
|
|
||||||
ret = intel_ddi_toggle_hdcp_signalling(&intel_dig_port->base, enable);
|
ret = intel_ddi_toggle_hdcp_signalling(&dig_port->base, enable);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
drm_err(&dev_priv->drm, "%s HDCP signalling failed (%d)\n",
|
drm_err(&dev_priv->drm, "%s HDCP signalling failed (%d)\n",
|
||||||
enable ? "Enable" : "Disable", ret);
|
enable ? "Enable" : "Disable", ret);
|
||||||
|
@ -1540,12 +1540,12 @@ int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
bool intel_hdmi_hdcp_check_link_once(struct intel_digital_port *intel_dig_port)
|
bool intel_hdmi_hdcp_check_link_once(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_connector *connector =
|
struct intel_connector *connector =
|
||||||
intel_dig_port->hdmi.attached_connector;
|
dig_port->hdmi.attached_connector;
|
||||||
enum port port = intel_dig_port->base.port;
|
enum port port = dig_port->base.port;
|
||||||
enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
|
enum transcoder cpu_transcoder = connector->hdcp.cpu_transcoder;
|
||||||
int ret;
|
int ret;
|
||||||
union {
|
union {
|
||||||
|
@ -1553,7 +1553,7 @@ bool intel_hdmi_hdcp_check_link_once(struct intel_digital_port *intel_dig_port)
|
||||||
u8 shim[DRM_HDCP_RI_LEN];
|
u8 shim[DRM_HDCP_RI_LEN];
|
||||||
} ri;
|
} ri;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp_read_ri_prime(intel_dig_port, ri.shim);
|
ret = intel_hdmi_hdcp_read_ri_prime(dig_port, ri.shim);
|
||||||
if (ret)
|
if (ret)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1572,13 +1572,13 @@ bool intel_hdmi_hdcp_check_link_once(struct intel_digital_port *intel_dig_port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port)
|
bool intel_hdmi_hdcp_check_link(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
int retry;
|
int retry;
|
||||||
|
|
||||||
for (retry = 0; retry < 3; retry++)
|
for (retry = 0; retry < 3; retry++)
|
||||||
if (intel_hdmi_hdcp_check_link_once(intel_dig_port))
|
if (intel_hdmi_hdcp_check_link_once(dig_port))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
drm_err(&i915->drm, "Link check failed\n");
|
drm_err(&i915->drm, "Link check failed\n");
|
||||||
|
@ -1599,10 +1599,10 @@ static const struct hdcp2_hdmi_msg_timeout hdcp2_msg_timeout[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp2_read_rx_status(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp2_read_rx_status(struct intel_digital_port *dig_port,
|
||||||
u8 *rx_status)
|
u8 *rx_status)
|
||||||
{
|
{
|
||||||
return intel_hdmi_hdcp_read(intel_dig_port,
|
return intel_hdmi_hdcp_read(dig_port,
|
||||||
HDCP_2_2_HDMI_REG_RXSTATUS_OFFSET,
|
HDCP_2_2_HDMI_REG_RXSTATUS_OFFSET,
|
||||||
rx_status,
|
rx_status,
|
||||||
HDCP_2_2_HDMI_RXSTATUS_LEN);
|
HDCP_2_2_HDMI_RXSTATUS_LEN);
|
||||||
|
@ -1628,15 +1628,15 @@ static int get_hdcp2_msg_timeout(u8 msg_id, bool is_paired)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
hdcp2_detect_msg_availability(struct intel_digital_port *intel_dig_port,
|
hdcp2_detect_msg_availability(struct intel_digital_port *dig_port,
|
||||||
u8 msg_id, bool *msg_ready,
|
u8 msg_id, bool *msg_ready,
|
||||||
ssize_t *msg_sz)
|
ssize_t *msg_sz)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
u8 rx_status[HDCP_2_2_HDMI_RXSTATUS_LEN];
|
u8 rx_status[HDCP_2_2_HDMI_RXSTATUS_LEN];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp2_read_rx_status(intel_dig_port, rx_status);
|
ret = intel_hdmi_hdcp2_read_rx_status(dig_port, rx_status);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
drm_dbg_kms(&i915->drm, "rx_status read failed. Err %d\n",
|
drm_dbg_kms(&i915->drm, "rx_status read failed. Err %d\n",
|
||||||
ret);
|
ret);
|
||||||
|
@ -1656,10 +1656,10 @@ hdcp2_detect_msg_availability(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port *intel_dig_port,
|
intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port *dig_port,
|
||||||
u8 msg_id, bool paired)
|
u8 msg_id, bool paired)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
bool msg_ready = false;
|
bool msg_ready = false;
|
||||||
int timeout, ret;
|
int timeout, ret;
|
||||||
ssize_t msg_sz = 0;
|
ssize_t msg_sz = 0;
|
||||||
|
@ -1668,7 +1668,7 @@ intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port *intel_dig_port,
|
||||||
if (timeout < 0)
|
if (timeout < 0)
|
||||||
return timeout;
|
return timeout;
|
||||||
|
|
||||||
ret = __wait_for(ret = hdcp2_detect_msg_availability(intel_dig_port,
|
ret = __wait_for(ret = hdcp2_detect_msg_availability(dig_port,
|
||||||
msg_id, &msg_ready,
|
msg_id, &msg_ready,
|
||||||
&msg_sz),
|
&msg_sz),
|
||||||
!ret && msg_ready && msg_sz, timeout * 1000,
|
!ret && msg_ready && msg_sz, timeout * 1000,
|
||||||
|
@ -1681,26 +1681,26 @@ intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp2_write_msg(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp2_write_msg(struct intel_digital_port *dig_port,
|
||||||
void *buf, size_t size)
|
void *buf, size_t size)
|
||||||
{
|
{
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
|
|
||||||
offset = HDCP_2_2_HDMI_REG_WR_MSG_OFFSET;
|
offset = HDCP_2_2_HDMI_REG_WR_MSG_OFFSET;
|
||||||
return intel_hdmi_hdcp_write(intel_dig_port, offset, buf, size);
|
return intel_hdmi_hdcp_write(dig_port, offset, buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp2_read_msg(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp2_read_msg(struct intel_digital_port *dig_port,
|
||||||
u8 msg_id, void *buf, size_t size)
|
u8 msg_id, void *buf, size_t size)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
|
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||||
struct intel_hdmi *hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *hdmi = &dig_port->hdmi;
|
||||||
struct intel_hdcp *hdcp = &hdmi->attached_connector->hdcp;
|
struct intel_hdcp *hdcp = &hdmi->attached_connector->hdcp;
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp2_wait_for_msg(intel_dig_port, msg_id,
|
ret = intel_hdmi_hdcp2_wait_for_msg(dig_port, msg_id,
|
||||||
hdcp->is_paired);
|
hdcp->is_paired);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1717,7 +1717,7 @@ int intel_hdmi_hdcp2_read_msg(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = HDCP_2_2_HDMI_REG_RD_MSG_OFFSET;
|
offset = HDCP_2_2_HDMI_REG_RD_MSG_OFFSET;
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, offset, buf, ret);
|
ret = intel_hdmi_hdcp_read(dig_port, offset, buf, ret);
|
||||||
if (ret)
|
if (ret)
|
||||||
drm_dbg_kms(&i915->drm, "Failed to read msg_id: %d(%zd)\n",
|
drm_dbg_kms(&i915->drm, "Failed to read msg_id: %d(%zd)\n",
|
||||||
msg_id, ret);
|
msg_id, ret);
|
||||||
|
@ -1726,12 +1726,12 @@ int intel_hdmi_hdcp2_read_msg(struct intel_digital_port *intel_dig_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp2_check_link(struct intel_digital_port *intel_dig_port)
|
int intel_hdmi_hdcp2_check_link(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
u8 rx_status[HDCP_2_2_HDMI_RXSTATUS_LEN];
|
u8 rx_status[HDCP_2_2_HDMI_RXSTATUS_LEN];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = intel_hdmi_hdcp2_read_rx_status(intel_dig_port, rx_status);
|
ret = intel_hdmi_hdcp2_read_rx_status(dig_port, rx_status);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -1748,14 +1748,14 @@ int intel_hdmi_hdcp2_check_link(struct intel_digital_port *intel_dig_port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int intel_hdmi_hdcp2_capable(struct intel_digital_port *intel_dig_port,
|
int intel_hdmi_hdcp2_capable(struct intel_digital_port *dig_port,
|
||||||
bool *capable)
|
bool *capable)
|
||||||
{
|
{
|
||||||
u8 hdcp2_version;
|
u8 hdcp2_version;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
*capable = false;
|
*capable = false;
|
||||||
ret = intel_hdmi_hdcp_read(intel_dig_port, HDCP_2_2_HDMI_REG_VER_OFFSET,
|
ret = intel_hdmi_hdcp_read(dig_port, HDCP_2_2_HDMI_REG_VER_OFFSET,
|
||||||
&hdcp2_version, sizeof(hdcp2_version));
|
&hdcp2_version, sizeof(hdcp2_version));
|
||||||
if (!ret && hdcp2_version & HDCP_2_2_HDMI_SUPPORT_MASK)
|
if (!ret && hdcp2_version & HDCP_2_2_HDMI_SUPPORT_MASK)
|
||||||
*capable = true;
|
*capable = true;
|
||||||
|
@ -2063,7 +2063,7 @@ static void intel_disable_hdmi(struct intel_atomic_state *state,
|
||||||
struct drm_device *dev = encoder->base.dev;
|
struct drm_device *dev = encoder->base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
|
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
|
||||||
struct intel_digital_port *intel_dig_port =
|
struct intel_digital_port *dig_port =
|
||||||
hdmi_to_dig_port(intel_hdmi);
|
hdmi_to_dig_port(intel_hdmi);
|
||||||
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
|
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
|
||||||
u32 temp;
|
u32 temp;
|
||||||
|
@ -2107,7 +2107,7 @@ static void intel_disable_hdmi(struct intel_atomic_state *state,
|
||||||
intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, true);
|
intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_dig_port->set_infoframes(encoder,
|
dig_port->set_infoframes(encoder,
|
||||||
false,
|
false,
|
||||||
old_crtc_state, old_conn_state);
|
old_crtc_state, old_conn_state);
|
||||||
|
|
||||||
|
@ -2722,12 +2722,12 @@ static void intel_hdmi_pre_enable(struct intel_atomic_state *state,
|
||||||
const struct intel_crtc_state *pipe_config,
|
const struct intel_crtc_state *pipe_config,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port =
|
struct intel_digital_port *dig_port =
|
||||||
enc_to_dig_port(encoder);
|
enc_to_dig_port(encoder);
|
||||||
|
|
||||||
intel_hdmi_prepare(encoder, pipe_config);
|
intel_hdmi_prepare(encoder, pipe_config);
|
||||||
|
|
||||||
intel_dig_port->set_infoframes(encoder,
|
dig_port->set_infoframes(encoder,
|
||||||
pipe_config->has_infoframe,
|
pipe_config->has_infoframe,
|
||||||
pipe_config, conn_state);
|
pipe_config, conn_state);
|
||||||
}
|
}
|
||||||
|
@ -2737,7 +2737,7 @@ static void vlv_hdmi_pre_enable(struct intel_atomic_state *state,
|
||||||
const struct intel_crtc_state *pipe_config,
|
const struct intel_crtc_state *pipe_config,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||||
|
|
||||||
vlv_phy_pre_encoder_enable(encoder, pipe_config);
|
vlv_phy_pre_encoder_enable(encoder, pipe_config);
|
||||||
|
@ -2746,13 +2746,13 @@ static void vlv_hdmi_pre_enable(struct intel_atomic_state *state,
|
||||||
vlv_set_phy_signal_level(encoder, 0x2b245f5f, 0x00002000, 0x5578b83a,
|
vlv_set_phy_signal_level(encoder, 0x2b245f5f, 0x00002000, 0x5578b83a,
|
||||||
0x2b247878);
|
0x2b247878);
|
||||||
|
|
||||||
dport->set_infoframes(encoder,
|
dig_port->set_infoframes(encoder,
|
||||||
pipe_config->has_infoframe,
|
pipe_config->has_infoframe,
|
||||||
pipe_config, conn_state);
|
pipe_config, conn_state);
|
||||||
|
|
||||||
g4x_enable_hdmi(state, encoder, pipe_config, conn_state);
|
g4x_enable_hdmi(state, encoder, pipe_config, conn_state);
|
||||||
|
|
||||||
vlv_wait_port_ready(dev_priv, dport, 0x0);
|
vlv_wait_port_ready(dev_priv, dig_port, 0x0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vlv_hdmi_pre_pll_enable(struct intel_atomic_state *state,
|
static void vlv_hdmi_pre_pll_enable(struct intel_atomic_state *state,
|
||||||
|
@ -2813,7 +2813,7 @@ static void chv_hdmi_pre_enable(struct intel_atomic_state *state,
|
||||||
const struct intel_crtc_state *pipe_config,
|
const struct intel_crtc_state *pipe_config,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *dport = enc_to_dig_port(encoder);
|
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||||
struct drm_device *dev = encoder->base.dev;
|
struct drm_device *dev = encoder->base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
|
|
||||||
|
@ -2823,13 +2823,13 @@ static void chv_hdmi_pre_enable(struct intel_atomic_state *state,
|
||||||
/* Use 800mV-0dB */
|
/* Use 800mV-0dB */
|
||||||
chv_set_phy_signal_level(encoder, 128, 102, false);
|
chv_set_phy_signal_level(encoder, 128, 102, false);
|
||||||
|
|
||||||
dport->set_infoframes(encoder,
|
dig_port->set_infoframes(encoder,
|
||||||
pipe_config->has_infoframe,
|
pipe_config->has_infoframe,
|
||||||
pipe_config, conn_state);
|
pipe_config, conn_state);
|
||||||
|
|
||||||
g4x_enable_hdmi(state, encoder, pipe_config, conn_state);
|
g4x_enable_hdmi(state, encoder, pipe_config, conn_state);
|
||||||
|
|
||||||
vlv_wait_port_ready(dev_priv, dport, 0x0);
|
vlv_wait_port_ready(dev_priv, dig_port, 0x0);
|
||||||
|
|
||||||
/* Second common lane will stay alive on its own now */
|
/* Second common lane will stay alive on its own now */
|
||||||
chv_phy_release_cl2_override(encoder);
|
chv_phy_release_cl2_override(encoder);
|
||||||
|
@ -2923,7 +2923,7 @@ static void
|
||||||
intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
|
intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(connector->dev);
|
struct drm_i915_private *dev_priv = to_i915(connector->dev);
|
||||||
struct intel_digital_port *intel_dig_port =
|
struct intel_digital_port *dig_port =
|
||||||
hdmi_to_dig_port(intel_hdmi);
|
hdmi_to_dig_port(intel_hdmi);
|
||||||
|
|
||||||
intel_attach_force_audio_property(connector);
|
intel_attach_force_audio_property(connector);
|
||||||
|
@ -2935,7 +2935,7 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
|
||||||
* ToDo: This needs to be extended for LSPCON implementation
|
* ToDo: This needs to be extended for LSPCON implementation
|
||||||
* as well. Will be implemented separately.
|
* as well. Will be implemented separately.
|
||||||
*/
|
*/
|
||||||
if (!intel_dig_port->lspcon.active)
|
if (!dig_port->lspcon.active)
|
||||||
intel_attach_colorspace_property(connector);
|
intel_attach_colorspace_property(connector);
|
||||||
|
|
||||||
drm_connector_attach_content_type_property(connector);
|
drm_connector_attach_content_type_property(connector);
|
||||||
|
@ -3172,52 +3172,52 @@ static u8 intel_hdmi_ddc_pin(struct intel_encoder *encoder)
|
||||||
return ddc_pin;
|
return ddc_pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_infoframe_init(struct intel_digital_port *intel_dig_port)
|
void intel_infoframe_init(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv =
|
struct drm_i915_private *dev_priv =
|
||||||
to_i915(intel_dig_port->base.base.dev);
|
to_i915(dig_port->base.base.dev);
|
||||||
|
|
||||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
|
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
|
||||||
intel_dig_port->write_infoframe = vlv_write_infoframe;
|
dig_port->write_infoframe = vlv_write_infoframe;
|
||||||
intel_dig_port->read_infoframe = vlv_read_infoframe;
|
dig_port->read_infoframe = vlv_read_infoframe;
|
||||||
intel_dig_port->set_infoframes = vlv_set_infoframes;
|
dig_port->set_infoframes = vlv_set_infoframes;
|
||||||
intel_dig_port->infoframes_enabled = vlv_infoframes_enabled;
|
dig_port->infoframes_enabled = vlv_infoframes_enabled;
|
||||||
} else if (IS_G4X(dev_priv)) {
|
} else if (IS_G4X(dev_priv)) {
|
||||||
intel_dig_port->write_infoframe = g4x_write_infoframe;
|
dig_port->write_infoframe = g4x_write_infoframe;
|
||||||
intel_dig_port->read_infoframe = g4x_read_infoframe;
|
dig_port->read_infoframe = g4x_read_infoframe;
|
||||||
intel_dig_port->set_infoframes = g4x_set_infoframes;
|
dig_port->set_infoframes = g4x_set_infoframes;
|
||||||
intel_dig_port->infoframes_enabled = g4x_infoframes_enabled;
|
dig_port->infoframes_enabled = g4x_infoframes_enabled;
|
||||||
} else if (HAS_DDI(dev_priv)) {
|
} else if (HAS_DDI(dev_priv)) {
|
||||||
if (intel_dig_port->lspcon.active) {
|
if (dig_port->lspcon.active) {
|
||||||
intel_dig_port->write_infoframe = lspcon_write_infoframe;
|
dig_port->write_infoframe = lspcon_write_infoframe;
|
||||||
intel_dig_port->read_infoframe = lspcon_read_infoframe;
|
dig_port->read_infoframe = lspcon_read_infoframe;
|
||||||
intel_dig_port->set_infoframes = lspcon_set_infoframes;
|
dig_port->set_infoframes = lspcon_set_infoframes;
|
||||||
intel_dig_port->infoframes_enabled = lspcon_infoframes_enabled;
|
dig_port->infoframes_enabled = lspcon_infoframes_enabled;
|
||||||
} else {
|
} else {
|
||||||
intel_dig_port->write_infoframe = hsw_write_infoframe;
|
dig_port->write_infoframe = hsw_write_infoframe;
|
||||||
intel_dig_port->read_infoframe = hsw_read_infoframe;
|
dig_port->read_infoframe = hsw_read_infoframe;
|
||||||
intel_dig_port->set_infoframes = hsw_set_infoframes;
|
dig_port->set_infoframes = hsw_set_infoframes;
|
||||||
intel_dig_port->infoframes_enabled = hsw_infoframes_enabled;
|
dig_port->infoframes_enabled = hsw_infoframes_enabled;
|
||||||
}
|
}
|
||||||
} else if (HAS_PCH_IBX(dev_priv)) {
|
} else if (HAS_PCH_IBX(dev_priv)) {
|
||||||
intel_dig_port->write_infoframe = ibx_write_infoframe;
|
dig_port->write_infoframe = ibx_write_infoframe;
|
||||||
intel_dig_port->read_infoframe = ibx_read_infoframe;
|
dig_port->read_infoframe = ibx_read_infoframe;
|
||||||
intel_dig_port->set_infoframes = ibx_set_infoframes;
|
dig_port->set_infoframes = ibx_set_infoframes;
|
||||||
intel_dig_port->infoframes_enabled = ibx_infoframes_enabled;
|
dig_port->infoframes_enabled = ibx_infoframes_enabled;
|
||||||
} else {
|
} else {
|
||||||
intel_dig_port->write_infoframe = cpt_write_infoframe;
|
dig_port->write_infoframe = cpt_write_infoframe;
|
||||||
intel_dig_port->read_infoframe = cpt_read_infoframe;
|
dig_port->read_infoframe = cpt_read_infoframe;
|
||||||
intel_dig_port->set_infoframes = cpt_set_infoframes;
|
dig_port->set_infoframes = cpt_set_infoframes;
|
||||||
intel_dig_port->infoframes_enabled = cpt_infoframes_enabled;
|
dig_port->infoframes_enabled = cpt_infoframes_enabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
|
void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
|
||||||
struct intel_connector *intel_connector)
|
struct intel_connector *intel_connector)
|
||||||
{
|
{
|
||||||
struct drm_connector *connector = &intel_connector->base;
|
struct drm_connector *connector = &intel_connector->base;
|
||||||
struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
|
struct intel_hdmi *intel_hdmi = &dig_port->hdmi;
|
||||||
struct intel_encoder *intel_encoder = &intel_dig_port->base;
|
struct intel_encoder *intel_encoder = &dig_port->base;
|
||||||
struct drm_device *dev = intel_encoder->base.dev;
|
struct drm_device *dev = intel_encoder->base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
struct i2c_adapter *ddc;
|
struct i2c_adapter *ddc;
|
||||||
|
@ -3231,9 +3231,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
|
||||||
if (INTEL_GEN(dev_priv) < 12 && drm_WARN_ON(dev, port == PORT_A))
|
if (INTEL_GEN(dev_priv) < 12 && drm_WARN_ON(dev, port == PORT_A))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (drm_WARN(dev, intel_dig_port->max_lanes < 4,
|
if (drm_WARN(dev, dig_port->max_lanes < 4,
|
||||||
"Not enough lanes (%d) for HDMI on [ENCODER:%d:%s]\n",
|
"Not enough lanes (%d) for HDMI on [ENCODER:%d:%s]\n",
|
||||||
intel_dig_port->max_lanes, intel_encoder->base.base.id,
|
dig_port->max_lanes, intel_encoder->base.base.id,
|
||||||
intel_encoder->base.name))
|
intel_encoder->base.name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -3322,21 +3322,21 @@ intel_hdmi_hotplug(struct intel_encoder *encoder,
|
||||||
void intel_hdmi_init(struct drm_i915_private *dev_priv,
|
void intel_hdmi_init(struct drm_i915_private *dev_priv,
|
||||||
i915_reg_t hdmi_reg, enum port port)
|
i915_reg_t hdmi_reg, enum port port)
|
||||||
{
|
{
|
||||||
struct intel_digital_port *intel_dig_port;
|
struct intel_digital_port *dig_port;
|
||||||
struct intel_encoder *intel_encoder;
|
struct intel_encoder *intel_encoder;
|
||||||
struct intel_connector *intel_connector;
|
struct intel_connector *intel_connector;
|
||||||
|
|
||||||
intel_dig_port = kzalloc(sizeof(*intel_dig_port), GFP_KERNEL);
|
dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL);
|
||||||
if (!intel_dig_port)
|
if (!dig_port)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
intel_connector = intel_connector_alloc();
|
intel_connector = intel_connector_alloc();
|
||||||
if (!intel_connector) {
|
if (!intel_connector) {
|
||||||
kfree(intel_dig_port);
|
kfree(dig_port);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_encoder = &intel_dig_port->base;
|
intel_encoder = &dig_port->base;
|
||||||
|
|
||||||
drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
|
drm_encoder_init(&dev_priv->drm, &intel_encoder->base,
|
||||||
&intel_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS,
|
&intel_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS,
|
||||||
|
@ -3393,12 +3393,12 @@ void intel_hdmi_init(struct drm_i915_private *dev_priv,
|
||||||
if (IS_G4X(dev_priv))
|
if (IS_G4X(dev_priv))
|
||||||
intel_encoder->cloneable |= 1 << INTEL_OUTPUT_HDMI;
|
intel_encoder->cloneable |= 1 << INTEL_OUTPUT_HDMI;
|
||||||
|
|
||||||
intel_dig_port->hdmi.hdmi_reg = hdmi_reg;
|
dig_port->hdmi.hdmi_reg = hdmi_reg;
|
||||||
intel_dig_port->dp.output_reg = INVALID_MMIO_REG;
|
dig_port->dp.output_reg = INVALID_MMIO_REG;
|
||||||
intel_dig_port->max_lanes = 4;
|
dig_port->max_lanes = 4;
|
||||||
|
|
||||||
intel_infoframe_init(intel_dig_port);
|
intel_infoframe_init(dig_port);
|
||||||
|
|
||||||
intel_dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
|
dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
|
||||||
intel_hdmi_init_connector(intel_dig_port, intel_connector);
|
intel_hdmi_init_connector(dig_port, intel_connector);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ enum port;
|
||||||
|
|
||||||
void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
|
void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
|
||||||
enum port port);
|
enum port port);
|
||||||
void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
|
void intel_hdmi_init_connector(struct intel_digital_port *dig_port,
|
||||||
struct intel_connector *intel_connector);
|
struct intel_connector *intel_connector);
|
||||||
struct intel_hdmi *enc_to_intel_hdmi(struct intel_encoder *encoder);
|
struct intel_hdmi *enc_to_intel_hdmi(struct intel_encoder *encoder);
|
||||||
int intel_hdmi_compute_config(struct intel_encoder *encoder,
|
int intel_hdmi_compute_config(struct intel_encoder *encoder,
|
||||||
|
@ -36,7 +36,7 @@ bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
|
||||||
bool high_tmds_clock_ratio,
|
bool high_tmds_clock_ratio,
|
||||||
bool scrambling);
|
bool scrambling);
|
||||||
void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
|
void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
|
||||||
void intel_infoframe_init(struct intel_digital_port *intel_dig_port);
|
void intel_infoframe_init(struct intel_digital_port *dig_port);
|
||||||
u32 intel_hdmi_infoframes_enabled(struct intel_encoder *encoder,
|
u32 intel_hdmi_infoframes_enabled(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state);
|
const struct intel_crtc_state *crtc_state);
|
||||||
u32 intel_hdmi_infoframe_enable(unsigned int type);
|
u32 intel_hdmi_infoframe_enable(unsigned int type);
|
||||||
|
|
|
@ -550,11 +550,11 @@ void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon)
|
||||||
lspcon_wait_mode(lspcon, DRM_LSPCON_MODE_PCON);
|
lspcon_wait_mode(lspcon, DRM_LSPCON_MODE_PCON);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lspcon_init(struct intel_digital_port *intel_dig_port)
|
bool lspcon_init(struct intel_digital_port *dig_port)
|
||||||
{
|
{
|
||||||
struct intel_dp *dp = &intel_dig_port->dp;
|
struct intel_dp *dp = &dig_port->dp;
|
||||||
struct intel_lspcon *lspcon = &intel_dig_port->lspcon;
|
struct intel_lspcon *lspcon = &dig_port->lspcon;
|
||||||
struct drm_device *dev = intel_dig_port->base.base.dev;
|
struct drm_device *dev = dig_port->base.base.dev;
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
struct drm_connector *connector = &dp->attached_connector->base;
|
struct drm_connector *connector = &dp->attached_connector->base;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ struct intel_digital_port;
|
||||||
struct intel_encoder;
|
struct intel_encoder;
|
||||||
struct intel_lspcon;
|
struct intel_lspcon;
|
||||||
|
|
||||||
bool lspcon_init(struct intel_digital_port *intel_dig_port);
|
bool lspcon_init(struct intel_digital_port *dig_port);
|
||||||
void lspcon_resume(struct intel_lspcon *lspcon);
|
void lspcon_resume(struct intel_lspcon *lspcon);
|
||||||
void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);
|
void lspcon_wait_pcon_mode(struct intel_lspcon *lspcon);
|
||||||
void lspcon_write_infoframe(struct intel_encoder *encoder,
|
void lspcon_write_infoframe(struct intel_encoder *encoder,
|
||||||
|
|
|
@ -905,8 +905,8 @@ static void intel_psr_enable_locked(struct drm_i915_private *dev_priv,
|
||||||
const struct drm_connector_state *conn_state)
|
const struct drm_connector_state *conn_state)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = dev_priv->psr.dp;
|
struct intel_dp *intel_dp = dev_priv->psr.dp;
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
struct intel_encoder *encoder = &intel_dig_port->base;
|
struct intel_encoder *encoder = &dig_port->base;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
drm_WARN_ON(&dev_priv->drm, dev_priv->psr.enabled);
|
drm_WARN_ON(&dev_priv->drm, dev_priv->psr.enabled);
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ static void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
|
||||||
const struct intel_crtc_state *crtc_state)
|
const struct intel_crtc_state *crtc_state)
|
||||||
{
|
{
|
||||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||||
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
|
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||||
const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
|
const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
|
||||||
struct drm_dsc_pps_infoframe dp_dsc_pps_sdp;
|
struct drm_dsc_pps_infoframe dp_dsc_pps_sdp;
|
||||||
|
|
||||||
|
@ -1055,7 +1055,7 @@ static void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
|
||||||
/* Fill the PPS payload bytes as per DSC spec 1.2 Table 4-1 */
|
/* Fill the PPS payload bytes as per DSC spec 1.2 Table 4-1 */
|
||||||
drm_dsc_pps_payload_pack(&dp_dsc_pps_sdp.pps_payload, vdsc_cfg);
|
drm_dsc_pps_payload_pack(&dp_dsc_pps_sdp.pps_payload, vdsc_cfg);
|
||||||
|
|
||||||
intel_dig_port->write_infoframe(encoder, crtc_state,
|
dig_port->write_infoframe(encoder, crtc_state,
|
||||||
DP_SDP_PPS, &dp_dsc_pps_sdp,
|
DP_SDP_PPS, &dp_dsc_pps_sdp,
|
||||||
sizeof(dp_dsc_pps_sdp));
|
sizeof(dp_dsc_pps_sdp));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue