mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
Merge changes Ib8f66b43,I88fba6e2 into dev/msm-4.14-display
* changes: drm/msm/dp: skip HDCP version checks for simulation mode drm/msm/dp: validate inputs for simulated AUX transfers
This commit is contained in:
commit
72a8305e9a
@ -371,8 +371,11 @@ static void dp_aux_transfer_helper(struct dp_aux_private *aux,
|
||||
bool i2c_read = input_msg->request &
|
||||
(DP_AUX_I2C_READ & DP_AUX_NATIVE_READ);
|
||||
|
||||
if (!i2c_mot || !i2c_read || (input_msg->size == 0))
|
||||
if (!i2c_mot || !i2c_read || (input_msg->size == 0)) {
|
||||
/* reset the offset for all other transaction types */
|
||||
aux->offset = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sending the segment value and EDID offset will be performed
|
||||
@ -417,7 +420,6 @@ static void dp_aux_transfer_helper(struct dp_aux_private *aux,
|
||||
dp_aux_cmd_fifo_tx(aux, &helper_msg);
|
||||
end:
|
||||
aux->offset += message_size;
|
||||
|
||||
if (aux->offset == 0x80 || aux->offset == 0x100)
|
||||
aux->segment = 0x0; /* reset segment at end of block */
|
||||
}
|
||||
@ -485,8 +487,25 @@ static ssize_t dp_aux_transfer_debug(struct drm_dp_aux *drm_aux,
|
||||
|
||||
aux->aux_error_num = DP_AUX_ERR_NONE;
|
||||
|
||||
if (!aux->dpcd || !aux->edid) {
|
||||
pr_err("invalid aux/dpcd structure\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((msg->address + msg->size) > SZ_16K) {
|
||||
pr_err("invalid dpcd access: addr=0x%x, size=0x%x\n",
|
||||
msg->address + msg->size);
|
||||
goto address_error;
|
||||
}
|
||||
|
||||
if ((msg->size + aux->offset) > SZ_256) {
|
||||
pr_err("invalid edid access: offset=0x%x, size=0x%x\n",
|
||||
aux->offset, msg->size);
|
||||
goto address_error;
|
||||
}
|
||||
|
||||
if (aux->native) {
|
||||
if (aux->read && ((msg->address + msg->size) < SZ_1K)) {
|
||||
if (aux->read) {
|
||||
aux->dp_aux.reg = msg->address;
|
||||
|
||||
reinit_completion(&aux->comp);
|
||||
@ -525,6 +544,10 @@ static ssize_t dp_aux_transfer_debug(struct drm_dp_aux *drm_aux,
|
||||
DP_AUX_NATIVE_REPLY_DEFER : DP_AUX_I2C_REPLY_DEFER;
|
||||
}
|
||||
|
||||
return msg->size;
|
||||
|
||||
address_error:
|
||||
memset(msg->buffer, 0, msg->size);
|
||||
ret = msg->size;
|
||||
end:
|
||||
return ret;
|
||||
|
@ -222,6 +222,11 @@ static void dp_display_update_hdcp_info(struct dp_display_private *dp)
|
||||
return;
|
||||
}
|
||||
|
||||
if (dp->debug->sim_mode) {
|
||||
pr_debug("skip HDCP version checks for simulation mode\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fd = dp->hdcp.hdcp2;
|
||||
if (fd)
|
||||
ops = sde_dp_hdcp2p2_start(fd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user