From: Yongqiang Niu <yongqiang.niu@mediatek.com>
To: CK Hu <ck.hu@mediatek.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
Rob Herring <robh+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
"David Airlie" <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>,
Mark Rutland <mark.rutland@arm.com>,
<dri-devel@lists.freedesktop.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2, 1/2] drm/mediatek: Fix gamma correction issue
Date: Fri, 13 Dec 2019 16:03:11 +0800 [thread overview]
Message-ID: <1576224191.31822.2.camel@mhfsdcap03> (raw)
In-Reply-To: <1576223336.9817.3.camel@mtksdaap41>
On Fri, 2019-12-13 at 15:48 +0800, CK Hu wrote:
> Hi, Yongqiang:
>
> The title is too rough. Any bug of gamma would be this title. I would
> like the title show explicitly what it does.
>
> On Fri, 2019-12-13 at 15:28 +0800, Yongqiang Niu wrote:
> > if there is no gamma function in the crtc
> > display path, don't add gamma property
> > for crtc
> >
> > Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
> > ---
> > drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> > index ca4fc47..9a8e1d4 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> > @@ -734,6 +734,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
> > int pipe = priv->num_pipes;
> > int ret;
> > int i;
> > + uint gamma_lut_size = 0;
> >
> > if (!path)
> > return 0;
> > @@ -785,6 +786,9 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
> > }
> >
> > mtk_crtc->ddp_comp[i] = comp;
> > +
> > + if (comp->funcs->gamma_set)
> > + gamma_lut_size = MTK_LUT_SIZE;
> > }
> >
> > for (i = 0; i < mtk_crtc->ddp_comp_nr; i++)
> > @@ -805,8 +809,10 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
> > NULL, pipe);
> > if (ret < 0)
> > return ret;
> > - drm_mode_crtc_set_gamma_size(&mtk_crtc->base, MTK_LUT_SIZE);
> > - drm_crtc_enable_color_mgmt(&mtk_crtc->base, 0, false, MTK_LUT_SIZE);
> > +
> > + if (gamma_lut_size)
> > + drm_mode_crtc_set_gamma_size(&mtk_crtc->base, gamma_lut_size);
> > + drm_crtc_enable_color_mgmt(&mtk_crtc->base, 0, false, gamma_lut_size);
>
> If there is no gamma, shall we enable color management?
>
> Regards,
> CK
drm_crtc_enable_color_mgmt will check the gamma_lut_size parameter,
if no gamma, gamma_lut_size will be 0, and gamma_lut_size will not attch
gamma property for the crtc
>
> > priv->num_pipes++;
> > mutex_init(&mtk_crtc->hw_lock);
> >
>
>
next prev parent reply other threads:[~2019-12-13 8:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 7:28 [PATCH v2, 0/2] drm/mediatek: Add ctm property support Yongqiang Niu
2019-12-13 7:28 ` [PATCH v2, 1/2] drm/mediatek: Fix gamma correction issue Yongqiang Niu
2019-12-13 7:48 ` CK Hu
2019-12-13 8:03 ` Yongqiang Niu [this message]
2019-12-13 8:09 ` CK Hu
2019-12-13 7:28 ` [PATCH v2, 2/2] drm/mediatek: Add ctm property support Yongqiang Niu
2019-12-13 7:57 ` CK Hu
2019-12-13 8:11 ` Yongqiang Niu
2019-12-13 8:13 ` CK Hu
2019-12-13 7:49 ` [PATCH v2, 0/2] " CK Hu
2019-12-24 2:18 ` CK Hu
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=1576224191.31822.2.camel@mhfsdcap03 \
--to=yongqiang.niu@mediatek.com \
--cc=airlied@linux.ie \
--cc=ck.hu@mediatek.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
/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