mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "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>,
	Nicolas Prado <nfraprado@collabora.com>,
	"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 05/11] drm/mediatek: ovl: Implement support for Inverse Gamma
Date: Wed, 25 Feb 2026 09:40:24 +0000	[thread overview]
Message-ID: <223fbaf0a88971bc7834f383fd208747f35f2dcc.camel@mediatek.com> (raw)
In-Reply-To: <e6c5ee0f34f6347176f2918e88f6958a493da104.camel@mediatek.com>

On Wed, 2026-02-25 at 08:54 +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 Inverse Gamma setting. Available
> > functions are scRGB and BT.709. 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>
> > ---

[snip]

> > +
> > +#define MAX_COLOR_PIPELINE_OPS 3

After review later patch, this is hardware limitation.
The three ops is:
1. Inverse gamme
2. 3x3 matrix
3. gamme

Please add this information.

> 
> Why is 3? Is this hardware limitation?
> Provide some information about this value,
> so we know it's possible to change it or not.
> 
> > +
> > +static int
> > +mtk_ovl_initialize_plane_color_pipeline(struct drm_plane *plane,
> > +                                       struct drm_prop_enum_list *pipeline)
> > +{
> > +       struct drm_colorop *ops[MAX_COLOR_PIPELINE_OPS];
> > +       struct drm_device *dev = plane->dev;
> > +       int i = 0;
> > +       int ret;
> > +
> > +       memset(ops, 0, sizeof(ops));
> > +
> > +       /* 1st op: OVL's Inverse Gamma */
> > +       ops[i] = kzalloc(sizeof(*ops[i]), GFP_KERNEL);
> > +       if (!ops[i]) {
> > +               ret = -ENOMEM;
> > +               goto err_alloc;
> > +       }
> > +
> > +       ret = drm_plane_colorop_curve_1d_init(dev, ops[i], plane,
> > +                                             &mtk_ovl_colorop_funcs,
> > +                                             igamma_supported_tfs,
> > +                                             DRM_COLOROP_FLAG_ALLOW_BYPASS);
> 
> If other sub driver (maybe ovl adapter) also has inverse gamma,
> most part of this function looks common and only mtk_ovl_colorop_funcs and igamma_supported_tfs are sub driver specific.
> So move the common part to mtk_crtc.c and sub driver provide function to query mtk_ovl_colorop_funcs and igamma_supported_tfs.
> (mtk_ovl_colorop_funcs looks not a sub driver specific function, maybe it could be common part)

Sorry, I've reviewed the later patch, and I find the whole function is sub driver specific.
So forget this comment.

Regards,
CK

> 
> Regards,
> CK
> 
> > +       if (ret)
> > +               goto err_colorop_init;
> > +
> > +       pipeline->type = ops[0]->base.id;
> > +       pipeline->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", ops[0]->base.id);
> > +
> > +       return 0;
> > +
> > +err_colorop_init:
> > +       kfree(ops[i]);
> > +
> > +err_alloc:
> > +       i--;
> > +       for (; i >= 0; i--) {
> > +               drm_colorop_cleanup(ops[i]);
> > +               kfree(ops[i]);
> > +       }
> > +
> > +       return ret;
> > +}
> > +
> > 
> 
> 
> ************* MEDIATEK Confidentiality Notice
>  ********************
> The information contained in this e-mail message (including any 
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be 
> conveyed only to the designated recipient(s). Any use, dissemination, 
> distribution, printing, retaining or copying of this e-mail (including its 
> attachments) by unintended recipient(s) is strictly prohibited and may 
> be unlawful. If you are not an intended recipient of this e-mail, or believe
>  
> 
> 
> 
> that you have received this e-mail in error, please notify the sender 
> immediately (by replying to this e-mail), delete any and all copies of 
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!


  reply	other threads:[~2026-02-25  9:40 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 (胡俊光) [this message]
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
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=223fbaf0a88971bc7834f383fd208747f35f2dcc.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=ariel.dalessandro@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --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=nfraprado@collabora.com \
    --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

all inboxes | Powered by JetHome®