Re: [PATCH v3 07/23] drm: atmel: use vblank hooks in struct drm_crtc_funcs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue,  7 Feb 2017 17:16:19 +0800
Shawn Guo <shawnguo@xxxxxxxxxx> wrote:

> From: Shawn Guo <shawn.guo@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Cc: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx>

Acked-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx>

> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 21 +++++++++++++++++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c   | 21 ---------------------
>  2 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index 9b17a66cf0e1..fabeeea0e899 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -434,6 +434,25 @@ static void atmel_hlcdc_crtc_destroy_state(struct drm_crtc *crtc,
>  	kfree(state);
>  }
>  
> +static int atmel_hlcdc_crtc_enable_vblank(struct drm_crtc *c)
> +{
> +	struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c);
> +	struct regmap *regmap = crtc->dc->hlcdc->regmap;
> +
> +	/* Enable SOF (Start Of Frame) interrupt for vblank counting */
> +	regmap_write(regmap, ATMEL_HLCDC_IER, ATMEL_HLCDC_SOF);
> +
> +	return 0;
> +}
> +
> +static void atmel_hlcdc_crtc_disable_vblank(struct drm_crtc *c)
> +{
> +	struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c);
> +	struct regmap *regmap = crtc->dc->hlcdc->regmap;
> +
> +	regmap_write(regmap, ATMEL_HLCDC_IDR, ATMEL_HLCDC_SOF);
> +}
> +
>  static const struct drm_crtc_funcs atmel_hlcdc_crtc_funcs = {
>  	.page_flip = drm_atomic_helper_page_flip,
>  	.set_config = drm_atomic_helper_set_config,
> @@ -441,6 +460,8 @@ static void atmel_hlcdc_crtc_destroy_state(struct drm_crtc *crtc,
>  	.reset = atmel_hlcdc_crtc_reset,
>  	.atomic_duplicate_state =  atmel_hlcdc_crtc_duplicate_state,
>  	.atomic_destroy_state = atmel_hlcdc_crtc_destroy_state,
> +	.enable_vblank = atmel_hlcdc_crtc_enable_vblank,
> +	.disable_vblank = atmel_hlcdc_crtc_disable_vblank,
>  };
>  
>  int atmel_hlcdc_crtc_create(struct drm_device *dev)
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index 5cba65b5ea16..fd1a2d0c870d 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -720,25 +720,6 @@ static void atmel_hlcdc_dc_irq_uninstall(struct drm_device *dev)
>  	regmap_read(dc->hlcdc->regmap, ATMEL_HLCDC_ISR, &isr);
>  }
>  
> -static int atmel_hlcdc_dc_enable_vblank(struct drm_device *dev,
> -					unsigned int pipe)
> -{
> -	struct atmel_hlcdc_dc *dc = dev->dev_private;
> -
> -	/* Enable SOF (Start Of Frame) interrupt for vblank counting */
> -	regmap_write(dc->hlcdc->regmap, ATMEL_HLCDC_IER, ATMEL_HLCDC_SOF);
> -
> -	return 0;
> -}
> -
> -static void atmel_hlcdc_dc_disable_vblank(struct drm_device *dev,
> -					  unsigned int pipe)
> -{
> -	struct atmel_hlcdc_dc *dc = dev->dev_private;
> -
> -	regmap_write(dc->hlcdc->regmap, ATMEL_HLCDC_IDR, ATMEL_HLCDC_SOF);
> -}
> -
>  static const struct file_operations fops = {
>  	.owner              = THIS_MODULE,
>  	.open               = drm_open,
> @@ -760,8 +741,6 @@ static void atmel_hlcdc_dc_disable_vblank(struct drm_device *dev,
>  	.irq_preinstall = atmel_hlcdc_dc_irq_uninstall,
>  	.irq_postinstall = atmel_hlcdc_dc_irq_postinstall,
>  	.irq_uninstall = atmel_hlcdc_dc_irq_uninstall,
> -	.enable_vblank = atmel_hlcdc_dc_enable_vblank,
> -	.disable_vblank = atmel_hlcdc_dc_disable_vblank,
>  	.gem_free_object_unlocked = drm_gem_cma_free_object,
>  	.gem_vm_ops = &drm_gem_cma_vm_ops,
>  	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux