Commit 13900e6f authored by Meenakshikumar Somasundaram's avatar Meenakshikumar Somasundaram Committed by Alex Deucher

drm/amd/display: Fix for null pointer access for ddc pin and aux engine.

[Why]
Need a check for NULL pointer access for ddc pin and aux engine.

[How]
Adding a check for ddc pin and aux engine accesses.
Reviewed-by: default avatarJimmy Kizito <jimmy.kizito@amd.com>
Acked-by: default avatarMikita Lipski <mikita.lipski@amd.com>
Signed-off-by: default avatarMeenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5e1a9a3e
...@@ -449,9 +449,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config) ...@@ -449,9 +449,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
struct mod_hdcp_link *link = &hdcp_work[link_index].link; struct mod_hdcp_link *link = &hdcp_work[link_index].link;
struct drm_connector_state *conn_state; struct drm_connector_state *conn_state;
struct dc_sink *sink = NULL; struct dc_sink *sink = NULL;
#if defined(CONFIG_DRM_AMD_DC_DCN3_1)
bool link_is_hdcp14 = false; bool link_is_hdcp14 = false;
#endif
if (config->dpms_off) { if (config->dpms_off) {
hdcp_remove_display(hdcp_work, link_index, aconnector); hdcp_remove_display(hdcp_work, link_index, aconnector);
......
...@@ -689,8 +689,8 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc, ...@@ -689,8 +689,8 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
enum aux_return_code_type operation_result; enum aux_return_code_type operation_result;
bool retry_on_defer = false; bool retry_on_defer = false;
struct ddc *ddc_pin = ddc->ddc_pin; struct ddc *ddc_pin = ddc->ddc_pin;
struct dce_aux *aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]; struct dce_aux *aux_engine = NULL;
struct aux_engine_dce110 *aux110 = FROM_AUX_ENGINE(aux_engine); struct aux_engine_dce110 *aux110 = NULL;
uint32_t defer_time_in_ms = 0; uint32_t defer_time_in_ms = 0;
int aux_ack_retries = 0, int aux_ack_retries = 0,
...@@ -699,6 +699,11 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc, ...@@ -699,6 +699,11 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
aux_timeout_retries = 0, aux_timeout_retries = 0,
aux_invalid_reply_retries = 0; aux_invalid_reply_retries = 0;
if (ddc_pin) {
aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];
aux110 = FROM_AUX_ENGINE(aux_engine);
}
if (!payload->reply) { if (!payload->reply) {
payload_reply = false; payload_reply = false;
payload->reply = &reply; payload->reply = &reply;
...@@ -765,6 +770,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc, ...@@ -765,6 +770,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
"dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_AUX_DEFER"); "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_AUX_DEFER");
/* polling_timeout_period is in us */ /* polling_timeout_period is in us */
if (aux110)
defer_time_in_ms += aux110->polling_timeout_period / 1000; defer_time_in_ms += aux110->polling_timeout_period / 1000;
++aux_defer_retries; ++aux_defer_retries;
fallthrough; fallthrough;
......
...@@ -227,7 +227,7 @@ enum { ...@@ -227,7 +227,7 @@ enum {
#define FAMILY_YELLOW_CARP 146 #define FAMILY_YELLOW_CARP 146
#define YELLOW_CARP_A0 0x01 #define YELLOW_CARP_A0 0x01
#define YELLOW_CARP_B0 0x02 // TODO: DCN31 - update with correct B0 ID #define YELLOW_CARP_B0 0x20
#define YELLOW_CARP_UNKNOWN 0xFF #define YELLOW_CARP_UNKNOWN 0xFF
#ifndef ASICREV_IS_YELLOW_CARP #ifndef ASICREV_IS_YELLOW_CARP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment