public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason-JH Lin <jason-jh.lin@mediatek.com>
To: CK Hu <ck.hu@mediatek.com>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>
Cc: Rex-BC Chen <rex-bc.chen@mediatek.com>,
	Singo Chang <singo.chang@mediatek.com>,
	<dri-devel@lists.freedesktop.org>,
	<linux-mediatek@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH RESEND v3 3/9] drm/mediatek: Adjust mtk_drm_gamma_set_common parameters
Date: Wed, 14 Sep 2022 09:10:56 +0800	[thread overview]
Message-ID: <b83434dacff497fa738f84ced33fe1dc2ef32ff9.camel@mediatek.com> (raw)
In-Reply-To: <44d19c4ea29bdbf3a07890ed25fd637f8805b6c6.camel@mediatek.com>

Hi CK, 

Thanks for the reviews.

On Mon, 2022-09-12 at 10:48 +0800, CK Hu wrote:
> Hi, Jason:
> 
> On Mon, 2022-09-12 at 09:30 +0800, Jason-JH.Lin wrote:
> > Adjust the parameters in mtk_drm_gamma_set_common()
> >   - add (struct device *dev) to get lut_diff from gamma's driver
> > data
> >   - remove (bool lut_diff) and use false as default value in the
> > function
> > 
> > Fixes: 051524cbe62d ("FROMGIT: drm/mediatek: Add lut diff flag for
> > new gamma hardware support")
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_disp_aal.c   |  2 +-
> >  drivers/gpu/drm/mediatek/mtk_disp_drv.h   |  2 +-
> >  drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 13 +++++++------
> >  3 files changed, 9 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> > b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> > index 0f9d7efb61d7..6517e0a5a7d8 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_disp_aal.c
> > @@ -66,7 +66,7 @@ void mtk_aal_gamma_set(struct device *dev, struct
> > drm_crtc_state *state)
> >  	struct mtk_disp_aal *aal = dev_get_drvdata(dev);
> >  
> >  	if (aal->data && aal->data->has_gamma)
> > -		mtk_gamma_set_common(aal->regs, state, false);
> > +		mtk_gamma_set_common(NULL, aal->regs, state);
> >  }
> >  
> >  void mtk_aal_start(struct device *dev)
> > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_drv.h
> > b/drivers/gpu/drm/mediatek/mtk_disp_drv.h
> > index 33e61a136bbc..a83e5fbc8724 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_disp_drv.h
> > +++ b/drivers/gpu/drm/mediatek/mtk_disp_drv.h
> > @@ -52,7 +52,7 @@ void mtk_gamma_config(struct device *dev,
> > unsigned
> > int w,
> >  		      unsigned int h, unsigned int vrefresh,
> >  		      unsigned int bpc, struct cmdq_pkt *cmdq_pkt);
> >  void mtk_gamma_set(struct device *dev, struct drm_crtc_state
> > *state);
> > -void mtk_gamma_set_common(void __iomem *regs, struct
> > drm_crtc_state
> > *state, bool lut_diff);
> > +void mtk_gamma_set_common(struct device *dev, void __iomem *regs,
> > struct drm_crtc_state *state);
> 
> This function is called by both aal and gamma driver, so I would like
> to pass struct device dev because priv data of aal and gamma are
> different. Make this function command for both aal and gamma driver.
> 
> Regards,
> CK
> 
I think handle the priv data of AAL in the gamma_set_common function
will make this function coupling with AAL.
So I'll drop this patch and move the gamma priv data to gamma_set and
just pass the necessary parameters for gamma_set_common.


Regards,
Jason-JH.Lin
> >  void mtk_gamma_start(struct device *dev);
> >  void mtk_gamma_stop(struct device *dev);
> >  
> > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> > b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> > index bbd558a036ec..f54a6a618348 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c
> > @@ -54,14 +54,19 @@ void mtk_gamma_clk_disable(struct device *dev)
> >  	clk_disable_unprepare(gamma->clk);
> >  }
> >  
> > -void mtk_gamma_set_common(void __iomem *regs, struct
> > drm_crtc_state
> > *state, bool lut_diff)
> > +void mtk_gamma_set_common(struct device *dev, void __iomem *regs,
> > struct drm_crtc_state *state)
> >  {
> > +	struct mtk_disp_gamma *gamma = dev_get_drvdata(dev);
> > +	bool lut_diff = false;
> >  	unsigned int i, reg;
> >  	struct drm_color_lut *lut;
> >  	void __iomem *lut_base;
> >  	u32 word;
> >  	u32 diff[3] = {0};
> >  
> > +	if (gamma && gamma->data)
> > +		lut_diff = gamma->data->lut_diff;
> > +
> >  	if (state->gamma_lut) {
> >  		reg = readl(regs + DISP_GAMMA_CFG);
> >  		reg = reg | GAMMA_LUT_EN;
> > @@ -91,12 +96,8 @@ void mtk_gamma_set_common(void __iomem *regs,
> > struct drm_crtc_state *state, bool
> >  void mtk_gamma_set(struct device *dev, struct drm_crtc_state
> > *state)
> >  {
> >  	struct mtk_disp_gamma *gamma = dev_get_drvdata(dev);
> > -	bool lut_diff = false;
> > -
> > -	if (gamma->data)
> > -		lut_diff = gamma->data->lut_diff;
> >  
> > -	mtk_gamma_set_common(gamma->regs, state, lut_diff);
> > +	mtk_gamma_set_common(dev, gamma->regs, state);
> >  }
> >  
> >  void mtk_gamma_config(struct device *dev, unsigned int w,
> 
> 
-- 
Jason-JH Lin <jason-jh.lin@mediatek.com>


       reply	other threads:[~2022-09-14  1:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220912013006.27541-1-jason-jh.lin@mediatek.com>
     [not found] ` <20220912013006.27541-4-jason-jh.lin@mediatek.com>
     [not found]   ` <44d19c4ea29bdbf3a07890ed25fd637f8805b6c6.camel@mediatek.com>
2022-09-14  1:10     ` Jason-JH Lin [this message]
     [not found] ` <20220912013006.27541-5-jason-jh.lin@mediatek.com>
     [not found]   ` <e1945785da7c56bbb7fe94926c39fc6c3593cdb0.camel@mediatek.com>
2022-09-14  1:14     ` [PATCH RESEND v3 4/9] drm/mediatek: Add gamma support different lut_size for other SoC Jason-JH Lin
     [not found] ` <20220912013006.27541-6-jason-jh.lin@mediatek.com>
     [not found]   ` <b740f81d62ce73e08a2a43637b4f951298b1c28a.camel@mediatek.com>
2022-09-14  1:17     ` [PATCH RESEND v3 5/9] drm/mediatek: Add gamma support different lut_bits " Jason-JH Lin
     [not found] ` <20220912013006.27541-9-jason-jh.lin@mediatek.com>
     [not found]   ` <ecdb209437e78b3273374ef963fd2c5c64ba88fd.camel@mediatek.com>
2022-09-14  1:26     ` [PATCH RESEND v3 8/9] drm/mediatek: Add clear RELAY_MODE bit to set gamma Jason-JH Lin
     [not found] ` <20220912013006.27541-2-jason-jh.lin@mediatek.com>
2022-09-18  9:59   ` [PATCH RESEND v3 1/9] dt-bindings: mediatek: modify item formatting for gamma Krzysztof Kozlowski
     [not found] ` <20220912013006.27541-3-jason-jh.lin@mediatek.com>
2022-09-18  9:59   ` [PATCH RESEND v3 2/9] dt-bindings: mediatek: Add gamma compatible for mt8195 Krzysztof Kozlowski
2023-04-26 11:43 ` [PATCH RESEND v3 0/9] Add gamma lut support " AngeloGioacchino Del Regno
2023-04-27 15:15   ` AngeloGioacchino Del Regno
2023-04-28  6:45     ` Jason-JH Lin (林睿祥)
     [not found] ` <20220912013006.27541-7-jason-jh.lin@mediatek.com>
     [not found]   ` <3c67e742bdb06e55ba170a0a6dc79e6f6833c0e7.camel@mediatek.com>
2022-09-14  1:28     ` [PATCH RESEND v3 6/9] drm/mediatek: Add gamma support different bank_size for other SoC Jason-JH Lin
2023-04-26 12:06   ` 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=b83434dacff497fa738f84ced33fe1dc2ef32ff9.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=ck.hu@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rex-bc.chen@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=singo.chang@mediatek.com \
    /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