Skip to content

Commit

Permalink
drm/amd/display: Fix for access for ddc pin and aux engine.
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1951868

[Why & How]
1. Remove unnecessary dummy interrupt source for USB4 HPD & HPD RX
2. Adjust parameter for DPCD writing of link training process of DPIA link
3. Adjust specific AUX defer delay for DPIA link

Reviewed-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Acked-by: Wayne Lin <Wayne.Lin@amd.com>
Acked-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(backported from commit 40fadb4)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
  • Loading branch information
Meenakshikumar Somasundaram authored and Timo Aaltonen committed Dec 3, 2021
1 parent 2677b94 commit 72e9cfb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/amd/display/dc/core/dc_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1657,9 +1657,9 @@ static bool dc_link_construct_dpia(struct dc_link *link,

DC_LOGGER_INIT(dc_ctx->logger);

/* Initialized dummy hpd and hpd rx */
link->irq_source_hpd = DC_IRQ_SOURCE_USB4_DMUB_HPD;
link->irq_source_hpd_rx = DC_IRQ_SOURCE_USB4_DMUB_HPDRX;
/* Initialized irq source for hpd and hpd rx */
link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
link->irq_source_hpd_rx = DC_IRQ_SOURCE_INVALID;
link->link_status.dpcd_caps = &link->dpcd_caps;

link->dc = init_params->dc;
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static enum dc_status dpcd_set_lt_pattern(struct dc_link *link,
}

status = core_link_write_dpcd(link,
DP_TRAINING_PATTERN_SET,
dpcd_tps_offset,
&dpcd_pattern.raw,
sizeof(dpcd_pattern.raw));

Expand Down Expand Up @@ -796,7 +796,7 @@ static enum dc_status dpcd_clear_lt_pattern(struct dc_link *link, uint32_t hop)
((DP_REPEATER_CONFIGURATION_AND_STATUS_SIZE) * (hop - 1));

status = core_link_write_dpcd(link,
DP_TRAINING_PATTERN_SET,
dpcd_tps_offset,
&dpcd_pattern.raw,
sizeof(dpcd_pattern.raw));

Expand Down Expand Up @@ -906,7 +906,7 @@ enum link_training_result dc_link_dpia_perform_link_training(struct dc_link *lin
enum link_training_result result;
struct link_training_settings lt_settings;
uint8_t repeater_cnt = 0; /* Number of hops/repeaters in display path. */
uint8_t repeater_id; /* Current hop. */
int8_t repeater_id; /* Current hop. */

/* Configure link as prescribed in link_setting and set LTTPR mode. */
result = dpia_configure_link(link, link_setting, &lt_settings);
Expand Down
6 changes: 5 additions & 1 deletion drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ int dce_aux_transfer_dmub_raw(struct ddc_service *ddc,
#define AUX_MAX_I2C_DEFER_RETRIES 7
#define AUX_MAX_INVALID_REPLY_RETRIES 2
#define AUX_MAX_TIMEOUT_RETRIES 3
#define AUX_DEFER_DELAY_FOR_DPIA 4 /*ms*/

bool dce_aux_transfer_with_retries(struct ddc_service *ddc,
struct aux_payload *payload)
Expand Down Expand Up @@ -666,7 +667,10 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc,

case AUX_TRANSACTION_REPLY_AUX_DEFER:
/* polling_timeout_period is in us */
defer_time_in_ms += aux110->polling_timeout_period / 1000;
if (aux110)
defer_time_in_ms += aux110->polling_timeout_period / 1000;
else
defer_time_in_ms += AUX_DEFER_DELAY_FOR_DPIA;
++aux_defer_retries;
fallthrough;
case AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER:
Expand Down
5 changes: 1 addition & 4 deletions drivers/gpu/drm/amd/display/dc/irq_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ enum dc_irq_source {
DC_IRQ_SOURCE_DMCUB_OUTBOX,
DC_IRQ_SOURCE_DMCUB_OUTBOX0,
DC_IRQ_SOURCE_DMCUB_GENERAL_DATAOUT,
DAL_IRQ_SOURCES_NUMBER,
/* Dummy interrupt source for USB4 HPD & HPD RX */
DC_IRQ_SOURCE_USB4_DMUB_HPD,
DC_IRQ_SOURCE_USB4_DMUB_HPDRX,
DAL_IRQ_SOURCES_NUMBER
};

enum irq_type
Expand Down

0 comments on commit 72e9cfb

Please sign in to comment.