<div dir="auto"><div>Hi,<br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Alex Hung <<a href="mailto:alex.hung@amd.com">alex.hung@amd.com</a>> ezt írta (időpont: 2025. júl. 25., Pén 22:26):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This patch may be related and conflict to <br>
<a href="https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg125873.html" rel="noreferrer noreferrer" target="_blank">https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg125873.html</a><br>
<br>
amd-staging-drm-next should include the above patch but it is not <br>
updated for 2 weeks, so let's wait for ASDN to be updated.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes, it indeed looks like that patch addresses the same problem.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On 7/24/25 16:32, Rodrigo Siqueira wrote:<br>
> On 010/22, Timur Kristóf wrote:<br>
>> After refactoring the DSC capability calculation, the<br>
>> get_min_slice_count_for_odm could crash on some GPUs due to a<br>
>> division by zero when max_total_throughput_mps was zero.<br>
>> As a result, DC was broken when connecting a GPU that doesn't<br>
>> support DSC to a monitor that supports DSC.<br>
>> Tested on Oland (DCE 6) and Fiji (DCE 10).<br>
>><br>
>> This commit fixes it by returning zero instead.<br>
>><br>
>> Fixes: 4909b8b3846c ("drm/amd/display: Refactor DSC cap calculations")<br>
>> Signed-off-by: Timur Kristóf <<a href="mailto:timur.kristof@gmail.com" target="_blank" rel="noreferrer">timur.kristof@gmail.com</a>><br>
>> ---<br>
>>   drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 17 +++++++++--------<br>
>>   1 file changed, 9 insertions(+), 8 deletions(-)<br>
>><br>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c<br>
>> index a454d16e6586..4169ece9c535 100644<br>
>> --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c<br>
>> +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c<br>
>> @@ -642,14 +642,15 @@ static unsigned int get_min_slice_count_for_odm(<br>
>>      unsigned int max_dispclk_khz;<br>
>>   <br>
>>      /* get max pixel rate and combine caps */<br>
>> -    max_dispclk_khz = dsc_enc_caps->max_total_throughput_mps * 1000;<br>
>> -    if (dsc && dsc->ctx->dc) {<br>
>> -            if (dsc->ctx->dc->clk_mgr &&<br>
>> -                    dsc->ctx->dc->clk_mgr->funcs->get_max_clock_khz) {<br>
>> -                    /* dispclk is available */<br>
>> -                    max_dispclk_khz = dsc->ctx->dc->clk_mgr->funcs->get_max_clock_khz(dsc->ctx->dc->clk_mgr, CLK_TYPE_DISPCLK);<br>
>> -            }<br>
>> -    }<br>
>> +    if (dsc && dsc->ctx->dc && dsc->ctx->dc->clk_mgr &&<br>
>> +            dsc->ctx->dc->clk_mgr->funcs->get_max_clock_khz)<br>
>> +            max_dispclk_khz =<br>
>> +                    dsc->ctx->dc->clk_mgr->funcs->get_max_clock_khz(<br>
>> +                            dsc->ctx->dc->clk_mgr, CLK_TYPE_DISPCLK);<br>
>> +    else if (dsc_enc_caps->max_total_throughput_mps)<br>
>> +            max_dispclk_khz = dsc_enc_caps->max_total_throughput_mps * 1000;<br>
>> +    else<br>
>> +            return 0;<br>
>>   <br>
>>      /* consider minimum odm slices required due to<br>
>>       * 1) display pipe throughput (dispclk)<br>
>> -- <br>
>> 2.50.1<br>
>><br>
> <br>
> This patch lgtm.<br>
> <br>
> Reviewed-by: Rodrigo Siqueira <<a href="mailto:siqueira@igalia.com" target="_blank" rel="noreferrer">siqueira@igalia.com</a>><br>
> <br>
> I added other display folks to this patch.<br>
> <br>
> I'm not sure if the original modification (4909b8b3846c) is already in<br>
> the stable kernel; if so, it could be a good idea to send this fix to<br>
> the stable kernel as well.<br>
> <br>
> Thanks<br>
> <br>
<br>
</blockquote></div></div></div>