From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: "CK Hu (胡俊光)" <ck.hu@mediatek.com>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
"simona@ffwll.ch" <simona@ffwll.ch>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"airlied@gmail.com" <airlied@gmail.com>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"mripard@kernel.org" <mripard@kernel.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
Daniel Stone <daniels@collabora.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ariel D'Alessandro <ariel.dalessandro@collabora.com>,
"kernel@collabora.com" <kernel@collabora.com>
Subject: Re: [PATCH 08/11] drm/mediatek: ovl: Implement support for Gamma
Date: Wed, 18 Mar 2026 09:04:39 -0400 [thread overview]
Message-ID: <c4abafcb370fda06dc36338b451ddabd3de9eda3.camel@collabora.com> (raw)
In-Reply-To: <6f0e1de2043f03bd3e00a31210af50e06aef7205.camel@mediatek.com>
On Tue, 2026-03-03 at 06:53 +0000, CK Hu (胡俊光) wrote:
> On Tue, 2025-12-23 at 16:44 -0300, Nícolas F. R. A. Prado wrote:
> > External email : Please do not click links or open attachments
> > until you have verified the sender or the content.
> >
> >
> > The OVL hardware allows selecting between different fixed transfer
> > functions for each layer through the Gamma setting. Available
> > functions are scRGB, BT.709, BT.2020 and HLG. Implement support for
> > it
> > and expose it as a colorop through the DRM plane color pipeline
> > uAPI.
> >
> > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > ---
> > drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 67
> > ++++++++++++++++++++++++++++++++-
> > 1 file changed, 65 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > index 4eaa31541ccc..a70092c792a9 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > @@ -52,10 +52,16 @@
> > #define OVL_CON_CLRFMT_10_BIT (1)
> > #define DISP_REG_OVL_WCG_CFG1 0x2d8
> > #define IGAMMA_EN(layer) BIT(0 + 4 *
> > (layer))
> > +#define GAMMA_EN(layer)
> > BIT(2 + 4 * (layer))
> > #define DISP_REG_OVL_WCG_CFG2 0x2dc
> > #define IGAMMA_MASK(layer)
> > GENMASK((layer) * 4 + 1, (layer) * 4)
> > #define IGAMMA_SCRGB 0
> > #define IGAMMA_BT709 1
> > +#define GAMMA_MASK(layer)
> > GENMASK((layer) * 4 + 3, (layer) * 4 + 2)
> > +#define GAMMA_SCRGB 0
> > +#define GAMMA_BT709 1
> > +#define GAMMA_BT2020 2
> > +#define GAMMA_HLG 3
> > #define DISP_REG_OVL_ADDR_MT8173 0x0f40
> > #define DISP_REG_OVL_ADDR(ovl, n) ((ovl)->data->addr
> > + 0x20 * (n))
> > #define DISP_REG_OVL_HDR_ADDR(ovl, n) ((ovl)->data->addr
> > + 0x20 * (n) + 0x04)
> > @@ -508,11 +514,41 @@ static int
> > mtk_ovl_colorop_curve_to_reg_val(enum drm_colorop_curve_1d_type
> > curve
> > return IGAMMA_SCRGB;
> > case DRM_COLOROP_1D_CURVE_BT2020_OETF:
> > return IGAMMA_BT709;
> > + case DRM_COLOROP_1D_CURVE_SRGB_EOTF:
> > + return GAMMA_SCRGB;
> > + case DRM_COLOROP_1D_CURVE_BT2020_INV_OETF:
>
> Maybe DRM_COLOROP_1D_CURVE_BT2020_OETF?
That is the kind of thing that is just guessing unless we can verify
through writeback or through official documentation of the hardware.
Just because a block is called "Inverse Gamma" it doesn't guarantee
that all curves should have inverse in their names. Some specifications
define EOTF curves, others define OETF curves. The inverse curves are
the inverse functions of a given EOTF or OETF curve, which are often
mathematically derived and not explicitly mentioned in the specs.
As for the other comments I'll address them in a following version.
Thanks,
Nícolas
>
next prev parent reply other threads:[~2026-03-18 13:05 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 19:44 [PATCH 00/11] Plane Color Pipeline support for MediaTek Nícolas F. R. A. Prado
2025-12-23 19:44 ` [PATCH 01/11] drm/mediatek: Introduce DDP plane_colorops_init() hook Nícolas F. R. A. Prado
2026-02-06 10:07 ` AngeloGioacchino Del Regno
2026-02-06 14:13 ` Nícolas F. R. A. Prado
2025-12-23 19:44 ` [PATCH 02/11] drm/mediatek: Initialize colorops when creating plane Nícolas F. R. A. Prado
2026-02-06 10:07 ` AngeloGioacchino Del Regno
2025-12-23 19:44 ` [PATCH 03/11] drm/mediatek: ovl: Add supports_plane_colorops flag Nícolas F. R. A. Prado
2025-12-24 2:17 ` Macpaul Lin (林智斌)
2026-02-06 10:07 ` AngeloGioacchino Del Regno
2026-02-06 14:10 ` Nícolas F. R. A. Prado
2025-12-23 19:44 ` [PATCH 04/11] drm/mediatek: ovl: Enable per-plane color operations on MT8195 Nícolas F. R. A. Prado
2025-12-24 2:19 ` Macpaul Lin (林智斌)
2026-02-06 10:07 ` AngeloGioacchino Del Regno
2026-02-06 14:11 ` Nícolas F. R. A. Prado
2025-12-23 19:44 ` [PATCH 05/11] drm/mediatek: ovl: Implement support for Inverse Gamma Nícolas F. R. A. Prado
2026-02-25 8:54 ` CK Hu (胡俊光)
2026-02-25 9:40 ` CK Hu (胡俊光)
2025-12-23 19:44 ` [PATCH 06/11] drm/mediatek: Add plane_colorops_init() DDP hook for OVL Nícolas F. R. A. Prado
2025-12-24 2:20 ` Macpaul Lin (林智斌)
2026-02-25 8:58 ` CK Hu (胡俊光)
2025-12-23 19:44 ` [PATCH 07/11] drm/colorop: Introduce HLG EOTF Nícolas F. R. A. Prado
2025-12-24 2:21 ` Macpaul Lin (林智斌)
2026-02-06 8:51 ` Pekka Paalanen
2026-02-06 14:02 ` Nícolas F. R. A. Prado
2025-12-23 19:44 ` [PATCH 08/11] drm/mediatek: ovl: Implement support for Gamma Nícolas F. R. A. Prado
2026-03-03 6:53 ` CK Hu (胡俊光)
2026-03-18 13:04 ` Nícolas F. R. A. Prado [this message]
2025-12-23 19:44 ` [PATCH 09/11] drm/colorop: Introduce 3x3 Matrix Nícolas F. R. A. Prado
2026-02-06 9:27 ` Pekka Paalanen
2026-02-06 14:05 ` Nícolas F. R. A. Prado
2025-12-23 19:44 ` [PATCH 10/11] drm/mediatek: ovl: Enable support for R2R Color Space Conversion Nícolas F. R. A. Prado
2026-03-03 7:16 ` CK Hu (胡俊光)
2026-03-18 13:18 ` Nícolas F. R. A. Prado
2025-12-23 19:44 ` [PATCH 11/11] drm/mediatek: Check 3x3 Matrix colorop has DATA set Nícolas F. R. A. Prado
2026-03-03 7:21 ` CK Hu (胡俊光)
2025-12-29 18:53 ` [PATCH 00/11] Plane Color Pipeline support for MediaTek Shengyu Qu
2026-01-01 12:37 ` Shengyu Qu
2026-01-02 18:40 ` Harry Wentland
2026-02-06 9:09 ` Pekka Paalanen
2026-02-06 13:28 ` Nícolas F. R. A. Prado
2026-02-26 6:24 ` CK Hu (胡俊光)
2026-02-26 10:26 ` AngeloGioacchino Del Regno
2026-02-26 10:51 ` AngeloGioacchino Del Regno
2026-03-18 12:43 ` Nícolas F. R. A. Prado
2026-01-07 20:01 ` Xaver Hugl
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=c4abafcb370fda06dc36338b451ddabd3de9eda3.camel@collabora.com \
--to=nfraprado@collabora.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=ariel.dalessandro@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=ck.hu@mediatek.com \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--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=p.zabel@pengutronix.de \
--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