Re: [PATCH v8 02/13] drm/mediatek: Implement Display Stream Compression support

From: Nikolai Burov

Date: Sat Sep 19 2026 - 06:07:19 EST


On 9/16/26 1:57 PM, AngeloGioacchino Del Regno wrote:
>>>> The defaults in MediaTek's downstream driver match DRM_DSC_1_2_444, not
>>>> DRM_DSC_1_1_PRE_SCR, and the panel on my test device requires that even
>>>> though it uses DSC v1.1. This may be a panel-specific problem, but have
>>>> you tested this with any actual panels that need 1_1_PRE_SCR?
>>>>
>>>
>>> My downstream uses 1_1_PRE_SCR... that's why it is like this.
>>>
>>> I can resolve it like
>>>
>>> if (dsc->dsc_version_major == 1 && dsc->dsc_version_minor == 1)
>>> type = DRM_DSC_1_1_PRE_SCR;
>>> else
>>> type = DRM_DSC_1_2_444;
>>>
>>> ret = drm_dsc_setup_rc_params(dsc, type);
>>>
>>> ...that will work, granted that the panel declares the correct DSC
>>> version.
>>>
>>
>> Unfortunately not, because DRM_DSC_1_2_444 is also needed for some v1.1
>> panels. From drivers/gpu/drm/drm_dsc_helper.c:
>>
>> /*
>> * Selected Rate Control Related Parameter Recommended Values from
>> DSC v1.2, v1.2a, v1.2b and
>> * DSC_v1.1_E1 specs.
>> *
>> * Cross-checked against C Model releases: DSC_model_20161212 and
>> 20210623
>> */
>> static const struct rc_parameters_data rc_parameters_1_2_444[] = {
>> ...
>>
>> I'm pretty sure that my device is not using DSC v1.2.
>>
>> Since this is definitely panel-specific and there seems to be no good
>> way to detect the required parameters at the moment, this is probably
>> something to fix later.
>>
>
> Ok, let's just go with 1_2_444 then - makes sense... that's something
> that must be accounted at the API level, because I know of some panels
> that need the PRE_SCR set... and that's even if they're using v1.2, just
> because - for whatever reason - some of the DSC params are stored in and
> read from an OTP area of the DriverIC (and that would mismatch then with
> the other params that are runtime-programmable from the DrIC view, which
> results in pixel-garbage artifacts).
>
> Not sure how many panels are doing that, but this is of course not a MTK
> specific thing... I looked around, and apparently there's a mention of
> that in the Intel driver as well - yay I'm not the only one who knows, lol.
>
> (And I definitely didn't expect that to be the case anyway).

I just double-checked the downstream code I was referring to, and it
seems that the 1.2 parameters are only used for 10-bit panels by
default. The parameters for 8-bit panels match 1_1_PRE_SCR [1].

So this would be closer to the default downstream behavior:

if (dsc->bits_per_component == 8)
type = DRM_DSC_1_1_PRE_SCR;
else
type = DRM_DSC_1_2_444;

ret = drm_dsc_setup_rc_params(dsc, type);

But again, this is actually panel-specific and should be fixed
separately. I wasn't demanding any changes here and you can also keep
using 1_1_PRE_SCR or whatever works for you if you have to send another
version.

[1]: https://github.com/oppo-source/android_kernel_modules_and_devicetree_oppo_mt6993/blob/4d505a4292dab3176a45fec66dc85debc362e24c/kernel/kernel_device_modules-6.12/drivers/gpu/drm/mediatek/mediatek_v2/v1/mtk_disp_dsc.c#L1522

Best regards,
Nikolai