lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a634b80e-1549-86a1-4cda-274743eec554@denx.de>
Date:   Mon, 12 Feb 2018 10:26:09 +0100
From:   Marek Vasut <marex@...x.de>
To:     Oleksandr Andrushchenko <andr2000@...il.com>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc:     daniel.vetter@...el.com, gustavo@...ovan.org, airlied@...ux.ie,
        seanpaul@...omium.org,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>
Subject: Re: [PATCH 2/4] drm/mxsfb: Do not use deprecated
 drm_driver.{enable|disable)_vblank

On 02/12/2018 09:52 AM, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>
> 
> Do not use deprecated drm_driver.{enable|disable)_vblank callbacks,
> but use drm_simple_kms_helpe's pipe callbacks instead.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>
> Cc: Marek Vasut <marex@...x.de>

Reviewed-by: Marek Vasut <marex@...x.de>

> ---
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c | 54 ++++++++++++++++++++-------------------
>  1 file changed, 28 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 1207ffe36250..5cae8db9dcd4 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -131,11 +131,37 @@ static int mxsfb_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
>  	return drm_gem_fb_prepare_fb(&pipe->plane, plane_state);
>  }
>  
> +static int mxsfb_pipe_enable_vblank(struct drm_simple_display_pipe *pipe)
> +{
> +	struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe);
> +
> +	/* Clear and enable VBLANK IRQ */
> +	mxsfb_enable_axi_clk(mxsfb);
> +	writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> +	writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_SET);
> +	mxsfb_disable_axi_clk(mxsfb);
> +
> +	return 0;
> +}
> +
> +static void mxsfb_pipe_disable_vblank(struct drm_simple_display_pipe *pipe)
> +{
> +	struct mxsfb_drm_private *mxsfb = drm_pipe_to_mxsfb_drm_private(pipe);
> +
> +	/* Disable and clear VBLANK IRQ */
> +	mxsfb_enable_axi_clk(mxsfb);
> +	writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> +	writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> +	mxsfb_disable_axi_clk(mxsfb);
> +}
> +
>  static struct drm_simple_display_pipe_funcs mxsfb_funcs = {
>  	.enable		= mxsfb_pipe_enable,
>  	.disable	= mxsfb_pipe_disable,
>  	.update		= mxsfb_pipe_update,
>  	.prepare_fb	= mxsfb_pipe_prepare_fb,
> +	.enable_vblank	= mxsfb_pipe_enable_vblank,
> +	.disable_vblank	= mxsfb_pipe_disable_vblank,
>  };
>  
>  static int mxsfb_load(struct drm_device *drm, unsigned long flags)
> @@ -274,33 +300,11 @@ static void mxsfb_lastclose(struct drm_device *drm)
>  	drm_fbdev_cma_restore_mode(mxsfb->fbdev);
>  }
>  
> -static int mxsfb_enable_vblank(struct drm_device *drm, unsigned int crtc)
> -{
> -	struct mxsfb_drm_private *mxsfb = drm->dev_private;
> -
> -	/* Clear and enable VBLANK IRQ */
> -	mxsfb_enable_axi_clk(mxsfb);
> -	writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> -	writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_SET);
> -	mxsfb_disable_axi_clk(mxsfb);
> -
> -	return 0;
> -}
> -
> -static void mxsfb_disable_vblank(struct drm_device *drm, unsigned int crtc)
> +static void mxsfb_irq_preinstall(struct drm_device *drm)
>  {
>  	struct mxsfb_drm_private *mxsfb = drm->dev_private;
>  
> -	/* Disable and clear VBLANK IRQ */
> -	mxsfb_enable_axi_clk(mxsfb);
> -	writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> -	writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> -	mxsfb_disable_axi_clk(mxsfb);
> -}
> -
> -static void mxsfb_irq_preinstall(struct drm_device *drm)
> -{
> -	mxsfb_disable_vblank(drm, 0);
> +	mxsfb_pipe_disable_vblank(&mxsfb->pipe);
>  }
>  
>  static irqreturn_t mxsfb_irq_handler(int irq, void *data)
> @@ -333,8 +337,6 @@ static struct drm_driver mxsfb_driver = {
>  	.irq_handler		= mxsfb_irq_handler,
>  	.irq_preinstall		= mxsfb_irq_preinstall,
>  	.irq_uninstall		= mxsfb_irq_preinstall,
> -	.enable_vblank		= mxsfb_enable_vblank,
> -	.disable_vblank		= mxsfb_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,
> 


-- 
Best regards,
Marek Vasut

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ