dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: Shawn Guo <shawnguo@kernel.org>
Cc: Marek Vasut <marex@denx.de>,
	dri-devel@lists.freedesktop.org,
	Neil Armstrong <narmstrong@baylibre.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Russell King <linux@armlinux.org.uk>, Jyri Sarha <jsarha@ti.com>,
	Xinliang Liu <z.liuxinliang@hisilicon.com>,
	Alexey Brodkin <abrodkin@synopsys.com>,
	Mali DP Maintainers <malidp@foss.arm.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Ben Skeggs <bskeggs@redhat.com>
Subject: Re: [PATCH v3 17/23] drm: rockchip: remove struct rockchip_crtc_funcs
Date: Tue, 7 Feb 2017 10:35:08 -0500	[thread overview]
Message-ID: <20170207153508.GD15150@art_vandelay> (raw)
In-Reply-To: <1486458995-31018-18-git-send-email-shawnguo@kernel.org>

On Tue, Feb 07, 2017 at 05:16:29PM +0800, Shawn Guo wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
> 
> With the vblank hooks in struct drm_crtc_funcs, we do not need to
> maintain struct rockchip_crtc_funcs and the related registration
> functions.  Remove them.
> 

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Mark Yao <mark.yao@rock-chips.com>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 51 -----------------------------
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 14 --------
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c |  9 ++---
>  3 files changed, 2 insertions(+), 72 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index 39243480c834..7719b9cd5b74 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -74,55 +74,6 @@ void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,
>  	arm_iommu_detach_device(dev);
>  }
>  
> -int rockchip_register_crtc_funcs(struct drm_crtc *crtc,
> -				 const struct rockchip_crtc_funcs *crtc_funcs)
> -{
> -	int pipe = drm_crtc_index(crtc);
> -	struct rockchip_drm_private *priv = crtc->dev->dev_private;
> -
> -	if (pipe >= ROCKCHIP_MAX_CRTC)
> -		return -EINVAL;
> -
> -	priv->crtc_funcs[pipe] = crtc_funcs;
> -
> -	return 0;
> -}
> -
> -void rockchip_unregister_crtc_funcs(struct drm_crtc *crtc)
> -{
> -	int pipe = drm_crtc_index(crtc);
> -	struct rockchip_drm_private *priv = crtc->dev->dev_private;
> -
> -	if (pipe >= ROCKCHIP_MAX_CRTC)
> -		return;
> -
> -	priv->crtc_funcs[pipe] = NULL;
> -}
> -
> -static int rockchip_drm_crtc_enable_vblank(struct drm_device *dev,
> -					   unsigned int pipe)
> -{
> -	struct rockchip_drm_private *priv = dev->dev_private;
> -	struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
> -
> -	if (crtc && priv->crtc_funcs[pipe] &&
> -	    priv->crtc_funcs[pipe]->enable_vblank)
> -		return priv->crtc_funcs[pipe]->enable_vblank(crtc);
> -
> -	return 0;
> -}
> -
> -static void rockchip_drm_crtc_disable_vblank(struct drm_device *dev,
> -					     unsigned int pipe)
> -{
> -	struct rockchip_drm_private *priv = dev->dev_private;
> -	struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
> -
> -	if (crtc && priv->crtc_funcs[pipe] &&
> -	    priv->crtc_funcs[pipe]->enable_vblank)
> -		priv->crtc_funcs[pipe]->disable_vblank(crtc);
> -}
> -
>  static int rockchip_drm_bind(struct device *dev)
>  {
>  	struct drm_device *drm_dev;
> @@ -270,8 +221,6 @@ static void rockchip_drm_lastclose(struct drm_device *dev)
>  	.driver_features	= DRIVER_MODESET | DRIVER_GEM |
>  				  DRIVER_PRIME | DRIVER_ATOMIC,
>  	.lastclose		= rockchip_drm_lastclose,
> -	.enable_vblank		= rockchip_drm_crtc_enable_vblank,
> -	.disable_vblank		= rockchip_drm_crtc_disable_vblank,
>  	.gem_vm_ops		= &drm_gem_cma_vm_ops,
>  	.gem_free_object_unlocked = rockchip_gem_free_object,
>  	.dumb_create		= rockchip_gem_dumb_create,
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
> index fb6226cf84b7..9f9bc959b108 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h
> @@ -31,16 +31,6 @@
>  struct drm_device;
>  struct drm_connector;
>  
> -/*
> - * Rockchip drm private crtc funcs.
> - * @enable_vblank: enable crtc vblank irq.
> - * @disable_vblank: disable crtc vblank irq.
> - */
> -struct rockchip_crtc_funcs {
> -	int (*enable_vblank)(struct drm_crtc *crtc);
> -	void (*disable_vblank)(struct drm_crtc *crtc);
> -};
> -
>  struct rockchip_crtc_state {
>  	struct drm_crtc_state base;
>  	int output_type;
> @@ -58,16 +48,12 @@ struct rockchip_crtc_state {
>  struct rockchip_drm_private {
>  	struct drm_fb_helper fbdev_helper;
>  	struct drm_gem_object *fbdev_bo;
> -	const struct rockchip_crtc_funcs *crtc_funcs[ROCKCHIP_MAX_CRTC];
>  	struct drm_atomic_state *state;
>  
>  	struct list_head psr_list;
>  	spinlock_t psr_list_lock;
>  };
>  
> -int rockchip_register_crtc_funcs(struct drm_crtc *crtc,
> -				 const struct rockchip_crtc_funcs *crtc_funcs);
> -void rockchip_unregister_crtc_funcs(struct drm_crtc *crtc);
>  int rockchip_drm_dma_attach_device(struct drm_device *drm_dev,
>  				   struct device *dev);
>  void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index fb5f001f51c3..ffee8d8c3794 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -853,11 +853,6 @@ static void vop_crtc_disable_vblank(struct drm_crtc *crtc)
>  	spin_unlock_irqrestore(&vop->irq_lock, flags);
>  }
>  
> -static const struct rockchip_crtc_funcs private_crtc_funcs = {
> -	.enable_vblank = vop_crtc_enable_vblank,
> -	.disable_vblank = vop_crtc_disable_vblank,
> -};
> -
>  static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
>  				const struct drm_display_mode *mode,
>  				struct drm_display_mode *adjusted_mode)
> @@ -1112,6 +1107,8 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc,
>  	.reset = vop_crtc_reset,
>  	.atomic_duplicate_state = vop_crtc_duplicate_state,
>  	.atomic_destroy_state = vop_crtc_destroy_state,
> +	.enable_vblank = vop_crtc_enable_vblank,
> +	.disable_vblank = vop_crtc_disable_vblank,
>  };
>  
>  static void vop_fb_unref_worker(struct drm_flip_work *work, void *val)
> @@ -1283,7 +1280,6 @@ static int vop_create_crtc(struct vop *vop)
>  	init_completion(&vop->dsp_hold_completion);
>  	init_completion(&vop->line_flag_completion);
>  	crtc->port = port;
> -	rockchip_register_crtc_funcs(crtc, &private_crtc_funcs);
>  
>  	return 0;
>  
> @@ -1302,7 +1298,6 @@ static void vop_destroy_crtc(struct vop *vop)
>  	struct drm_device *drm_dev = vop->drm_dev;
>  	struct drm_plane *plane, *tmp;
>  
> -	rockchip_unregister_crtc_funcs(crtc);
>  	of_node_put(crtc->port);
>  
>  	/*
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-02-07 15:35 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07  9:16 [PATCH v3 00/23] Add vblank hooks to struct drm_crtc_funcs Shawn Guo
2017-02-07  9:16 ` [PATCH v3 01/23] drm: add " Shawn Guo
2017-02-07 10:38   ` Andrzej Hajda
2017-02-07 10:52     ` Daniel Vetter
2017-02-07 11:50       ` Thierry Reding
2017-02-07 11:04   ` Thierry Reding
2017-02-07 14:01   ` Laurent Pinchart
2017-02-07  9:16 ` [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code Shawn Guo
2017-02-07  9:27   ` Maxime Ripard
2017-02-07  9:46   ` Boris Brezillon
2017-02-07 10:09   ` Neil Armstrong
2017-02-07 10:22   ` Russell King - ARM Linux
2017-02-07 10:42   ` Laurent Pinchart
2017-02-07 10:44     ` Russell King - ARM Linux
2017-02-07 10:58       ` Laurent Pinchart
2017-02-07 11:01       ` Thierry Reding
2017-02-07 11:54   ` Alexey Brodkin
2017-02-07 15:21   ` Liviu Dudau
2017-02-08 19:58   ` Eric Anholt
2017-02-07  9:16 ` [PATCH v3 03/23] drm: unexport function drm_vblank_no_hw_counter() Shawn Guo
2017-02-07 10:56   ` Laurent Pinchart
2017-02-07  9:16 ` [PATCH v3 04/23] drm: hdlcd: use vblank hooks in struct drm_crtc_funcs Shawn Guo
2017-02-07  9:16 ` [PATCH v3 05/23] drm: malidp: " Shawn Guo
2017-02-07 15:22   ` Liviu Dudau
2017-02-07  9:16 ` [PATCH v3 06/23] drm: armada: " Shawn Guo
2017-02-07 10:23   ` Russell King - ARM Linux
2017-02-07  9:16 ` [PATCH v3 07/23] drm: atmel: " Shawn Guo
2017-02-07  9:46   ` Boris Brezillon
2017-02-07  9:16 ` [PATCH v3 08/23] drm: exynos: " Shawn Guo
2017-02-07 10:47   ` Andrzej Hajda
2017-02-07  9:16 ` [PATCH v3 09/23] drm: fsl-dcu: " Shawn Guo
2017-02-08  5:01   ` Stefan Agner
2017-02-08 12:04     ` Daniel Vetter
2017-02-07  9:16 ` [PATCH v3 10/23] drm: hibmc: " Shawn Guo
2017-02-08 15:39   ` Sean Paul
2017-02-16  3:28   ` Xinliang Liu
2017-02-07  9:16 ` [PATCH v3 11/23] drm: kirin: " Shawn Guo
2017-02-16  3:23   ` Xinliang Liu
2017-02-21 16:20     ` Sean Paul
2017-02-07  9:16 ` [PATCH v3 12/23] drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs Shawn Guo
2017-02-07 10:10   ` Philipp Zabel
2017-02-07  9:16 ` [PATCH v3 13/23] drm: mediatek: use vblank hooks in struct drm_crtc_funcs Shawn Guo
2017-02-21 16:21   ` Sean Paul
2017-02-07  9:16 ` [PATCH v3 14/23] drm: meson: " Shawn Guo
2017-02-07 10:09   ` Neil Armstrong
2017-02-07  9:16 ` [PATCH v3 15/23] drm: qxl: " Shawn Guo
2017-02-21 16:21   ` Sean Paul
2017-02-07  9:16 ` [PATCH v3 16/23] drm: rcar-du: " Shawn Guo
2017-02-07 14:03   ` Laurent Pinchart
2017-02-07  9:16 ` [PATCH v3 17/23] drm: rockchip: remove struct rockchip_crtc_funcs Shawn Guo
2017-02-07 15:35   ` Sean Paul [this message]
2017-02-07  9:16 ` [PATCH v3 18/23] drm: shmobile: use vblank hooks in struct drm_crtc_funcs Shawn Guo
2017-02-07 14:05   ` Laurent Pinchart
2017-02-07  9:16 ` [PATCH v3 19/23] drm: sun4i: " Shawn Guo
2017-02-07  9:28   ` Maxime Ripard
2017-02-07  9:16 ` [PATCH v3 20/23] drm: tegra: " Shawn Guo
2017-02-07 11:02   ` Thierry Reding
2017-02-07  9:16 ` [PATCH v3 21/23] drm: tilcdc: " Shawn Guo
2017-02-07  9:38   ` Jyri Sarha
2017-02-07  9:16 ` [PATCH v3 22/23] drm: vc4: " Shawn Guo
2017-02-08 19:56   ` Eric Anholt
2017-02-07  9:16 ` [PATCH v3 23/23] drm: zte: " Shawn Guo
2017-02-07 15:34   ` Sean Paul
2017-02-08 11:30 ` [PATCH v3 00/23] Add vblank hooks to " Tomi Valkeinen
2017-02-08 18:10   ` Laurent Pinchart
2017-02-08 18:24     ` Daniel Vetter
2017-02-08 15:49 ` Sean Paul
2017-02-09  8:36   ` 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=20170207153508.GD15150@art_vandelay \
    --to=seanpaul@chromium.org \
    --cc=abrodkin@synopsys.com \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux@armlinux.org.uk \
    --cc=liviu.dudau@arm.com \
    --cc=malidp@foss.arm.com \
    --cc=marex@denx.de \
    --cc=maxime.ripard@free-electrons.com \
    --cc=narmstrong@baylibre.com \
    --cc=shawnguo@kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=z.liuxinliang@hisilicon.com \
    /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