Skip to content

Commit 892b41b

Browse files
Hersen Wualexdeucher
authored andcommitted
drm/amd/display: Fix incorrect DSC instance for MST
[Why] DSC debugfs, such as dp_dsc_clock_en_read, use aconnector->dc_link to find pipe_ctx for display. Displays connected to MST hub share the same dc_link. DSC instance is from pipe_ctx. This causes incorrect DSC instance for display connected to MST hub. [How] Add aconnector->sink check to find pipe_ctx. CC: [email protected] Reviewed-by: Aurabindo Pillai <[email protected]> Signed-off-by: Hersen Wu <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 9a35d20 commit 892b41b

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,9 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char __user *buf,
14951495
for (i = 0; i < MAX_PIPES; i++) {
14961496
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
14971497
if (pipe_ctx->stream &&
1498-
pipe_ctx->stream->link == aconnector->dc_link)
1498+
pipe_ctx->stream->link == aconnector->dc_link &&
1499+
pipe_ctx->stream->sink &&
1500+
pipe_ctx->stream->sink == aconnector->dc_sink)
14991501
break;
15001502
}
15011503

@@ -1596,7 +1598,9 @@ static ssize_t dp_dsc_clock_en_write(struct file *f, const char __user *buf,
15961598
for (i = 0; i < MAX_PIPES; i++) {
15971599
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
15981600
if (pipe_ctx->stream &&
1599-
pipe_ctx->stream->link == aconnector->dc_link)
1601+
pipe_ctx->stream->link == aconnector->dc_link &&
1602+
pipe_ctx->stream->sink &&
1603+
pipe_ctx->stream->sink == aconnector->dc_sink)
16001604
break;
16011605
}
16021606

@@ -1681,7 +1685,9 @@ static ssize_t dp_dsc_slice_width_read(struct file *f, char __user *buf,
16811685
for (i = 0; i < MAX_PIPES; i++) {
16821686
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
16831687
if (pipe_ctx->stream &&
1684-
pipe_ctx->stream->link == aconnector->dc_link)
1688+
pipe_ctx->stream->link == aconnector->dc_link &&
1689+
pipe_ctx->stream->sink &&
1690+
pipe_ctx->stream->sink == aconnector->dc_sink)
16851691
break;
16861692
}
16871693

@@ -1780,7 +1786,9 @@ static ssize_t dp_dsc_slice_width_write(struct file *f, const char __user *buf,
17801786
for (i = 0; i < MAX_PIPES; i++) {
17811787
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
17821788
if (pipe_ctx->stream &&
1783-
pipe_ctx->stream->link == aconnector->dc_link)
1789+
pipe_ctx->stream->link == aconnector->dc_link &&
1790+
pipe_ctx->stream->sink &&
1791+
pipe_ctx->stream->sink == aconnector->dc_sink)
17841792
break;
17851793
}
17861794

@@ -1865,7 +1873,9 @@ static ssize_t dp_dsc_slice_height_read(struct file *f, char __user *buf,
18651873
for (i = 0; i < MAX_PIPES; i++) {
18661874
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
18671875
if (pipe_ctx->stream &&
1868-
pipe_ctx->stream->link == aconnector->dc_link)
1876+
pipe_ctx->stream->link == aconnector->dc_link &&
1877+
pipe_ctx->stream->sink &&
1878+
pipe_ctx->stream->sink == aconnector->dc_sink)
18691879
break;
18701880
}
18711881

@@ -1964,7 +1974,9 @@ static ssize_t dp_dsc_slice_height_write(struct file *f, const char __user *buf,
19641974
for (i = 0; i < MAX_PIPES; i++) {
19651975
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
19661976
if (pipe_ctx->stream &&
1967-
pipe_ctx->stream->link == aconnector->dc_link)
1977+
pipe_ctx->stream->link == aconnector->dc_link &&
1978+
pipe_ctx->stream->sink &&
1979+
pipe_ctx->stream->sink == aconnector->dc_sink)
19681980
break;
19691981
}
19701982

@@ -2045,7 +2057,9 @@ static ssize_t dp_dsc_bits_per_pixel_read(struct file *f, char __user *buf,
20452057
for (i = 0; i < MAX_PIPES; i++) {
20462058
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
20472059
if (pipe_ctx->stream &&
2048-
pipe_ctx->stream->link == aconnector->dc_link)
2060+
pipe_ctx->stream->link == aconnector->dc_link &&
2061+
pipe_ctx->stream->sink &&
2062+
pipe_ctx->stream->sink == aconnector->dc_sink)
20492063
break;
20502064
}
20512065

@@ -2141,7 +2155,9 @@ static ssize_t dp_dsc_bits_per_pixel_write(struct file *f, const char __user *bu
21412155
for (i = 0; i < MAX_PIPES; i++) {
21422156
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
21432157
if (pipe_ctx->stream &&
2144-
pipe_ctx->stream->link == aconnector->dc_link)
2158+
pipe_ctx->stream->link == aconnector->dc_link &&
2159+
pipe_ctx->stream->sink &&
2160+
pipe_ctx->stream->sink == aconnector->dc_sink)
21452161
break;
21462162
}
21472163

@@ -2220,7 +2236,9 @@ static ssize_t dp_dsc_pic_width_read(struct file *f, char __user *buf,
22202236
for (i = 0; i < MAX_PIPES; i++) {
22212237
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
22222238
if (pipe_ctx->stream &&
2223-
pipe_ctx->stream->link == aconnector->dc_link)
2239+
pipe_ctx->stream->link == aconnector->dc_link &&
2240+
pipe_ctx->stream->sink &&
2241+
pipe_ctx->stream->sink == aconnector->dc_sink)
22242242
break;
22252243
}
22262244

@@ -2276,7 +2294,9 @@ static ssize_t dp_dsc_pic_height_read(struct file *f, char __user *buf,
22762294
for (i = 0; i < MAX_PIPES; i++) {
22772295
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
22782296
if (pipe_ctx->stream &&
2279-
pipe_ctx->stream->link == aconnector->dc_link)
2297+
pipe_ctx->stream->link == aconnector->dc_link &&
2298+
pipe_ctx->stream->sink &&
2299+
pipe_ctx->stream->sink == aconnector->dc_sink)
22802300
break;
22812301
}
22822302

@@ -2347,7 +2367,9 @@ static ssize_t dp_dsc_chunk_size_read(struct file *f, char __user *buf,
23472367
for (i = 0; i < MAX_PIPES; i++) {
23482368
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
23492369
if (pipe_ctx->stream &&
2350-
pipe_ctx->stream->link == aconnector->dc_link)
2370+
pipe_ctx->stream->link == aconnector->dc_link &&
2371+
pipe_ctx->stream->sink &&
2372+
pipe_ctx->stream->sink == aconnector->dc_sink)
23512373
break;
23522374
}
23532375

@@ -2418,7 +2440,9 @@ static ssize_t dp_dsc_slice_bpg_offset_read(struct file *f, char __user *buf,
24182440
for (i = 0; i < MAX_PIPES; i++) {
24192441
pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
24202442
if (pipe_ctx->stream &&
2421-
pipe_ctx->stream->link == aconnector->dc_link)
2443+
pipe_ctx->stream->link == aconnector->dc_link &&
2444+
pipe_ctx->stream->sink &&
2445+
pipe_ctx->stream->sink == aconnector->dc_sink)
24222446
break;
24232447
}
24242448

0 commit comments

Comments
 (0)