devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: CK Hu <ck.hu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: YT Shen <yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Matthias Brugger
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Daniel Kurtz <djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: Re: [PATCH v11 02/12] drm/mediatek: add helpers for coverting from the generic components
Date: Mon, 16 Jan 2017 09:09:36 +0800	[thread overview]
Message-ID: <1484528976.11503.1.camel@mtksdaap41> (raw)
In-Reply-To: <1484117473-46644-3-git-send-email-yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

On Wed, 2017-01-11 at 14:51 +0800, YT Shen wrote:
> define helpers for converting from 'mtk_ddp_comp' to 'mtk_disp_ovl'
> define helpers for converting from 'mtk_ddp_comp' to 'mtk_disp_rdma'
> 
> Signed-off-by: YT Shen <yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

Acked-by CK Hu <ck.hu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

> ---
>  drivers/gpu/drm/mediatek/mtk_disp_ovl.c  | 15 +++++++++------
>  drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 15 +++++++++------
>  2 files changed, 18 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> index c703102..ce2759f 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> @@ -57,6 +57,11 @@ struct mtk_disp_ovl {
>  	struct drm_crtc			*crtc;
>  };
>  
> +static inline struct mtk_disp_ovl *comp_to_ovl(struct mtk_ddp_comp *comp)
> +{
> +	return container_of(comp, struct mtk_disp_ovl, ddp_comp);
> +}
> +
>  static irqreturn_t mtk_disp_ovl_irq_handler(int irq, void *dev_id)
>  {
>  	struct mtk_disp_ovl *priv = dev_id;
> @@ -76,20 +81,18 @@ static irqreturn_t mtk_disp_ovl_irq_handler(int irq, void *dev_id)
>  static void mtk_ovl_enable_vblank(struct mtk_ddp_comp *comp,
>  				  struct drm_crtc *crtc)
>  {
> -	struct mtk_disp_ovl *priv = container_of(comp, struct mtk_disp_ovl,
> -						 ddp_comp);
> +	struct mtk_disp_ovl *ovl = comp_to_ovl(comp);
>  
> -	priv->crtc = crtc;
> +	ovl->crtc = crtc;
>  	writel(0x0, comp->regs + DISP_REG_OVL_INTSTA);
>  	writel_relaxed(OVL_FME_CPL_INT, comp->regs + DISP_REG_OVL_INTEN);
>  }
>  
>  static void mtk_ovl_disable_vblank(struct mtk_ddp_comp *comp)
>  {
> -	struct mtk_disp_ovl *priv = container_of(comp, struct mtk_disp_ovl,
> -						 ddp_comp);
> +	struct mtk_disp_ovl *ovl = comp_to_ovl(comp);
>  
> -	priv->crtc = NULL;
> +	ovl->crtc = NULL;
>  	writel_relaxed(0x0, comp->regs + DISP_REG_OVL_INTEN);
>  }
>  
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> index 0df05f9..21eff6f 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> @@ -49,6 +49,11 @@ struct mtk_disp_rdma {
>  	struct drm_crtc			*crtc;
>  };
>  
> +static inline struct mtk_disp_rdma *comp_to_rdma(struct mtk_ddp_comp *comp)
> +{
> +	return container_of(comp, struct mtk_disp_rdma, ddp_comp);
> +}
> +
>  static irqreturn_t mtk_disp_rdma_irq_handler(int irq, void *dev_id)
>  {
>  	struct mtk_disp_rdma *priv = dev_id;
> @@ -77,20 +82,18 @@ static void rdma_update_bits(struct mtk_ddp_comp *comp, unsigned int reg,
>  static void mtk_rdma_enable_vblank(struct mtk_ddp_comp *comp,
>  				   struct drm_crtc *crtc)
>  {
> -	struct mtk_disp_rdma *priv = container_of(comp, struct mtk_disp_rdma,
> -						  ddp_comp);
> +	struct mtk_disp_rdma *rdma = comp_to_rdma(comp);
>  
> -	priv->crtc = crtc;
> +	rdma->crtc = crtc;
>  	rdma_update_bits(comp, DISP_REG_RDMA_INT_ENABLE, RDMA_FRAME_END_INT,
>  			 RDMA_FRAME_END_INT);
>  }
>  
>  static void mtk_rdma_disable_vblank(struct mtk_ddp_comp *comp)
>  {
> -	struct mtk_disp_rdma *priv = container_of(comp, struct mtk_disp_rdma,
> -						  ddp_comp);
> +	struct mtk_disp_rdma *rdma = comp_to_rdma(comp);
>  
> -	priv->crtc = NULL;
> +	rdma->crtc = NULL;
>  	rdma_update_bits(comp, DISP_REG_RDMA_INT_ENABLE, RDMA_FRAME_END_INT, 0);
>  }
>  


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-01-16  1:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11  6:51 [PATCH v11 00/12] MT2701 DRM support YT Shen
     [not found] ` <1484117473-46644-1-git-send-email-yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-01-11  6:51   ` [PATCH v11 01/12] dt-bindings: display: mediatek: update supported chips YT Shen
2017-01-13 17:37     ` Rob Herring
2017-01-11  6:51 ` [PATCH v11 02/12] drm/mediatek: add helpers for coverting from the generic components YT Shen
     [not found]   ` <1484117473-46644-3-git-send-email-yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-01-16  1:09     ` CK Hu [this message]
2017-01-11  6:51 ` [PATCH v11 03/12] drm/mediatek: add *driver_data for different hardware settings YT Shen
2017-01-17  2:37   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 04/12] drm/mediatek: add shadow register support YT Shen
2017-01-17  2:47   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 05/12] drm/mediatek: add BLS component YT Shen
2017-01-17  5:07   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 06/12] drm/mediatek: update display module connections YT Shen
2017-01-17  5:19   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 07/12] drm/mediatek: cleaning up and refine YT Shen
2017-01-18  5:55   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 08/12] drm/mediatek: add dsi interrupt control YT Shen
2017-01-18  6:21   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 09/12] drm/mediatek: add dsi transfer function YT Shen
2017-01-18  7:49   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 10/12] drm/mediatek: add non-continuous clock mode and EOT packet control YT Shen
2017-01-19  1:42   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 11/12] drm/mediatek: update DSI sub driver flow for sending commands to panel YT Shen
2017-01-19  3:20   ` CK Hu
2017-01-11  6:51 ` [PATCH v11 12/12] drm/mediatek: add support for Mediatek SoC MT2701 YT Shen
2017-01-19  5:30   ` 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=1484528976.11503.1.camel@mtksdaap41 \
    --to=ck.hu-nus5lvnupcjwk0htik3j/w@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).