diff mbox

[v3,11/23] drm: kirin: use vblank hooks in struct drm_crtc_funcs

Message ID 1486458995-31018-12-git-send-email-shawnguo@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Shawn Guo Feb. 7, 2017, 9:16 a.m. UTC
From: Shawn Guo <shawn.guo@linaro.org>

The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers.  For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Xinliang Liu Feb. 16, 2017, 3:23 a.m. UTC | #1
On 7 February 2017 at 17:16, Shawn Guo <shawnguo@kernel.org> wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> The vblank hooks in struct drm_driver are deprecated and only meant for
> legacy drivers.  For modern drivers with DRIVER_MODESET flag, the hooks
> in struct drm_crtc_funcs should be used instead.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>

Thanks Shawn for the rework patches,
For the kirin,
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>

Thanks,
-xinliang

> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index 0624fab8046f..c96c228a9898 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -302,9 +302,8 @@ static void ade_set_medianoc_qos(struct ade_crtc *acrtc)
>                            SOCKET_QOS_EN, SOCKET_QOS_EN);
>  }
>
> -static int ade_enable_vblank(struct drm_device *dev, unsigned int pipe)
> +static int ade_crtc_enable_vblank(struct drm_crtc *crtc)
>  {
> -       struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
>         struct ade_crtc *acrtc = to_ade_crtc(crtc);
>         struct ade_hw_ctx *ctx = acrtc->ctx;
>         void __iomem *base = ctx->base;
> @@ -318,9 +317,8 @@ static int ade_enable_vblank(struct drm_device *dev, unsigned int pipe)
>         return 0;
>  }
>
> -static void ade_disable_vblank(struct drm_device *dev, unsigned int pipe)
> +static void ade_crtc_disable_vblank(struct drm_crtc *crtc)
>  {
> -       struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
>         struct ade_crtc *acrtc = to_ade_crtc(crtc);
>         struct ade_hw_ctx *ctx = acrtc->ctx;
>         void __iomem *base = ctx->base;
> @@ -570,6 +568,8 @@ static void ade_crtc_atomic_flush(struct drm_crtc *crtc,
>         .set_property = drm_atomic_helper_crtc_set_property,
>         .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
>         .atomic_destroy_state   = drm_atomic_helper_crtc_destroy_state,
> +       .enable_vblank  = ade_crtc_enable_vblank,
> +       .disable_vblank = ade_crtc_disable_vblank,
>  };
>
>  static int ade_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
> @@ -1025,8 +1025,6 @@ static int ade_drm_init(struct platform_device *pdev)
>                                IRQF_SHARED, dev->driver->name, acrtc);
>         if (ret)
>                 return ret;
> -       dev->driver->enable_vblank = ade_enable_vblank;
> -       dev->driver->disable_vblank = ade_disable_vblank;
>
>         return 0;
>  }
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sean Paul Feb. 21, 2017, 4:20 p.m. UTC | #2
On Thu, Feb 16, 2017 at 11:23:39AM +0800, Xinliang Liu wrote:
> On 7 February 2017 at 17:16, Shawn Guo <shawnguo@kernel.org> wrote:
> > From: Shawn Guo <shawn.guo@linaro.org>
> >
> > The vblank hooks in struct drm_driver are deprecated and only meant for
> > legacy drivers.  For modern drivers with DRIVER_MODESET flag, the hooks
> > in struct drm_crtc_funcs should be used instead.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
> 
> Thanks Shawn for the rework patches,
> For the kirin,
> Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>

Applied to -misc

Thanks,

Sean

> 
> Thanks,
> -xinliang
> 
> > ---
> >  drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++------
> >  1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> > index 0624fab8046f..c96c228a9898 100644
> > --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> > +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> > @@ -302,9 +302,8 @@ static void ade_set_medianoc_qos(struct ade_crtc *acrtc)
> >                            SOCKET_QOS_EN, SOCKET_QOS_EN);
> >  }
> >
> > -static int ade_enable_vblank(struct drm_device *dev, unsigned int pipe)
> > +static int ade_crtc_enable_vblank(struct drm_crtc *crtc)
> >  {
> > -       struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
> >         struct ade_crtc *acrtc = to_ade_crtc(crtc);
> >         struct ade_hw_ctx *ctx = acrtc->ctx;
> >         void __iomem *base = ctx->base;
> > @@ -318,9 +317,8 @@ static int ade_enable_vblank(struct drm_device *dev, unsigned int pipe)
> >         return 0;
> >  }
> >
> > -static void ade_disable_vblank(struct drm_device *dev, unsigned int pipe)
> > +static void ade_crtc_disable_vblank(struct drm_crtc *crtc)
> >  {
> > -       struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
> >         struct ade_crtc *acrtc = to_ade_crtc(crtc);
> >         struct ade_hw_ctx *ctx = acrtc->ctx;
> >         void __iomem *base = ctx->base;
> > @@ -570,6 +568,8 @@ static void ade_crtc_atomic_flush(struct drm_crtc *crtc,
> >         .set_property = drm_atomic_helper_crtc_set_property,
> >         .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
> >         .atomic_destroy_state   = drm_atomic_helper_crtc_destroy_state,
> > +       .enable_vblank  = ade_crtc_enable_vblank,
> > +       .disable_vblank = ade_crtc_disable_vblank,
> >  };
> >
> >  static int ade_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
> > @@ -1025,8 +1025,6 @@ static int ade_drm_init(struct platform_device *pdev)
> >                                IRQF_SHARED, dev->driver->name, acrtc);
> >         if (ret)
> >                 return ret;
> > -       dev->driver->enable_vblank = ade_enable_vblank;
> > -       dev->driver->disable_vblank = ade_disable_vblank;
> >
> >         return 0;
> >  }
> > --
> > 1.9.1
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index 0624fab8046f..c96c228a9898 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -302,9 +302,8 @@  static void ade_set_medianoc_qos(struct ade_crtc *acrtc)
 			   SOCKET_QOS_EN, SOCKET_QOS_EN);
 }
 
-static int ade_enable_vblank(struct drm_device *dev, unsigned int pipe)
+static int ade_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
 	struct ade_crtc *acrtc = to_ade_crtc(crtc);
 	struct ade_hw_ctx *ctx = acrtc->ctx;
 	void __iomem *base = ctx->base;
@@ -318,9 +317,8 @@  static int ade_enable_vblank(struct drm_device *dev, unsigned int pipe)
 	return 0;
 }
 
-static void ade_disable_vblank(struct drm_device *dev, unsigned int pipe)
+static void ade_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
 	struct ade_crtc *acrtc = to_ade_crtc(crtc);
 	struct ade_hw_ctx *ctx = acrtc->ctx;
 	void __iomem *base = ctx->base;
@@ -570,6 +568,8 @@  static void ade_crtc_atomic_flush(struct drm_crtc *crtc,
 	.set_property = drm_atomic_helper_crtc_set_property,
 	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
 	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank	= ade_crtc_enable_vblank,
+	.disable_vblank	= ade_crtc_disable_vblank,
 };
 
 static int ade_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
@@ -1025,8 +1025,6 @@  static int ade_drm_init(struct platform_device *pdev)
 			       IRQF_SHARED, dev->driver->name, acrtc);
 	if (ret)
 		return ret;
-	dev->driver->enable_vblank = ade_enable_vblank;
-	dev->driver->disable_vblank = ade_disable_vblank;
 
 	return 0;
 }