diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 59445c83f023..c0297201acb6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -84,11 +84,13 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, enum i2caux_transaction_action action; enum aux_transaction_type type; + DRM_DEBUG_KMS("msg=%p, aux=%p\n", msg, aux); if (WARN_ON(msg->size > 16)) return -E2BIG; switch (msg->request & ~DP_AUX_I2C_MOT) { case DP_AUX_NATIVE_READ: + DRM_DEBUG_KMS("%s\n", "DP_AUX_NATIVE_READ"); type = AUX_TRANSACTION_TYPE_DP; action = I2CAUX_TRANSACTION_ACTION_DP_READ; @@ -101,6 +103,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, action); break; case DP_AUX_NATIVE_WRITE: + DRM_DEBUG_KMS("%s\n", "DP_AUX_NATIVE_WRITE"); type = AUX_TRANSACTION_TYPE_DP; action = I2CAUX_TRANSACTION_ACTION_DP_WRITE; @@ -114,6 +117,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, result = msg->size; break; case DP_AUX_I2C_READ: + DRM_DEBUG_KMS("%s\n", "DP_AUX_I2C_READ"); type = AUX_TRANSACTION_TYPE_I2C; if (msg->request & DP_AUX_I2C_MOT) action = I2CAUX_TRANSACTION_ACTION_I2C_READ_MOT; @@ -129,6 +133,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, action); break; case DP_AUX_I2C_WRITE: + DRM_DEBUG_KMS("%s\n", "DP_AUX_I2C_WRITE"); type = AUX_TRANSACTION_TYPE_I2C; if (msg->request & DP_AUX_I2C_MOT) action = I2CAUX_TRANSACTION_ACTION_I2C_WRITE_MOT; @@ -142,9 +147,11 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, msg->size, type, action); + DRM_DEBUG_KMS("%s\n", "BACK FROM DP_AUX_I2C_WRITE"); result = msg->size; break; default: + DRM_DEBUG_KMS("%s\n", "-EINVAL"); return -EINVAL; } diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c index 8def0d9fa0ff..f241f8c554e2 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c @@ -647,10 +647,26 @@ int dc_link_aux_transfer(struct ddc_service *ddc, int res = -1; uint32_t status; + DRM_DEBUG_KMS("%s: ddc=%p, reply=%p, buffer=%p\n", + "DC_LINK_AUX_TRANSFER", ddc, reply, buffer); + DRM_DEBUG_KMS("ddc->ddc_pin=%p\n", ddc->ddc_pin); + DRM_DEBUG_KMS("ddc->ddc_pin->pin_data=%p\n", ddc->ddc_pin->pin_data); + DRM_DEBUG_KMS("ddc->ddc_pin->pin_data->en=%d\n", ddc->ddc_pin->pin_data->en); memset(&aux_req, 0, sizeof(aux_req)); memset(&aux_rep, 0, sizeof(aux_rep)); + DRM_DEBUG_KMS("ddc->ctx=%p", ddc->ctx); + DRM_DEBUG_KMS("ddc->ctx->dc=%p", ddc->ctx->dc); + DRM_DEBUG_KMS("ddc->ctx->dc->res_pool=%p", ddc->ctx->dc->res_pool); + DRM_DEBUG_KMS("ddc->ctx->dc->res_pool->engines=%p", ddc->ctx->dc->res_pool->engines); + DRM_DEBUG_KMS("ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]=%p", + ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]); aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]; + DRM_DEBUG_KMS("aux_engine=%p\n", aux_engine); + if (!aux_engine) { + DRM_DEBUG_KMS("%s\n", "Cowardly refusing to call through null pointer"); + return -1; + } aux_engine->funcs->acquire(aux_engine, ddc_pin); aux_req.type = type; @@ -668,10 +684,13 @@ int dc_link_aux_transfer(struct ddc_service *ddc, case AUX_CHANNEL_OPERATION_SUCCEEDED: res = returned_bytes; - if (res <= size && res >= 0) + if (res <= size && res >= 0) { + if (!buffer) + DRM_DEBUG_KMS("%s\n", "calling READ_CHANNEL_REPLY w/null buffer"); res = aux_engine->funcs->read_channel_reply(aux_engine, size, buffer, reply, &status); + } break; case AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON: