dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Shawn Guo <shawnguo@kernel.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [RFC PATCH v2 2/5] drm: hdlcd: use vblank hooks in struct drm_crtc_funcs
Date: Fri, 27 Jan 2017 17:02:06 +0000	[thread overview]
Message-ID: <20170127170206.GG3140@e110455-lin.cambridge.arm.com> (raw)
In-Reply-To: <1485065346-11578-3-git-send-email-shawnguo@kernel.org>

On Sun, Jan 22, 2017 at 02:09:03PM +0800, Shawn Guo 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: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> ---
>  drivers/gpu/drm/arm/hdlcd_crtc.c | 20 ++++++++++++++++++++
>  drivers/gpu/drm/arm/hdlcd_drv.c  | 20 --------------------
>  2 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
> index 20ebfb4fbdfa..798a3cc480a2 100644
> --- a/drivers/gpu/drm/arm/hdlcd_crtc.c
> +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
> @@ -42,6 +42,24 @@ static void hdlcd_crtc_cleanup(struct drm_crtc *crtc)
>  	drm_crtc_cleanup(crtc);
>  }
>  
> +static int hdlcd_crtc_enable_vblank(struct drm_crtc *crtc)
> +{
> +	struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
> +	unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK);
> +
> +	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask | HDLCD_INTERRUPT_VSYNC);
> +
> +	return 0;
> +}
> +
> +static void hdlcd_crtc_disable_vblank(struct drm_crtc *crtc)
> +{
> +	struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
> +	unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK);
> +
> +	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask & ~HDLCD_INTERRUPT_VSYNC);
> +}
> +
>  static const struct drm_crtc_funcs hdlcd_crtc_funcs = {
>  	.destroy = hdlcd_crtc_cleanup,
>  	.set_config = drm_atomic_helper_set_config,
> @@ -49,6 +67,8 @@ static void hdlcd_crtc_cleanup(struct drm_crtc *crtc)
>  	.reset = drm_atomic_helper_crtc_reset,
>  	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
>  	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
> +	.enable_vblank = hdlcd_crtc_enable_vblank,
> +	.disable_vblank = hdlcd_crtc_disable_vblank,
>  };
>  
>  static struct simplefb_format supported_formats[] = SIMPLEFB_FORMATS;
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index e5f4f4a6546d..6598ba4cc958 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -199,24 +199,6 @@ static void hdlcd_irq_uninstall(struct drm_device *drm)
>  	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, irq_mask);
>  }
>  
> -static int hdlcd_enable_vblank(struct drm_device *drm, unsigned int crtc)
> -{
> -	struct hdlcd_drm_private *hdlcd = drm->dev_private;
> -	unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK);
> -
> -	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask | HDLCD_INTERRUPT_VSYNC);
> -
> -	return 0;
> -}
> -
> -static void hdlcd_disable_vblank(struct drm_device *drm, unsigned int crtc)
> -{
> -	struct hdlcd_drm_private *hdlcd = drm->dev_private;
> -	unsigned int mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK);
> -
> -	hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, mask & ~HDLCD_INTERRUPT_VSYNC);
> -}
> -
>  #ifdef CONFIG_DEBUG_FS
>  static int hdlcd_show_underrun_count(struct seq_file *m, void *arg)
>  {
> @@ -285,8 +267,6 @@ static void hdlcd_debugfs_cleanup(struct drm_minor *minor)
>  	.irq_postinstall = hdlcd_irq_postinstall,
>  	.irq_uninstall = hdlcd_irq_uninstall,
>  	.get_vblank_counter = drm_vblank_no_hw_counter,
> -	.enable_vblank = hdlcd_enable_vblank,
> -	.disable_vblank = hdlcd_disable_vblank,
>  	.gem_free_object_unlocked = drm_gem_cma_free_object,
>  	.gem_vm_ops = &drm_gem_cma_vm_ops,
>  	.dumb_create = drm_gem_cma_dumb_create,
> -- 
> 1.9.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-01-27 17:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22  6:09 [RFC PATCH v2 0/5] Add vblank hooks to struct drm_crtc_funcs Shawn Guo
2017-01-22  6:09 ` [RFC PATCH v2 1/5] drm: add " Shawn Guo
2017-01-24  7:54   ` Daniel Vetter
2017-01-22  6:09 ` [RFC PATCH v2 2/5] drm: hdlcd: use vblank hooks in " Shawn Guo
2017-01-27 17:02   ` Liviu Dudau [this message]
2017-01-22  6:09 ` [RFC PATCH v2 3/5] drm: zte: zx_vou_enable[disable]_vblank can be static Shawn Guo
2017-01-22  6:09 ` [RFC PATCH v2 4/5] drm: rockchip: remove struct rockchip_crtc_funcs Shawn Guo
2017-01-22  6:09 ` [RFC PATCH v2 5/5] drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs Shawn Guo
2017-01-24  7:55 ` [RFC PATCH v2 0/5] Add vblank hooks to struct drm_crtc_funcs Daniel Vetter
2017-02-07  7:32   ` Daniel Vetter
2017-02-07  8:34     ` Shawn Guo

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=20170127170206.GG3140@e110455-lin.cambridge.arm.com \
    --to=liviu.dudau@arm.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=shawnguo@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