From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Nikolai Burov <nikolai.burov@jolla.com>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>
Cc: "p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"mripard@kernel.org" <mripard@kernel.org>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
"airlied@gmail.com" <airlied@gmail.com>,
"simona@ffwll.ch" <simona@ffwll.ch>,
"robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"jitao.shi@mediatek.com" <jitao.shi@mediatek.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"kernel@collabora.com" <kernel@collabora.com>,
"justin.yeh@mediatek.com" <justin.yeh@mediatek.com>,
"jason-jh.lin@mediatek.com" <jason-jh.lin@mediatek.com>
Subject: Re: [PATCH v8 02/13] drm/mediatek: Implement Display Stream Compression support
Date: Wed, 16 Sep 2026 12:57:25 +0200 [thread overview]
Message-ID: <1b7438ba-69c3-4c3d-b79b-2879b90fabc1@collabora.com> (raw)
In-Reply-To: <GV1PR06MB841771AF67A658BF71D4F479E4BA2@GV1PR06MB8417.eurprd06.prod.outlook.com>
On 9/15/26 20:51, Nikolai Burov wrote:
> On 9/15/26 6:05 PM, AngeloGioacchino Del Regno wrote:
> [...]
>>>> + ret = drm_dsc_setup_rc_params(dsc, DRM_DSC_1_1_PRE_SCR);
>>>> + if (ret) {
>>>> + dev_err(dev, "Cannot find DSC RC params\n");
>>>> + return ret;
>>>> + }
>>>
>>> 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 don't quite understand what is going on here, even in the original
>>> driver before this patch. What is the point of setting VACT_NL twice?
>>> Does mtk_dsi_ps_control() really need to be called in mtk_dsi_poweron()
>>> if mtk_dsi_config_vdo_timing() ends up calling it a second time?
>>
>> I didn't do much research, but MT8173 and 8192 if I remember correctly
>> won't work
>> without this sequence. I saw that 2 years ago or something, so I don't
>> remember
>> all that clearly.
>>
>
> Okay, it's fine to keep it as-is then to avoid breaking older SoCs. One
> change I would definitely recommend though is to move
> mtk_dsi_set_dsc_params() to the very beginning of the sequence, maybe
> even into mtk_dsi_host_attach().
>
> Otherwise some parts of the code might end up relying on unpopulated
> parameters by accident, and it's harder to debug if they change in the
> middle of the sequence.
>
Honestly, since it works right now, I would be happier to push this upstream
as-is, and then shuffle things around (for an optimization, or else) after
the fact.
The point is to have a working baseline upstream, then if needed improve it
later when further testing can be done - point is that there's a huge set
of patches that is restructuring everything, so I want to play safe as much
as I can in this moment - I think (and hope) you understand my feeling here.
> [...]
>> We can always come back to this in the future with a separate patch, and
>> we should
>> do just that, otherwise series versions will never come to an end :-)
>>
>
> Agreed. My work is currently also based on the restructured mediatek-drm
> driver, but I will try to send follow-up patches for MT6858 support once
> some of this stuff lands upstream.
>
That's... a w e s o m e !
This is a practical test of the restructured code on yet another platform,
and I'm happier now because it's a different type of device (as in, not a
laptop and not an aiot board).
Thanks for that, highly appreciated.
Cheers,
Angelo
next prev parent reply other threads:[~2026-09-16 10:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 8:41 [PATCH v8 00/13] drm/mediatek: Add DSC, WDMA, MT8189/96 DSI support AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 01/13] dt-bindings: display: mediatek: dsc: Add MT8196 compatible AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 02/13] drm/mediatek: Implement Display Stream Compression support AngeloGioacchino Del Regno
2026-09-15 13:37 ` Nikolai Burov
2026-09-15 13:55 ` Nikolai Burov
2026-09-15 15:05 ` AngeloGioacchino Del Regno
2026-09-15 18:51 ` Nikolai Burov
2026-09-16 10:57 ` AngeloGioacchino Del Regno [this message]
2026-09-15 8:41 ` [PATCH v8 03/13] dt-bindings: display: mediatek: dsi: Document MT8189 and MT8196 AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 04/13] drm/mediatek: mtk_dsi: Cleanup encoder if reset fails during bind AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 05/13] drm/mediatek: mtk_dsi: Enable interrupt at component bind time AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 06/13] drm/mediatek: mtk_dsi: Transfer register offsets to per-SoC const AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 07/13] drm/mediatek: mtk_dsi: Move max link rate parameter to platform data AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 08/13] drm/mediatek: mtk_dsi: Add support for MT8189 AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 09/13] drm/mediatek: mtk_dsi: Add support for SRAM QoS setting AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 10/13] drm/mediatek: mtk_dsi: Add support for MT8196 AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 11/13] drm/mediatek: mtk_dsi: Enable PM Runtime on probe AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 12/13] dt-bindings: display: mediatek: wdma: Add compatibles for more SoCs AngeloGioacchino Del Regno
2026-09-15 8:41 ` [PATCH v8 13/13] drm/mediatek: Add Write DMA (WDMA) Engine for Writeback support AngeloGioacchino Del Regno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b7438ba-69c3-4c3d-b79b-2879b90fabc1@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=airlied@gmail.com \
--cc=chunkuang.hu@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jason-jh.lin@mediatek.com \
--cc=jitao.shi@mediatek.com \
--cc=justin.yeh@mediatek.com \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthias.bgg@gmail.com \
--cc=mripard@kernel.org \
--cc=nikolai.burov@jolla.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®