Skip to contentSkip to conversation

Add vblank hooks to struct drm_crtc_funcs

PATCH Applied Shawn Guo 18 participants 68 messages Feb 7, 2017 – Feb 21, 2017

Subsystems (33)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

v3 cover Add vblank hooks to struct drm_crtc_funcs

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. The first patch adds 3 vblank core<->driver hooks into struct drm_crtc_funcs, and plug them into core by adding wrapper functions for vblank handling code. We effectively make the .get_vblank_counter hook optional by providing drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Patch #2 and #3 unexport function drm_vblank_no_hw_counter() by cleaning up its use, since it's already the default implememention for .get_vblank_counter hook anyway.

The rest of the series is trying to do a massive conversion to the new hooks for DRIVER_MODESET drivers. But it only handles low-hanging fruit, and leaves out the ones that need a bit surgery, like gma500, i915, msm etc. Most of conversion get done by simply moving code and making functions static, but imx and rockchip are great examples showing how driver code can be cleaned up with these new hooks.

The series is generated against branch drm-next.

Changes for v3:
- Let drm_vblank_no_hw_counter() be the last fallback for .get_vblank_counter() hook.
- Improve the kernel-doc for .get_vblank_counter() hook.
- Convert more DRIVER_MODESET drivers to new hooks.

Changes for v2:
- Wrap around core vblank handling code to save drm_crtc_enable[disable]_vblank() helpers
- Add .get_vblank_counter to struct drm_crtc_funcs
- Add some comments to link between two sets of hooks
- Add one hdlcd driver patch for example

Shawn Guo (23):
drm: add vblank hooks to struct drm_crtc_funcs
drm: remove drm_vblank_no_hw_counter assignment from driver code
drm: unexport function drm_vblank_no_hw_counter()
drm: hdlcd: use vblank hooks in struct drm_crtc_funcs
drm: malidp: use vblank hooks in struct drm_crtc_funcs
drm: armada: use vblank hooks in struct drm_crtc_funcs
drm: atmel: use vblank hooks in struct drm_crtc_funcs
drm: exynos: use vblank hooks in struct drm_crtc_funcs
drm: fsl-dcu: use vblank hooks in struct drm_crtc_funcs
drm: hibmc: use vblank hooks in struct drm_crtc_funcs
drm: kirin: use vblank hooks in struct drm_crtc_funcs
drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs
drm: mediatek: use vblank hooks in struct drm_crtc_funcs
drm: meson: use vblank hooks in struct drm_crtc_funcs
drm: qxl: use vblank hooks in struct drm_crtc_funcs
drm: rcar-du: use vblank hooks in struct drm_crtc_funcs
drm: rockchip: remove struct rockchip_crtc_funcs
drm: shmobile: use vblank hooks in struct drm_crtc_funcs
drm: sun4i: use vblank hooks in struct drm_crtc_funcs
drm: tegra: use vblank hooks in struct drm_crtc_funcs
drm: tilcdc: use vblank hooks in struct drm_crtc_funcs
drm: vc4: use vblank hooks in struct drm_crtc_funcs
drm: zte: use vblank hooks in struct drm_crtc_funcs

 drivers/gpu/drm/arc/arcpgu_drv.c                |   1 -
 drivers/gpu/drm/arm/hdlcd_crtc.c                |  20 +++++
 drivers/gpu/drm/arm/hdlcd_drv.c                 |  21 -----
 drivers/gpu/drm/arm/malidp_crtc.c               |  21 +++++
 drivers/gpu/drm/arm/malidp_drv.c                |  22 -----
 drivers/gpu/drm/armada/armada_crtc.c            |  56 ++++++++-----
 drivers/gpu/drm/armada/armada_crtc.h            |   2 -
 drivers/gpu/drm/armada/armada_drv.c             |  17 ----
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c  |  21 +++++
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    |  22 -----
 drivers/gpu/drm/drm_irq.c                       |  81 +++++++++++++------
 drivers/gpu/drm/exynos/exynos_drm_crtc.c        |  40 +++++-----
 drivers/gpu/drm/exynos/exynos_drm_crtc.h        |   2 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         |   4 -
 drivers/gpu/drm/exynos/exynos_drm_drv.h         |   8 --
 drivers/gpu/drm/exynos/exynos_hdmi.c            |   7 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c      |  26 ++++++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       |  26 ------
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  |  20 +++++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c |  23 ------
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |  11 +--
 drivers/gpu/drm/i915/i915_irq.c                 |   1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 102 ------------------------
 drivers/gpu/drm/imx/imx-drm.h                   |  13 ---
 drivers/gpu/drm/imx/ipuv3-crtc.c                |  58 +++++---------
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c         |   8 +-
 drivers/gpu/drm/mediatek/mtk_drm_crtc.h         |   2 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          |   4 -
 drivers/gpu/drm/meson/meson_crtc.c              |  22 +++++
 drivers/gpu/drm/meson/meson_drv.c               |  21 -----
 drivers/gpu/drm/msm/msm_drv.c                   |   1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               |   1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           |   1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              |   1 -
 drivers/gpu/drm/qxl/qxl_display.c               |  16 ++++
 drivers/gpu/drm/qxl/qxl_drv.c                   |  18 -----
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c          |  29 ++++---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h          |   1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           |  20 -----
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     |  52 ------------
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h     |  14 ----
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c     |   9 +--
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c       |  51 ++++++++----
 drivers/gpu/drm/shmobile/shmob_drm_crtc.h       |   1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        |  20 -----
 drivers/gpu/drm/sti/sti_drv.c                   |   1 -
 drivers/gpu/drm/sun4i/sun4i_crtc.c              |  24 ++++++
 drivers/gpu/drm/sun4i/sun4i_drv.c               |  28 -------
 drivers/gpu/drm/tegra/dc.c                      |  15 +++-
 drivers/gpu/drm/tegra/drm.c                     |  38 ---------
 drivers/gpu/drm/tegra/drm.h                     |   3 -
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c            |  11 +++
 drivers/gpu/drm/tilcdc/tilcdc_drv.c             |  13 ---
 drivers/gpu/drm/vc4/vc4_crtc.c                  |   8 +-
 drivers/gpu/drm/vc4/vc4_drv.c                   |   3 -
 drivers/gpu/drm/vc4/vc4_drv.h                   |   2 -
 drivers/gpu/drm/zte/zx_drm_drv.c                |   3 -
 drivers/gpu/drm/zte/zx_vou.c                    |  61 ++++++--------
 drivers/gpu/drm/zte/zx_vou.h                    |   3 -
 include/drm/drm_crtc.h                          |  44 ++++++++++
 include/drm/drm_drv.h                           |  16 +++-
 include/drm/drm_irq.h                           |   1 -
 62 files changed, 481 insertions(+), 710 deletions(-)
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#1 lore raw

PATCH v3 1/23 drm: add vblank hooks to struct drm_crtc_funcs

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. Let's keep the vblank hooks struct drm_driver for legacy drivers, and add corresponding hooks in struct drm_crtc_funcs. These hooks take struct drm_crtc pointer as argument, and will be called by core vblank handling code for DRIVER_MODESET drivers.

The new hooks get plugged into core by adding wrapper functions for vblank handling code. The .get_vblank_counter hook is effectively optional, as we provide drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

---
 drivers/gpu/drm/drm_irq.c | 53 +++++++++++++++++++++++++++++++++++++++++------
 include/drm/drm_crtc.h    | 44 +++++++++++++++++++++++++++++++++++++++
 include/drm/drm_drv.h     |  9 ++++++++
 3 files changed, 100 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_irq.c +47 -6
index e06cf11ebb4a..646b3e57b9ad 100644
@@ -89,6 +89,21 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe,
 	write_sequnlock(&vblank->seqlock);
 }
 
+static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->get_vblank_counter)
+			return crtc->funcs->get_vblank_counter(crtc);
+	}
+
+	if (dev->driver->get_vblank_counter)
+		return dev->driver->get_vblank_counter(dev, pipe);
+
+	return drm_vblank_no_hw_counter(dev, pipe);
+}
+
 /*
  * Reset the stored timestamp for the current vblank count to correspond
  * to the last vblank occurred.
@@ -112,9 +127,9 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe
 	 * when drm_vblank_enable() applies the diff
 	 */
 	do {
-		cur_vblank = dev->driver->get_vblank_counter(dev, pipe);
+		cur_vblank = __get_vblank_counter(dev, pipe);
 		rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, 0);
-	} while (cur_vblank != dev->driver->get_vblank_counter(dev, pipe) && --count > 0);
+	} while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0);
 
 	/*
 	 * Only reinitialize corresponding vblank timestamp if high-precision query
@@ -168,9 +183,9 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
 	 * corresponding vblank timestamp.
 	 */
 	do {
-		cur_vblank = dev->driver->get_vblank_counter(dev, pipe);
+		cur_vblank = __get_vblank_counter(dev, pipe);
 		rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, flags);
-	} while (cur_vblank != dev->driver->get_vblank_counter(dev, pipe) && --count > 0);
+	} while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0);
 
 	if (dev->max_vblank_count != 0) {
 		/* trust the hw counter when it's around */
@@ -275,6 +290,20 @@ u32 drm_accurate_vblank_count(struct drm_crtc *crtc)
 }
 EXPORT_SYMBOL(drm_accurate_vblank_count);
 
+static void __disable_vblank(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->disable_vblank) {
+			crtc->funcs->disable_vblank(crtc);
+			return;
+		}
+	}
+
+	dev->driver->disable_vblank(dev, pipe);
+}
+
 /*
  * Disable vblank irq's on crtc, make sure that last vblank count
  * of hardware and corresponding consistent software vblank counter
@@ -298,7 +327,7 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
 	 * hardware potentially runtime suspended.
 	 */
 	if (vblank->enabled) {
-		dev->driver->disable_vblank(dev, pipe);
+		__disable_vblank(dev, pipe);
 		vblank->enabled = false;
 	}
 
@@ -1027,6 +1056,18 @@ void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
 }
 EXPORT_SYMBOL(drm_crtc_send_vblank_event);
 
+static int __enable_vblank(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->enable_vblank)
+			return crtc->funcs->enable_vblank(crtc);
+	}
+
+	return dev->driver->enable_vblank(dev, pipe);
+}
+
 /**
  * drm_vblank_enable - enable the vblank interrupt on a CRTC
  * @dev: DRM device
@@ -1052,7 +1093,7 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
 		 * timestamps. Filtercode in drm_handle_vblank() will
 		 * prevent double-accounting of same vblank interval.
 		 */
-		ret = dev->driver->enable_vblank(dev, pipe);
+		ret = __enable_vblank(dev, pipe);
 		DRM_DEBUG("enabling vblank on crtc %u, ret: %d\n", pipe, ret);
 		if (ret)
 			atomic_dec(&vblank->refcount);
include/drm/drm_crtc.h +44 -0

50 lines not on this page · raw message

include/drm/drm_drv.h +9 -0
index f2c0040ddc3a..40ae89106594 100644
@@ -130,6 +130,9 @@ struct drm_driver {
 	 * drm_crtc_vblank_off() and drm_crtc_vblank_on() when disabling or
 	 * enabling a CRTC.
 	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.get_vblank_counter instead.
+	 *
 	 * Returns:
 	 *
 	 * Raw vblank counter value.
@@ -142,6 +145,9 @@ struct drm_driver {
 	 * Enable vblank interrupts for the CRTC specified with the pipe
 	 * argument.
 	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.enable_vblank instead.
+	 *
 	 * Returns:
 	 *
 	 * Zero on success, appropriate errno if the given @crtc's vblank
@@ -154,6 +160,9 @@ struct drm_driver {
 	 *
 	 * Disable vblank interrupts for the CRTC specified with the pipe
 	 * argument.
+	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.disable_vblank instead.
 	 */
 	void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 1/23
#2 lore raw

Re: [PATCH v3 01/23] drm: add vblank hooks to struct drm_crtc_funcs

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. Let's keep the vblank hooks struct drm_driver for legacy drivers, and add corresponding hooks in struct drm_crtc_funcs. These hooks take struct drm_crtc pointer as argument, and will be called by core vblank handling code for DRIVER_MODESET drivers.

Quoted 6 lines

The new hooks get plugged into core by adding wrapper functions for vblank handling code. The .get_vblank_counter hook is effectively optional, as we provide drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Every time I have lurked into vblank code I was wondering why it is not a part of crtc, thanks for clearing it up.
Small comment below, anyway:

Quoted 15 lines
---
 drivers/gpu/drm/drm_irq.c | 53 +++++++++++++++++++++++++++++++++++++++++------
 include/drm/drm_crtc.h    | 44 +++++++++++++++++++++++++++++++++++++++
 include/drm/drm_drv.h     |  9 ++++++++
 3 files changed, 100 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_irq.c +1 -0
index e06cf11ebb4a..646b3e57b9ad 100644
@@ -89,6 +89,21 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe,
 	write_sequnlock(&vblank->seqlock);
 }
 
+static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)

drivers/gpu/drm/drm_irq.c static void store_vblank(struct drm_device *dev, unsigned int pipe, · line 102

Quoted 10 lines
drivers/gpu/drm/drm_irq.c +10 -0
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->get_vblank_counter)
+			return crtc->funcs->get_vblank_counter(crtc);
+	}
+
+	if (dev->driver->get_vblank_counter)
+		return dev->driver->get_vblank_counter(dev, pipe);

After converting all modeset drivers dev->driver->get_vblank_counter could be called only for non-modeset drivers, ie 'else' can be put before last if, the same for two other callbacks.

Regards
Andrzej

Quoted 169 lines
drivers/gpu/drm/drm_irq.c +36 -6
+
+	return drm_vblank_no_hw_counter(dev, pipe);
+}
+
 /*
  * Reset the stored timestamp for the current vblank count to correspond
  * to the last vblank occurred.
@@ -112,9 +127,9 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe
 	 * when drm_vblank_enable() applies the diff
 	 */
 	do {
-		cur_vblank = dev->driver->get_vblank_counter(dev, pipe);
+		cur_vblank = __get_vblank_counter(dev, pipe);
 		rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, 0);
-	} while (cur_vblank != dev->driver->get_vblank_counter(dev, pipe) && --count > 0);
+	} while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0);
 
 	/*
 	 * Only reinitialize corresponding vblank timestamp if high-precision query
@@ -168,9 +183,9 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
 	 * corresponding vblank timestamp.
 	 */
 	do {
-		cur_vblank = dev->driver->get_vblank_counter(dev, pipe);
+		cur_vblank = __get_vblank_counter(dev, pipe);
 		rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, flags);
-	} while (cur_vblank != dev->driver->get_vblank_counter(dev, pipe) && --count > 0);
+	} while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0);
 
 	if (dev->max_vblank_count != 0) {
 		/* trust the hw counter when it's around */
@@ -275,6 +290,20 @@ u32 drm_accurate_vblank_count(struct drm_crtc *crtc)
 }
 EXPORT_SYMBOL(drm_accurate_vblank_count);
 
+static void __disable_vblank(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->disable_vblank) {
+			crtc->funcs->disable_vblank(crtc);
+			return;
+		}
+	}
+
+	dev->driver->disable_vblank(dev, pipe);
+}
+
 /*
  * Disable vblank irq's on crtc, make sure that last vblank count
  * of hardware and corresponding consistent software vblank counter
@@ -298,7 +327,7 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
 	 * hardware potentially runtime suspended.
 	 */
 	if (vblank->enabled) {
-		dev->driver->disable_vblank(dev, pipe);
+		__disable_vblank(dev, pipe);
 		vblank->enabled = false;
 	}
 
@@ -1027,6 +1056,18 @@ void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
 }
 EXPORT_SYMBOL(drm_crtc_send_vblank_event);
 
+static int __enable_vblank(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->enable_vblank)
+			return crtc->funcs->enable_vblank(crtc);
+	}
+
+	return dev->driver->enable_vblank(dev, pipe);
+}
+
 /**
  * drm_vblank_enable - enable the vblank interrupt on a CRTC
  * @dev: DRM device
@@ -1052,7 +1093,7 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
 		 * timestamps. Filtercode in drm_handle_vblank() will
 		 * prevent double-accounting of same vblank interval.
 		 */
-		ret = dev->driver->enable_vblank(dev, pipe);
+		ret = __enable_vblank(dev, pipe);
 		DRM_DEBUG("enabling vblank on crtc %u, ret: %d\n", pipe, ret);
 		if (ret)
 			atomic_dec(&vblank->refcount);
include/drm/drm_crtc.h +44 -0
index 8f0b195e4a59..4323acefa596 100644
@@ -601,6 +601,50 @@ struct drm_crtc_funcs {
 	 */
 	void (*atomic_print_state)(struct drm_printer *p,
 				   const struct drm_crtc_state *state);
+
+	/**
+	 * @get_vblank_counter:
+	 *
+	 * Driver callback for fetching a raw hardware vblank counter for the
+	 * CRTC. It's meant to be used by new drivers as the replacement of
+	 * &drm_driver.get_vblank_counter hook.
+	 *
+	 * This callback is optional. If a device doesn't have a hardware
+	 * counter, the driver can simply leave the hook as NULL. The DRM core
+	 * will account for missed vblank events while interrupts where disabled
+	 * based on system timestamps.
+	 *
+	 * Wraparound handling and loss of events due to modesetting is dealt
+	 * with in the DRM core code, as long as drivers call
+	 * drm_crtc_vblank_off() and drm_crtc_vblank_on() when disabling or
+	 * enabling a CRTC.
+	 *
+	 * Returns:
+	 *
+	 * Raw vblank counter value.
+	 */
+	u32 (*get_vblank_counter)(struct drm_crtc *crtc);
+
+	/**
+	 * @enable_vblank:
+	 *
+	 * Enable vblank interrupts for the CRTC. It's meant to be used by
+	 * new drivers as the replacement of &drm_driver.enable_vblank hook.
+	 *
+	 * Returns:
+	 *
+	 * Zero on success, appropriate errno if the vblank interrupt cannot
+	 * be enabled.
+	 */
+	int (*enable_vblank)(struct drm_crtc *crtc);
+
+	/**
+	 * @disable_vblank:
+	 *
+	 * Disable vblank interrupts for the CRTC. It's meant to be used by
+	 * new drivers as the replacement of &drm_driver.disable_vblank hook.
+	 */
+	void (*disable_vblank)(struct drm_crtc *crtc);
 };
 
 /**
include/drm/drm_drv.h +6 -0
index f2c0040ddc3a..40ae89106594 100644
@@ -130,6 +130,9 @@ struct drm_driver {
 	 * drm_crtc_vblank_off() and drm_crtc_vblank_on() when disabling or
 	 * enabling a CRTC.
 	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.get_vblank_counter instead.
+	 *
 	 * Returns:
 	 *
 	 * Raw vblank counter value.
@@ -142,6 +145,9 @@ struct drm_driver {
 	 * Enable vblank interrupts for the CRTC specified with the pipe
 	 * argument.
 	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.enable_vblank instead.
+	 *
 	 * Returns:
 	 *
 	 * Zero on success, appropriate errno if the given @crtc's vblank

include/drm/drm_drv.h struct drm_driver { · line 168

Quoted 9 lines
include/drm/drm_drv.h +3 -0
@@ -154,6 +160,9 @@ struct drm_driver {
 	 *
 	 * Disable vblank interrupts for the CRTC specified with the pipe
 	 * argument.
+	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.disable_vblank instead.
 	 */
 	void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH v3 01/23] drm: add vblank hooks to struct drm_crtc_funcs

Quoted 16 lines · Andrzej Hajda

drivers/gpu/drm/drm_irq.c static void store_vblank(struct drm_device *dev, unsigned int pipe, · line 102

Quoted 11 lines · Shawn Guo
drivers/gpu/drm/drm_irq.c +11 -0
+static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->get_vblank_counter)
+			return crtc->funcs->get_vblank_counter(crtc);
+	}
+
+	if (dev->driver->get_vblank_counter)
+		return dev->driver->get_vblank_counter(dev, pipe);

After converting all modeset drivers dev->driver->get_vblank_counter could be called only for non-modeset drivers, ie 'else' can be put before last if, the same for two other callbacks.

Shawn converted a lot of drivers, but not yet all of them. There's a lot more kms drivers, so probably will take some time until we can do this. But a good long-term goal indeed.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH v3 01/23] drm: add vblank hooks to struct drm_crtc_funcs

Quoted 18 lines · Daniel Vetter
Quoted 16 lines · Andrzej Hajda

drivers/gpu/drm/drm_irq.c static void store_vblank(struct drm_device *dev, unsigned int pipe, · line 102

Quoted 11 lines · Shawn Guo
drivers/gpu/drm/drm_irq.c +11 -0
+static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->get_vblank_counter)
+			return crtc->funcs->get_vblank_counter(crtc);
+	}
+
+	if (dev->driver->get_vblank_counter)
+		return dev->driver->get_vblank_counter(dev, pipe);

After converting all modeset drivers dev->driver->get_vblank_counter could be called only for non-modeset drivers, ie 'else' can be put before last if, the same for two other callbacks.

Quoted 3 lines

Shawn converted a lot of drivers, but not yet all of them. There's a lot more kms drivers, so probably will take some time until we can do this. But a good long-term goal indeed.

Probably should be added to that new TODO list thing... =)

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v3 1/23
#5 lore raw

Re: [PATCH v3 01/23] drm: add vblank hooks to struct drm_crtc_funcs

In reply to Shawn Guo
Quoted 13 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. Let's keep the vblank hooks struct drm_driver for legacy drivers, and add corresponding hooks in struct drm_crtc_funcs. These hooks take struct drm_crtc pointer as argument, and will be called by core vblank handling code for DRIVER_MODESET drivers.

The new hooks get plugged into core by adding wrapper functions for vblank handling code. The .get_vblank_counter hook is effectively optional, as we provide drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Quoted 6 lines
---
 drivers/gpu/drm/drm_irq.c | 53 +++++++++++++++++++++++++++++++++++++++++------
 include/drm/drm_crtc.h    | 44 +++++++++++++++++++++++++++++++++++++++
 include/drm/drm_drv.h     |  9 ++++++++
 3 files changed, 100 insertions(+), 6 deletions(-)

I had been meaning to do this for a long time myself but never got around to it. Great stuff.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v3 1/23
#6 lore raw

Re: [PATCH v3 01/23] drm: add vblank hooks to struct drm_crtc_funcs

In reply to Shawn Guo

Hi Shawn,

Thank you for the patch.

Quoted 8 lines · On Tuesday 07 Feb 2017 17:16:13 Shawn Guo wrote:

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. Let's keep the vblank hooks struct drm_driver for legacy drivers, and add corresponding hooks in struct drm_crtc_funcs. These hooks take struct drm_crtc pointer as argument, and will be called by core vblank handling code for DRIVER_MODESET drivers.

Quoted 6 lines

The new hooks get plugged into core by adding wrapper functions for vblank handling code. The .get_vblank_counter hook is effectively optional, as we provide drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Quoted 33 lines
---
 drivers/gpu/drm/drm_irq.c | 53 ++++++++++++++++++++++++++++++++++++++------
 include/drm/drm_crtc.h    | 44 +++++++++++++++++++++++++++++++++++++++
 include/drm/drm_drv.h     |  9 ++++++++
 3 files changed, 100 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_irq.c +15 -0
index e06cf11ebb4a..646b3e57b9ad 100644
@@ -89,6 +89,21 @@ static void store_vblank(struct drm_device *dev, unsigned
 int pipe, write_sequnlock(&vblank->seqlock);
 }
 
+static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->get_vblank_counter)
+			return crtc->funcs->get_vblank_counter(crtc);
+	}
+
+	if (dev->driver->get_vblank_counter)
+		return dev->driver->get_vblank_counter(dev, pipe);
+
+	return drm_vblank_no_hw_counter(dev, pipe);
+}
+
 /*
  * Reset the stored timestamp for the current vblank count to correspond
  * to the last vblank occurred.

drivers/gpu/drm/drm_irq.c static void drm_reset_vblank_timestamp(struct drm_device · line 118

Quoted 8 lines
drivers/gpu/drm/drm_irq.c +1 -3
@@ -112,9 +127,9 @@ static void drm_reset_vblank_timestamp(struct drm_device
 *dev, unsigned int pipe * when drm_vblank_enable() applies the diff
 	 */
 	do {
-		cur_vblank = dev->driver->get_vblank_counter(dev, pipe);
+		cur_vblank = __get_vblank_counter(dev, pipe);
 		rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, 0);
-	} while (cur_vblank != dev->driver->get_vblank_counter(dev, pipe) &&
--count > 0); +	} while (cur_vblank != __get_vblank_counter(dev, pipe) 

&&

drivers/gpu/drm/drm_irq.c static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,

Quoted 13 lines
drivers/gpu/drm/drm_irq.c +0 -1
--count > 0);
 
 	/*
 	 * Only reinitialize corresponding vblank timestamp if high-precision

query @@ -168,9 +183,9 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, * corresponding vblank timestamp.

drivers/gpu/drm/drm_irq.c +1 -3
 	 */
 	do {
-		cur_vblank = dev->driver->get_vblank_counter(dev, pipe);
+		cur_vblank = __get_vblank_counter(dev, pipe);
 		rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, flags);
-	} while (cur_vblank != dev->driver->get_vblank_counter(dev, pipe) &&
--count > 0); +	} while (cur_vblank != __get_vblank_counter(dev, pipe) 

&&

Quoted 71 lines

--count > 0);

drivers/gpu/drm/drm_irq.c +27 -1
 	if (dev->max_vblank_count != 0) {
 		/* trust the hw counter when it's around */
@@ -275,6 +290,20 @@ u32 drm_accurate_vblank_count(struct drm_crtc *crtc)
 }
 EXPORT_SYMBOL(drm_accurate_vblank_count);
 
+static void __disable_vblank(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->disable_vblank) {
+			crtc->funcs->disable_vblank(crtc);
+			return;
+		}
+	}
+
+	dev->driver->disable_vblank(dev, pipe);
+}
+
 /*
  * Disable vblank irq's on crtc, make sure that last vblank count
  * of hardware and corresponding consistent software vblank counter
@@ -298,7 +327,7 @@ static void vblank_disable_and_save(struct drm_device
 *dev, unsigned int pipe) * hardware potentially runtime suspended.
 	 */
 	if (vblank->enabled) {
-		dev->driver->disable_vblank(dev, pipe);
+		__disable_vblank(dev, pipe);
 		vblank->enabled = false;
 	}
 
@@ -1027,6 +1056,18 @@ void drm_crtc_send_vblank_event(struct drm_crtc
 *crtc, }
 EXPORT_SYMBOL(drm_crtc_send_vblank_event);
 
+static int __enable_vblank(struct drm_device *dev, unsigned int pipe)
+{
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+
+		if (crtc->funcs->enable_vblank)
+			return crtc->funcs->enable_vblank(crtc);
+	}
+
+	return dev->driver->enable_vblank(dev, pipe);
+}
+
 /**
  * drm_vblank_enable - enable the vblank interrupt on a CRTC
  * @dev: DRM device
@@ -1052,7 +1093,7 @@ static int drm_vblank_enable(struct drm_device *dev,

unsigned int pipe) * timestamps. Filtercode in drm_handle_vblank() will

drivers/gpu/drm/drm_irq.c +1 -1
 		 * prevent double-accounting of same vblank interval.
 		 */
-		ret = dev->driver->enable_vblank(dev, pipe);
+		ret = __enable_vblank(dev, pipe);
 		DRM_DEBUG("enabling vblank on crtc %u, ret: %d\n", pipe, ret);
 		if (ret)
 			atomic_dec(&vblank->refcount);
include/drm/drm_crtc.h +1 -0
index 8f0b195e4a59..4323acefa596 100644
@@ -601,6 +601,50 @@ struct drm_crtc_funcs {
 	 */
 	void (*atomic_print_state)(struct drm_printer *p,
 				   const struct drm_crtc_state *state);
+

include/drm/drm_crtc.h struct drm_crtc_funcs { · line 614

Quoted 10 lines
include/drm/drm_crtc.h +10 -0
+	/**
+	 * @get_vblank_counter:
+	 *
+	 * Driver callback for fetching a raw hardware vblank counter for the
+	 * CRTC. It's meant to be used by new drivers as the replacement of
+	 * &drm_driver.get_vblank_counter hook.
+	 *
+	 * This callback is optional. If a device doesn't have a hardware
+	 * counter, the driver can simply leave the hook as NULL. The DRM core
+	 * will account for missed vblank events while interrupts where 

disabled

Quoted 69 lines
include/drm/drm_crtc.h +33 -0
+	 * based on system timestamps.
+	 *
+	 * Wraparound handling and loss of events due to modesetting is dealt
+	 * with in the DRM core code, as long as drivers call
+	 * drm_crtc_vblank_off() and drm_crtc_vblank_on() when disabling or
+	 * enabling a CRTC.
+	 *
+	 * Returns:
+	 *
+	 * Raw vblank counter value.
+	 */
+	u32 (*get_vblank_counter)(struct drm_crtc *crtc);
+
+	/**
+	 * @enable_vblank:
+	 *
+	 * Enable vblank interrupts for the CRTC. It's meant to be used by
+	 * new drivers as the replacement of &drm_driver.enable_vblank hook.
+	 *
+	 * Returns:
+	 *
+	 * Zero on success, appropriate errno if the vblank interrupt cannot
+	 * be enabled.
+	 */
+	int (*enable_vblank)(struct drm_crtc *crtc);
+
+	/**
+	 * @disable_vblank:
+	 *
+	 * Disable vblank interrupts for the CRTC. It's meant to be used by
+	 * new drivers as the replacement of &drm_driver.disable_vblank hook.
+	 */
+	void (*disable_vblank)(struct drm_crtc *crtc);
 };
 
 /**
include/drm/drm_drv.h +9 -0
index f2c0040ddc3a..40ae89106594 100644
@@ -130,6 +130,9 @@ struct drm_driver {
 	 * drm_crtc_vblank_off() and drm_crtc_vblank_on() when disabling or
 	 * enabling a CRTC.
 	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.get_vblank_counter instead.
+	 *
 	 * Returns:
 	 *
 	 * Raw vblank counter value.
@@ -142,6 +145,9 @@ struct drm_driver {
 	 * Enable vblank interrupts for the CRTC specified with the pipe
 	 * argument.
 	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.enable_vblank instead.
+	 *
 	 * Returns:
 	 *
 	 * Zero on success, appropriate errno if the given @crtc's vblank
@@ -154,6 +160,9 @@ struct drm_driver {
 	 *
 	 * Disable vblank interrupts for the CRTC specified with the pipe
 	 * argument.
+	 *
+	 * This is deprecated and should not be used by new drivers.
+	 * Use &drm_crtc_funcs.disable_vblank instead.
 	 */
 	void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#7 lore raw

PATCH v3 2/23 drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Cc Alexey Brodkin <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Mali DP Maintainers <[email protected]>
Cc Russell King <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Inki Dae <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Xinliang Liu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Rob Clark <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Mark Yao <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Jyri Sarha <[email protected]>
Cc Eric Anholt <[email protected]>
---
 drivers/gpu/drm/arc/arcpgu_drv.c                | 1 -
 drivers/gpu/drm/arm/hdlcd_drv.c                 | 1 -
 drivers/gpu/drm/arm/malidp_drv.c                | 1 -
 drivers/gpu/drm/armada/armada_drv.c             | 1 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         | 1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
 drivers/gpu/drm/i915/i915_irq.c                 | 1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 1 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          | 1 -
 drivers/gpu/drm/meson/meson_drv.c               | 1 -
 drivers/gpu/drm/msm/msm_drv.c                   | 1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               | 1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           | 1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              | 1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        | 1 -
 drivers/gpu/drm/sti/sti_drv.c                   | 1 -
 drivers/gpu/drm/sun4i/sun4i_drv.c               | 1 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c             | 1 -
 drivers/gpu/drm/vc4/vc4_drv.c                   | 1 -
 drivers/gpu/drm/zte/zx_drm_drv.c                | 1 -
 25 files changed, 25 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +0 -1
index 8d8344ed655e..1926b200e4cb 100644
@@ -175,7 +175,6 @@ static int arcpgu_unload(struct drm_device *drm)
 	.dumb_create = drm_gem_cma_dumb_create,
 	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
 	.dumb_destroy = drm_gem_dumb_destroy,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/arm/hdlcd_drv.c +0 -1
index 4ce4f970920b..5d79e87f7421 100644
@@ -278,7 +278,6 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
 	.irq_preinstall = hdlcd_irq_preinstall,
 	.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,
drivers/gpu/drm/arm/malidp_drv.c +0 -1
index 8b0672d4aee9..ca6ccd172de3 100644
@@ -213,7 +213,6 @@ static void malidp_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
 			   DRIVER_PRIME,
 	.lastclose = malidp_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = malidp_enable_vblank,
 	.disable_vblank = malidp_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/armada/armada_drv.c +0 -1
index 63f42d001f33..bb27892012de 100644
@@ -87,7 +87,6 @@ static void armada_drm_lastclose(struct drm_device *dev)
 
 static struct drm_driver armada_drm_driver = {
 	.lastclose		= armada_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= armada_drm_enable_vblank,
 	.disable_vblank		= armada_drm_disable_vblank,
 	.gem_free_object_unlocked = armada_gem_free_object,
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -1
index 427bdff425c2..5cba65b5ea16 100644
@@ -760,7 +760,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,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = atmel_hlcdc_dc_enable_vblank,
 	.disable_vblank = atmel_hlcdc_dc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -1
index 035d02ecffcd..a1c22eb12f4b 100644
@@ -263,7 +263,6 @@ static void exynos_drm_lastclose(struct drm_device *dev)
 	.preclose		= exynos_drm_preclose,
 	.lastclose		= exynos_drm_lastclose,
 	.postclose		= exynos_drm_postclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= exynos_drm_crtc_enable_vblank,
 	.disable_vblank		= exynos_drm_crtc_disable_vblank,
 	.gem_free_object_unlocked = exynos_drm_gem_free_object,
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -1
index 04173235f448..b59b816a1d7d 100644
@@ -203,7 +203,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 	.load			= fsl_dcu_load,
 	.unload			= fsl_dcu_unload,
 	.irq_handler		= fsl_dcu_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= fsl_dcu_drm_enable_vblank,
 	.disable_vblank		= fsl_dcu_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -1
index 7e2043f4348c..8cac70454b57 100644
@@ -84,7 +84,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 	.desc			= "hibmc drm driver",
 	.major			= 1,
 	.minor			= 0,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= hibmc_enable_vblank,
 	.disable_vblank		= hibmc_disable_vblank,
 	.gem_free_object_unlocked = hibmc_gem_free_object,
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0 -1
index 9a0678a33e0d..0624fab8046f 100644
@@ -1025,7 +1025,6 @@ static int ade_drm_init(struct platform_device *pdev)
 			       IRQF_SHARED, dev->driver->name, acrtc);
 	if (ret)
 		return ret;
-	dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	dev->driver->enable_vblank = ade_enable_vblank;
 	dev->driver->disable_vblank = ade_disable_vblank;
 
drivers/gpu/drm/i915/i915_irq.c +0 -1
index 47d6131e977f..5aab08172faf 100644
@@ -4218,7 +4218,6 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
 	if (IS_GEN2(dev_priv)) {
 		/* Gen2 doesn't have a hardware frame counter */
 		dev->max_vblank_count = 0;
-		dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	} else if (IS_G4X(dev_priv) || INTEL_INFO(dev_priv)->gen >= 5) {
 		dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
 		dev->driver->get_vblank_counter = g4x_get_vblank_counter;
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
index 5ae48836652e..4badbb66d69e 100644
@@ -288,7 +288,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
 	.gem_prime_vmap		= drm_gem_cma_prime_vmap,
 	.gem_prime_vunmap	= drm_gem_cma_prime_vunmap,
 	.gem_prime_mmap		= drm_gem_cma_prime_mmap,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= imx_drm_enable_vblank,
 	.disable_vblank		= imx_drm_disable_vblank,
 	.ioctls			= imx_drm_ioctls,
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0 -1
index b5f88e6d078e..ef8675336465 100644
@@ -256,7 +256,6 @@ static void mtk_drm_kms_deinit(struct drm_device *drm)
 	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = mtk_drm_crtc_enable_vblank,
 	.disable_vblank = mtk_drm_crtc_disable_vblank,
 
drivers/gpu/drm/meson/meson_drv.c +0 -1
index 6f2fd82ed483..c0a59889c45f 100644
@@ -129,7 +129,6 @@ static irqreturn_t meson_irq(int irq, void *arg)
 	/* Vblank */
 	.enable_vblank		= meson_enable_vblank,
 	.disable_vblank		= meson_disable_vblank,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 
 	/* IRQ */
 	.irq_handler		= meson_irq,
drivers/gpu/drm/msm/msm_drv.c +0 -1
index 70226eaa5cac..cb47f4a14215 100644
@@ -816,7 +816,6 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data,
 	.irq_preinstall     = msm_irq_preinstall,
 	.irq_postinstall    = msm_irq_postinstall,
 	.irq_uninstall      = msm_irq_uninstall,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = msm_enable_vblank,
 	.disable_vblank     = msm_disable_vblank,
 	.gem_free_object    = msm_gem_free_object,
drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -1
index cdfbe0284635..104722a78bd6 100644
@@ -340,7 +340,6 @@ static irqreturn_t mxsfb_irq_handler(int irq, void *data)
 	.irq_handler		= mxsfb_irq_handler,
 	.irq_preinstall		= mxsfb_irq_preinstall,
 	.irq_uninstall		= mxsfb_irq_preinstall,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= mxsfb_enable_vblank,
 	.disable_vblank		= mxsfb_disable_vblank,
 	.gem_free_object	= drm_gem_cma_free_object,
drivers/gpu/drm/nouveau/nouveau_drm.c +0 -1
index 9ed2ca0769e3..626df485a03a 100644
@@ -977,7 +977,6 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	.debugfs_cleanup = nouveau_drm_debugfs_cleanup,
 #endif
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = nouveau_display_vblank_enable,
 	.disable_vblank = nouveau_display_vblank_disable,
 	.get_scanout_position = nouveau_display_scanoutpos,
drivers/gpu/drm/omapdrm/omap_drv.c +0 -1
index afe8f05b927b..da049a7636ad 100644
@@ -714,7 +714,6 @@ static void dev_lastclose(struct drm_device *dev)
 		DRIVER_ATOMIC,
 	.open = dev_open,
 	.lastclose = dev_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = omap_irq_enable_vblank,
 	.disable_vblank = omap_irq_disable_vblank,
 #ifdef CONFIG_DEBUG_FS
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -1
index c05e00872778..094da3ef49d1 100644
@@ -259,7 +259,6 @@ static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME
 				| DRIVER_ATOMIC,
 	.lastclose		= rcar_du_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rcar_du_enable_vblank,
 	.disable_vblank		= rcar_du_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -1
index c30d649cb147..39243480c834 100644
@@ -270,7 +270,6 @@ static void rockchip_drm_lastclose(struct drm_device *dev)
 	.driver_features	= DRIVER_MODESET | DRIVER_GEM |
 				  DRIVER_PRIME | DRIVER_ATOMIC,
 	.lastclose		= rockchip_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rockchip_drm_crtc_enable_vblank,
 	.disable_vblank		= rockchip_drm_crtc_disable_vblank,
 	.gem_vm_ops		= &drm_gem_cma_vm_ops,
drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -1
index 33cec3d42389..d6b0545d252d 100644
@@ -256,7 +256,6 @@ static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.load			= shmob_drm_load,
 	.unload			= shmob_drm_unload,
 	.irq_handler		= shmob_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= shmob_drm_enable_vblank,
 	.disable_vblank		= shmob_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/sti/sti_drv.c +0 -1
index 788feed208d7..d4b771d2d10d 100644
@@ -264,7 +264,6 @@ static void sti_mode_config_init(struct drm_device *dev)
 	.dumb_destroy = drm_gem_dumb_destroy,
 	.fops = &sti_driver_fops,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = sti_crtc_enable_vblank,
 	.disable_vblank = sti_crtc_disable_vblank,
 
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -1
index 4ce665349f6b..0816c635df20 100644
@@ -92,7 +92,6 @@ static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe)
 	/* Frame Buffer Operations */
 
 	/* VBlank Operations */
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= sun4i_drv_enable_vblank,
 	.disable_vblank		= sun4i_drv_disable_vblank,
 };
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -1
index 372d86fbb093..d5bc98e283d9 100644
@@ -557,7 +557,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
 			       DRIVER_PRIME | DRIVER_ATOMIC),
 	.lastclose          = tilcdc_lastclose,
 	.irq_handler        = tilcdc_irq,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = tilcdc_enable_vblank,
 	.disable_vblank     = tilcdc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/vc4/vc4_drv.c +0 -1
index a459745e96f7..3a8709d85da1 100644
@@ -139,7 +139,6 @@ static void vc4_lastclose(struct drm_device *dev)
 
 	.enable_vblank = vc4_enable_vblank,
 	.disable_vblank = vc4_disable_vblank,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.get_scanout_position = vc4_crtc_get_scanoutpos,
 	.get_vblank_timestamp = vc4_crtc_get_vblank_timestamp,
 
drivers/gpu/drm/zte/zx_drm_drv.c +0 -1
index 5c6944a1e72c..afd713a954c6 100644
@@ -71,7 +71,6 @@ static void zx_drm_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 	.lastclose = zx_drm_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = zx_vou_enable_vblank,
 	.disable_vblank = zx_vou_disable_vblank,
 	.gem_free_object = drm_gem_cma_free_object,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v3 2/23
#8 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

Quoted 45 lines · Shawn Guo

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Cc Alexey Brodkin <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Mali DP Maintainers <[email protected]>
Cc Russell King <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Inki Dae <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Xinliang Liu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Rob Clark <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Mark Yao <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Jyri Sarha <[email protected]>
Cc Eric Anholt <[email protected]>
---
 drivers/gpu/drm/arc/arcpgu_drv.c                | 1 -
 drivers/gpu/drm/arm/hdlcd_drv.c                 | 1 -
 drivers/gpu/drm/arm/malidp_drv.c                | 1 -
 drivers/gpu/drm/armada/armada_drv.c             | 1 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         | 1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
 drivers/gpu/drm/i915/i915_irq.c                 | 1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 1 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          | 1 -
 drivers/gpu/drm/meson/meson_drv.c               | 1 -
 drivers/gpu/drm/msm/msm_drv.c                   | 1 -
Quoted 8 lines
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               | 1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           | 1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              | 1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        | 1 -
 drivers/gpu/drm/sti/sti_drv.c                   | 1 -
 drivers/gpu/drm/sun4i/sun4i_drv.c               | 1 -

For sun4i,

Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v3 2/23
#9 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo
Quoted 7 lines · On Tue, 7 Feb 2017 17:16:14 +0800 Shawn Guo <[email protected]> wrote:

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Quoted 6 lines
Cc Alexey Brodkin <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Mali DP Maintainers <[email protected]>
Cc Russell King <[email protected]>
Cc Boris Brezillon <[email protected]>
Quoted 338 lines
Cc Inki Dae <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Xinliang Liu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Rob Clark <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Mark Yao <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Jyri Sarha <[email protected]>
Cc Eric Anholt <[email protected]>
---
 drivers/gpu/drm/arc/arcpgu_drv.c                | 1 -
 drivers/gpu/drm/arm/hdlcd_drv.c                 | 1 -
 drivers/gpu/drm/arm/malidp_drv.c                | 1 -
 drivers/gpu/drm/armada/armada_drv.c             | 1 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         | 1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
 drivers/gpu/drm/i915/i915_irq.c                 | 1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 1 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          | 1 -
 drivers/gpu/drm/meson/meson_drv.c               | 1 -
 drivers/gpu/drm/msm/msm_drv.c                   | 1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               | 1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           | 1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              | 1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        | 1 -
 drivers/gpu/drm/sti/sti_drv.c                   | 1 -
 drivers/gpu/drm/sun4i/sun4i_drv.c               | 1 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c             | 1 -
 drivers/gpu/drm/vc4/vc4_drv.c                   | 1 -
 drivers/gpu/drm/zte/zx_drm_drv.c                | 1 -
 25 files changed, 25 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +0 -1
index 8d8344ed655e..1926b200e4cb 100644
@@ -175,7 +175,6 @@ static int arcpgu_unload(struct drm_device *drm)
 	.dumb_create = drm_gem_cma_dumb_create,
 	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
 	.dumb_destroy = drm_gem_dumb_destroy,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/arm/hdlcd_drv.c +0 -1
index 4ce4f970920b..5d79e87f7421 100644
@@ -278,7 +278,6 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
 	.irq_preinstall = hdlcd_irq_preinstall,
 	.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,
drivers/gpu/drm/arm/malidp_drv.c +0 -1
index 8b0672d4aee9..ca6ccd172de3 100644
@@ -213,7 +213,6 @@ static void malidp_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
 			   DRIVER_PRIME,
 	.lastclose = malidp_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = malidp_enable_vblank,
 	.disable_vblank = malidp_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/armada/armada_drv.c +0 -1
index 63f42d001f33..bb27892012de 100644
@@ -87,7 +87,6 @@ static void armada_drm_lastclose(struct drm_device *dev)
 
 static struct drm_driver armada_drm_driver = {
 	.lastclose		= armada_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= armada_drm_enable_vblank,
 	.disable_vblank		= armada_drm_disable_vblank,
 	.gem_free_object_unlocked = armada_gem_free_object,
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -1
index 427bdff425c2..5cba65b5ea16 100644
@@ -760,7 +760,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,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = atmel_hlcdc_dc_enable_vblank,
 	.disable_vblank = atmel_hlcdc_dc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -1
index 035d02ecffcd..a1c22eb12f4b 100644
@@ -263,7 +263,6 @@ static void exynos_drm_lastclose(struct drm_device *dev)
 	.preclose		= exynos_drm_preclose,
 	.lastclose		= exynos_drm_lastclose,
 	.postclose		= exynos_drm_postclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= exynos_drm_crtc_enable_vblank,
 	.disable_vblank		= exynos_drm_crtc_disable_vblank,
 	.gem_free_object_unlocked = exynos_drm_gem_free_object,
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -1
index 04173235f448..b59b816a1d7d 100644
@@ -203,7 +203,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 	.load			= fsl_dcu_load,
 	.unload			= fsl_dcu_unload,
 	.irq_handler		= fsl_dcu_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= fsl_dcu_drm_enable_vblank,
 	.disable_vblank		= fsl_dcu_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -1
index 7e2043f4348c..8cac70454b57 100644
@@ -84,7 +84,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 	.desc			= "hibmc drm driver",
 	.major			= 1,
 	.minor			= 0,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= hibmc_enable_vblank,
 	.disable_vblank		= hibmc_disable_vblank,
 	.gem_free_object_unlocked = hibmc_gem_free_object,
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0 -1
index 9a0678a33e0d..0624fab8046f 100644
@@ -1025,7 +1025,6 @@ static int ade_drm_init(struct platform_device *pdev)
 			       IRQF_SHARED, dev->driver->name, acrtc);
 	if (ret)
 		return ret;
-	dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	dev->driver->enable_vblank = ade_enable_vblank;
 	dev->driver->disable_vblank = ade_disable_vblank;
 
drivers/gpu/drm/i915/i915_irq.c +0 -1
index 47d6131e977f..5aab08172faf 100644
@@ -4218,7 +4218,6 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
 	if (IS_GEN2(dev_priv)) {
 		/* Gen2 doesn't have a hardware frame counter */
 		dev->max_vblank_count = 0;
-		dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	} else if (IS_G4X(dev_priv) || INTEL_INFO(dev_priv)->gen >= 5) {
 		dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
 		dev->driver->get_vblank_counter = g4x_get_vblank_counter;
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
index 5ae48836652e..4badbb66d69e 100644
@@ -288,7 +288,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
 	.gem_prime_vmap		= drm_gem_cma_prime_vmap,
 	.gem_prime_vunmap	= drm_gem_cma_prime_vunmap,
 	.gem_prime_mmap		= drm_gem_cma_prime_mmap,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= imx_drm_enable_vblank,
 	.disable_vblank		= imx_drm_disable_vblank,
 	.ioctls			= imx_drm_ioctls,
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0 -1
index b5f88e6d078e..ef8675336465 100644
@@ -256,7 +256,6 @@ static void mtk_drm_kms_deinit(struct drm_device *drm)
 	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = mtk_drm_crtc_enable_vblank,
 	.disable_vblank = mtk_drm_crtc_disable_vblank,
 
drivers/gpu/drm/meson/meson_drv.c +0 -1
index 6f2fd82ed483..c0a59889c45f 100644
@@ -129,7 +129,6 @@ static irqreturn_t meson_irq(int irq, void *arg)
 	/* Vblank */
 	.enable_vblank		= meson_enable_vblank,
 	.disable_vblank		= meson_disable_vblank,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 
 	/* IRQ */
 	.irq_handler		= meson_irq,
drivers/gpu/drm/msm/msm_drv.c +0 -1
index 70226eaa5cac..cb47f4a14215 100644
@@ -816,7 +816,6 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data,
 	.irq_preinstall     = msm_irq_preinstall,
 	.irq_postinstall    = msm_irq_postinstall,
 	.irq_uninstall      = msm_irq_uninstall,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = msm_enable_vblank,
 	.disable_vblank     = msm_disable_vblank,
 	.gem_free_object    = msm_gem_free_object,
drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -1
index cdfbe0284635..104722a78bd6 100644
@@ -340,7 +340,6 @@ static irqreturn_t mxsfb_irq_handler(int irq, void *data)
 	.irq_handler		= mxsfb_irq_handler,
 	.irq_preinstall		= mxsfb_irq_preinstall,
 	.irq_uninstall		= mxsfb_irq_preinstall,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= mxsfb_enable_vblank,
 	.disable_vblank		= mxsfb_disable_vblank,
 	.gem_free_object	= drm_gem_cma_free_object,
drivers/gpu/drm/nouveau/nouveau_drm.c +0 -1
index 9ed2ca0769e3..626df485a03a 100644
@@ -977,7 +977,6 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	.debugfs_cleanup = nouveau_drm_debugfs_cleanup,
 #endif
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = nouveau_display_vblank_enable,
 	.disable_vblank = nouveau_display_vblank_disable,
 	.get_scanout_position = nouveau_display_scanoutpos,
drivers/gpu/drm/omapdrm/omap_drv.c +0 -1
index afe8f05b927b..da049a7636ad 100644
@@ -714,7 +714,6 @@ static void dev_lastclose(struct drm_device *dev)
 		DRIVER_ATOMIC,
 	.open = dev_open,
 	.lastclose = dev_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = omap_irq_enable_vblank,
 	.disable_vblank = omap_irq_disable_vblank,
 #ifdef CONFIG_DEBUG_FS
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -1
index c05e00872778..094da3ef49d1 100644
@@ -259,7 +259,6 @@ static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME
 				| DRIVER_ATOMIC,
 	.lastclose		= rcar_du_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rcar_du_enable_vblank,
 	.disable_vblank		= rcar_du_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -1
index c30d649cb147..39243480c834 100644
@@ -270,7 +270,6 @@ static void rockchip_drm_lastclose(struct drm_device *dev)
 	.driver_features	= DRIVER_MODESET | DRIVER_GEM |
 				  DRIVER_PRIME | DRIVER_ATOMIC,
 	.lastclose		= rockchip_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rockchip_drm_crtc_enable_vblank,
 	.disable_vblank		= rockchip_drm_crtc_disable_vblank,
 	.gem_vm_ops		= &drm_gem_cma_vm_ops,
drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -1
index 33cec3d42389..d6b0545d252d 100644
@@ -256,7 +256,6 @@ static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.load			= shmob_drm_load,
 	.unload			= shmob_drm_unload,
 	.irq_handler		= shmob_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= shmob_drm_enable_vblank,
 	.disable_vblank		= shmob_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/sti/sti_drv.c +0 -1
index 788feed208d7..d4b771d2d10d 100644
@@ -264,7 +264,6 @@ static void sti_mode_config_init(struct drm_device *dev)
 	.dumb_destroy = drm_gem_dumb_destroy,
 	.fops = &sti_driver_fops,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = sti_crtc_enable_vblank,
 	.disable_vblank = sti_crtc_disable_vblank,
 
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -1
index 4ce665349f6b..0816c635df20 100644
@@ -92,7 +92,6 @@ static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe)
 	/* Frame Buffer Operations */
 
 	/* VBlank Operations */
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= sun4i_drv_enable_vblank,
 	.disable_vblank		= sun4i_drv_disable_vblank,
 };
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -1
index 372d86fbb093..d5bc98e283d9 100644
@@ -557,7 +557,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
 			       DRIVER_PRIME | DRIVER_ATOMIC),
 	.lastclose          = tilcdc_lastclose,
 	.irq_handler        = tilcdc_irq,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = tilcdc_enable_vblank,
 	.disable_vblank     = tilcdc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/vc4/vc4_drv.c +0 -1
index a459745e96f7..3a8709d85da1 100644
@@ -139,7 +139,6 @@ static void vc4_lastclose(struct drm_device *dev)
 
 	.enable_vblank = vc4_enable_vblank,
 	.disable_vblank = vc4_disable_vblank,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.get_scanout_position = vc4_crtc_get_scanoutpos,
 	.get_vblank_timestamp = vc4_crtc_get_vblank_timestamp,
 
drivers/gpu/drm/zte/zx_drm_drv.c +0 -0
index 5c6944a1e72c..afd713a954c6 100644

drivers/gpu/drm/zte/zx_drm_drv.c static void zx_drm_lastclose(struct drm_device *drm) · line 76

Quoted 7 lines
drivers/gpu/drm/zte/zx_drm_drv.c +0 -1
@@ -71,7 +71,6 @@ static void zx_drm_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 	.lastclose = zx_drm_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = zx_vou_enable_vblank,
 	.disable_vblank = zx_vou_disable_vblank,
 	.gem_free_object = drm_gem_cma_free_object,

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v3 2/23
#10 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo
Quoted 7 lines · Shawn Guo

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Quoted 13 lines
Cc Alexey Brodkin <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Mali DP Maintainers <[email protected]>
Cc Russell King <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Inki Dae <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Xinliang Liu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Neil Armstrong <[email protected]>

For the meson drm driver :

Quoted 332 lines
Cc Rob Clark <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Mark Yao <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Jyri Sarha <[email protected]>
Cc Eric Anholt <[email protected]>
---
 drivers/gpu/drm/arc/arcpgu_drv.c                | 1 -
 drivers/gpu/drm/arm/hdlcd_drv.c                 | 1 -
 drivers/gpu/drm/arm/malidp_drv.c                | 1 -
 drivers/gpu/drm/armada/armada_drv.c             | 1 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         | 1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
 drivers/gpu/drm/i915/i915_irq.c                 | 1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 1 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          | 1 -
 drivers/gpu/drm/meson/meson_drv.c               | 1 -
 drivers/gpu/drm/msm/msm_drv.c                   | 1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               | 1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           | 1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              | 1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        | 1 -
 drivers/gpu/drm/sti/sti_drv.c                   | 1 -
 drivers/gpu/drm/sun4i/sun4i_drv.c               | 1 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c             | 1 -
 drivers/gpu/drm/vc4/vc4_drv.c                   | 1 -
 drivers/gpu/drm/zte/zx_drm_drv.c                | 1 -
 25 files changed, 25 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +0 -1
index 8d8344ed655e..1926b200e4cb 100644
@@ -175,7 +175,6 @@ static int arcpgu_unload(struct drm_device *drm)
 	.dumb_create = drm_gem_cma_dumb_create,
 	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
 	.dumb_destroy = drm_gem_dumb_destroy,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/arm/hdlcd_drv.c +0 -1
index 4ce4f970920b..5d79e87f7421 100644
@@ -278,7 +278,6 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
 	.irq_preinstall = hdlcd_irq_preinstall,
 	.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,
drivers/gpu/drm/arm/malidp_drv.c +0 -1
index 8b0672d4aee9..ca6ccd172de3 100644
@@ -213,7 +213,6 @@ static void malidp_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
 			   DRIVER_PRIME,
 	.lastclose = malidp_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = malidp_enable_vblank,
 	.disable_vblank = malidp_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/armada/armada_drv.c +0 -1
index 63f42d001f33..bb27892012de 100644
@@ -87,7 +87,6 @@ static void armada_drm_lastclose(struct drm_device *dev)
 
 static struct drm_driver armada_drm_driver = {
 	.lastclose		= armada_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= armada_drm_enable_vblank,
 	.disable_vblank		= armada_drm_disable_vblank,
 	.gem_free_object_unlocked = armada_gem_free_object,
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -1
index 427bdff425c2..5cba65b5ea16 100644
@@ -760,7 +760,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,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = atmel_hlcdc_dc_enable_vblank,
 	.disable_vblank = atmel_hlcdc_dc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -1
index 035d02ecffcd..a1c22eb12f4b 100644
@@ -263,7 +263,6 @@ static void exynos_drm_lastclose(struct drm_device *dev)
 	.preclose		= exynos_drm_preclose,
 	.lastclose		= exynos_drm_lastclose,
 	.postclose		= exynos_drm_postclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= exynos_drm_crtc_enable_vblank,
 	.disable_vblank		= exynos_drm_crtc_disable_vblank,
 	.gem_free_object_unlocked = exynos_drm_gem_free_object,
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -1
index 04173235f448..b59b816a1d7d 100644
@@ -203,7 +203,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 	.load			= fsl_dcu_load,
 	.unload			= fsl_dcu_unload,
 	.irq_handler		= fsl_dcu_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= fsl_dcu_drm_enable_vblank,
 	.disable_vblank		= fsl_dcu_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -1
index 7e2043f4348c..8cac70454b57 100644
@@ -84,7 +84,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 	.desc			= "hibmc drm driver",
 	.major			= 1,
 	.minor			= 0,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= hibmc_enable_vblank,
 	.disable_vblank		= hibmc_disable_vblank,
 	.gem_free_object_unlocked = hibmc_gem_free_object,
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0 -1
index 9a0678a33e0d..0624fab8046f 100644
@@ -1025,7 +1025,6 @@ static int ade_drm_init(struct platform_device *pdev)
 			       IRQF_SHARED, dev->driver->name, acrtc);
 	if (ret)
 		return ret;
-	dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	dev->driver->enable_vblank = ade_enable_vblank;
 	dev->driver->disable_vblank = ade_disable_vblank;
 
drivers/gpu/drm/i915/i915_irq.c +0 -1
index 47d6131e977f..5aab08172faf 100644
@@ -4218,7 +4218,6 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
 	if (IS_GEN2(dev_priv)) {
 		/* Gen2 doesn't have a hardware frame counter */
 		dev->max_vblank_count = 0;
-		dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	} else if (IS_G4X(dev_priv) || INTEL_INFO(dev_priv)->gen >= 5) {
 		dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
 		dev->driver->get_vblank_counter = g4x_get_vblank_counter;
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
index 5ae48836652e..4badbb66d69e 100644
@@ -288,7 +288,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
 	.gem_prime_vmap		= drm_gem_cma_prime_vmap,
 	.gem_prime_vunmap	= drm_gem_cma_prime_vunmap,
 	.gem_prime_mmap		= drm_gem_cma_prime_mmap,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= imx_drm_enable_vblank,
 	.disable_vblank		= imx_drm_disable_vblank,
 	.ioctls			= imx_drm_ioctls,
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0 -1
index b5f88e6d078e..ef8675336465 100644
@@ -256,7 +256,6 @@ static void mtk_drm_kms_deinit(struct drm_device *drm)
 	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = mtk_drm_crtc_enable_vblank,
 	.disable_vblank = mtk_drm_crtc_disable_vblank,
 
drivers/gpu/drm/meson/meson_drv.c +0 -1
index 6f2fd82ed483..c0a59889c45f 100644
@@ -129,7 +129,6 @@ static irqreturn_t meson_irq(int irq, void *arg)
 	/* Vblank */
 	.enable_vblank		= meson_enable_vblank,
 	.disable_vblank		= meson_disable_vblank,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 
 	/* IRQ */
 	.irq_handler		= meson_irq,
drivers/gpu/drm/msm/msm_drv.c +0 -1
index 70226eaa5cac..cb47f4a14215 100644
@@ -816,7 +816,6 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data,
 	.irq_preinstall     = msm_irq_preinstall,
 	.irq_postinstall    = msm_irq_postinstall,
 	.irq_uninstall      = msm_irq_uninstall,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = msm_enable_vblank,
 	.disable_vblank     = msm_disable_vblank,
 	.gem_free_object    = msm_gem_free_object,
drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -1
index cdfbe0284635..104722a78bd6 100644
@@ -340,7 +340,6 @@ static irqreturn_t mxsfb_irq_handler(int irq, void *data)
 	.irq_handler		= mxsfb_irq_handler,
 	.irq_preinstall		= mxsfb_irq_preinstall,
 	.irq_uninstall		= mxsfb_irq_preinstall,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= mxsfb_enable_vblank,
 	.disable_vblank		= mxsfb_disable_vblank,
 	.gem_free_object	= drm_gem_cma_free_object,
drivers/gpu/drm/nouveau/nouveau_drm.c +0 -1
index 9ed2ca0769e3..626df485a03a 100644
@@ -977,7 +977,6 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	.debugfs_cleanup = nouveau_drm_debugfs_cleanup,
 #endif
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = nouveau_display_vblank_enable,
 	.disable_vblank = nouveau_display_vblank_disable,
 	.get_scanout_position = nouveau_display_scanoutpos,
drivers/gpu/drm/omapdrm/omap_drv.c +0 -1
index afe8f05b927b..da049a7636ad 100644
@@ -714,7 +714,6 @@ static void dev_lastclose(struct drm_device *dev)
 		DRIVER_ATOMIC,
 	.open = dev_open,
 	.lastclose = dev_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = omap_irq_enable_vblank,
 	.disable_vblank = omap_irq_disable_vblank,
 #ifdef CONFIG_DEBUG_FS
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -1
index c05e00872778..094da3ef49d1 100644
@@ -259,7 +259,6 @@ static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME
 				| DRIVER_ATOMIC,
 	.lastclose		= rcar_du_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rcar_du_enable_vblank,
 	.disable_vblank		= rcar_du_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -1
index c30d649cb147..39243480c834 100644
@@ -270,7 +270,6 @@ static void rockchip_drm_lastclose(struct drm_device *dev)
 	.driver_features	= DRIVER_MODESET | DRIVER_GEM |
 				  DRIVER_PRIME | DRIVER_ATOMIC,
 	.lastclose		= rockchip_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rockchip_drm_crtc_enable_vblank,
 	.disable_vblank		= rockchip_drm_crtc_disable_vblank,
 	.gem_vm_ops		= &drm_gem_cma_vm_ops,
drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -1
index 33cec3d42389..d6b0545d252d 100644
@@ -256,7 +256,6 @@ static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.load			= shmob_drm_load,
 	.unload			= shmob_drm_unload,
 	.irq_handler		= shmob_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= shmob_drm_enable_vblank,
 	.disable_vblank		= shmob_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/sti/sti_drv.c +0 -1
index 788feed208d7..d4b771d2d10d 100644
@@ -264,7 +264,6 @@ static void sti_mode_config_init(struct drm_device *dev)
 	.dumb_destroy = drm_gem_dumb_destroy,
 	.fops = &sti_driver_fops,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = sti_crtc_enable_vblank,
 	.disable_vblank = sti_crtc_disable_vblank,
 
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -1
index 4ce665349f6b..0816c635df20 100644
@@ -92,7 +92,6 @@ static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe)
 	/* Frame Buffer Operations */
 
 	/* VBlank Operations */
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= sun4i_drv_enable_vblank,
 	.disable_vblank		= sun4i_drv_disable_vblank,
 };
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -1
index 372d86fbb093..d5bc98e283d9 100644
@@ -557,7 +557,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
 			       DRIVER_PRIME | DRIVER_ATOMIC),
 	.lastclose          = tilcdc_lastclose,
 	.irq_handler        = tilcdc_irq,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = tilcdc_enable_vblank,
 	.disable_vblank     = tilcdc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/vc4/vc4_drv.c +0 -1
index a459745e96f7..3a8709d85da1 100644
@@ -139,7 +139,6 @@ static void vc4_lastclose(struct drm_device *dev)
 
 	.enable_vblank = vc4_enable_vblank,
 	.disable_vblank = vc4_disable_vblank,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.get_scanout_position = vc4_crtc_get_scanoutpos,
 	.get_vblank_timestamp = vc4_crtc_get_vblank_timestamp,
 
drivers/gpu/drm/zte/zx_drm_drv.c +0 -0
index 5c6944a1e72c..afd713a954c6 100644

drivers/gpu/drm/zte/zx_drm_drv.c static void zx_drm_lastclose(struct drm_device *drm) · line 76

Quoted 7 lines
drivers/gpu/drm/zte/zx_drm_drv.c +0 -1
@@ -71,7 +71,6 @@ static void zx_drm_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 	.lastclose = zx_drm_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = zx_vou_enable_vblank,
 	.disable_vblank = zx_vou_disable_vblank,
 	.gem_free_object = drm_gem_cma_free_object,

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Acked-by Russell King on v3 2/23
#11 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo

On Tue, Feb 07, 2017 at 05:16:14PM +0800, Shawn Guo wrote:

For:

Quoted 1 line
 drivers/gpu/drm/armada/armada_drv.c             | 1 -
Signature · 7 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 2/23
#12 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo

Hi Shawn,

Thank you for the patch.

Quoted 57 lines · On Tuesday 07 Feb 2017 17:16:14 Shawn Guo wrote:

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Cc Alexey Brodkin <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Mali DP Maintainers <[email protected]>
Cc Russell King <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Inki Dae <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Xinliang Liu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Rob Clark <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Mark Yao <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Jyri Sarha <[email protected]>
Cc Eric Anholt <[email protected]>
---
 drivers/gpu/drm/arc/arcpgu_drv.c                | 1 -
 drivers/gpu/drm/arm/hdlcd_drv.c                 | 1 -
 drivers/gpu/drm/arm/malidp_drv.c                | 1 -
 drivers/gpu/drm/armada/armada_drv.c             | 1 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         | 1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
 drivers/gpu/drm/i915/i915_irq.c                 | 1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 1 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          | 1 -
 drivers/gpu/drm/meson/meson_drv.c               | 1 -
 drivers/gpu/drm/msm/msm_drv.c                   | 1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               | 1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           | 1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              | 1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        | 1 -
 drivers/gpu/drm/sti/sti_drv.c                   | 1 -
 drivers/gpu/drm/sun4i/sun4i_drv.c               | 1 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c             | 1 -
 drivers/gpu/drm/vc4/vc4_drv.c                   | 1 -
 drivers/gpu/drm/zte/zx_drm_drv.c                | 1 -
 25 files changed, 25 deletions(-)

[snip]

drivers/gpu/drm/i915/i915_irq.c void intel_irq_init(struct drm_i915_private *dev_priv) · line 4223

Quoted 12 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/i915_irq.c index 47d6131e977f..5aab08172faf 100644

drivers/gpu/drm/i915/i915_irq.c +0 -1
@@ -4218,7 +4218,6 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
 if (IS_GEN2(dev_priv)) {
 		/* Gen2 doesn't have a hardware frame counter */
 		dev->max_vblank_count = 0;
-		dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	} else if (IS_G4X(dev_priv) || INTEL_INFO(dev_priv)->gen >= 5) {
 		dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
 		dev->driver->get_vblank_counter = g4x_get_vblank_counter;

On an unrelated note, for security reasons we should try to make the driver structure static, or at least move ops to a static structure.

Anyway, for this patch,

Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

Quoted 2 lines · Laurent Pinchart

On an unrelated note, for security reasons we should try to make the driver structure static, or at least move ops to a static structure.

ITYM "const" not "static".

"static" doesn't get you anything from a security point of view. "const" gets you write protection, so code can't modify the function pointers.

Signature · 7 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#14 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

Hi Russell,

Quoted 9 lines · On Tuesday 07 Feb 2017 10:44:49 Russell King - ARM Linux wrote:
Quoted 3 lines · Laurent Pinchart

On an unrelated note, for security reasons we should try to make the driver
structure static, or at least move ops to a static structure.

ITYM "const" not "static".

"static" doesn't get you anything from a security point of view. "const" gets you write protection, so code can't modify the function pointers.

That's what I meant, sorry. My brain-fingers link seems to be have a high noise level this week.

Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#15 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Russell King - ARM Linux
Quoted 8 lines · Russell King - ARM Linux
Quoted 2 lines · Laurent Pinchart

On an unrelated note, for security reasons we should try to make the driver structure static, or at least move ops to a static structure.

ITYM "const" not "static".

"static" doesn't get you anything from a security point of view. "const" gets you write protection, so code can't modify the function pointers.

We can't easily do that for struct drm_driver at the moment because some fields end up being modified at runtime. I suppose we could move some of those fields over to struct drm_device, which, in many cases, would make more sense anyway.

What i915 is currently doing is probably fine for all existing cases, but it sets a bad example for other drivers that may end up having to drive multiple devices with one driver, so modifying the global driver is likely going to break things.

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v3 2/23
#16 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo

Hi Shawn,

Quoted 9 lines · Shawn Guo

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook.  So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Cc Alexey Brodkin <[email protected]>

For ARC PGU part

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Acked-by on v3 2/23
#17 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo
Quoted 30 lines · Shawn Guo

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Cc Alexey Brodkin <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Mali DP Maintainers <[email protected]>
Cc Russell King <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Inki Dae <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Xinliang Liu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Rob Clark <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Mark Yao <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Jyri Sarha <[email protected]>
Cc Eric Anholt <[email protected]>
Quoted 4 lines
---
 drivers/gpu/drm/arc/arcpgu_drv.c                | 1 -
 drivers/gpu/drm/arm/hdlcd_drv.c                 | 1 -
 drivers/gpu/drm/arm/malidp_drv.c                | 1 -

For the HDLCD and Mali DP drivers:

Thanks for doing this!
Liviu

Quoted 327 lines
 drivers/gpu/drm/armada/armada_drv.c             | 1 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 1 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         | 1 -
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 1 -
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
 drivers/gpu/drm/i915/i915_irq.c                 | 1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 1 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          | 1 -
 drivers/gpu/drm/meson/meson_drv.c               | 1 -
 drivers/gpu/drm/msm/msm_drv.c                   | 1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               | 1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           | 1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              | 1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        | 1 -
 drivers/gpu/drm/sti/sti_drv.c                   | 1 -
 drivers/gpu/drm/sun4i/sun4i_drv.c               | 1 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c             | 1 -
 drivers/gpu/drm/vc4/vc4_drv.c                   | 1 -
 drivers/gpu/drm/zte/zx_drm_drv.c                | 1 -
 25 files changed, 25 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +0 -1
index 8d8344ed655e..1926b200e4cb 100644
@@ -175,7 +175,6 @@ static int arcpgu_unload(struct drm_device *drm)
 	.dumb_create = drm_gem_cma_dumb_create,
 	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
 	.dumb_destroy = drm_gem_dumb_destroy,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/arm/hdlcd_drv.c +0 -1
index 4ce4f970920b..5d79e87f7421 100644
@@ -278,7 +278,6 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
 	.irq_preinstall = hdlcd_irq_preinstall,
 	.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,
drivers/gpu/drm/arm/malidp_drv.c +0 -1
index 8b0672d4aee9..ca6ccd172de3 100644
@@ -213,7 +213,6 @@ static void malidp_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
 			   DRIVER_PRIME,
 	.lastclose = malidp_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = malidp_enable_vblank,
 	.disable_vblank = malidp_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/armada/armada_drv.c +0 -1
index 63f42d001f33..bb27892012de 100644
@@ -87,7 +87,6 @@ static void armada_drm_lastclose(struct drm_device *dev)
 
 static struct drm_driver armada_drm_driver = {
 	.lastclose		= armada_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= armada_drm_enable_vblank,
 	.disable_vblank		= armada_drm_disable_vblank,
 	.gem_free_object_unlocked = armada_gem_free_object,
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -1
index 427bdff425c2..5cba65b5ea16 100644
@@ -760,7 +760,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,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = atmel_hlcdc_dc_enable_vblank,
 	.disable_vblank = atmel_hlcdc_dc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -1
index 035d02ecffcd..a1c22eb12f4b 100644
@@ -263,7 +263,6 @@ static void exynos_drm_lastclose(struct drm_device *dev)
 	.preclose		= exynos_drm_preclose,
 	.lastclose		= exynos_drm_lastclose,
 	.postclose		= exynos_drm_postclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= exynos_drm_crtc_enable_vblank,
 	.disable_vblank		= exynos_drm_crtc_disable_vblank,
 	.gem_free_object_unlocked = exynos_drm_gem_free_object,
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -1
index 04173235f448..b59b816a1d7d 100644
@@ -203,7 +203,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 	.load			= fsl_dcu_load,
 	.unload			= fsl_dcu_unload,
 	.irq_handler		= fsl_dcu_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= fsl_dcu_drm_enable_vblank,
 	.disable_vblank		= fsl_dcu_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -1
index 7e2043f4348c..8cac70454b57 100644
@@ -84,7 +84,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 	.desc			= "hibmc drm driver",
 	.major			= 1,
 	.minor			= 0,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= hibmc_enable_vblank,
 	.disable_vblank		= hibmc_disable_vblank,
 	.gem_free_object_unlocked = hibmc_gem_free_object,
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +0 -1
index 9a0678a33e0d..0624fab8046f 100644
@@ -1025,7 +1025,6 @@ static int ade_drm_init(struct platform_device *pdev)
 			       IRQF_SHARED, dev->driver->name, acrtc);
 	if (ret)
 		return ret;
-	dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	dev->driver->enable_vblank = ade_enable_vblank;
 	dev->driver->disable_vblank = ade_disable_vblank;
 
drivers/gpu/drm/i915/i915_irq.c +0 -1
index 47d6131e977f..5aab08172faf 100644
@@ -4218,7 +4218,6 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
 	if (IS_GEN2(dev_priv)) {
 		/* Gen2 doesn't have a hardware frame counter */
 		dev->max_vblank_count = 0;
-		dev->driver->get_vblank_counter = drm_vblank_no_hw_counter;
 	} else if (IS_G4X(dev_priv) || INTEL_INFO(dev_priv)->gen >= 5) {
 		dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
 		dev->driver->get_vblank_counter = g4x_get_vblank_counter;
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
index 5ae48836652e..4badbb66d69e 100644
@@ -288,7 +288,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
 	.gem_prime_vmap		= drm_gem_cma_prime_vmap,
 	.gem_prime_vunmap	= drm_gem_cma_prime_vunmap,
 	.gem_prime_mmap		= drm_gem_cma_prime_mmap,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= imx_drm_enable_vblank,
 	.disable_vblank		= imx_drm_disable_vblank,
 	.ioctls			= imx_drm_ioctls,
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0 -1
index b5f88e6d078e..ef8675336465 100644
@@ -256,7 +256,6 @@ static void mtk_drm_kms_deinit(struct drm_device *drm)
 	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = mtk_drm_crtc_enable_vblank,
 	.disable_vblank = mtk_drm_crtc_disable_vblank,
 
drivers/gpu/drm/meson/meson_drv.c +0 -1
index 6f2fd82ed483..c0a59889c45f 100644
@@ -129,7 +129,6 @@ static irqreturn_t meson_irq(int irq, void *arg)
 	/* Vblank */
 	.enable_vblank		= meson_enable_vblank,
 	.disable_vblank		= meson_disable_vblank,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 
 	/* IRQ */
 	.irq_handler		= meson_irq,
drivers/gpu/drm/msm/msm_drv.c +0 -1
index 70226eaa5cac..cb47f4a14215 100644
@@ -816,7 +816,6 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data,
 	.irq_preinstall     = msm_irq_preinstall,
 	.irq_postinstall    = msm_irq_postinstall,
 	.irq_uninstall      = msm_irq_uninstall,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = msm_enable_vblank,
 	.disable_vblank     = msm_disable_vblank,
 	.gem_free_object    = msm_gem_free_object,
drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -1
index cdfbe0284635..104722a78bd6 100644
@@ -340,7 +340,6 @@ static irqreturn_t mxsfb_irq_handler(int irq, void *data)
 	.irq_handler		= mxsfb_irq_handler,
 	.irq_preinstall		= mxsfb_irq_preinstall,
 	.irq_uninstall		= mxsfb_irq_preinstall,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= mxsfb_enable_vblank,
 	.disable_vblank		= mxsfb_disable_vblank,
 	.gem_free_object	= drm_gem_cma_free_object,
drivers/gpu/drm/nouveau/nouveau_drm.c +0 -1
index 9ed2ca0769e3..626df485a03a 100644
@@ -977,7 +977,6 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	.debugfs_cleanup = nouveau_drm_debugfs_cleanup,
 #endif
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = nouveau_display_vblank_enable,
 	.disable_vblank = nouveau_display_vblank_disable,
 	.get_scanout_position = nouveau_display_scanoutpos,
drivers/gpu/drm/omapdrm/omap_drv.c +0 -1
index afe8f05b927b..da049a7636ad 100644
@@ -714,7 +714,6 @@ static void dev_lastclose(struct drm_device *dev)
 		DRIVER_ATOMIC,
 	.open = dev_open,
 	.lastclose = dev_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = omap_irq_enable_vblank,
 	.disable_vblank = omap_irq_disable_vblank,
 #ifdef CONFIG_DEBUG_FS
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -1
index c05e00872778..094da3ef49d1 100644
@@ -259,7 +259,6 @@ static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME
 				| DRIVER_ATOMIC,
 	.lastclose		= rcar_du_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rcar_du_enable_vblank,
 	.disable_vblank		= rcar_du_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -1
index c30d649cb147..39243480c834 100644
@@ -270,7 +270,6 @@ static void rockchip_drm_lastclose(struct drm_device *dev)
 	.driver_features	= DRIVER_MODESET | DRIVER_GEM |
 				  DRIVER_PRIME | DRIVER_ATOMIC,
 	.lastclose		= rockchip_drm_lastclose,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= rockchip_drm_crtc_enable_vblank,
 	.disable_vblank		= rockchip_drm_crtc_disable_vblank,
 	.gem_vm_ops		= &drm_gem_cma_vm_ops,
drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -1
index 33cec3d42389..d6b0545d252d 100644
@@ -256,7 +256,6 @@ static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.load			= shmob_drm_load,
 	.unload			= shmob_drm_unload,
 	.irq_handler		= shmob_drm_irq,
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= shmob_drm_enable_vblank,
 	.disable_vblank		= shmob_drm_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/sti/sti_drv.c +0 -1
index 788feed208d7..d4b771d2d10d 100644
@@ -264,7 +264,6 @@ static void sti_mode_config_init(struct drm_device *dev)
 	.dumb_destroy = drm_gem_dumb_destroy,
 	.fops = &sti_driver_fops,
 
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = sti_crtc_enable_vblank,
 	.disable_vblank = sti_crtc_disable_vblank,
 
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -1
index 4ce665349f6b..0816c635df20 100644
@@ -92,7 +92,6 @@ static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe)
 	/* Frame Buffer Operations */
 
 	/* VBlank Operations */
-	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= sun4i_drv_enable_vblank,
 	.disable_vblank		= sun4i_drv_disable_vblank,
 };
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -1
index 372d86fbb093..d5bc98e283d9 100644
@@ -557,7 +557,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
 			       DRIVER_PRIME | DRIVER_ATOMIC),
 	.lastclose          = tilcdc_lastclose,
 	.irq_handler        = tilcdc_irq,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank      = tilcdc_enable_vblank,
 	.disable_vblank     = tilcdc_disable_vblank,
 	.gem_free_object_unlocked = drm_gem_cma_free_object,
drivers/gpu/drm/vc4/vc4_drv.c +0 -1
index a459745e96f7..3a8709d85da1 100644
@@ -139,7 +139,6 @@ static void vc4_lastclose(struct drm_device *dev)
 
 	.enable_vblank = vc4_enable_vblank,
 	.disable_vblank = vc4_disable_vblank,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.get_scanout_position = vc4_crtc_get_scanoutpos,
 	.get_vblank_timestamp = vc4_crtc_get_vblank_timestamp,
 
drivers/gpu/drm/zte/zx_drm_drv.c +0 -1
index 5c6944a1e72c..afd713a954c6 100644
@@ -71,7 +71,6 @@ static void zx_drm_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 	.lastclose = zx_drm_lastclose,
-	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = zx_vou_enable_vblank,
 	.disable_vblank = zx_vou_disable_vblank,
 	.gem_free_object = drm_gem_cma_free_object,
Signature · 1 line
1.9.1
Signature · 12 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v3 2/23
#18 lore raw

Re: [PATCH v3 02/23] drm: remove drm_vblank_no_hw_counter assignment from driver code

In reply to Shawn Guo
Quoted 6 lines · Shawn Guo

From: Shawn Guo <[email protected]>

Core code already makes drm_driver.get_vblank_counter hook optional by letting drm_vblank_no_hw_counter be the default implementation for the function hook. So the drm_vblank_no_hw_counter assignment in the driver code becomes redundant and can be removed now.

Thanks. Missing this hook was actually a problem in vc4 for a while, so it's nice to have sensible defaults. For vc4:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#19 lore raw

PATCH v3 3/23 drm: unexport function drm_vblank_no_hw_counter()

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

The function drm_vblank_no_hw_counter() is now only used in core vblank wrapper code. Let's unexport it by making it a static function.

---
 drivers/gpu/drm/drm_irq.c | 28 ++++++++++------------------
 include/drm/drm_drv.h     |  7 +++----
 include/drm/drm_irq.h     |  1 -
 3 files changed, 13 insertions(+), 23 deletions(-)
drivers/gpu/drm/drm_irq.c +10 -18
index 646b3e57b9ad..1906723af389 100644
@@ -89,6 +89,16 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe,
 	write_sequnlock(&vblank->seqlock);
 }
 
+/*
+ * "No hw counter" fallback implementation of .get_vblank_counter() hook,
+ * if there is no useable hardware frame counter available.
+ */
+static u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe)
+{
+	WARN_ON_ONCE(dev->max_vblank_count != 0);
+	return 0;
+}
+
 static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
 {
 	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
@@ -1748,21 +1758,3 @@ bool drm_crtc_handle_vblank(struct drm_crtc *crtc)
 	return drm_handle_vblank(crtc->dev, drm_crtc_index(crtc));
 }
 EXPORT_SYMBOL(drm_crtc_handle_vblank);
-
-/**
- * drm_vblank_no_hw_counter - "No hw counter" implementation of .get_vblank_counter()
- * @dev: DRM device
- * @pipe: CRTC for which to read the counter
- *
- * Drivers can plug this into the .get_vblank_counter() function if
- * there is no useable hardware frame counter available.
- *
- * Returns:
- * 0
- */
-u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe)
-{
-	WARN_ON_ONCE(dev->max_vblank_count != 0);
-	return 0;
-}
-EXPORT_SYMBOL(drm_vblank_no_hw_counter);
include/drm/drm_drv.h +3 -4
index 40ae89106594..661ca24a4c97 100644
@@ -120,10 +120,9 @@ struct drm_driver {
 	 *
 	 * Driver callback for fetching a raw hardware vblank counter for the
 	 * CRTC specified with the pipe argument.  If a device doesn't have a
-	 * hardware counter, the driver can simply use
-	 * drm_vblank_no_hw_counter() function. The DRM core will account for
-	 * missed vblank events while interrupts where disabled based on system
-	 * timestamps.
+	 * hardware counter, the driver can simply leave the hook as NULL.
+	 * The DRM core will account for missed vblank events while interrupts
+	 * where disabled based on system timestamps.
 	 *
 	 * Wraparound handling and loss of events due to modesetting is dealt
 	 * with in the DRM core code, as long as drivers call
include/drm/drm_irq.h +0 -1
index 2fb880462a57..cf0be6594c8c 100644
@@ -152,7 +152,6 @@ void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
 void drm_crtc_vblank_on(struct drm_crtc *crtc);
 void drm_vblank_cleanup(struct drm_device *dev);
 u32 drm_accurate_vblank_count(struct drm_crtc *crtc);
-u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe);
 
 int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
 					  unsigned int pipe, int *max_error,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 3/23
#20 lore raw

Re: [PATCH v3 03/23] drm: unexport function drm_vblank_no_hw_counter()

Hi Shawn,

Thank you for the patch.

Quoted 6 lines · On Tuesday 07 Feb 2017 17:16:15 Shawn Guo wrote:

From: Shawn Guo <[email protected]>

The function drm_vblank_no_hw_counter() is now only used in core vblank wrapper code. Let's unexport it by making it a static function.

Quoted 54 lines
---
 drivers/gpu/drm/drm_irq.c | 28 ++++++++++------------------
 include/drm/drm_drv.h     |  7 +++----
 include/drm/drm_irq.h     |  1 -
 3 files changed, 13 insertions(+), 23 deletions(-)
drivers/gpu/drm/drm_irq.c +9 -3
index 646b3e57b9ad..1906723af389 100644
@@ -89,6 +89,16 @@ static void store_vblank(struct drm_device *dev, unsigned
 int pipe, write_sequnlock(&vblank->seqlock);
 }
 
+/*
+ * "No hw counter" fallback implementation of .get_vblank_counter() hook,
+ * if there is no useable hardware frame counter available.
+ */
+static u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int
 pipe) +{
+	WARN_ON_ONCE(dev->max_vblank_count != 0);
+	return 0;
+}
+
 static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
 {
 	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
@@ -1748,21 +1758,3 @@ bool drm_crtc_handle_vblank(struct drm_crtc *crtc)
 	return drm_handle_vblank(crtc->dev, drm_crtc_index(crtc));
 }
 EXPORT_SYMBOL(drm_crtc_handle_vblank);
-
-/**
- * drm_vblank_no_hw_counter - "No hw counter" implementation of

.get_vblank_counter() - * @dev: DRM device
- * @pipe: CRTC for which to read the counter
- *
- * Drivers can plug this into the .get_vblank_counter() function if
- * there is no useable hardware frame counter available.
- *
- * Returns:
- * 0
- */

drivers/gpu/drm/drm_irq.c +0 -6
-u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe)
-{
-	WARN_ON_ONCE(dev->max_vblank_count != 0);
-	return 0;
-}
-EXPORT_SYMBOL(drm_vblank_no_hw_counter);
include/drm/drm_drv.h +0 -0
index 40ae89106594..661ca24a4c97 100644

include/drm/drm_drv.h struct drm_driver { · line 125

Quoted 6 lines
include/drm/drm_drv.h +0 -3
@@ -120,10 +120,9 @@ struct drm_driver {
 	 *
 	 * Driver callback for fetching a raw hardware vblank counter for the
 	 * CRTC specified with the pipe argument.  If a device doesn't have a
-	 * hardware counter, the driver can simply use
-	 * drm_vblank_no_hw_counter() function. The DRM core will account for
-	 * missed vblank events while interrupts where disabled based on 

system

Quoted 19 lines
include/drm/drm_drv.h +3 -1
-	 * timestamps.
+	 * hardware counter, the driver can simply leave the hook as NULL.
+	 * The DRM core will account for missed vblank events while interrupts
+	 * where disabled based on system timestamps.
 	 *
 	 * Wraparound handling and loss of events due to modesetting is dealt
 	 * with in the DRM core code, as long as drivers call
include/drm/drm_irq.h +0 -1
index 2fb880462a57..cf0be6594c8c 100644
@@ -152,7 +152,6 @@ void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
 void drm_crtc_vblank_on(struct drm_crtc *crtc);
 void drm_vblank_cleanup(struct drm_device *dev);
 u32 drm_accurate_vblank_count(struct drm_crtc *crtc);
-u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe);
 
 int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
 					  unsigned int pipe, int *max_error,
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#21 lore raw

PATCH v3 4/23 drm: hdlcd: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

---
 drivers/gpu/drm/arm/hdlcd_crtc.c | 20 ++++++++++++++++++++
 drivers/gpu/drm/arm/hdlcd_drv.c  | 20 --------------------
 2 files changed, 20 insertions(+), 20 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +20 -0
index 20ebfb4fbdfa..798a3cc480a2 100644
@@ -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;
drivers/gpu/drm/arm/hdlcd_drv.c +0 -20
index 5d79e87f7421..4840dc277339 100644
@@ -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)
 {
@@ -278,8 +260,6 @@ static int hdlcd_debugfs_init(struct drm_minor *minor)
 	.irq_preinstall = hdlcd_irq_preinstall,
 	.irq_postinstall = hdlcd_irq_postinstall,
 	.irq_uninstall = hdlcd_irq_uninstall,
-	.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,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#22 lore raw

PATCH v3 5/23 drm: malidp: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Mali DP Maintainers <[email protected]>
---
 drivers/gpu/drm/arm/malidp_crtc.c | 21 +++++++++++++++++++++
 drivers/gpu/drm/arm/malidp_drv.c  | 21 ---------------------
 2 files changed, 21 insertions(+), 21 deletions(-)
drivers/gpu/drm/arm/malidp_crtc.c +21 -0
index 08e6a71f5d05..bad4d80cb711 100644
@@ -167,6 +167,25 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc,
 	.atomic_check = malidp_crtc_atomic_check,
 };
 
+static int malidp_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
+	struct malidp_hw_device *hwdev = malidp->dev;
+
+	malidp_hw_enable_irq(hwdev, MALIDP_DE_BLOCK,
+			     hwdev->map.de_irq_map.vsync_irq);
+	return 0;
+}
+
+static void malidp_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
+	struct malidp_hw_device *hwdev = malidp->dev;
+
+	malidp_hw_disable_irq(hwdev, MALIDP_DE_BLOCK,
+			      hwdev->map.de_irq_map.vsync_irq);
+}
+
 static const struct drm_crtc_funcs malidp_crtc_funcs = {
 	.destroy = drm_crtc_cleanup,
 	.set_config = drm_atomic_helper_set_config,
@@ -174,6 +193,8 @@ static int malidp_crtc_atomic_check(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 = malidp_crtc_enable_vblank,
+	.disable_vblank = malidp_crtc_disable_vblank,
 };
 
 int malidp_crtc_init(struct drm_device *drm)
drivers/gpu/drm/arm/malidp_drv.c +0 -21
index ca6ccd172de3..5dfcdb05c96e 100644
@@ -111,25 +111,6 @@ static void malidp_atomic_commit_tail(struct drm_atomic_state *state)
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
-static int malidp_enable_vblank(struct drm_device *drm, unsigned int crtc)
-{
-	struct malidp_drm *malidp = drm->dev_private;
-	struct malidp_hw_device *hwdev = malidp->dev;
-
-	malidp_hw_enable_irq(hwdev, MALIDP_DE_BLOCK,
-			     hwdev->map.de_irq_map.vsync_irq);
-	return 0;
-}
-
-static void malidp_disable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct malidp_drm *malidp = drm->dev_private;
-	struct malidp_hw_device *hwdev = malidp->dev;
-
-	malidp_hw_disable_irq(hwdev, MALIDP_DE_BLOCK,
-			      hwdev->map.de_irq_map.vsync_irq);
-}
-
 static int malidp_init(struct drm_device *drm)
 {
 	int ret;
@@ -213,8 +194,6 @@ static void malidp_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
 			   DRIVER_PRIME,
 	.lastclose = malidp_lastclose,
-	.enable_vblank = malidp_enable_vblank,
-	.disable_vblank = malidp_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,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v3 5/23
#23 lore raw

Re: [PATCH v3 05/23] drm: malidp: use vblank hooks in struct drm_crtc_funcs

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Mali DP Maintainers <[email protected]>
Quoted 86 lines
---
 drivers/gpu/drm/arm/malidp_crtc.c | 21 +++++++++++++++++++++
 drivers/gpu/drm/arm/malidp_drv.c  | 21 ---------------------
 2 files changed, 21 insertions(+), 21 deletions(-)
drivers/gpu/drm/arm/malidp_crtc.c +21 -0
index 08e6a71f5d05..bad4d80cb711 100644
@@ -167,6 +167,25 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc,
 	.atomic_check = malidp_crtc_atomic_check,
 };
 
+static int malidp_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
+	struct malidp_hw_device *hwdev = malidp->dev;
+
+	malidp_hw_enable_irq(hwdev, MALIDP_DE_BLOCK,
+			     hwdev->map.de_irq_map.vsync_irq);
+	return 0;
+}
+
+static void malidp_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
+	struct malidp_hw_device *hwdev = malidp->dev;
+
+	malidp_hw_disable_irq(hwdev, MALIDP_DE_BLOCK,
+			      hwdev->map.de_irq_map.vsync_irq);
+}
+
 static const struct drm_crtc_funcs malidp_crtc_funcs = {
 	.destroy = drm_crtc_cleanup,
 	.set_config = drm_atomic_helper_set_config,
@@ -174,6 +193,8 @@ static int malidp_crtc_atomic_check(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 = malidp_crtc_enable_vblank,
+	.disable_vblank = malidp_crtc_disable_vblank,
 };
 
 int malidp_crtc_init(struct drm_device *drm)
drivers/gpu/drm/arm/malidp_drv.c +0 -21
index ca6ccd172de3..5dfcdb05c96e 100644
@@ -111,25 +111,6 @@ static void malidp_atomic_commit_tail(struct drm_atomic_state *state)
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
-static int malidp_enable_vblank(struct drm_device *drm, unsigned int crtc)
-{
-	struct malidp_drm *malidp = drm->dev_private;
-	struct malidp_hw_device *hwdev = malidp->dev;
-
-	malidp_hw_enable_irq(hwdev, MALIDP_DE_BLOCK,
-			     hwdev->map.de_irq_map.vsync_irq);
-	return 0;
-}
-
-static void malidp_disable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct malidp_drm *malidp = drm->dev_private;
-	struct malidp_hw_device *hwdev = malidp->dev;
-
-	malidp_hw_disable_irq(hwdev, MALIDP_DE_BLOCK,
-			      hwdev->map.de_irq_map.vsync_irq);
-}
-
 static int malidp_init(struct drm_device *drm)
 {
 	int ret;
@@ -213,8 +194,6 @@ static void malidp_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
 			   DRIVER_PRIME,
 	.lastclose = malidp_lastclose,
-	.enable_vblank = malidp_enable_vblank,
-	.disable_vblank = malidp_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,
Signature · 1 line
1.9.1
Signature · 12 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#24 lore raw

PATCH v3 6/23 drm: armada: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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. As the result, functions armada_drm_crtc_enable[disable]_irq() can be static, although they are moved around a bit to save forward declaration.

The armada_crtc pointer array in struct armada_private is still kept in there, because armada_debugfs.c still have reference to it.

Cc Russell King <[email protected]>
---
 drivers/gpu/drm/armada/armada_crtc.c | 56 ++++++++++++++++++++++++------------
 drivers/gpu/drm/armada/armada_crtc.h |  2 --
 drivers/gpu/drm/armada/armada_drv.c  | 16 -----------
 3 files changed, 37 insertions(+), 37 deletions(-)
drivers/gpu/drm/armada/armada_crtc.c +37 -19
index e62ee4498ce4..1341e0b9368a 100644
@@ -418,6 +418,25 @@ static bool armada_drm_crtc_mode_fixup(struct drm_crtc *crtc,
 	return true;
 }
 
+/* These are locked by dev->vbl_lock */
+static void armada_drm_crtc_disable_irq(struct armada_crtc *dcrtc, u32 mask)
+{
+	if (dcrtc->irq_ena & mask) {
+		dcrtc->irq_ena &= ~mask;
+		writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA);
+	}
+}
+
+static void armada_drm_crtc_enable_irq(struct armada_crtc *dcrtc, u32 mask)
+{
+	if ((dcrtc->irq_ena & mask) != mask) {
+		dcrtc->irq_ena |= mask;
+		writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA);
+		if (readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR) & mask)
+			writel(0, dcrtc->base + LCD_SPU_IRQ_ISR);
+	}
+}
+
 static void armada_drm_crtc_irq(struct armada_crtc *dcrtc, u32 stat)
 {
 	void __iomem *base = dcrtc->base;
@@ -491,25 +510,6 @@ static irqreturn_t armada_drm_irq(int irq, void *arg)
 	return IRQ_NONE;
 }
 
-/* These are locked by dev->vbl_lock */
-void armada_drm_crtc_disable_irq(struct armada_crtc *dcrtc, u32 mask)
-{
-	if (dcrtc->irq_ena & mask) {
-		dcrtc->irq_ena &= ~mask;
-		writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA);
-	}
-}
-
-void armada_drm_crtc_enable_irq(struct armada_crtc *dcrtc, u32 mask)
-{
-	if ((dcrtc->irq_ena & mask) != mask) {
-		dcrtc->irq_ena |= mask;
-		writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA);
-		if (readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR) & mask)
-			writel(0, dcrtc->base + LCD_SPU_IRQ_ISR);
-	}
-}
-
 static uint32_t armada_drm_crtc_calculate_csc(struct armada_crtc *dcrtc)
 {
 	struct drm_display_mode *adj = &dcrtc->crtc.mode;
@@ -1109,6 +1109,22 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
 	return 0;
 }
 
+/* These are called under the vbl_lock. */
+static int armada_drm_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
+
+	armada_drm_crtc_enable_irq(dcrtc, VSYNC_IRQ_ENA);
+	return 0;
+}
+
+static void armada_drm_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
+
+	armada_drm_crtc_disable_irq(dcrtc, VSYNC_IRQ_ENA);
+}
+
 static const struct drm_crtc_funcs armada_crtc_funcs = {
 	.cursor_set	= armada_drm_crtc_cursor_set,
 	.cursor_move	= armada_drm_crtc_cursor_move,
@@ -1116,6 +1132,8 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
 	.set_config	= drm_crtc_helper_set_config,
 	.page_flip	= armada_drm_crtc_page_flip,
 	.set_property	= armada_drm_crtc_set_property,
+	.enable_vblank	= armada_drm_crtc_enable_vblank,
+	.disable_vblank	= armada_drm_crtc_disable_vblank,
 };
 
 static const struct drm_plane_funcs armada_primary_plane_funcs = {
drivers/gpu/drm/armada/armada_crtc.h +0 -2
index b08043e8cc3b..7e8906d3ae26 100644
@@ -104,8 +104,6 @@ struct armada_crtc {
 
 void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int);
 void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int);
-void armada_drm_crtc_disable_irq(struct armada_crtc *, u32);
-void armada_drm_crtc_enable_irq(struct armada_crtc *, u32);
 void armada_drm_crtc_update_regs(struct armada_crtc *, struct armada_regs *);
 
 void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc,
drivers/gpu/drm/armada/armada_drv.c +0 -16
index bb27892012de..737bfcbce87b 100644
@@ -49,20 +49,6 @@ void armada_drm_queue_unref_work(struct drm_device *dev,
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
-/* These are called under the vbl_lock. */
-static int armada_drm_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct armada_private *priv = dev->dev_private;
-	armada_drm_crtc_enable_irq(priv->dcrtc[pipe], VSYNC_IRQ_ENA);
-	return 0;
-}
-
-static void armada_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct armada_private *priv = dev->dev_private;
-	armada_drm_crtc_disable_irq(priv->dcrtc[pipe], VSYNC_IRQ_ENA);
-}
-
 static struct drm_ioctl_desc armada_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(ARMADA_GEM_CREATE, armada_gem_create_ioctl,0),
 	DRM_IOCTL_DEF_DRV(ARMADA_GEM_MMAP, armada_gem_mmap_ioctl, 0),
@@ -87,8 +73,6 @@ static void armada_drm_lastclose(struct drm_device *dev)
 
 static struct drm_driver armada_drm_driver = {
 	.lastclose		= armada_drm_lastclose,
-	.enable_vblank		= armada_drm_enable_vblank,
-	.disable_vblank		= armada_drm_disable_vblank,
 	.gem_free_object_unlocked = armada_gem_free_object,
 	.prime_handle_to_fd	= drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle	= drm_gem_prime_fd_to_handle,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by Russell King on v3 6/23
#25 lore raw

Re: [PATCH v3 06/23] drm: armada: use vblank hooks in struct drm_crtc_funcs

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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. As the result, functions armada_drm_crtc_enable[disable]_irq() can be static, although they are moved around a bit to save forward declaration.

Quoted 5 lines

The armada_crtc pointer array in struct armada_private is still kept in there, because armada_debugfs.c still have reference to it.

Cc Russell King <[email protected]>

Thanks.

Signature · 7 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#26 lore raw

PATCH v3 7/23 drm: atmel: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Boris Brezillon <[email protected]>
---
 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(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +21 -0
index 9b17a66cf0e1..fabeeea0e899 100644
@@ -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)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -21
index 5cba65b5ea16..fd1a2d0c870d 100644
@@ -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,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v3 7/23
#27 lore raw

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

Quoted 8 lines · On Tue, 7 Feb 2017 17:16:19 +0800 Shawn Guo <[email protected]> wrote:

From: Shawn Guo <[email protected]>

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.

Cc Boris Brezillon <[email protected]>
Quoted 75 lines
---
 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(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +21 -0
index 9b17a66cf0e1..fabeeea0e899 100644
@@ -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)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -19
index 5cba65b5ea16..fd1a2d0c870d 100644
@@ -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,

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c static void atmel_hlcdc_dc_disable_vblank(struct drm_device *dev, · line 746

Quoted 8 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -2
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#28 lore raw

PATCH v3 8/23 drm: exynos: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

As the result, exynos_drm_crtc_enable[disable]_vblank() become static functions. They are moved around a bit to save forward declaration though. Also while at it, we move one step further to kill exynos_drm_crtc_from_pipe() completely by updating hdmi_bind() a bit.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 40 ++++++++++++++++----------------
 drivers/gpu/drm/exynos/exynos_drm_crtc.h |  2 --
 drivers/gpu/drm/exynos/exynos_drm_drv.c  |  3 ---
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |  8 -------
 drivers/gpu/drm/exynos/exynos_hdmi.c     |  7 ++++--
 5 files changed, 25 insertions(+), 35 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +20 -20
index 5367b6664fe3..fa32091af924 100644
@@ -122,6 +122,24 @@ static void exynos_drm_crtc_destroy(struct drm_crtc *crtc)
 	kfree(exynos_crtc);
 }
 
+static int exynos_drm_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+
+	if (exynos_crtc->ops->enable_vblank)
+		return exynos_crtc->ops->enable_vblank(exynos_crtc);
+
+	return 0;
+}
+
+static void exynos_drm_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+
+	if (exynos_crtc->ops->disable_vblank)
+		exynos_crtc->ops->disable_vblank(exynos_crtc);
+}
+
 static const struct drm_crtc_funcs exynos_crtc_funcs = {
 	.set_config	= drm_atomic_helper_set_config,
 	.page_flip	= drm_atomic_helper_page_flip,
@@ -129,6 +147,8 @@ static void exynos_drm_crtc_destroy(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 = exynos_drm_crtc_enable_vblank,
+	.disable_vblank = exynos_drm_crtc_disable_vblank,
 };
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
@@ -168,26 +188,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 	return ERR_PTR(ret);
 }
 
-int exynos_drm_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct exynos_drm_crtc *exynos_crtc = exynos_drm_crtc_from_pipe(dev,
-									pipe);
-
-	if (exynos_crtc->ops->enable_vblank)
-		return exynos_crtc->ops->enable_vblank(exynos_crtc);
-
-	return 0;
-}
-
-void exynos_drm_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct exynos_drm_crtc *exynos_crtc = exynos_drm_crtc_from_pipe(dev,
-									pipe);
-
-	if (exynos_crtc->ops->disable_vblank)
-		exynos_crtc->ops->disable_vblank(exynos_crtc);
-}
-
 int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,
 				       enum exynos_drm_output_type out_type)
 {
drivers/gpu/drm/exynos/exynos_drm_crtc.h +0 -2
index 6a581a8af465..4e986ba92320 100644
@@ -23,8 +23,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 					enum exynos_drm_output_type type,
 					const struct exynos_drm_crtc_ops *ops,
 					void *context);
-int exynos_drm_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe);
-void exynos_drm_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe);
 void exynos_drm_crtc_wait_pending_update(struct exynos_drm_crtc *exynos_crtc);
 void exynos_drm_crtc_finish_update(struct exynos_drm_crtc *exynos_crtc,
 				   struct exynos_drm_plane *exynos_plane);
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -3
index a1c22eb12f4b..b4522f67b3cb 100644
@@ -22,7 +22,6 @@
 #include <drm/exynos_drm.h>
 
 #include "exynos_drm_drv.h"
-#include "exynos_drm_crtc.h"
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
@@ -263,8 +262,6 @@ static void exynos_drm_lastclose(struct drm_device *dev)
 	.preclose		= exynos_drm_preclose,
 	.lastclose		= exynos_drm_lastclose,
 	.postclose		= exynos_drm_postclose,
-	.enable_vblank		= exynos_drm_crtc_enable_vblank,
-	.disable_vblank		= exynos_drm_crtc_disable_vblank,
 	.gem_free_object_unlocked = exynos_drm_gem_free_object,
 	.gem_vm_ops		= &exynos_drm_gem_vm_ops,
 	.dumb_create		= exynos_drm_gem_dumb_create,
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -8
index cf6e08cb35a7..cb3176930596 100644
@@ -222,14 +222,6 @@ struct exynos_drm_private {
 	wait_queue_head_t	wait;
 };
 
-static inline struct exynos_drm_crtc *
-exynos_drm_crtc_from_pipe(struct drm_device *dev, int pipe)
-{
-	struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
-
-	return to_exynos_crtc(crtc);
-}
-
 static inline struct device *to_dma_dev(struct drm_device *dev)
 {
 	struct exynos_drm_private *priv = dev->dev_private;
drivers/gpu/drm/exynos/exynos_hdmi.c +5 -2
index 5ed8b1effe71..752e8a3afc79 100644
@@ -42,7 +42,6 @@
 
 #include <drm/exynos_drm.h>
 
-#include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
 
 #define HOTPLUG_DEBOUNCE_MS		1100
@@ -1657,6 +1656,8 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
 	struct drm_device *drm_dev = data;
 	struct hdmi_context *hdata = dev_get_drvdata(dev);
 	struct drm_encoder *encoder = &hdata->encoder;
+	struct exynos_drm_crtc *exynos_crtc;
+	struct drm_crtc *crtc;
 	int ret, pipe;
 
 	hdata->drm_dev = drm_dev;
@@ -1668,7 +1669,9 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
 
 	hdata->phy_clk.enable = hdmiphy_clk_enable;
 
-	exynos_drm_crtc_from_pipe(drm_dev, pipe)->pipe_clk = &hdata->phy_clk;
+	crtc = drm_crtc_from_index(drm_dev, pipe);
+	exynos_crtc = to_exynos_crtc(crtc);
+	exynos_crtc->pipe_clk = &hdata->phy_clk;
 
 	encoder->possible_crtcs = 1 << pipe;
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 8/23
#29 lore raw

Re: [PATCH v3 08/23] drm: exynos: use vblank hooks in struct drm_crtc_funcs

Quoted 6 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Quoted 7 lines

As the result, exynos_drm_crtc_enable[disable]_vblank() become static functions. They are moved around a bit to save forward declaration though. Also while at it, we move one step further to kill exynos_drm_crtc_from_pipe() completely by updating hdmi_bind() a bit.

--
Regards
Andrzej

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#30 lore raw

PATCH v3 9/23 drm: fsl-dcu: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Stefan Agner <[email protected]>
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 26 ++++++++++++++++++++++++++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 25 -------------------------
 2 files changed, 26 insertions(+), 25 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +26 -0
index deb57435cc89..cc4e944a1d3c 100644
@@ -137,6 +137,30 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	.mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb,
 };
 
+static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct drm_device *dev = crtc->dev;
+	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+	unsigned int value;
+
+	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
+	value &= ~DCU_INT_MASK_VBLANK;
+	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+
+	return 0;
+}
+
+static void fsl_dcu_drm_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct drm_device *dev = crtc->dev;
+	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+	unsigned int value;
+
+	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
+	value |= DCU_INT_MASK_VBLANK;
+	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+}
+
 static const struct drm_crtc_funcs fsl_dcu_drm_crtc_funcs = {
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
 	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
@@ -144,6 +168,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	.page_flip = drm_atomic_helper_page_flip,
 	.reset = drm_atomic_helper_crtc_reset,
 	.set_config = drm_atomic_helper_set_config,
+	.enable_vblank = fsl_dcu_drm_crtc_enable_vblank,
+	.disable_vblank = fsl_dcu_drm_crtc_disable_vblank,
 };
 
 int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -25
index b59b816a1d7d..b5391c124c64 100644
@@ -154,29 +154,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-	unsigned int value;
-
-	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
-	value &= ~DCU_INT_MASK_VBLANK;
-	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
-
-	return 0;
-}
-
-static void fsl_dcu_drm_disable_vblank(struct drm_device *dev,
-				       unsigned int pipe)
-{
-	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-	unsigned int value;
-
-	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
-	value |= DCU_INT_MASK_VBLANK;
-	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
-}
-
 static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 {
 	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
@@ -203,8 +180,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 	.load			= fsl_dcu_load,
 	.unload			= fsl_dcu_unload,
 	.irq_handler		= fsl_dcu_drm_irq,
-	.enable_vblank		= fsl_dcu_drm_enable_vblank,
-	.disable_vblank		= fsl_dcu_drm_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,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v3 9/23
#31 lore raw

Re: [PATCH v3 09/23] drm: fsl-dcu: use vblank hooks in struct drm_crtc_funcs

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Stefan Agner <[email protected]>
Quoted 88 lines
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 26 ++++++++++++++++++++++++++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 25 -------------------------
 2 files changed, 26 insertions(+), 25 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +24 -0
index deb57435cc89..cc4e944a1d3c 100644
@@ -137,6 +137,30 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct
 drm_crtc *crtc)
 	.mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb,
 };
 
+static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct drm_device *dev = crtc->dev;
+	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+	unsigned int value;
+
+	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
+	value &= ~DCU_INT_MASK_VBLANK;
+	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+
+	return 0;
+}
+
+static void fsl_dcu_drm_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct drm_device *dev = crtc->dev;
+	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+	unsigned int value;
+
+	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
+	value |= DCU_INT_MASK_VBLANK;
+	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+}
+
 static const struct drm_crtc_funcs fsl_dcu_drm_crtc_funcs = {
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +2 -0
 	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
@@ -144,6 +168,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct
 drm_crtc *crtc)
 	.page_flip = drm_atomic_helper_page_flip,
 	.reset = drm_atomic_helper_crtc_reset,
 	.set_config = drm_atomic_helper_set_config,
+	.enable_vblank = fsl_dcu_drm_crtc_enable_vblank,
+	.disable_vblank = fsl_dcu_drm_crtc_disable_vblank,
 };
 

int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev)

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -23
index b59b816a1d7d..b5391c124c64 100644
@@ -154,29 +154,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-	unsigned int value;
-
-	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
-	value &= ~DCU_INT_MASK_VBLANK;
-	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
-
-	return 0;
-}
-
-static void fsl_dcu_drm_disable_vblank(struct drm_device *dev,
-				       unsigned int pipe)
-{
-	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-	unsigned int value;
-
-	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
-	value |= DCU_INT_MASK_VBLANK;
-	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
-}
-
 static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 {
 	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static void fsl_dcu_drm_lastclose(struct drm_device *dev) · line 185

Quoted 8 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -2
@@ -203,8 +180,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 	.load			= fsl_dcu_load,
 	.unload			= fsl_dcu_unload,
 	.irq_handler		= fsl_dcu_drm_irq,
-	.enable_vblank		= fsl_dcu_drm_enable_vblank,
-	.disable_vblank		= fsl_dcu_drm_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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#32 lore raw

Re: [PATCH v3 09/23] drm: fsl-dcu: use vblank hooks in struct drm_crtc_funcs

Quoted 11 lines · Stefan Agner
Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Stefan Agner <[email protected]>

Merged up to this one to drm-misc for 4.12, I'll give the others some more time for maintainer acks.
-Daniel

Quoted 97 lines
Quoted 97 lines
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 26 ++++++++++++++++++++++++++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c  | 25 -------------------------
 2 files changed, 26 insertions(+), 25 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +24 -0
index deb57435cc89..cc4e944a1d3c 100644
@@ -137,6 +137,30 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct
 drm_crtc *crtc)
 	.mode_set_nofb = fsl_dcu_drm_crtc_mode_set_nofb,
 };
 
+static int fsl_dcu_drm_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct drm_device *dev = crtc->dev;
+	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+	unsigned int value;
+
+	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
+	value &= ~DCU_INT_MASK_VBLANK;
+	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+
+	return 0;
+}
+
+static void fsl_dcu_drm_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct drm_device *dev = crtc->dev;
+	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+	unsigned int value;
+
+	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
+	value |= DCU_INT_MASK_VBLANK;
+	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
+}
+
 static const struct drm_crtc_funcs fsl_dcu_drm_crtc_funcs = {
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +2 -0
 	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
@@ -144,6 +168,8 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct
 drm_crtc *crtc)
 	.page_flip = drm_atomic_helper_page_flip,
 	.reset = drm_atomic_helper_crtc_reset,
 	.set_config = drm_atomic_helper_set_config,
+	.enable_vblank = fsl_dcu_drm_crtc_enable_vblank,
+	.disable_vblank = fsl_dcu_drm_crtc_disable_vblank,
 };
 

int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev)

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -25
index b59b816a1d7d..b5391c124c64 100644
@@ -154,29 +154,6 @@ static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-static int fsl_dcu_drm_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-	unsigned int value;
-
-	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
-	value &= ~DCU_INT_MASK_VBLANK;
-	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
-
-	return 0;
-}
-
-static void fsl_dcu_drm_disable_vblank(struct drm_device *dev,
-				       unsigned int pipe)
-{
-	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
-	unsigned int value;
-
-	regmap_read(fsl_dev->regmap, DCU_INT_MASK, &value);
-	value |= DCU_INT_MASK_VBLANK;
-	regmap_write(fsl_dev->regmap, DCU_INT_MASK, value);
-}
-
 static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 {
 	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
@@ -203,8 +180,6 @@ static void fsl_dcu_drm_lastclose(struct drm_device *dev)
 	.load			= fsl_dcu_load,
 	.unload			= fsl_dcu_unload,
 	.irq_handler		= fsl_dcu_drm_irq,
-	.enable_vblank		= fsl_dcu_drm_enable_vblank,
-	.disable_vblank		= fsl_dcu_drm_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,
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#33 lore raw

PATCH v3 10/23 drm: hibmc: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Xinliang Liu <[email protected]>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  | 20 ++++++++++++++++++++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 ----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +20 -0
index c655883d3613..59542bddc980 100644
@@ -423,6 +423,24 @@ static void hibmc_crtc_atomic_flush(struct drm_crtc *crtc,
 	spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
 }
 
+static int hibmc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct hibmc_drm_private *priv = crtc->dev->dev_private;
+
+	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1),
+	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
+
+	return 0;
+}
+
+static void hibmc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct hibmc_drm_private *priv = crtc->dev->dev_private;
+
+	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0),
+	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
+}
+
 static const struct drm_crtc_funcs hibmc_crtc_funcs = {
 	.page_flip = drm_atomic_helper_page_flip,
 	.set_config = drm_atomic_helper_set_config,
@@ -430,6 +448,8 @@ static void hibmc_crtc_atomic_flush(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 = hibmc_crtc_enable_vblank,
+	.disable_vblank = hibmc_crtc_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs hibmc_crtc_helper_funcs = {
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -22
index 8cac70454b57..2ffdbf9801bd 100644
@@ -37,26 +37,6 @@
 	.llseek		= no_llseek,
 };
 
-static int hibmc_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct hibmc_drm_private *priv =
-		(struct hibmc_drm_private *)dev->dev_private;
-
-	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1),
-	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
-
-	return 0;
-}
-
-static void hibmc_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct hibmc_drm_private *priv =
-		(struct hibmc_drm_private *)dev->dev_private;
-
-	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0),
-	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
-}
-
 irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 {
 	struct drm_device *dev = (struct drm_device *)arg;
@@ -84,8 +64,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 	.desc			= "hibmc drm driver",
 	.major			= 1,
 	.minor			= 0,
-	.enable_vblank		= hibmc_enable_vblank,
-	.disable_vblank		= hibmc_disable_vblank,
 	.gem_free_object_unlocked = hibmc_gem_free_object,
 	.dumb_create            = hibmc_dumb_create,
 	.dumb_map_offset        = hibmc_dumb_mmap_offset,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 10/23
#34 lore raw

Re: [PATCH v3 10/23] drm: hibmc: use vblank hooks in struct drm_crtc_funcs

Quoted 6 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Quoted 92 lines
Cc Xinliang Liu <[email protected]>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  | 20 ++++++++++++++++++++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 ----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +20 -0
index c655883d3613..59542bddc980 100644
@@ -423,6 +423,24 @@ static void hibmc_crtc_atomic_flush(struct drm_crtc *crtc,
 	spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
 }
 
+static int hibmc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct hibmc_drm_private *priv = crtc->dev->dev_private;
+
+	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1),
+	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
+
+	return 0;
+}
+
+static void hibmc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct hibmc_drm_private *priv = crtc->dev->dev_private;
+
+	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0),
+	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
+}
+
 static const struct drm_crtc_funcs hibmc_crtc_funcs = {
 	.page_flip = drm_atomic_helper_page_flip,
 	.set_config = drm_atomic_helper_set_config,
@@ -430,6 +448,8 @@ static void hibmc_crtc_atomic_flush(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 = hibmc_crtc_enable_vblank,
+	.disable_vblank = hibmc_crtc_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs hibmc_crtc_helper_funcs = {
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -22
index 8cac70454b57..2ffdbf9801bd 100644
@@ -37,26 +37,6 @@
 	.llseek		= no_llseek,
 };
 
-static int hibmc_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct hibmc_drm_private *priv =
-		(struct hibmc_drm_private *)dev->dev_private;
-
-	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1),
-	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
-
-	return 0;
-}
-
-static void hibmc_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct hibmc_drm_private *priv =
-		(struct hibmc_drm_private *)dev->dev_private;
-
-	writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0),
-	       priv->mmio + HIBMC_RAW_INTERRUPT_EN);
-}
-
 irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 {
 	struct drm_device *dev = (struct drm_device *)arg;
@@ -84,8 +64,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 	.desc			= "hibmc drm driver",
 	.major			= 1,
 	.minor			= 0,
-	.enable_vblank		= hibmc_enable_vblank,
-	.disable_vblank		= hibmc_disable_vblank,
 	.gem_free_object_unlocked = hibmc_gem_free_object,
 	.dumb_create            = hibmc_dumb_create,
 	.dumb_map_offset        = hibmc_dumb_mmap_offset,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v3 10/23
#35 lore raw

Re: [PATCH v3 10/23] drm: hibmc: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo
Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Xinliang Liu <[email protected]>

Thanks Shawn for the rework patches,
For the hibmc,

Thanks,
-xinliang

Quoted 86 lines
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  | 20 ++++++++++++++++++++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 22 ----------------------
 2 files changed, 20 insertions(+), 22 deletions(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c +20 -0
index c655883d3613..59542bddc980 100644
@@ -423,6 +423,24 @@ static void hibmc_crtc_atomic_flush(struct drm_crtc *crtc,
        spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
 }
 
+static int hibmc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+       struct hibmc_drm_private *priv = crtc->dev->dev_private;
+
+       writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1),
+              priv->mmio + HIBMC_RAW_INTERRUPT_EN);
+
+       return 0;
+}
+
+static void hibmc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+       struct hibmc_drm_private *priv = crtc->dev->dev_private;
+
+       writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0),
+              priv->mmio + HIBMC_RAW_INTERRUPT_EN);
+}
+
 static const struct drm_crtc_funcs hibmc_crtc_funcs = {
        .page_flip = drm_atomic_helper_page_flip,
        .set_config = drm_atomic_helper_set_config,
@@ -430,6 +448,8 @@ static void hibmc_crtc_atomic_flush(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 = hibmc_crtc_enable_vblank,
+       .disable_vblank = hibmc_crtc_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs hibmc_crtc_helper_funcs = {
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -23
index 8cac70454b57..2ffdbf9801bd 100644
@@ -37,26 +37,6 @@
        .llseek         = no_llseek,
 };
 
-static int hibmc_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-       struct hibmc_drm_private *priv =
-               (struct hibmc_drm_private *)dev->dev_private;
-
-       writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(1),
-              priv->mmio + HIBMC_RAW_INTERRUPT_EN);
-
-       return 0;
-}
-
-static void hibmc_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-       struct hibmc_drm_private *priv =
-               (struct hibmc_drm_private *)dev->dev_private;
-
-       writel(HIBMC_RAW_INTERRUPT_EN_VBLANK(0),
-              priv->mmio + HIBMC_RAW_INTERRUPT_EN);
-}
-
 irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
 {
        struct drm_device *dev = (struct drm_device *)arg;
@@ -84,8 +64,6 @@ irqreturn_t hibmc_drm_interrupt(int irq, void *arg)
        .desc                   = "hibmc drm driver",
        .major                  = 1,
        .minor                  = 0,
-       .enable_vblank          = hibmc_enable_vblank,
-       .disable_vblank         = hibmc_disable_vblank,
        .gem_free_object_unlocked = hibmc_gem_free_object,
        .dumb_create            = hibmc_dumb_create,
        .dumb_map_offset        = hibmc_dumb_mmap_offset,
--

1.9.1

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#36 lore raw

PATCH v3 11/23 drm: kirin: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Xinliang Liu <[email protected]>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +4 -6
index 0624fab8046f..c96c228a9898 100644
@@ -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;
 }
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v3 11/23
#37 lore raw

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

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Xinliang Liu <[email protected]>

Thanks Shawn for the rework patches,
For the kirin,

Thanks,
-xinliang

Quoted 51 lines
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +4 -7
index 0624fab8046f..c96c228a9898 100644
@@ -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

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#38 lore raw

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

Quoted 7 lines · Xinliang Liu
Quoted 6 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Quoted 6 lines
Quoted 2 lines
Cc Xinliang Liu <[email protected]>

Thanks Shawn for the rework patches,
For the kirin,

Applied to -misc

Thanks,

Sean

Quoted 63 lines

Thanks,
-xinliang

Quoted 51 lines
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +4 -7
index 0624fab8046f..c96c228a9898 100644
@@ -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

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#39 lore raw

PATCH v3 12/23 drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

With the vblank hooks in struct drm_crtc_funcs, we do not need to maintain the CRTC specific vblank callbacks with struct imx_drm_crtc_helper_funcs any more. By moving the stuff that we currently do in imx_drm_add_crtc(), like of_node setting and drm_crtc_helper_add()/drm_crtc_init_with_planes() invoking, we can kill things like struct imx_drm_crtc, imx_drm_crtc_helper_funcs and related functions completely.

Functions ipu_enable_vblank() and ipu_disable_vblank() are moved around without changes, only for saving the forward declarations.

Cc Philipp Zabel <[email protected]>
---
 drivers/gpu/drm/imx/imx-drm-core.c | 101 -------------------------------------
 drivers/gpu/drm/imx/imx-drm.h      |  13 -----
 drivers/gpu/drm/imx/ipuv3-crtc.c   |  58 ++++++++-------------
 3 files changed, 22 insertions(+), 150 deletions(-)
drivers/gpu/drm/imx/imx-drm-core.c +0 -101
index 4badbb66d69e..65bd8b8a2494 100644
@@ -40,17 +40,11 @@ struct imx_drm_component {
 
 struct imx_drm_device {
 	struct drm_device			*drm;
-	struct imx_drm_crtc			*crtc[MAX_CRTC];
 	unsigned int				pipes;
 	struct drm_fbdev_cma			*fbhelper;
 	struct drm_atomic_state			*state;
 };
 
-struct imx_drm_crtc {
-	struct drm_crtc				*crtc;
-	struct imx_drm_crtc_helper_funcs	imx_drm_helper_funcs;
-};
-
 #if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
 static int legacyfb_depth = 16;
 module_param(legacyfb_depth, int, 0444);
@@ -63,38 +57,6 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
 	drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
 }
 
-static int imx_drm_enable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct imx_drm_device *imxdrm = drm->dev_private;
-	struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[pipe];
-	int ret;
-
-	if (!imx_drm_crtc)
-		return -EINVAL;
-
-	if (!imx_drm_crtc->imx_drm_helper_funcs.enable_vblank)
-		return -ENOSYS;
-
-	ret = imx_drm_crtc->imx_drm_helper_funcs.enable_vblank(
-			imx_drm_crtc->crtc);
-
-	return ret;
-}
-
-static void imx_drm_disable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct imx_drm_device *imxdrm = drm->dev_private;
-	struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[pipe];
-
-	if (!imx_drm_crtc)
-		return;
-
-	if (!imx_drm_crtc->imx_drm_helper_funcs.disable_vblank)
-		return;
-
-	imx_drm_crtc->imx_drm_helper_funcs.disable_vblank(imx_drm_crtc->crtc);
-}
-
 static const struct file_operations imx_drm_driver_fops = {
 	.owner = THIS_MODULE,
 	.open = drm_open,
@@ -180,67 +142,6 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state)
 	.atomic_commit_tail = imx_drm_atomic_commit_tail,
 };
 
-/*
- * imx_drm_add_crtc - add a new crtc
- */
-int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
-		struct imx_drm_crtc **new_crtc, struct drm_plane *primary_plane,
-		const struct imx_drm_crtc_helper_funcs *imx_drm_helper_funcs,
-		struct device_node *port)
-{
-	struct imx_drm_device *imxdrm = drm->dev_private;
-	struct imx_drm_crtc *imx_drm_crtc;
-
-	/*
-	 * The vblank arrays are dimensioned by MAX_CRTC - we can't
-	 * pass IDs greater than this to those functions.
-	 */
-	if (imxdrm->pipes >= MAX_CRTC)
-		return -EINVAL;
-
-	if (imxdrm->drm->open_count)
-		return -EBUSY;
-
-	imx_drm_crtc = kzalloc(sizeof(*imx_drm_crtc), GFP_KERNEL);
-	if (!imx_drm_crtc)
-		return -ENOMEM;
-
-	imx_drm_crtc->imx_drm_helper_funcs = *imx_drm_helper_funcs;
-	imx_drm_crtc->crtc = crtc;
-
-	crtc->port = port;
-
-	imxdrm->crtc[imxdrm->pipes++] = imx_drm_crtc;
-
-	*new_crtc = imx_drm_crtc;
-
-	drm_crtc_helper_add(crtc,
-			imx_drm_crtc->imx_drm_helper_funcs.crtc_helper_funcs);
-
-	drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
-			imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs, NULL);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(imx_drm_add_crtc);
-
-/*
- * imx_drm_remove_crtc - remove a crtc
- */
-int imx_drm_remove_crtc(struct imx_drm_crtc *imx_drm_crtc)
-{
-	struct imx_drm_device *imxdrm = imx_drm_crtc->crtc->dev->dev_private;
-	unsigned int pipe = drm_crtc_index(imx_drm_crtc->crtc);
-
-	drm_crtc_cleanup(imx_drm_crtc->crtc);
-
-	imxdrm->crtc[pipe] = NULL;
-
-	kfree(imx_drm_crtc);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(imx_drm_remove_crtc);
 
 int imx_drm_encoder_parse_of(struct drm_device *drm,
 	struct drm_encoder *encoder, struct device_node *np)
@@ -288,8 +189,6 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
 	.gem_prime_vmap		= drm_gem_cma_prime_vmap,
 	.gem_prime_vunmap	= drm_gem_cma_prime_vunmap,
 	.gem_prime_mmap		= drm_gem_cma_prime_mmap,
-	.enable_vblank		= imx_drm_enable_vblank,
-	.disable_vblank		= imx_drm_disable_vblank,
 	.ioctls			= imx_drm_ioctls,
 	.num_ioctls		= ARRAY_SIZE(imx_drm_ioctls),
 	.fops			= &imx_drm_driver_fops,
drivers/gpu/drm/imx/imx-drm.h +0 -13
index 5a91cb16c8fa..cc003334505d 100644
@@ -25,19 +25,6 @@ static inline struct imx_crtc_state *to_imx_crtc_state(struct drm_crtc_state *s)
 {
 	return container_of(s, struct imx_crtc_state, base);
 }
-
-struct imx_drm_crtc_helper_funcs {
-	int (*enable_vblank)(struct drm_crtc *crtc);
-	void (*disable_vblank)(struct drm_crtc *crtc);
-	const struct drm_crtc_helper_funcs *crtc_helper_funcs;
-	const struct drm_crtc_funcs *crtc_funcs;
-};
-
-int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
-		struct imx_drm_crtc **new_crtc, struct drm_plane *primary_plane,
-		const struct imx_drm_crtc_helper_funcs *imx_helper_funcs,
-		struct device_node *port);
-int imx_drm_remove_crtc(struct imx_drm_crtc *);
 int imx_drm_init_drm(struct platform_device *pdev,
 		int preferred_bpp);
 int imx_drm_exit_drm(void);
drivers/gpu/drm/imx/ipuv3-crtc.c +22 -36

102 lines not on this page · raw message

Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v3 12/23
#40 lore raw

Re: [PATCH v3 12/23] drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs

Hi Shawn,

Quoted 9 lines · Shawn Guo

From: Shawn Guo <[email protected]>

With the vblank hooks in struct drm_crtc_funcs, we do not need to maintain the CRTC specific vblank callbacks with struct imx_drm_crtc_helper_funcs any more. By moving the stuff that we currently do in imx_drm_add_crtc(), like of_node setting and drm_crtc_helper_add()/drm_crtc_init_with_planes() invoking, we can kill things like struct imx_drm_crtc, imx_drm_crtc_helper_funcs and related functions completely.

Thanks for removing the imx_drm_crtc indirection.

Quoted 5 lines

Functions ipu_enable_vblank() and ipu_disable_vblank() are moved around without changes, only for saving the forward declarations.

Cc Philipp Zabel <[email protected]>

regards
Philipp

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#41 lore raw

PATCH v3 13/23 drm: mediatek: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 8 ++++----
 drivers/gpu/drm/mediatek/mtk_drm_crtc.h | 2 --
 drivers/gpu/drm/mediatek/mtk_drm_drv.c  | 3 ---
 3 files changed, 4 insertions(+), 9 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +4 -4
index a73de1e669c2..69982f5a6198 100644
@@ -168,9 +168,8 @@ static void mtk_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	state->pending_config = true;
 }
 
-int mtk_drm_crtc_enable_vblank(struct drm_device *drm, unsigned int pipe)
+static int mtk_drm_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
 	struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
 	struct mtk_ddp_comp *ovl = mtk_crtc->ddp_comp[0];
 
@@ -179,9 +178,8 @@ int mtk_drm_crtc_enable_vblank(struct drm_device *drm, unsigned int pipe)
 	return 0;
 }
 
-void mtk_drm_crtc_disable_vblank(struct drm_device *drm, unsigned int pipe)
+static void mtk_drm_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
 	struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
 	struct mtk_ddp_comp *ovl = mtk_crtc->ddp_comp[0];
 
@@ -436,6 +434,8 @@ static void mtk_drm_crtc_atomic_flush(struct drm_crtc *crtc,
 	.atomic_duplicate_state	= mtk_drm_crtc_duplicate_state,
 	.atomic_destroy_state	= mtk_drm_crtc_destroy_state,
 	.gamma_set		= drm_atomic_helper_legacy_gamma_set,
+	.enable_vblank		= mtk_drm_crtc_enable_vblank,
+	.disable_vblank		= mtk_drm_crtc_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs mtk_crtc_helper_funcs = {
drivers/gpu/drm/mediatek/mtk_drm_crtc.h +0 -2
index a1550fa3c9d2..9d9410c67ae9 100644
@@ -23,8 +23,6 @@
 #define MTK_MAX_BPC	10
 #define MTK_MIN_BPC	3
 
-int mtk_drm_crtc_enable_vblank(struct drm_device *drm, unsigned int pipe);
-void mtk_drm_crtc_disable_vblank(struct drm_device *drm, unsigned int pipe);
 void mtk_drm_crtc_commit(struct drm_crtc *crtc);
 void mtk_crtc_ddp_irq(struct drm_crtc *crtc, struct mtk_ddp_comp *ovl);
 int mtk_drm_crtc_create(struct drm_device *drm_dev,
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0 -3
index ef8675336465..f5a1fd9b3ecc 100644
@@ -256,9 +256,6 @@ static void mtk_drm_kms_deinit(struct drm_device *drm)
 	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 
-	.enable_vblank = mtk_drm_crtc_enable_vblank,
-	.disable_vblank = mtk_drm_crtc_disable_vblank,
-
 	.gem_free_object_unlocked = mtk_drm_gem_free_object,
 	.gem_vm_ops = &drm_gem_cma_vm_ops,
 	.dumb_create = mtk_drm_gem_dumb_create,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#42 lore raw

Re: [PATCH v3 13/23] drm: mediatek: use vblank hooks in struct drm_crtc_funcs

Quoted 7 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Applied to -misc

Thanks,

Sean

Quoted 76 lines
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 8 ++++----
 drivers/gpu/drm/mediatek/mtk_drm_crtc.h | 2 --
 drivers/gpu/drm/mediatek/mtk_drm_drv.c  | 3 ---
 3 files changed, 4 insertions(+), 9 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +4 -4
index a73de1e669c2..69982f5a6198 100644
@@ -168,9 +168,8 @@ static void mtk_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	state->pending_config = true;
 }
 
-int mtk_drm_crtc_enable_vblank(struct drm_device *drm, unsigned int pipe)
+static int mtk_drm_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
 	struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
 	struct mtk_ddp_comp *ovl = mtk_crtc->ddp_comp[0];
 
@@ -179,9 +178,8 @@ int mtk_drm_crtc_enable_vblank(struct drm_device *drm, unsigned int pipe)
 	return 0;
 }
 
-void mtk_drm_crtc_disable_vblank(struct drm_device *drm, unsigned int pipe)
+static void mtk_drm_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
 	struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
 	struct mtk_ddp_comp *ovl = mtk_crtc->ddp_comp[0];
 
@@ -436,6 +434,8 @@ static void mtk_drm_crtc_atomic_flush(struct drm_crtc *crtc,
 	.atomic_duplicate_state	= mtk_drm_crtc_duplicate_state,
 	.atomic_destroy_state	= mtk_drm_crtc_destroy_state,
 	.gamma_set		= drm_atomic_helper_legacy_gamma_set,
+	.enable_vblank		= mtk_drm_crtc_enable_vblank,
+	.disable_vblank		= mtk_drm_crtc_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs mtk_crtc_helper_funcs = {
drivers/gpu/drm/mediatek/mtk_drm_crtc.h +0 -2
index a1550fa3c9d2..9d9410c67ae9 100644
@@ -23,8 +23,6 @@
 #define MTK_MAX_BPC	10
 #define MTK_MIN_BPC	3
 
-int mtk_drm_crtc_enable_vblank(struct drm_device *drm, unsigned int pipe);
-void mtk_drm_crtc_disable_vblank(struct drm_device *drm, unsigned int pipe);
 void mtk_drm_crtc_commit(struct drm_crtc *crtc);
 void mtk_crtc_ddp_irq(struct drm_crtc *crtc, struct mtk_ddp_comp *ovl);
 int mtk_drm_crtc_create(struct drm_device *drm_dev,
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0 -3
index ef8675336465..f5a1fd9b3ecc 100644
@@ -256,9 +256,6 @@ static void mtk_drm_kms_deinit(struct drm_device *drm)
 	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 
-	.enable_vblank = mtk_drm_crtc_enable_vblank,
-	.disable_vblank = mtk_drm_crtc_disable_vblank,
-
 	.gem_free_object_unlocked = mtk_drm_gem_free_object,
 	.gem_vm_ops = &drm_gem_cma_vm_ops,
 	.dumb_create = mtk_drm_gem_dumb_create,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#43 lore raw

PATCH v3 14/23 drm: meson: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Neil Armstrong <[email protected]>
---
 drivers/gpu/drm/meson/meson_crtc.c | 22 ++++++++++++++++++++++
 drivers/gpu/drm/meson/meson_drv.c  | 20 --------------------
 2 files changed, 22 insertions(+), 20 deletions(-)
drivers/gpu/drm/meson/meson_crtc.c +22 -0
index 749770e5c65f..0fe49eccda65 100644
@@ -33,6 +33,7 @@
 
 #include "meson_crtc.h"
 #include "meson_plane.h"
+#include "meson_venc.h"
 #include "meson_vpp.h"
 #include "meson_viu.h"
 #include "meson_registers.h"
@@ -48,6 +49,24 @@ struct meson_crtc {
 
 /* CRTC */
 
+static int meson_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
+	struct meson_drm *priv = meson_crtc->priv;
+
+	meson_venc_enable_vsync(priv);
+
+	return 0;
+}
+
+static void meson_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
+	struct meson_drm *priv = meson_crtc->priv;
+
+	meson_venc_disable_vsync(priv);
+}
+
 static const struct drm_crtc_funcs meson_crtc_funcs = {
 	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
@@ -55,6 +74,9 @@ struct meson_crtc {
 	.page_flip		= drm_atomic_helper_page_flip,
 	.reset			= drm_atomic_helper_crtc_reset,
 	.set_config             = drm_atomic_helper_set_config,
+	.enable_vblank		= meson_crtc_enable_vblank,
+	.disable_vblank		= meson_crtc_disable_vblank,
+
 };
 
 static void meson_crtc_enable(struct drm_crtc *crtc)
drivers/gpu/drm/meson/meson_drv.c +0 -20
index c0a59889c45f..8d17d0e59cbe 100644
@@ -79,22 +79,6 @@ static void meson_fb_output_poll_changed(struct drm_device *dev)
 	.fb_create           = drm_fb_cma_create,
 };
 
-static int meson_enable_vblank(struct drm_device *dev, unsigned int crtc)
-{
-	struct meson_drm *priv = dev->dev_private;
-
-	meson_venc_enable_vsync(priv);
-
-	return 0;
-}
-
-static void meson_disable_vblank(struct drm_device *dev, unsigned int crtc)
-{
-	struct meson_drm *priv = dev->dev_private;
-
-	meson_venc_disable_vsync(priv);
-}
-
 static irqreturn_t meson_irq(int irq, void *arg)
 {
 	struct drm_device *dev = arg;
@@ -126,10 +110,6 @@ static irqreturn_t meson_irq(int irq, void *arg)
 				  DRIVER_MODESET | DRIVER_PRIME |
 				  DRIVER_ATOMIC,
 
-	/* Vblank */
-	.enable_vblank		= meson_enable_vblank,
-	.disable_vblank		= meson_disable_vblank,
-
 	/* IRQ */
 	.irq_handler		= meson_irq,
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v3 14/23
#44 lore raw

Re: [PATCH v3 14/23] drm: meson: use vblank hooks in struct drm_crtc_funcs

Quoted 89 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Neil Armstrong <[email protected]>
---
 drivers/gpu/drm/meson/meson_crtc.c | 22 ++++++++++++++++++++++
 drivers/gpu/drm/meson/meson_drv.c  | 20 --------------------
 2 files changed, 22 insertions(+), 20 deletions(-)
drivers/gpu/drm/meson/meson_crtc.c +22 -0
index 749770e5c65f..0fe49eccda65 100644
@@ -33,6 +33,7 @@
 
 #include "meson_crtc.h"
 #include "meson_plane.h"
+#include "meson_venc.h"
 #include "meson_vpp.h"
 #include "meson_viu.h"
 #include "meson_registers.h"
@@ -48,6 +49,24 @@ struct meson_crtc {
 
 /* CRTC */
 
+static int meson_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
+	struct meson_drm *priv = meson_crtc->priv;
+
+	meson_venc_enable_vsync(priv);
+
+	return 0;
+}
+
+static void meson_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
+	struct meson_drm *priv = meson_crtc->priv;
+
+	meson_venc_disable_vsync(priv);
+}
+
 static const struct drm_crtc_funcs meson_crtc_funcs = {
 	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
@@ -55,6 +74,9 @@ struct meson_crtc {
 	.page_flip		= drm_atomic_helper_page_flip,
 	.reset			= drm_atomic_helper_crtc_reset,
 	.set_config             = drm_atomic_helper_set_config,
+	.enable_vblank		= meson_crtc_enable_vblank,
+	.disable_vblank		= meson_crtc_disable_vblank,
+
 };
 
 static void meson_crtc_enable(struct drm_crtc *crtc)
drivers/gpu/drm/meson/meson_drv.c +0 -16
index c0a59889c45f..8d17d0e59cbe 100644
@@ -79,22 +79,6 @@ static void meson_fb_output_poll_changed(struct drm_device *dev)
 	.fb_create           = drm_fb_cma_create,
 };
 
-static int meson_enable_vblank(struct drm_device *dev, unsigned int crtc)
-{
-	struct meson_drm *priv = dev->dev_private;
-
-	meson_venc_enable_vsync(priv);
-
-	return 0;
-}
-
-static void meson_disable_vblank(struct drm_device *dev, unsigned int crtc)
-{
-	struct meson_drm *priv = dev->dev_private;
-
-	meson_venc_disable_vsync(priv);
-}
-
 static irqreturn_t meson_irq(int irq, void *arg)
 {
 	struct drm_device *dev = arg;

drivers/gpu/drm/meson/meson_drv.c static irqreturn_t meson_irq(int irq, void *arg) · line 115

Quoted 10 lines
drivers/gpu/drm/meson/meson_drv.c +0 -4
@@ -126,10 +110,6 @@ static irqreturn_t meson_irq(int irq, void *arg)
 				  DRIVER_MODESET | DRIVER_PRIME |
 				  DRIVER_ATOMIC,
 
-	/* Vblank */
-	.enable_vblank		= meson_enable_vblank,
-	.disable_vblank		= meson_disable_vblank,
-
 	/* IRQ */
 	.irq_handler		= meson_irq,
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#45 lore raw

PATCH v3 15/23 drm: qxl: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

---
 drivers/gpu/drm/qxl/qxl_display.c | 16 ++++++++++++++++
 drivers/gpu/drm/qxl/qxl_drv.c     | 18 ------------------
 2 files changed, 16 insertions(+), 18 deletions(-)
drivers/gpu/drm/qxl/qxl_display.c +16 -0
index 1094cd33eb06..2ce805a7ce5e 100644
@@ -548,6 +548,19 @@ static int qxl_crtc_cursor_move(struct drm_crtc *crtc,
 	return 0;
 }
 
+static u32 qxl_noop_get_vblank_counter(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static int qxl_noop_enable_vblank(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static void qxl_noop_disable_vblank(struct drm_crtc *crtc)
+{
+}
 
 static const struct drm_crtc_funcs qxl_crtc_funcs = {
 	.cursor_set2 = qxl_crtc_cursor_set2,
@@ -555,6 +568,9 @@ static int qxl_crtc_cursor_move(struct drm_crtc *crtc,
 	.set_config = drm_crtc_helper_set_config,
 	.destroy = qxl_crtc_destroy,
 	.page_flip = qxl_crtc_page_flip,
+	.get_vblank_counter = qxl_noop_get_vblank_counter,
+	.enable_vblank = qxl_noop_enable_vblank,
+	.disable_vblank = qxl_noop_disable_vblank,
 };
 
 void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
drivers/gpu/drm/qxl/qxl_drv.c +0 -18
index 8e17c241e63c..48d51a2f3bd8 100644
@@ -247,21 +247,6 @@ static int qxl_pm_restore(struct device *dev)
 	return qxl_drm_resume(drm_dev, false);
 }
 
-static u32 qxl_noop_get_vblank_counter(struct drm_device *dev,
-				       unsigned int pipe)
-{
-	return 0;
-}
-
-static int qxl_noop_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	return 0;
-}
-
-static void qxl_noop_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-}
-
 static const struct dev_pm_ops qxl_pm_ops = {
 	.suspend = qxl_pm_suspend,
 	.resume = qxl_pm_resume,
@@ -281,9 +266,6 @@ static void qxl_noop_disable_vblank(struct drm_device *dev, unsigned int pipe)
 static struct drm_driver qxl_driver = {
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
-	.get_vblank_counter = qxl_noop_get_vblank_counter,
-	.enable_vblank = qxl_noop_enable_vblank,
-	.disable_vblank = qxl_noop_disable_vblank,
 
 	.set_busid = drm_pci_set_busid,
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#46 lore raw

Re: [PATCH v3 15/23] drm: qxl: use vblank hooks in struct drm_crtc_funcs

Quoted 7 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Applied to -misc

Thanks,

Sean

Quoted 83 lines
Cc Dave Airlie <[email protected]>
---
 drivers/gpu/drm/qxl/qxl_display.c | 16 ++++++++++++++++
 drivers/gpu/drm/qxl/qxl_drv.c     | 18 ------------------
 2 files changed, 16 insertions(+), 18 deletions(-)
drivers/gpu/drm/qxl/qxl_display.c +16 -0
index 1094cd33eb06..2ce805a7ce5e 100644
@@ -548,6 +548,19 @@ static int qxl_crtc_cursor_move(struct drm_crtc *crtc,
 	return 0;
 }
 
+static u32 qxl_noop_get_vblank_counter(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static int qxl_noop_enable_vblank(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static void qxl_noop_disable_vblank(struct drm_crtc *crtc)
+{
+}
 
 static const struct drm_crtc_funcs qxl_crtc_funcs = {
 	.cursor_set2 = qxl_crtc_cursor_set2,
@@ -555,6 +568,9 @@ static int qxl_crtc_cursor_move(struct drm_crtc *crtc,
 	.set_config = drm_crtc_helper_set_config,
 	.destroy = qxl_crtc_destroy,
 	.page_flip = qxl_crtc_page_flip,
+	.get_vblank_counter = qxl_noop_get_vblank_counter,
+	.enable_vblank = qxl_noop_enable_vblank,
+	.disable_vblank = qxl_noop_disable_vblank,
 };
 
 void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
drivers/gpu/drm/qxl/qxl_drv.c +0 -18
index 8e17c241e63c..48d51a2f3bd8 100644
@@ -247,21 +247,6 @@ static int qxl_pm_restore(struct device *dev)
 	return qxl_drm_resume(drm_dev, false);
 }
 
-static u32 qxl_noop_get_vblank_counter(struct drm_device *dev,
-				       unsigned int pipe)
-{
-	return 0;
-}
-
-static int qxl_noop_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	return 0;
-}
-
-static void qxl_noop_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-}
-
 static const struct dev_pm_ops qxl_pm_ops = {
 	.suspend = qxl_pm_suspend,
 	.resume = qxl_pm_resume,
@@ -281,9 +266,6 @@ static void qxl_noop_disable_vblank(struct drm_device *dev, unsigned int pipe)
 static struct drm_driver qxl_driver = {
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
-	.get_vblank_counter = qxl_noop_get_vblank_counter,
-	.enable_vblank = qxl_noop_enable_vblank,
-	.disable_vblank = qxl_noop_disable_vblank,
 
 	.set_busid = drm_pci_set_busid,
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#47 lore raw

PATCH v3 16/23 drm: rcar-du: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Laurent Pinchart <[email protected]>
---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 29 +++++++++++++++++++----------
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h |  1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c  | 19 -------------------
 3 files changed, 19 insertions(+), 30 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +19 -10
index a2ec6d8796a0..edcbe2e3625d 100644
@@ -529,6 +529,23 @@ static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc,
 	.atomic_flush = rcar_du_crtc_atomic_flush,
 };
 
+static int rcar_du_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+
+	rcar_du_crtc_write(rcrtc, DSRCR, DSRCR_VBCL);
+	rcar_du_crtc_set(rcrtc, DIER, DIER_VBE);
+
+	return 0;
+}
+
+static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+
+	rcar_du_crtc_clr(rcrtc, DIER, DIER_VBE);
+}
+
 static const struct drm_crtc_funcs crtc_funcs = {
 	.reset = drm_atomic_helper_crtc_reset,
 	.destroy = drm_crtc_cleanup,
@@ -536,6 +553,8 @@ static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc,
 	.page_flip = drm_atomic_helper_page_flip,
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
 	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank = rcar_du_crtc_enable_vblank,
+	.disable_vblank = rcar_du_crtc_disable_vblank,
 };
 
 /* -----------------------------------------------------------------------------
@@ -650,13 +669,3 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
 
 	return 0;
 }
-
-void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable)
-{
-	if (enable) {
-		rcar_du_crtc_write(rcrtc, DSRCR, DSRCR_VBCL);
-		rcar_du_crtc_set(rcrtc, DIER, DIER_VBE);
-	} else {
-		rcar_du_crtc_clr(rcrtc, DIER, DIER_VBE);
-	}
-}
drivers/gpu/drm/rcar-du/rcar_du_crtc.h +0 -1
index 6f08b7e7db06..a7194812997e 100644
@@ -66,7 +66,6 @@ enum rcar_du_output {
 };
 
 int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index);
-void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable);
 void rcar_du_crtc_suspend(struct rcar_du_crtc *rcrtc);
 void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc);
 
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -19
index 094da3ef49d1..192346d4fb34 100644
@@ -26,7 +26,6 @@
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 
-#include "rcar_du_crtc.h"
 #include "rcar_du_drv.h"
 #include "rcar_du_kms.h"
 #include "rcar_du_regs.h"
@@ -227,22 +226,6 @@ static void rcar_du_lastclose(struct drm_device *dev)
 	drm_fbdev_cma_restore_mode(rcdu->fbdev);
 }
 
-static int rcar_du_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct rcar_du_device *rcdu = dev->dev_private;
-
-	rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], true);
-
-	return 0;
-}
-
-static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct rcar_du_device *rcdu = dev->dev_private;
-
-	rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], false);
-}
-
 static const struct file_operations rcar_du_fops = {
 	.owner		= THIS_MODULE,
 	.open		= drm_open,
@@ -259,8 +242,6 @@ static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME
 				| DRIVER_ATOMIC,
 	.lastclose		= rcar_du_lastclose,
-	.enable_vblank		= rcar_du_enable_vblank,
-	.disable_vblank		= rcar_du_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,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 16/23
#48 lore raw

Re: [PATCH v3 16/23] drm: rcar-du: use vblank hooks in struct drm_crtc_funcs

Hi Shawn,

Thank you for the patch.

Quoted 8 lines · On Tuesday 07 Feb 2017 17:16:28 Shawn Guo wrote:

From: Shawn Guo <[email protected]>

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.

Cc Laurent Pinchart <[email protected]>
Quoted 110 lines
---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 29 +++++++++++++++++++----------
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h |  1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c  | 19 -------------------
 3 files changed, 19 insertions(+), 30 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index a2ec6d8796a0..edcbe2e3625d 100644

drivers/gpu/drm/rcar-du/rcar_du_crtc.c +19 -2
@@ -529,6 +529,23 @@ static void rcar_du_crtc_atomic_flush(struct drm_crtc
 *crtc, .atomic_flush = rcar_du_crtc_atomic_flush,
 };
 
+static int rcar_du_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+
+	rcar_du_crtc_write(rcrtc, DSRCR, DSRCR_VBCL);
+	rcar_du_crtc_set(rcrtc, DIER, DIER_VBE);
+
+	return 0;
+}
+
+static void rcar_du_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+
+	rcar_du_crtc_clr(rcrtc, DIER, DIER_VBE);
+}
+
 static const struct drm_crtc_funcs crtc_funcs = {
 	.reset = drm_atomic_helper_crtc_reset,
 	.destroy = drm_crtc_cleanup,
@@ -536,6 +553,8 @@ static void rcar_du_crtc_atomic_flush(struct drm_crtc
 *crtc, .page_flip = drm_atomic_helper_page_flip,
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
 	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank = rcar_du_crtc_enable_vblank,
+	.disable_vblank = rcar_du_crtc_disable_vblank,
 };
 
 /*
---------------------------------------------------------------------------
-- @@ -650,13 +669,3 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp,

unsigned int index)

drivers/gpu/drm/rcar-du/rcar_du_crtc.c +0 -10
 	return 0;
 }
-
-void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable)
-{
-	if (enable) {
-		rcar_du_crtc_write(rcrtc, DSRCR, DSRCR_VBCL);
-		rcar_du_crtc_set(rcrtc, DIER, DIER_VBE);
-	} else {
-		rcar_du_crtc_clr(rcrtc, DIER, DIER_VBE);
-	}
-}
(quoted diff) +0 -0

b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h index 6f08b7e7db06..a7194812997e 100644

drivers/gpu/drm/rcar-du/rcar_du_crtc.h +0 -1
@@ -66,7 +66,6 @@ enum rcar_du_output {
 };
 
 int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index);
-void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable);
 void rcar_du_crtc_suspend(struct rcar_du_crtc *rcrtc);
 void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc);
 
(quoted diff) +0 -0

b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 094da3ef49d1..192346d4fb34 100644

drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -16
@@ -26,7 +26,6 @@
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 
-#include "rcar_du_crtc.h"
 #include "rcar_du_drv.h"
 #include "rcar_du_kms.h"
 #include "rcar_du_regs.h"
@@ -227,22 +226,6 @@ static void rcar_du_lastclose(struct drm_device *dev)
 	drm_fbdev_cma_restore_mode(rcdu->fbdev);
 }
 
-static int rcar_du_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct rcar_du_device *rcdu = dev->dev_private;
-
-	rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], true);
-
-	return 0;
-}
-
-static void rcar_du_disable_vblank(struct drm_device *dev, unsigned int
 pipe) -{
-	struct rcar_du_device *rcdu = dev->dev_private;
-
-	rcar_du_crtc_enable_vblank(&rcdu->crtcs[pipe], false);
-}
-
 static const struct file_operations rcar_du_fops = {
 	.owner		= THIS_MODULE,
 	.open		= drm_open,

drivers/gpu/drm/rcar-du/rcar_du_drv.c static void rcar_du_disable_vblank(struct drm_device · line 242

Quoted 1 line
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -0
@@ -259,8 +242,6 @@ static void rcar_du_disable_vblank(struct drm_device
 *dev, unsigned int pipe) .driver_features	= DRIVER_GEM | DRIVER_MODESET 

|

Quoted 10 lines

DRIVER_PRIME

drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -2
 				| DRIVER_ATOMIC,
 
 	.lastclose		= rcar_du_lastclose,
-	.enable_vblank		= rcar_du_enable_vblank,
-	.disable_vblank		= rcar_du_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,
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#49 lore raw

PATCH v3 17/23 drm: rockchip: remove struct rockchip_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

---
 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(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -51
index 39243480c834..7719b9cd5b74 100644
@@ -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,
drivers/gpu/drm/rockchip/rockchip_drm_drv.h +0 -14
index fb6226cf84b7..9f9bc959b108 100644
@@ -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,
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -7
index fb5f001f51c3..ffee8d8c3794 100644
@@ -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);
 
 	/*
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 17/23
#50 lore raw

Re: [PATCH v3 17/23] drm: rockchip: remove struct rockchip_crtc_funcs

Quoted 6 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Quoted 163 lines
---
 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(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -51
index 39243480c834..7719b9cd5b74 100644
@@ -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,
drivers/gpu/drm/rockchip/rockchip_drm_drv.h +0 -14
index fb6226cf84b7..9f9bc959b108 100644
@@ -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,
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -7
index fb5f001f51c3..ffee8d8c3794 100644
@@ -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);
 
 	/*
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#51 lore raw

PATCH v3 18/23 drm: shmobile: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

As the result, shmob_drm_crtc_enable_vblank() becomes a static function, although it gets moved around a bit to save forward declaration.

Cc Laurent Pinchart <[email protected]>
---
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 51 +++++++++++++++++++++----------
 drivers/gpu/drm/shmobile/shmob_drm_crtc.h |  1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c  | 19 ------------
 3 files changed, 35 insertions(+), 36 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_crtc.c +35 -16
index 445476551695..8244890e6d53 100644
@@ -476,10 +476,45 @@ static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc,
 	return 0;
 }
 
+static void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev,
+					 bool enable)
+{
+	unsigned long flags;
+	u32 ldintr;
+
+	/* Be careful not to acknowledge any pending interrupt. */
+	spin_lock_irqsave(&sdev->irq_lock, flags);
+	ldintr = lcdc_read(sdev, LDINTR) | LDINTR_STATUS_MASK;
+	if (enable)
+		ldintr |= LDINTR_VEE;
+	else
+		ldintr &= ~LDINTR_VEE;
+	lcdc_write(sdev, LDINTR, ldintr);
+	spin_unlock_irqrestore(&sdev->irq_lock, flags);
+}
+
+static int shmob_drm_enable_vblank(struct drm_crtc *crtc)
+{
+	struct shmob_drm_device *sdev = crtc->dev->dev_private;
+
+	shmob_drm_crtc_enable_vblank(sdev, true);
+
+	return 0;
+}
+
+static void shmob_drm_disable_vblank(struct drm_crtc *crtc)
+{
+	struct shmob_drm_device *sdev = crtc->dev->dev_private;
+
+	shmob_drm_crtc_enable_vblank(sdev, false);
+}
+
 static const struct drm_crtc_funcs crtc_funcs = {
 	.destroy = drm_crtc_cleanup,
 	.set_config = drm_crtc_helper_set_config,
 	.page_flip = shmob_drm_crtc_page_flip,
+	.enable_vblank = shmob_drm_enable_vblank,
+	.disable_vblank = shmob_drm_disable_vblank,
 };
 
 int shmob_drm_crtc_create(struct shmob_drm_device *sdev)
@@ -594,22 +629,6 @@ int shmob_drm_encoder_create(struct shmob_drm_device *sdev)
 	return 0;
 }
 
-void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev, bool enable)
-{
-	unsigned long flags;
-	u32 ldintr;
-
-	/* Be careful not to acknowledge any pending interrupt. */
-	spin_lock_irqsave(&sdev->irq_lock, flags);
-	ldintr = lcdc_read(sdev, LDINTR) | LDINTR_STATUS_MASK;
-	if (enable)
-		ldintr |= LDINTR_VEE;
-	else
-		ldintr &= ~LDINTR_VEE;
-	lcdc_write(sdev, LDINTR, ldintr);
-	spin_unlock_irqrestore(&sdev->irq_lock, flags);
-}
-
 /* -----------------------------------------------------------------------------
  * Connector
  */
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -1
index 818b31549ddc..f152973df11c 100644
@@ -47,7 +47,6 @@ struct shmob_drm_connector {
 };
 
 int shmob_drm_crtc_create(struct shmob_drm_device *sdev);
-void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev, bool enable);
 void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc);
 void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc);
 void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc);
drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -19
index d6b0545d252d..34fefa0ba0f0 100644
@@ -23,7 +23,6 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 
-#include "shmob_drm_crtc.h"
 #include "shmob_drm_drv.h"
 #include "shmob_drm_kms.h"
 #include "shmob_drm_plane.h"
@@ -222,22 +221,6 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-static int shmob_drm_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct shmob_drm_device *sdev = dev->dev_private;
-
-	shmob_drm_crtc_enable_vblank(sdev, true);
-
-	return 0;
-}
-
-static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	struct shmob_drm_device *sdev = dev->dev_private;
-
-	shmob_drm_crtc_enable_vblank(sdev, false);
-}
-
 static const struct file_operations shmob_drm_fops = {
 	.owner		= THIS_MODULE,
 	.open		= drm_open,
@@ -256,8 +239,6 @@ static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int pipe)
 	.load			= shmob_drm_load,
 	.unload			= shmob_drm_unload,
 	.irq_handler		= shmob_drm_irq,
-	.enable_vblank		= shmob_drm_enable_vblank,
-	.disable_vblank		= shmob_drm_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,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 18/23
#52 lore raw

Re: [PATCH v3 18/23] drm: shmobile: use vblank hooks in struct drm_crtc_funcs

Hi Shawn,

Thank you for the patch.

Quoted 11 lines · On Tuesday 07 Feb 2017 17:16:30 Shawn Guo wrote:

From: Shawn Guo <[email protected]>

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.

As the result, shmob_drm_crtc_enable_vblank() becomes a static function, although it gets moved around a bit to save forward declaration.

Cc Laurent Pinchart <[email protected]>
Quoted 140 lines
---
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 51 +++++++++++++++++++---------
 drivers/gpu/drm/shmobile/shmob_drm_crtc.h |  1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c  | 19 ------------
 3 files changed, 35 insertions(+), 36 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c index
445476551695..8244890e6d53 100644

drivers/gpu/drm/shmobile/shmob_drm_crtc.c +35 -16
@@ -476,10 +476,45 @@ static int shmob_drm_crtc_page_flip(struct drm_crtc
 *crtc, return 0;
 }
 
+static void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev,
+					 bool enable)
+{
+	unsigned long flags;
+	u32 ldintr;
+
+	/* Be careful not to acknowledge any pending interrupt. */
+	spin_lock_irqsave(&sdev->irq_lock, flags);
+	ldintr = lcdc_read(sdev, LDINTR) | LDINTR_STATUS_MASK;
+	if (enable)
+		ldintr |= LDINTR_VEE;
+	else
+		ldintr &= ~LDINTR_VEE;
+	lcdc_write(sdev, LDINTR, ldintr);
+	spin_unlock_irqrestore(&sdev->irq_lock, flags);
+}
+
+static int shmob_drm_enable_vblank(struct drm_crtc *crtc)
+{
+	struct shmob_drm_device *sdev = crtc->dev->dev_private;
+
+	shmob_drm_crtc_enable_vblank(sdev, true);
+
+	return 0;
+}
+
+static void shmob_drm_disable_vblank(struct drm_crtc *crtc)
+{
+	struct shmob_drm_device *sdev = crtc->dev->dev_private;
+
+	shmob_drm_crtc_enable_vblank(sdev, false);
+}
+
 static const struct drm_crtc_funcs crtc_funcs = {
 	.destroy = drm_crtc_cleanup,
 	.set_config = drm_crtc_helper_set_config,
 	.page_flip = shmob_drm_crtc_page_flip,
+	.enable_vblank = shmob_drm_enable_vblank,
+	.disable_vblank = shmob_drm_disable_vblank,
 };
 
 int shmob_drm_crtc_create(struct shmob_drm_device *sdev)
@@ -594,22 +629,6 @@ int shmob_drm_encoder_create(struct shmob_drm_device
 *sdev) return 0;
 }
 
-void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev, bool
 enable)
-{
-	unsigned long flags;
-	u32 ldintr;
-
-	/* Be careful not to acknowledge any pending interrupt. */
-	spin_lock_irqsave(&sdev->irq_lock, flags);
-	ldintr = lcdc_read(sdev, LDINTR) | LDINTR_STATUS_MASK;
-	if (enable)
-		ldintr |= LDINTR_VEE;
-	else
-		ldintr &= ~LDINTR_VEE;
-	lcdc_write(sdev, LDINTR, ldintr);
-	spin_unlock_irqrestore(&sdev->irq_lock, flags);
-}
-
 /* ------------------------------------------------------------------------
  * Connector

*/

(quoted diff) +0 -0

b/drivers/gpu/drm/shmobile/shmob_drm_crtc.h index
818b31549ddc..f152973df11c 100644

drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -1
@@ -47,7 +47,6 @@ struct shmob_drm_connector {
 };
 
 int shmob_drm_crtc_create(struct shmob_drm_device *sdev);
-void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev, bool
 enable);
 void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc);
 void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc);

void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc);

(quoted diff) +0 -0

b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index d6b0545d252d..34fefa0ba0f0 100644

drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -17
@@ -23,7 +23,6 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 
-#include "shmob_drm_crtc.h"
 #include "shmob_drm_drv.h"
 #include "shmob_drm_kms.h"
 #include "shmob_drm_plane.h"
@@ -222,22 +221,6 @@ static irqreturn_t shmob_drm_irq(int irq, void *arg)
 	return IRQ_HANDLED;
 }
 
-static int shmob_drm_enable_vblank(struct drm_device *dev, unsigned int
 pipe) -{
-	struct shmob_drm_device *sdev = dev->dev_private;
-
-	shmob_drm_crtc_enable_vblank(sdev, true);
-
-	return 0;
-}
-
-static void shmob_drm_disable_vblank(struct drm_device *dev, unsigned int
 pipe) -{
-	struct shmob_drm_device *sdev = dev->dev_private;
-
-	shmob_drm_crtc_enable_vblank(sdev, false);
-}
-
 static const struct file_operations shmob_drm_fops = {
 	.owner		= THIS_MODULE,
 	.open		= drm_open,
@@ -256,8 +239,6 @@ static void shmob_drm_disable_vblank(struct drm_device
 *dev, unsigned int pipe) .load			= shmob_drm_load,
 	.unload			= shmob_drm_unload,
 	.irq_handler		= shmob_drm_irq,
-	.enable_vblank		= shmob_drm_enable_vblank,
-	.disable_vblank		= shmob_drm_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,
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#53 lore raw

PATCH v3 19/23 drm: sun4i: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Maxime Ripard <[email protected]>
---
 drivers/gpu/drm/sun4i/sun4i_crtc.c | 24 ++++++++++++++++++++++++
 drivers/gpu/drm/sun4i/sun4i_drv.c  | 27 ---------------------------
 2 files changed, 24 insertions(+), 27 deletions(-)
drivers/gpu/drm/sun4i/sun4i_crtc.c +24 -0
index 4a192210574f..a5d546a68e16 100644
@@ -104,6 +104,28 @@ static void sun4i_crtc_enable(struct drm_crtc *crtc)
 	.enable		= sun4i_crtc_enable,
 };
 
+static int sun4i_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc);
+	struct sun4i_drv *drv = scrtc->drv;
+
+	DRM_DEBUG_DRIVER("Enabling VBLANK on crtc %p\n", crtc);
+
+	sun4i_tcon_enable_vblank(drv->tcon, true);
+
+	return 0;
+}
+
+static void sun4i_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+	struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc);
+	struct sun4i_drv *drv = scrtc->drv;
+
+	DRM_DEBUG_DRIVER("Disabling VBLANK on crtc %p\n", crtc);
+
+	sun4i_tcon_enable_vblank(drv->tcon, false);
+}
+
 static const struct drm_crtc_funcs sun4i_crtc_funcs = {
 	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
 	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
@@ -111,6 +133,8 @@ static void sun4i_crtc_enable(struct drm_crtc *crtc)
 	.page_flip		= drm_atomic_helper_page_flip,
 	.reset			= drm_atomic_helper_crtc_reset,
 	.set_config		= drm_atomic_helper_set_config,
+	.enable_vblank		= sun4i_crtc_enable_vblank,
+	.disable_vblank		= sun4i_crtc_disable_vblank,
 };
 
 struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm)
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -27
index 0816c635df20..9ccf7c4deb6d 100644
@@ -24,29 +24,6 @@
 #include "sun4i_drv.h"
 #include "sun4i_framebuffer.h"
 #include "sun4i_layer.h"
-#include "sun4i_tcon.h"
-
-static int sun4i_drv_enable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct sun4i_drv *drv = drm->dev_private;
-	struct sun4i_tcon *tcon = drv->tcon;
-
-	DRM_DEBUG_DRIVER("Enabling VBLANK on pipe %d\n", pipe);
-
-	sun4i_tcon_enable_vblank(tcon, true);
-
-	return 0;
-}
-
-static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct sun4i_drv *drv = drm->dev_private;
-	struct sun4i_tcon *tcon = drv->tcon;
-
-	DRM_DEBUG_DRIVER("Disabling VBLANK on pipe %d\n", pipe);
-
-	sun4i_tcon_enable_vblank(tcon, false);
-}
 
 static const struct file_operations sun4i_drv_fops = {
 	.owner		= THIS_MODULE,
@@ -90,10 +67,6 @@ static void sun4i_drv_disable_vblank(struct drm_device *drm, unsigned int pipe)
 	.gem_prime_mmap		= drm_gem_cma_prime_mmap,
 
 	/* Frame Buffer Operations */
-
-	/* VBlank Operations */
-	.enable_vblank		= sun4i_drv_enable_vblank,
-	.disable_vblank		= sun4i_drv_disable_vblank,
 };
 
 static void sun4i_remove_framebuffers(void)
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v3 19/23
#54 lore raw

Re: [PATCH v3 19/23] drm: sun4i: use vblank hooks in struct drm_crtc_funcs

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Cc Maxime Ripard <[email protected]>

Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#55 lore raw

PATCH v3 20/23 drm: tegra: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

As the result, the wrapper functions tegra_drm_xxx get killed completely, and tegra_dc_xxx are filled into struct drm_crtc_funcs as vblank hooks directly.

Cc Thierry Reding <[email protected]>
---
 drivers/gpu/drm/tegra/dc.c  | 15 ++++++++++++---
 drivers/gpu/drm/tegra/drm.c | 38 --------------------------------------
 drivers/gpu/drm/tegra/drm.h |  3 ---
 3 files changed, 12 insertions(+), 44 deletions(-)
drivers/gpu/drm/tegra/dc.c +12 -3
index 7561a95a54e3..0db5d5a8d3b9 100644
@@ -909,8 +909,10 @@ static int tegra_dc_add_planes(struct drm_device *drm, struct tegra_dc *dc)
 	return 0;
 }
 
-u32 tegra_dc_get_vblank_counter(struct tegra_dc *dc)
+static u32 tegra_dc_get_vblank_counter(struct drm_crtc *crtc)
 {
+	struct tegra_dc *dc = to_tegra_dc(crtc);
+
 	if (dc->syncpt)
 		return host1x_syncpt_read(dc->syncpt);
 
@@ -918,8 +920,9 @@ u32 tegra_dc_get_vblank_counter(struct tegra_dc *dc)
 	return drm_crtc_vblank_count(&dc->base);
 }
 
-void tegra_dc_enable_vblank(struct tegra_dc *dc)
+static int tegra_dc_enable_vblank(struct drm_crtc *crtc)
 {
+	struct tegra_dc *dc = to_tegra_dc(crtc);
 	unsigned long value, flags;
 
 	spin_lock_irqsave(&dc->lock, flags);
@@ -929,10 +932,13 @@ void tegra_dc_enable_vblank(struct tegra_dc *dc)
 	tegra_dc_writel(dc, value, DC_CMD_INT_MASK);
 
 	spin_unlock_irqrestore(&dc->lock, flags);
+
+	return 0;
 }
 
-void tegra_dc_disable_vblank(struct tegra_dc *dc)
+static void tegra_dc_disable_vblank(struct drm_crtc *crtc)
 {
+	struct tegra_dc *dc = to_tegra_dc(crtc);
 	unsigned long value, flags;
 
 	spin_lock_irqsave(&dc->lock, flags);
@@ -1036,6 +1042,9 @@ static void tegra_crtc_atomic_destroy_state(struct drm_crtc *crtc,
 	.reset = tegra_crtc_reset,
 	.atomic_duplicate_state = tegra_crtc_atomic_duplicate_state,
 	.atomic_destroy_state = tegra_crtc_atomic_destroy_state,
+	.get_vblank_counter = tegra_dc_get_vblank_counter,
+	.enable_vblank = tegra_dc_enable_vblank,
+	.disable_vblank = tegra_dc_disable_vblank,
 };
 
 static int tegra_dc_set_timings(struct tegra_dc *dc,
drivers/gpu/drm/tegra/drm.c +0 -38
index ef215fef63d6..dba4e090d3df 100644
@@ -804,40 +804,6 @@ static int tegra_gem_get_flags(struct drm_device *drm, void *data,
 	.llseek = noop_llseek,
 };
 
-static u32 tegra_drm_get_vblank_counter(struct drm_device *drm,
-					unsigned int pipe)
-{
-	struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
-	struct tegra_dc *dc = to_tegra_dc(crtc);
-
-	if (!crtc)
-		return 0;
-
-	return tegra_dc_get_vblank_counter(dc);
-}
-
-static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
-	struct tegra_dc *dc = to_tegra_dc(crtc);
-
-	if (!crtc)
-		return -ENODEV;
-
-	tegra_dc_enable_vblank(dc);
-
-	return 0;
-}
-
-static void tegra_drm_disable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe);
-	struct tegra_dc *dc = to_tegra_dc(crtc);
-
-	if (crtc)
-		tegra_dc_disable_vblank(dc);
-}
-
 static void tegra_drm_preclose(struct drm_device *drm, struct drm_file *file)
 {
 	struct tegra_drm_file *fpriv = file->driver_priv;
@@ -905,10 +871,6 @@ static int tegra_debugfs_init(struct drm_minor *minor)
 	.preclose = tegra_drm_preclose,
 	.lastclose = tegra_drm_lastclose,
 
-	.get_vblank_counter = tegra_drm_get_vblank_counter,
-	.enable_vblank = tegra_drm_enable_vblank,
-	.disable_vblank = tegra_drm_disable_vblank,
-
 #if defined(CONFIG_DEBUG_FS)
 	.debugfs_init = tegra_debugfs_init,
 #endif
drivers/gpu/drm/tegra/drm.h +0 -3
index 5205790dd679..5747accb2271 100644
@@ -193,9 +193,6 @@ struct tegra_dc_window {
 };
 
 /* from dc.c */
-u32 tegra_dc_get_vblank_counter(struct tegra_dc *dc);
-void tegra_dc_enable_vblank(struct tegra_dc *dc);
-void tegra_dc_disable_vblank(struct tegra_dc *dc);
 void tegra_dc_commit(struct tegra_dc *dc);
 int tegra_dc_state_setup_clock(struct tegra_dc *dc,
 			       struct drm_crtc_state *crtc_state,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v3 20/23
#56 lore raw

Re: [PATCH v3 20/23] drm: tegra: use vblank hooks in struct drm_crtc_funcs

Quoted 10 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

As the result, the wrapper functions tegra_drm_xxx get killed completely, and tegra_dc_xxx are filled into struct drm_crtc_funcs as vblank hooks directly.

Quoted 7 lines
Cc Thierry Reding <[email protected]>
---
 drivers/gpu/drm/tegra/dc.c  | 15 ++++++++++++---
 drivers/gpu/drm/tegra/drm.c | 38 --------------------------------------
 drivers/gpu/drm/tegra/drm.h |  3 ---
 3 files changed, 12 insertions(+), 44 deletions(-)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#57 lore raw

PATCH v3 21/23 drm: tilcdc: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

While at it, the 'return' of .disable_vblank is dropped to fix the following checkpatch warning.

WARNING: void function return statements are not generally useful

---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 11 +++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_drv.c  | 12 ------------
 2 files changed, 11 insertions(+), 12 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +11 -0
index f80bf9385e41..93505bcfdf4b 100644
@@ -695,6 +695,15 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc,
 	return 0;
 }
 
+static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static void tilcdc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+}
+
 static const struct drm_crtc_funcs tilcdc_crtc_funcs = {
 	.destroy        = tilcdc_crtc_destroy,
 	.set_config     = drm_atomic_helper_set_config,
@@ -702,6 +711,8 @@ static int tilcdc_crtc_atomic_check(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	= tilcdc_crtc_enable_vblank,
+	.disable_vblank	= tilcdc_crtc_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = {
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -12
index d5bc98e283d9..81d80a2ffeb1 100644
@@ -437,16 +437,6 @@ static irqreturn_t tilcdc_irq(int irq, void *arg)
 	return tilcdc_crtc_irq(priv->crtc);
 }
 
-static int tilcdc_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	return 0;
-}
-
-static void tilcdc_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	return;
-}
-
 #if defined(CONFIG_DEBUG_FS)
 static const struct {
 	const char *name;
@@ -557,8 +547,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
 			       DRIVER_PRIME | DRIVER_ATOMIC),
 	.lastclose          = tilcdc_lastclose,
 	.irq_handler        = tilcdc_irq,
-	.enable_vblank      = tilcdc_enable_vblank,
-	.disable_vblank     = tilcdc_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,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v3 21/23
#58 lore raw

Re: [PATCH v3 21/23] drm: tilcdc: use vblank hooks in struct drm_crtc_funcs

Quoted 6 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Quoted 7 lines

While at it, the 'return' of .disable_vblank is dropped to fix the following checkpatch warning.

WARNING: void function return statements are not generally useful

Quoted 57 lines
---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 11 +++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_drv.c  | 12 ------------
 2 files changed, 11 insertions(+), 12 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +11 -0
index f80bf9385e41..93505bcfdf4b 100644
@@ -695,6 +695,15 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc,
 	return 0;
 }
 
+static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static void tilcdc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+}
+
 static const struct drm_crtc_funcs tilcdc_crtc_funcs = {
 	.destroy        = tilcdc_crtc_destroy,
 	.set_config     = drm_atomic_helper_set_config,
@@ -702,6 +711,8 @@ static int tilcdc_crtc_atomic_check(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	= tilcdc_crtc_enable_vblank,
+	.disable_vblank	= tilcdc_crtc_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = {
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -10
index d5bc98e283d9..81d80a2ffeb1 100644
@@ -437,16 +437,6 @@ static irqreturn_t tilcdc_irq(int irq, void *arg)
 	return tilcdc_crtc_irq(priv->crtc);
 }
 
-static int tilcdc_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	return 0;
-}
-
-static void tilcdc_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-	return;
-}
-
 #if defined(CONFIG_DEBUG_FS)
 static const struct {
 	const char *name;

drivers/gpu/drm/tilcdc/tilcdc_drv.c static int tilcdc_debugfs_init(struct drm_minor *minor) · line 552

Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -2
@@ -557,8 +547,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
 			       DRIVER_PRIME | DRIVER_ATOMIC),
 	.lastclose          = tilcdc_lastclose,
 	.irq_handler        = tilcdc_irq,
-	.enable_vblank      = tilcdc_enable_vblank,
-	.disable_vblank     = tilcdc_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,

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#59 lore raw

PATCH v3 22/23 drm: vc4: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

---
 drivers/gpu/drm/vc4/vc4_crtc.c | 8 ++++----
 drivers/gpu/drm/vc4/vc4_drv.c  | 2 --
 drivers/gpu/drm/vc4/vc4_drv.h  | 2 --
 3 files changed, 4 insertions(+), 8 deletions(-)
drivers/gpu/drm/vc4/vc4_crtc.c +4 -4
index 93aece203c54..87b4445cb286 100644
@@ -654,9 +654,8 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
 	}
 }
 
-int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id)
+static int vc4_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id);
 	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
 
 	CRTC_WRITE(PV_INTEN, PV_INT_VFP_START);
@@ -664,9 +663,8 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id)
 	return 0;
 }
 
-void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id)
+static void vc4_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id);
 	struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
 
 	CRTC_WRITE(PV_INTEN, 0);
@@ -857,6 +855,8 @@ static void vc4_crtc_destroy_state(struct drm_crtc *crtc,
 	.atomic_duplicate_state = vc4_crtc_duplicate_state,
 	.atomic_destroy_state = vc4_crtc_destroy_state,
 	.gamma_set = vc4_crtc_gamma_set,
+	.enable_vblank = vc4_enable_vblank,
+	.disable_vblank = vc4_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {
drivers/gpu/drm/vc4/vc4_drv.c +0 -2
index 3a8709d85da1..4f93328a2f20 100644
@@ -137,8 +137,6 @@ static void vc4_lastclose(struct drm_device *dev)
 	.irq_postinstall = vc4_irq_postinstall,
 	.irq_uninstall = vc4_irq_uninstall,
 
-	.enable_vblank = vc4_enable_vblank,
-	.disable_vblank = vc4_disable_vblank,
 	.get_scanout_position = vc4_crtc_get_scanoutpos,
 	.get_vblank_timestamp = vc4_crtc_get_vblank_timestamp,
 
drivers/gpu/drm/vc4/vc4_drv.h +0 -2
index 0e59f3ee1b83..dffce6293d87 100644
@@ -444,8 +444,6 @@ int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data,
 
 /* vc4_crtc.c */
 extern struct platform_driver vc4_crtc_driver;
-int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id);
-void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id);
 bool vc4_event_pending(struct drm_crtc *crtc);
 int vc4_crtc_debugfs_regs(struct seq_file *m, void *arg);
 int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 22/23
#60 lore raw

Re: [PATCH v3 22/23] drm: vc4: use vblank hooks in struct drm_crtc_funcs

Quoted 5 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

Thanks for doing this cleanup!

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#61 lore raw

PATCH v3 23/23 drm: zte: use vblank hooks in struct drm_crtc_funcs

In reply to Shawn Guo

From: Shawn Guo <[email protected]>

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.

The functions are moved around to save forward declaration.

---
 drivers/gpu/drm/zte/zx_drm_drv.c |  2 --
 drivers/gpu/drm/zte/zx_vou.c     | 61 +++++++++++++++-------------------------
 drivers/gpu/drm/zte/zx_vou.h     |  3 --
 3 files changed, 23 insertions(+), 43 deletions(-)
drivers/gpu/drm/zte/zx_drm_drv.c +0 -2
index afd713a954c6..b24a70ba4b83 100644
@@ -71,8 +71,6 @@ static void zx_drm_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 	.lastclose = zx_drm_lastclose,
-	.enable_vblank = zx_vou_enable_vblank,
-	.disable_vblank = zx_vou_disable_vblank,
 	.gem_free_object = drm_gem_cma_free_object,
 	.gem_vm_ops = &drm_gem_cma_vm_ops,
 	.dumb_create = drm_gem_cma_dumb_create,
drivers/gpu/drm/zte/zx_vou.c +23 -38

79 lines not on this page · raw message

drivers/gpu/drm/zte/zx_vou.h +0 -3
index 57e3c31ee6a5..97d72bfce982 100644
@@ -61,9 +61,6 @@ struct vou_div_config {
 void zx_vou_config_dividers(struct drm_crtc *crtc,
 			    struct vou_div_config *configs, int num);
 
-int zx_vou_enable_vblank(struct drm_device *drm, unsigned int pipe);
-void zx_vou_disable_vblank(struct drm_device *drm, unsigned int pipe);
-
 void zx_vou_layer_enable(struct drm_plane *plane);
 void zx_vou_layer_disable(struct drm_plane *plane);
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v3 23/23
#62 lore raw

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

Quoted 8 lines · Shawn Guo

From: Shawn Guo <[email protected]>

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.

The functions are moved around to save forward declaration.

Quoted 127 lines
---
 drivers/gpu/drm/zte/zx_drm_drv.c |  2 --
 drivers/gpu/drm/zte/zx_vou.c     | 61 +++++++++++++++-------------------------
 drivers/gpu/drm/zte/zx_vou.h     |  3 --
 3 files changed, 23 insertions(+), 43 deletions(-)
drivers/gpu/drm/zte/zx_drm_drv.c +0 -2
index afd713a954c6..b24a70ba4b83 100644
@@ -71,8 +71,6 @@ static void zx_drm_lastclose(struct drm_device *drm)
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 	.lastclose = zx_drm_lastclose,
-	.enable_vblank = zx_vou_enable_vblank,
-	.disable_vblank = zx_vou_disable_vblank,
 	.gem_free_object = drm_gem_cma_free_object,
 	.gem_vm_ops = &drm_gem_cma_vm_ops,
 	.dumb_create = drm_gem_cma_dumb_create,
drivers/gpu/drm/zte/zx_vou.c +23 -38
index cf92d675feaa..b500c8dd0d9d 100644
@@ -470,6 +470,27 @@ static void zx_crtc_atomic_flush(struct drm_crtc *crtc,
 	.atomic_flush = zx_crtc_atomic_flush,
 };
 
+static int zx_vou_enable_vblank(struct drm_crtc *crtc)
+{
+	struct zx_crtc *zcrtc = to_zx_crtc(crtc);
+	struct zx_vou_hw *vou = crtc_to_vou(crtc);
+	u32 int_frame_mask = zcrtc->bits->int_frame_mask;
+
+	zx_writel_mask(vou->timing + TIMING_INT_CTRL, int_frame_mask,
+		       int_frame_mask);
+
+	return 0;
+}
+
+static void zx_vou_disable_vblank(struct drm_crtc *crtc)
+{
+	struct zx_crtc *zcrtc = to_zx_crtc(crtc);
+	struct zx_vou_hw *vou = crtc_to_vou(crtc);
+
+	zx_writel_mask(vou->timing + TIMING_INT_CTRL,
+		       zcrtc->bits->int_frame_mask, 0);
+}
+
 static const struct drm_crtc_funcs zx_crtc_funcs = {
 	.destroy = drm_crtc_cleanup,
 	.set_config = drm_atomic_helper_set_config,
@@ -477,6 +498,8 @@ static void zx_crtc_atomic_flush(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 = zx_vou_enable_vblank,
+	.disable_vblank = zx_vou_disable_vblank,
 };
 
 static int zx_crtc_init(struct drm_device *drm, struct zx_vou_hw *vou,
@@ -553,44 +576,6 @@ static int zx_crtc_init(struct drm_device *drm, struct zx_vou_hw *vou,
 	return 0;
 }
 
-int zx_vou_enable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct drm_crtc *crtc;
-	struct zx_crtc *zcrtc;
-	struct zx_vou_hw *vou;
-	u32 int_frame_mask;
-
-	crtc = drm_crtc_from_index(drm, pipe);
-	if (!crtc)
-		return 0;
-
-	vou = crtc_to_vou(crtc);
-	zcrtc = to_zx_crtc(crtc);
-	int_frame_mask = zcrtc->bits->int_frame_mask;
-
-	zx_writel_mask(vou->timing + TIMING_INT_CTRL, int_frame_mask,
-		       int_frame_mask);
-
-	return 0;
-}
-
-void zx_vou_disable_vblank(struct drm_device *drm, unsigned int pipe)
-{
-	struct drm_crtc *crtc;
-	struct zx_crtc *zcrtc;
-	struct zx_vou_hw *vou;
-
-	crtc = drm_crtc_from_index(drm, pipe);
-	if (!crtc)
-		return;
-
-	vou = crtc_to_vou(crtc);
-	zcrtc = to_zx_crtc(crtc);
-
-	zx_writel_mask(vou->timing + TIMING_INT_CTRL,
-		       zcrtc->bits->int_frame_mask, 0);
-}
-
 void zx_vou_layer_enable(struct drm_plane *plane)
 {
 	struct zx_crtc *zcrtc = to_zx_crtc(plane->state->crtc);
drivers/gpu/drm/zte/zx_vou.h +0 -3
index 57e3c31ee6a5..97d72bfce982 100644
@@ -61,9 +61,6 @@ struct vou_div_config {
 void zx_vou_config_dividers(struct drm_crtc *crtc,
 			    struct vou_div_config *configs, int num);
 
-int zx_vou_enable_vblank(struct drm_device *drm, unsigned int pipe);
-void zx_vou_disable_vblank(struct drm_device *drm, unsigned int pipe);
-
 void zx_vou_layer_enable(struct drm_plane *plane);
 void zx_vou_layer_disable(struct drm_plane *plane);
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#63 lore raw
In reply to Shawn Guo

Hi,

Quoted 13 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. The first patch adds 3 vblank core<->driver hooks into struct drm_crtc_funcs, and plug them into core by adding wrapper functions for vblank handling code. We effectively make the .get_vblank_counter hook optional by providing drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Patch #2 and #3 unexport function drm_vblank_no_hw_counter() by cleaning up its use, since it's already the default implememention for .get_vblank_counter hook anyway.

Quoted 8 lines

The rest of the series is trying to do a massive conversion to the new hooks for DRIVER_MODESET drivers. But it only handles low-hanging fruit, and leaves out the ones that need a bit surgery, like gma500, i915, msm etc. Most of conversion get done by simply moving code and making functions static, but imx and rockchip are great examples showing how driver code can be cleaned up with these new hooks.

The series is generated against branch drm-next.

Thanks for the series. I've attached a patch for omapdrm, in case you're sending v4 and want to include it in the series.

Tomi

From b03a468fdaf2b329a940f3980871c27bd8d0caa6 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <[email protected]>
Date: Wed, 8 Feb 2017 13:26:00 +0200
Subject: [PATCH] drm/omap: use vblank hooks in struct drm_crtc_funcs

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.

---
 drivers/gpu/drm/omapdrm/omap_crtc.c |  2 ++
 drivers/gpu/drm/omapdrm/omap_drv.c  |  2 --
 drivers/gpu/drm/omapdrm/omap_drv.h  |  4 ++--
 drivers/gpu/drm/omapdrm/omap_irq.c  | 18 ++++++++++--------
 4 files changed, 14 insertions(+), 12 deletions(-)
drivers/gpu/drm/omapdrm/omap_crtc.c +2 -0
index b68c70eb395f..2fe735c269fc 100644
@@ -495,6 +495,8 @@ static const struct drm_crtc_funcs omap_crtc_funcs = {
 	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
 	.atomic_set_property = omap_crtc_atomic_set_property,
 	.atomic_get_property = omap_crtc_atomic_get_property,
+	.enable_vblank = omap_irq_enable_vblank,
+	.disable_vblank = omap_irq_disable_vblank,
 };
 
 static const struct drm_crtc_helper_funcs omap_crtc_helper_funcs = {
drivers/gpu/drm/omapdrm/omap_drv.c +0 -2
index a6d05e82db10..92d2f87fed5f 100644
@@ -727,8 +727,6 @@ static struct drm_driver omap_drm_driver = {
 		DRIVER_ATOMIC,
 	.open = dev_open,
 	.lastclose = dev_lastclose,
-	.enable_vblank = omap_irq_enable_vblank,
-	.disable_vblank = omap_irq_disable_vblank,
 #ifdef CONFIG_DEBUG_FS
 	.debugfs_init = omap_debugfs_init,
 	.debugfs_cleanup = omap_debugfs_cleanup,
drivers/gpu/drm/omapdrm/omap_drv.h +2 -2
index b20377efd01b..3c13dc451ab4 100644
@@ -113,8 +113,8 @@ void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);
 int omap_gem_resume(struct device *dev);
 #endif
 
-int omap_irq_enable_vblank(struct drm_device *dev, unsigned int pipe);
-void omap_irq_disable_vblank(struct drm_device *dev, unsigned int pipe);
+int omap_irq_enable_vblank(struct drm_crtc *crtc);
+void omap_irq_disable_vblank(struct drm_crtc *crtc);
 void omap_drm_irq_uninstall(struct drm_device *dev);
 int omap_drm_irq_install(struct drm_device *dev);
 
drivers/gpu/drm/omapdrm/omap_irq.c +10 -8
index 9adfa7c99695..59f21add6f19 100644
@@ -101,16 +101,17 @@ int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait,
  * Zero on success, appropriate errno if the given @crtc's vblank
  * interrupt cannot be enabled.
  */
-int omap_irq_enable_vblank(struct drm_device *dev, unsigned int pipe)
+int omap_irq_enable_vblank(struct drm_crtc *crtc)
 {
+	struct drm_device *dev = crtc->dev;
 	struct omap_drm_private *priv = dev->dev_private;
-	struct drm_crtc *crtc = priv->crtcs[pipe];
 	unsigned long flags;
+	enum omap_channel channel = omap_crtc_channel(crtc);
 
-	DBG("dev=%p, crtc=%u", dev, pipe);
+	DBG("dev=%p, crtc=%u", dev, channel);
 
 	spin_lock_irqsave(&priv->wait_lock, flags);
-	priv->irq_mask |= dispc_mgr_get_vsync_irq(omap_crtc_channel(crtc));
+	priv->irq_mask |= dispc_mgr_get_vsync_irq(channel);
 	omap_irq_update(dev);
 	spin_unlock_irqrestore(&priv->wait_lock, flags);
 
@@ -126,16 +127,17 @@ int omap_irq_enable_vblank(struct drm_device *dev, unsigned int pipe)
  * a hardware vblank counter, this routine should be a no-op, since
  * interrupts will have to stay on to keep the count accurate.
  */
-void omap_irq_disable_vblank(struct drm_device *dev, unsigned int pipe)
+void omap_irq_disable_vblank(struct drm_crtc *crtc)
 {
+	struct drm_device *dev = crtc->dev;
 	struct omap_drm_private *priv = dev->dev_private;
-	struct drm_crtc *crtc = priv->crtcs[pipe];
 	unsigned long flags;
+	enum omap_channel channel = omap_crtc_channel(crtc);
 
-	DBG("dev=%p, crtc=%u", dev, pipe);
+	DBG("dev=%p, crtc=%u", dev, channel);
 
 	spin_lock_irqsave(&priv->wait_lock, flags);
-	priv->irq_mask &= ~dispc_mgr_get_vsync_irq(omap_crtc_channel(crtc));
+	priv->irq_mask &= ~dispc_mgr_get_vsync_irq(channel);
 	omap_irq_update(dev);
 	spin_unlock_irqrestore(&priv->wait_lock, flags);
 }
Signature · 1 line
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#64 lore raw

Hi Tomi,

Quoted 21 lines · On Wednesday 08 Feb 2017 13:30:51 Tomi Valkeinen wrote:
Quoted 20 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. The first patch adds 3 vblank core<->driver hooks into struct drm_crtc_funcs, and plug them into core by adding wrapper functions for vblank handling code. We effectively make the .get_vblank_counter hook optional by providing drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Patch #2 and #3 unexport function drm_vblank_no_hw_counter() by cleaning up its use, since it's already the default implememention for .get_vblank_counter hook anyway.

The rest of the series is trying to do a massive conversion to the new hooks for DRIVER_MODESET drivers. But it only handles low-hanging fruit, and leaves out the ones that need a bit surgery, like gma500, i915, msm etc. Most of conversion get done by simply moving code and making functions static, but imx and rockchip are great examples showing how driver code can be cleaned up with these new hooks.

Quoted 4 lines
Quoted 1 line

The series is generated against branch drm-next.

Thanks for the series. I've attached a patch for omapdrm, in case you're sending v4 and want to include it in the series.

You can add my

to the patch.

Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#65 lore raw
Quoted 24 lines · Laurent Pinchart

Hi Tomi,

Quoted 21 lines · On Wednesday 08 Feb 2017 13:30:51 Tomi Valkeinen wrote:
Quoted 20 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. The first patch adds 3 vblank core<->driver hooks into struct drm_crtc_funcs, and plug them into core by adding wrapper functions for vblank handling code. We effectively make the .get_vblank_counter hook optional by providing drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Patch #2 and #3 unexport function drm_vblank_no_hw_counter() by cleaning up its use, since it's already the default implememention for .get_vblank_counter hook anyway.

The rest of the series is trying to do a massive conversion to the new hooks for DRIVER_MODESET drivers. But it only handles low-hanging fruit, and leaves out the ones that need a bit surgery, like gma500, i915, msm etc. Most of conversion get done by simply moving code and making functions static, but imx and rockchip are great examples showing how driver code can be cleaned up with these new hooks.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

The series is generated against branch drm-next.

Thanks for the series. I've attached a patch for omapdrm, in case you're sending v4 and want to include it in the series.

You can add my

To simplify the flow a bit I've pushed this into drm-misc-next, with Tomi's ack.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#66 lore raw
In reply to Shawn Guo
Quoted 13 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. The first patch adds 3 vblank core<->driver hooks into struct drm_crtc_funcs, and plug them into core by adding wrapper functions for vblank handling code. We effectively make the .get_vblank_counter hook optional by providing drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Patch #2 and #3 unexport function drm_vblank_no_hw_counter() by cleaning up its use, since it's already the default implememention for .get_vblank_counter hook anyway.

Quoted 7 lines

The rest of the series is trying to do a massive conversion to the new hooks for DRIVER_MODESET drivers. But it only handles low-hanging fruit, and leaves out the ones that need a bit surgery, like gma500, i915, msm etc. Most of conversion get done by simply moving code and making functions static, but imx and rockchip are great examples showing how driver code can be cleaned up with these new hooks.

Hi Shawn,
Thanks for the cleanup, it looks great! Let's soak this on the list until next week, if there are no objections from driver maintainers, I'll merge it to -misc.

Sean

Quoted 111 lines

The series is generated against branch drm-next.

Changes for v3:
- Let drm_vblank_no_hw_counter() be the last fallback for .get_vblank_counter() hook.
- Improve the kernel-doc for .get_vblank_counter() hook.
- Convert more DRIVER_MODESET drivers to new hooks.

Changes for v2:
- Wrap around core vblank handling code to save drm_crtc_enable[disable]_vblank() helpers
- Add .get_vblank_counter to struct drm_crtc_funcs
- Add some comments to link between two sets of hooks
- Add one hdlcd driver patch for example

Shawn Guo (23):
drm: add vblank hooks to struct drm_crtc_funcs
drm: remove drm_vblank_no_hw_counter assignment from driver code
drm: unexport function drm_vblank_no_hw_counter()
drm: hdlcd: use vblank hooks in struct drm_crtc_funcs
drm: malidp: use vblank hooks in struct drm_crtc_funcs
drm: armada: use vblank hooks in struct drm_crtc_funcs
drm: atmel: use vblank hooks in struct drm_crtc_funcs
drm: exynos: use vblank hooks in struct drm_crtc_funcs
drm: fsl-dcu: use vblank hooks in struct drm_crtc_funcs
drm: hibmc: use vblank hooks in struct drm_crtc_funcs
drm: kirin: use vblank hooks in struct drm_crtc_funcs
drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs
drm: mediatek: use vblank hooks in struct drm_crtc_funcs
drm: meson: use vblank hooks in struct drm_crtc_funcs
drm: qxl: use vblank hooks in struct drm_crtc_funcs
drm: rcar-du: use vblank hooks in struct drm_crtc_funcs
drm: rockchip: remove struct rockchip_crtc_funcs
drm: shmobile: use vblank hooks in struct drm_crtc_funcs
drm: sun4i: use vblank hooks in struct drm_crtc_funcs
drm: tegra: use vblank hooks in struct drm_crtc_funcs
drm: tilcdc: use vblank hooks in struct drm_crtc_funcs
drm: vc4: use vblank hooks in struct drm_crtc_funcs
drm: zte: use vblank hooks in struct drm_crtc_funcs

 drivers/gpu/drm/arc/arcpgu_drv.c                |   1 -
 drivers/gpu/drm/arm/hdlcd_crtc.c                |  20 +++++
 drivers/gpu/drm/arm/hdlcd_drv.c                 |  21 -----
 drivers/gpu/drm/arm/malidp_crtc.c               |  21 +++++
 drivers/gpu/drm/arm/malidp_drv.c                |  22 -----
 drivers/gpu/drm/armada/armada_crtc.c            |  56 ++++++++-----
 drivers/gpu/drm/armada/armada_crtc.h            |   2 -
 drivers/gpu/drm/armada/armada_drv.c             |  17 ----
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c  |  21 +++++
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    |  22 -----
 drivers/gpu/drm/drm_irq.c                       |  81 +++++++++++++------
 drivers/gpu/drm/exynos/exynos_drm_crtc.c        |  40 +++++-----
 drivers/gpu/drm/exynos/exynos_drm_crtc.h        |   2 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c         |   4 -
 drivers/gpu/drm/exynos/exynos_drm_drv.h         |   8 --
 drivers/gpu/drm/exynos/exynos_hdmi.c            |   7 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c      |  26 ++++++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       |  26 ------
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c  |  20 +++++
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c |  23 ------
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |  11 +--
 drivers/gpu/drm/i915/i915_irq.c                 |   1 -
 drivers/gpu/drm/imx/imx-drm-core.c              | 102 ------------------------
 drivers/gpu/drm/imx/imx-drm.h                   |  13 ---
 drivers/gpu/drm/imx/ipuv3-crtc.c                |  58 +++++---------
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c         |   8 +-
 drivers/gpu/drm/mediatek/mtk_drm_crtc.h         |   2 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c          |   4 -
 drivers/gpu/drm/meson/meson_crtc.c              |  22 +++++
 drivers/gpu/drm/meson/meson_drv.c               |  21 -----
 drivers/gpu/drm/msm/msm_drv.c                   |   1 -
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               |   1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c           |   1 -
 drivers/gpu/drm/omapdrm/omap_drv.c              |   1 -
 drivers/gpu/drm/qxl/qxl_display.c               |  16 ++++
 drivers/gpu/drm/qxl/qxl_drv.c                   |  18 -----
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c          |  29 ++++---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h          |   1 -
 drivers/gpu/drm/rcar-du/rcar_du_drv.c           |  20 -----
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c     |  52 ------------
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h     |  14 ----
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c     |   9 +--
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c       |  51 ++++++++----
 drivers/gpu/drm/shmobile/shmob_drm_crtc.h       |   1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c        |  20 -----
 drivers/gpu/drm/sti/sti_drv.c                   |   1 -
 drivers/gpu/drm/sun4i/sun4i_crtc.c              |  24 ++++++
 drivers/gpu/drm/sun4i/sun4i_drv.c               |  28 -------
 drivers/gpu/drm/tegra/dc.c                      |  15 +++-
 drivers/gpu/drm/tegra/drm.c                     |  38 ---------
 drivers/gpu/drm/tegra/drm.h                     |   3 -
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c            |  11 +++
 drivers/gpu/drm/tilcdc/tilcdc_drv.c             |  13 ---
 drivers/gpu/drm/vc4/vc4_crtc.c                  |   8 +-
 drivers/gpu/drm/vc4/vc4_drv.c                   |   3 -
 drivers/gpu/drm/vc4/vc4_drv.h                   |   2 -
 drivers/gpu/drm/zte/zx_drm_drv.c                |   3 -
 drivers/gpu/drm/zte/zx_vou.c                    |  61 ++++++--------
 drivers/gpu/drm/zte/zx_vou.h                    |   3 -
 include/drm/drm_crtc.h                          |  44 ++++++++++
 include/drm/drm_drv.h                           |  16 +++-
 include/drm/drm_irq.h                           |   1 -
 62 files changed, 481 insertions(+), 710 deletions(-)
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#67 lore raw
Quoted 22 lines · Sean Paul
Quoted 13 lines · Shawn Guo

From: Shawn Guo <[email protected]>

The vblank is mostly CRTC specific and implemented as part of CRTC driver. The first patch adds 3 vblank core<->driver hooks into struct drm_crtc_funcs, and plug them into core by adding wrapper functions for vblank handling code. We effectively make the .get_vblank_counter hook optional by providing drm_vblank_no_hw_counter() as the default fallback in the wrapper function.

Patch #2 and #3 unexport function drm_vblank_no_hw_counter() by cleaning up its use, since it's already the default implememention for .get_vblank_counter hook anyway.

Quoted 7 lines

The rest of the series is trying to do a massive conversion to the new hooks for DRIVER_MODESET drivers. But it only handles low-hanging fruit, and leaves out the ones that need a bit surgery, like gma500, i915, msm etc. Most of conversion get done by simply moving code and making functions static, but imx and rockchip are great examples showing how driver code can be cleaned up with these new hooks.

Quoted 4 lines

Hi Shawn,
Thanks for the cleanup, it looks great! Let's soak this on the list until next week, if there are no objections from driver maintainers, I'll merge it to -misc.

As suggested by Daniel, I pushed another 11 patches which have already received Reviewed-by or Acked-by to branch drm-misc-next. That leaves the last 3 flowing around, i.e. kirin, mediatek and qxl.

So the drm-misc committer flow works for me \o/

Shawn
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel