dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6
@ 2016-11-14  9:02 Daniel Vetter
  2016-11-14  9:02 ` [PATCH 2/6] drm/nouveau: Use drm_crtc_vblank_off/on Daniel Vetter
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-11-14  9:02 UTC (permalink / raw)
  To: DRI Development
  Cc: Alex Deucher, Daniel Vetter, Christian König, Daniel Vetter,
	Ken Wang

This old code pattern was reintroduced in

Author: Ken Wang <Qingqing.Wang@amd.com>
Date:   Tue Jan 19 14:03:24 2016 +0800

    drm/amdgpu: add display controller implementation for si v10

Realign it with later display code. Tsk, tsk for massive copypasting
;-)

Cc: Christian König <christian.koenig@amd.com>
Cc: Ken Wang <Qingqing.Wang@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index c1bd1beab655..bc9f2f423270 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -2040,13 +2040,13 @@ static void dce_v6_0_crtc_dpms(struct drm_crtc *crtc, int mode)
 		type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
 		amdgpu_irq_update(adev, &adev->crtc_irq, type);
 		amdgpu_irq_update(adev, &adev->pageflip_irq, type);
-		drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
+		drm_crtc_vblank_on(crtc);
 		dce_v6_0_crtc_load_lut(crtc);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		drm_vblank_pre_modeset(dev, amdgpu_crtc->crtc_id);
+		drm_crtc_vblank_off(crtc);
 		if (amdgpu_crtc->enabled)
 			amdgpu_atombios_crtc_blank(crtc, ATOM_ENABLE);
 		amdgpu_atombios_crtc_enable(crtc, ATOM_DISABLE);
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/6] drm/nouveau: Use drm_crtc_vblank_off/on
  2016-11-14  9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
@ 2016-11-14  9:02 ` Daniel Vetter
  2016-11-14 11:41   ` [PATCH] " Daniel Vetter
  2016-11-14  9:02 ` [PATCH 3/6] drm/irq: Make drm_vblank_pre/post_modeset internal Daniel Vetter
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2016-11-14  9:02 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Ben Skeggs, Daniel Vetter

With atomic nv50+ is already converted over to them, but the old
display code is still using it. Found in a 2 year old patch I have
lying around to un-export these old helpers!

v2: Drop the hand-rolled versions from resume/suspend code. Now that
crtc callbacks do this, we don't need a special case for s/r anymore.

Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/nouveau/dispnv04/crtc.c   | 4 ++--
 drivers/gpu/drm/nouveau/nouveau_display.c | 8 --------
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
index 0cb7a18cde26..59d1d1c5de5f 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
@@ -702,7 +702,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
 	if (nv_two_heads(dev))
 		NVSetOwner(dev, nv_crtc->index);
 
-	drm_vblank_pre_modeset(dev, nv_crtc->index);
+	drm_crtc_vblank_off(crtc);
 	funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
 
 	NVBlankScreen(dev, nv_crtc->index, true);
@@ -734,7 +734,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc)
 #endif
 
 	funcs->dpms(crtc, DRM_MODE_DPMS_ON);
-	drm_vblank_post_modeset(dev, nv_crtc->index);
+	drm_crtc_vblank_on(crtc);
 }
 
 static void nv_crtc_destroy(struct drm_crtc *crtc)
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 75c90a8da18a..8bce519917b2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -385,10 +385,6 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
 	if (!suspend)
 		drm_crtc_force_disable_all(dev);
 
-	/* Make sure that drm and hw vblank irqs get properly disabled. */
-	for (head = 0; head < dev->mode_config.num_crtc; head++)
-		drm_vblank_off(dev, head);
-
 	/* disable flip completion events */
 	nvif_notify_put(&drm->flip);
 
@@ -777,10 +773,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
 
 	drm_helper_resume_force_mode(dev);
 
-	/* Make sure that drm and hw vblank irqs get resumed if needed. */
-	for (head = 0; head < dev->mode_config.num_crtc; head++)
-		drm_vblank_on(dev, head);
-
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 		struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
 
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/6] drm/irq: Make drm_vblank_pre/post_modeset internal
  2016-11-14  9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
  2016-11-14  9:02 ` [PATCH 2/6] drm/nouveau: Use drm_crtc_vblank_off/on Daniel Vetter
@ 2016-11-14  9:02 ` Daniel Vetter
  2016-11-14  9:02 ` [PATCH 4/6] drm/irq: Unexport drm_vblank_count Daniel Vetter
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-11-14  9:02 UTC (permalink / raw)
  To: DRI Development; +Cc: Alex Deucher, Daniel Vetter, Ben Skeggs, Daniel Vetter

Now that all drivers are switched over to drm_crtc_vblank_on/off we
can relegate pre/post_modeset to the purely drm_irq.c internal role of
supporting old ums userspace.

As usual switch to the drm_legacy_ prefix to make it clear this is
for old drivers only.

v2: Rebase on top of Thierry's s/int crtc/unsigned int pipe/ changes.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_irq.c | 43 ++++++-------------------------------------
 include/drm/drmP.h        |  4 ----
 2 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 48a6167f5e7b..2fb5861b04b7 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -1445,30 +1445,8 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc)
 }
 EXPORT_SYMBOL(drm_crtc_vblank_on);
 
-/**
- * drm_vblank_pre_modeset - account for vblanks across mode sets
- * @dev: DRM device
- * @pipe: CRTC index
- *
- * Account for vblank events across mode setting events, which will likely
- * reset the hardware frame counter.
- *
- * This is done by grabbing a temporary vblank reference to ensure that the
- * vblank interrupt keeps running across the modeset sequence. With this the
- * software-side vblank frame counting will ensure that there are no jumps or
- * discontinuities.
- *
- * Unfortunately this approach is racy and also doesn't work when the vblank
- * interrupt stops running, e.g. across system suspend resume. It is therefore
- * highly recommended that drivers use the newer drm_vblank_off() and
- * drm_vblank_on() instead. drm_vblank_pre_modeset() only works correctly when
- * using "cooked" software vblank frame counters and not relying on any hardware
- * counters.
- *
- * Drivers must call drm_vblank_post_modeset() when re-enabling the same crtc
- * again.
- */
-void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe)
+static void drm_legacy_vblank_pre_modeset(struct drm_device *dev,
+					  unsigned int pipe)
 {
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
@@ -1492,17 +1470,9 @@ void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe)
 			vblank->inmodeset |= 0x2;
 	}
 }
-EXPORT_SYMBOL(drm_vblank_pre_modeset);
 
-/**
- * drm_vblank_post_modeset - undo drm_vblank_pre_modeset changes
- * @dev: DRM device
- * @pipe: CRTC index
- *
- * This function again drops the temporary vblank reference acquired in
- * drm_vblank_pre_modeset.
- */
-void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe)
+static void drm_legacy_vblank_post_modeset(struct drm_device *dev,
+					   unsigned int pipe)
 {
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 	unsigned long irqflags;
@@ -1525,7 +1495,6 @@ void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe)
 		vblank->inmodeset = 0;
 	}
 }
-EXPORT_SYMBOL(drm_vblank_post_modeset);
 
 /*
  * drm_modeset_ctl - handle vblank event counter changes across mode switch
@@ -1558,10 +1527,10 @@ int drm_modeset_ctl(struct drm_device *dev, void *data,
 
 	switch (modeset->cmd) {
 	case _DRM_PRE_MODESET:
-		drm_vblank_pre_modeset(dev, pipe);
+		drm_legacy_vblank_pre_modeset(dev, pipe);
 		break;
 	case _DRM_POST_MODESET:
-		drm_vblank_post_modeset(dev, pipe);
+		drm_legacy_vblank_post_modeset(dev, pipe);
 		break;
 	default:
 		return -EINVAL;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 4e58137c1882..cfa4b80f0628 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1007,10 +1007,6 @@ void drm_clflush_virt_range(void *addr, unsigned long length);
  * DMA quiscent + idle. DMA quiescent usually requires the hardware lock.
  */
 
-/* Modesetting support */
-extern void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe);
-extern void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe);
-
 /* drm_drv.c */
 void drm_put_dev(struct drm_device *dev);
 void drm_unplug_dev(struct drm_device *dev);
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/6] drm/irq: Unexport drm_vblank_count
  2016-11-14  9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
  2016-11-14  9:02 ` [PATCH 2/6] drm/nouveau: Use drm_crtc_vblank_off/on Daniel Vetter
  2016-11-14  9:02 ` [PATCH 3/6] drm/irq: Make drm_vblank_pre/post_modeset internal Daniel Vetter
@ 2016-11-14  9:02 ` Daniel Vetter
  2016-11-14 17:51   ` Philipp Zabel
  2016-11-14  9:02 ` [PATCH 5/6] drm/irq: Unexport drm_vblank_on/off Daniel Vetter
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2016-11-14  9:02 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

No one outside of drm_irq.c should ever need this. The correct way to
implement get_vblank_count for hw lacking a vblank counter is
drm_vblank_no_hw_counter. Fix this up in mtk, which is the only
offender left over.

Cc: CK Hu <ck.hu@mediatek.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_irq.c              | 37 +++++++++-------------------------
 drivers/gpu/drm/mediatek/mtk_drm_drv.c |  2 +-
 2 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 2fb5861b04b7..1681e919b866 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -234,6 +234,16 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
 	store_vblank(dev, pipe, diff, &t_vblank, cur_vblank);
 }
 
+static u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
+{
+	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
+
+	if (WARN_ON(pipe >= dev->num_crtcs))
+		return 0;
+
+	return vblank->count;
+}
+
 /**
  * drm_accurate_vblank_count - retrieve the master vblank counter
  * @crtc: which counter to retrieve
@@ -888,31 +898,6 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
 }
 
 /**
- * drm_vblank_count - retrieve "cooked" vblank counter value
- * @dev: DRM device
- * @pipe: index of CRTC for which to retrieve the counter
- *
- * Fetches the "cooked" vblank count value that represents the number of
- * vblank events since the system was booted, including lost events due to
- * modesetting activity.
- *
- * This is the legacy version of drm_crtc_vblank_count().
- *
- * Returns:
- * The software vblank counter.
- */
-u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
-{
-	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
-
-	if (WARN_ON(pipe >= dev->num_crtcs))
-		return 0;
-
-	return vblank->count;
-}
-EXPORT_SYMBOL(drm_vblank_count);
-
-/**
  * drm_crtc_vblank_count - retrieve "cooked" vblank counter value
  * @crtc: which counter to retrieve
  *
@@ -920,8 +905,6 @@ EXPORT_SYMBOL(drm_vblank_count);
  * vblank events since the system was booted, including lost events due to
  * modesetting activity.
  *
- * This is the native KMS version of drm_vblank_count().
- *
  * Returns:
  * The software vblank counter.
  */
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index d90152e85ed0..4b7fe7eaec01 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -256,7 +256,7 @@ static struct drm_driver mtk_drm_driver = {
 	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
 			   DRIVER_ATOMIC,
 
-	.get_vblank_counter = drm_vblank_count,
+	.get_vblank_counter = drm_vblank_no_hw_counter,
 	.enable_vblank = mtk_drm_crtc_enable_vblank,
 	.disable_vblank = mtk_drm_crtc_disable_vblank,
 
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/6] drm/irq: Unexport drm_vblank_on/off
  2016-11-14  9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
                   ` (2 preceding siblings ...)
  2016-11-14  9:02 ` [PATCH 4/6] drm/irq: Unexport drm_vblank_count Daniel Vetter
@ 2016-11-14  9:02 ` Daniel Vetter
  2016-11-14  9:02 ` [PATCH 6/6] drm: drm_irq.h header cleanup Daniel Vetter
  2016-11-14 10:02 ` [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Christian König
  5 siblings, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-11-14  9:02 UTC (permalink / raw)
  To: DRI Development
  Cc: Alex Deucher, Daniel Vetter, Christian König, Daniel Vetter

Only remaining use was in amdgpu, and trivial to convert over to
drm_crtc_vblank_* variants.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c |  4 +-
 drivers/gpu/drm/drm_irq.c                | 80 +++++++++-----------------------
 include/drm/drm_irq.h                    |  3 --
 3 files changed, 23 insertions(+), 64 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index cc85676a68d9..81cbf0b05dff 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -214,12 +214,12 @@ static void dce_virtual_crtc_dpms(struct drm_crtc *crtc, int mode)
 		/* Make sure VBLANK interrupts are still enabled */
 		type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
 		amdgpu_irq_update(adev, &adev->crtc_irq, type);
-		drm_vblank_on(dev, amdgpu_crtc->crtc_id);
+		drm_crtc_vblank_on(crtc);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		drm_vblank_off(dev, amdgpu_crtc->crtc_id);
+		drm_crtc_vblank_off(crtc);
 		amdgpu_crtc->enabled = false;
 		break;
 	}
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 1681e919b866..273625a85036 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -93,7 +93,7 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe,
  * Reset the stored timestamp for the current vblank count to correspond
  * to the last vblank occurred.
  *
- * Only to be called from drm_vblank_on().
+ * Only to be called from drm_crtc_vblank_on().
  *
  * Note: caller must hold dev->vbl_lock since this reads & writes
  * device vblank fields.
@@ -306,7 +306,7 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
 	 * Always update the count and timestamp to maintain the
 	 * appearance that the counter has been ticking all along until
 	 * this time. This makes the count account for the entire time
-	 * between drm_vblank_on() and drm_vblank_off().
+	 * between drm_crtc_vblank_on() and drm_crtc_vblank_off().
 	 */
 	drm_update_vblank_count(dev, pipe, 0);
 
@@ -1255,21 +1255,20 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
 EXPORT_SYMBOL(drm_crtc_wait_one_vblank);
 
 /**
- * drm_vblank_off - disable vblank events on a CRTC
- * @dev: DRM device
- * @pipe: CRTC index
+ * drm_crtc_vblank_off - disable vblank events on a CRTC
+ * @crtc: CRTC in question
  *
  * Drivers can use this function to shut down the vblank interrupt handling when
  * disabling a crtc. This function ensures that the latest vblank frame count is
- * stored so that drm_vblank_on() can restore it again.
+ * stored so that drm_vblank_on can restore it again.
  *
  * Drivers must use this function when the hardware vblank counter can get
  * reset, e.g. when suspending.
- *
- * This is the legacy version of drm_crtc_vblank_off().
  */
-void drm_vblank_off(struct drm_device *dev, unsigned int pipe)
+void drm_crtc_vblank_off(struct drm_crtc *crtc)
 {
+	struct drm_device *dev = crtc->dev;
+	unsigned int pipe = drm_crtc_index(crtc);
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 	struct drm_pending_vblank_event *e, *t;
 	struct timeval now;
@@ -1285,7 +1284,8 @@ void drm_vblank_off(struct drm_device *dev, unsigned int pipe)
 	DRM_DEBUG_VBL("crtc %d, vblank enabled %d, inmodeset %d\n",
 		      pipe, vblank->enabled, vblank->inmodeset);
 
-	/* Avoid redundant vblank disables without previous drm_vblank_on(). */
+	/* Avoid redundant vblank disables without previous
+	 * drm_crtc_vblank_on(). */
 	if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset)
 		vblank_disable_and_save(dev, pipe);
 
@@ -1316,25 +1316,6 @@ void drm_vblank_off(struct drm_device *dev, unsigned int pipe)
 	}
 	spin_unlock_irqrestore(&dev->event_lock, irqflags);
 }
-EXPORT_SYMBOL(drm_vblank_off);
-
-/**
- * drm_crtc_vblank_off - disable vblank events on a CRTC
- * @crtc: CRTC in question
- *
- * Drivers can use this function to shut down the vblank interrupt handling when
- * disabling a crtc. This function ensures that the latest vblank frame count is
- * stored so that drm_vblank_on can restore it again.
- *
- * Drivers must use this function when the hardware vblank counter can get
- * reset, e.g. when suspending.
- *
- * This is the native kms version of drm_vblank_off().
- */
-void drm_crtc_vblank_off(struct drm_crtc *crtc)
-{
-	drm_vblank_off(crtc->dev, drm_crtc_index(crtc));
-}
 EXPORT_SYMBOL(drm_crtc_vblank_off);
 
 /**
@@ -1370,19 +1351,18 @@ void drm_crtc_vblank_reset(struct drm_crtc *crtc)
 EXPORT_SYMBOL(drm_crtc_vblank_reset);
 
 /**
- * drm_vblank_on - enable vblank events on a CRTC
- * @dev: DRM device
- * @pipe: CRTC index
+ * drm_crtc_vblank_on - enable vblank events on a CRTC
+ * @crtc: CRTC in question
  *
  * This functions restores the vblank interrupt state captured with
- * drm_vblank_off() again. Note that calls to drm_vblank_on() and
- * drm_vblank_off() can be unbalanced and so can also be unconditionally called
+ * drm_crtc_vblank_off() again. Note that calls to drm_crtc_vblank_on() and
+ * drm_crtc_vblank_off() can be unbalanced and so can also be unconditionally called
  * in driver load code to reflect the current hardware state of the crtc.
- *
- * This is the legacy version of drm_crtc_vblank_on().
  */
-void drm_vblank_on(struct drm_device *dev, unsigned int pipe)
+void drm_crtc_vblank_on(struct drm_crtc *crtc)
 {
+	struct drm_device *dev = crtc->dev;
+	unsigned int pipe = drm_crtc_index(crtc);
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 	unsigned long irqflags;
 
@@ -1409,23 +1389,6 @@ void drm_vblank_on(struct drm_device *dev, unsigned int pipe)
 		WARN_ON(drm_vblank_enable(dev, pipe));
 	spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
 }
-EXPORT_SYMBOL(drm_vblank_on);
-
-/**
- * drm_crtc_vblank_on - enable vblank events on a CRTC
- * @crtc: CRTC in question
- *
- * This functions restores the vblank interrupt state captured with
- * drm_vblank_off() again. Note that calls to drm_vblank_on() and
- * drm_vblank_off() can be unbalanced and so can also be unconditionally called
- * in driver load code to reflect the current hardware state of the crtc.
- *
- * This is the native kms version of drm_vblank_on().
- */
-void drm_crtc_vblank_on(struct drm_crtc *crtc)
-{
-	drm_vblank_on(crtc->dev, drm_crtc_index(crtc));
-}
 EXPORT_SYMBOL(drm_crtc_vblank_on);
 
 static void drm_legacy_vblank_pre_modeset(struct drm_device *dev,
@@ -1548,11 +1511,10 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
 	spin_lock_irqsave(&dev->event_lock, flags);
 
 	/*
-	 * drm_vblank_off() might have been called after we called
-	 * drm_vblank_get(). drm_vblank_off() holds event_lock
-	 * around the vblank disable, so no need for further locking.
-	 * The reference from drm_vblank_get() protects against
-	 * vblank disable from another source.
+	 * drm_crtc_vblank_off() might have been called after we called
+	 * drm_vblank_get(). drm_crtc_vblank_off() holds event_lock around the
+	 * vblank disable, so no need for further locking.  The reference from
+	 * drm_vblank_get() protects against vblank disable from another source.
 	 */
 	if (!vblank->enabled) {
 		ret = -EINVAL;
diff --git a/include/drm/drm_irq.h b/include/drm/drm_irq.h
index 2401b14d301f..92e59d0a5ddb 100644
--- a/include/drm/drm_irq.h
+++ b/include/drm/drm_irq.h
@@ -136,7 +136,6 @@ extern int drm_irq_uninstall(struct drm_device *dev);
 extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
 extern int drm_wait_vblank(struct drm_device *dev, void *data,
 			   struct drm_file *filp);
-extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
 extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
 extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
 					  struct timeval *vblanktime);
@@ -150,8 +149,6 @@ extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
 extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
 extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
 extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
-extern void drm_vblank_off(struct drm_device *dev, unsigned int pipe);
-extern void drm_vblank_on(struct drm_device *dev, unsigned int pipe);
 extern void drm_crtc_vblank_off(struct drm_crtc *crtc);
 extern void drm_crtc_vblank_reset(struct drm_crtc *crtc);
 extern void drm_crtc_vblank_on(struct drm_crtc *crtc);
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/6] drm: drm_irq.h header cleanup
  2016-11-14  9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
                   ` (3 preceding siblings ...)
  2016-11-14  9:02 ` [PATCH 5/6] drm/irq: Unexport drm_vblank_on/off Daniel Vetter
@ 2016-11-14  9:02 ` Daniel Vetter
  2016-11-14 15:35   ` Alex Deucher
  2016-11-14 10:02 ` [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Christian König
  5 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2016-11-14  9:02 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

- Drop extern for functions, it's noise.
- Move&consolidate drm.ko internal parts into drm-internal.h.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_internal.h |  8 +++---
 include/drm/drm_irq.h          | 60 ++++++++++++++++++++----------------------
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index abd209863ef4..1e29cbc556d5 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -24,9 +24,6 @@
 #define DRM_IF_MAJOR 1
 #define DRM_IF_MINOR 4
 
-/* drm_irq.c */
-extern unsigned int drm_timestamp_monotonic;
-
 /* drm_fops.c */
 extern struct mutex drm_global_mutex;
 void drm_lastclose(struct drm_device *dev);
@@ -52,6 +49,11 @@ int drm_clients_info(struct seq_file *m, void* data);
 int drm_gem_name_info(struct seq_file *m, void *data);
 
 /* drm_irq.c */
+extern unsigned int drm_timestamp_monotonic;
+
+/* IOCTLS */
+int drm_wait_vblank(struct drm_device *dev, void *data,
+		    struct drm_file *filp);
 int drm_control(struct drm_device *dev, void *data,
 		struct drm_file *file_priv);
 int drm_modeset_ctl(struct drm_device *dev, void *data,
diff --git a/include/drm/drm_irq.h b/include/drm/drm_irq.h
index 92e59d0a5ddb..293d08caab60 100644
--- a/include/drm/drm_irq.h
+++ b/include/drm/drm_irq.h
@@ -130,39 +130,37 @@ struct drm_vblank_crtc {
 	bool enabled;
 };
 
-extern int drm_irq_install(struct drm_device *dev, int irq);
-extern int drm_irq_uninstall(struct drm_device *dev);
+int drm_irq_install(struct drm_device *dev, int irq);
+int drm_irq_uninstall(struct drm_device *dev);
 
-extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
-extern int drm_wait_vblank(struct drm_device *dev, void *data,
-			   struct drm_file *filp);
-extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
-extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
-					  struct timeval *vblanktime);
-extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
-				       struct drm_pending_vblank_event *e);
-extern void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
-				      struct drm_pending_vblank_event *e);
-extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
-extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
-extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
-extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
-extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
-extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
-extern void drm_crtc_vblank_off(struct drm_crtc *crtc);
-extern void drm_crtc_vblank_reset(struct drm_crtc *crtc);
-extern void drm_crtc_vblank_on(struct drm_crtc *crtc);
-extern void drm_vblank_cleanup(struct drm_device *dev);
-extern u32 drm_accurate_vblank_count(struct drm_crtc *crtc);
-extern u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe);
+int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
+u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
+u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
+				   struct timeval *vblanktime);
+void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
+			       struct drm_pending_vblank_event *e);
+void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
+			      struct drm_pending_vblank_event *e);
+bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
+bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
+int drm_crtc_vblank_get(struct drm_crtc *crtc);
+void drm_crtc_vblank_put(struct drm_crtc *crtc);
+void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
+void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
+void drm_crtc_vblank_off(struct drm_crtc *crtc);
+void drm_crtc_vblank_reset(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);
 
-extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
-						 unsigned int pipe, int *max_error,
-						 struct timeval *vblank_time,
-						 unsigned flags,
-						 const struct drm_display_mode *mode);
-extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
-					    const struct drm_display_mode *mode);
+int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
+					  unsigned int pipe, int *max_error,
+					  struct timeval *vblank_time,
+					  unsigned flags,
+					  const struct drm_display_mode *mode);
+void drm_calc_timestamping_constants(struct drm_crtc *crtc,
+				     const struct drm_display_mode *mode);
 
 /**
  * drm_crtc_vblank_waitqueue - get vblank waitqueue for the CRTC
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6
  2016-11-14  9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
                   ` (4 preceding siblings ...)
  2016-11-14  9:02 ` [PATCH 6/6] drm: drm_irq.h header cleanup Daniel Vetter
@ 2016-11-14 10:02 ` Christian König
  5 siblings, 0 replies; 13+ messages in thread
From: Christian König @ 2016-11-14 10:02 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Alex Deucher, Daniel Vetter, Christian König, Ken Wang

Am 14.11.2016 um 10:02 schrieb Daniel Vetter:
> This old code pattern was reintroduced in
>
> Author: Ken Wang <Qingqing.Wang@amd.com>
> Date:   Tue Jan 19 14:03:24 2016 +0800
>
>      drm/amdgpu: add display controller implementation for si v10
>
> Realign it with later display code. Tsk, tsk for massive copypasting
> ;-)
>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Ken Wang <Qingqing.Wang@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Acked-by: Christian König <christian.koenig@amd.com> for the whole series.

Not that I'm deeply into this part of the driver, but it is clearly good 
to have a clean interface to use.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> index c1bd1beab655..bc9f2f423270 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> @@ -2040,13 +2040,13 @@ static void dce_v6_0_crtc_dpms(struct drm_crtc *crtc, int mode)
>   		type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
>   		amdgpu_irq_update(adev, &adev->crtc_irq, type);
>   		amdgpu_irq_update(adev, &adev->pageflip_irq, type);
> -		drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
> +		drm_crtc_vblank_on(crtc);
>   		dce_v6_0_crtc_load_lut(crtc);
>   		break;
>   	case DRM_MODE_DPMS_STANDBY:
>   	case DRM_MODE_DPMS_SUSPEND:
>   	case DRM_MODE_DPMS_OFF:
> -		drm_vblank_pre_modeset(dev, amdgpu_crtc->crtc_id);
> +		drm_crtc_vblank_off(crtc);
>   		if (amdgpu_crtc->enabled)
>   			amdgpu_atombios_crtc_blank(crtc, ATOM_ENABLE);
>   		amdgpu_atombios_crtc_enable(crtc, ATOM_DISABLE);


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] drm/nouveau: Use drm_crtc_vblank_off/on
  2016-11-14  9:02 ` [PATCH 2/6] drm/nouveau: Use drm_crtc_vblank_off/on Daniel Vetter
@ 2016-11-14 11:41   ` Daniel Vetter
  2016-11-15 21:59     ` Daniel Vetter
  2016-11-16  7:39     ` Ben Skeggs
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-11-14 11:41 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Ben Skeggs, Daniel Vetter

With atomic nv50+ is already converted over to them, but the old
display code is still using it. Found in a 2 year old patch I have
lying around to un-export these old helpers!

v2: Drop the hand-rolled versions from resume/suspend code. Now that
crtc callbacks do this, we don't need a special case for s/r anymore.

v3: Remove unused variables.

Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/nouveau/dispnv04/crtc.c   |  4 ++--
 drivers/gpu/drm/nouveau/nouveau_display.c | 11 +----------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
index 0cb7a18cde26..59d1d1c5de5f 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
@@ -702,7 +702,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
 	if (nv_two_heads(dev))
 		NVSetOwner(dev, nv_crtc->index);
 
-	drm_vblank_pre_modeset(dev, nv_crtc->index);
+	drm_crtc_vblank_off(crtc);
 	funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
 
 	NVBlankScreen(dev, nv_crtc->index, true);
@@ -734,7 +734,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc)
 #endif
 
 	funcs->dpms(crtc, DRM_MODE_DPMS_ON);
-	drm_vblank_post_modeset(dev, nv_crtc->index);
+	drm_crtc_vblank_on(crtc);
 }
 
 static void nv_crtc_destroy(struct drm_crtc *crtc)
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 75c90a8da18a..76c342bf047b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -380,15 +380,10 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
 	struct nouveau_display *disp = nouveau_display(dev);
 	struct nouveau_drm *drm = nouveau_drm(dev);
 	struct drm_connector *connector;
-	int head;
 
 	if (!suspend)
 		drm_crtc_force_disable_all(dev);
 
-	/* Make sure that drm and hw vblank irqs get properly disabled. */
-	for (head = 0; head < dev->mode_config.num_crtc; head++)
-		drm_vblank_off(dev, head);
-
 	/* disable flip completion events */
 	nvif_notify_put(&drm->flip);
 
@@ -723,7 +718,7 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
 	struct nouveau_display *disp = nouveau_display(dev);
 	struct nouveau_drm *drm = nouveau_drm(dev);
 	struct drm_crtc *crtc;
-	int ret, head;
+	int ret;
 
 	if (dev->mode_config.funcs->atomic_commit) {
 		nouveau_display_init(dev);
@@ -777,10 +772,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
 
 	drm_helper_resume_force_mode(dev);
 
-	/* Make sure that drm and hw vblank irqs get resumed if needed. */
-	for (head = 0; head < dev->mode_config.num_crtc; head++)
-		drm_vblank_on(dev, head);
-
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 		struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
 
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 6/6] drm: drm_irq.h header cleanup
  2016-11-14  9:02 ` [PATCH 6/6] drm: drm_irq.h header cleanup Daniel Vetter
@ 2016-11-14 15:35   ` Alex Deucher
  2016-11-15 22:02     ` Daniel Vetter
  0 siblings, 1 reply; 13+ messages in thread
From: Alex Deucher @ 2016-11-14 15:35 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

On Mon, Nov 14, 2016 at 4:02 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> - Drop extern for functions, it's noise.
> - Move&consolidate drm.ko internal parts into drm-internal.h.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/drm_internal.h |  8 +++---
>  include/drm/drm_irq.h          | 60 ++++++++++++++++++++----------------------
>  2 files changed, 34 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index abd209863ef4..1e29cbc556d5 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -24,9 +24,6 @@
>  #define DRM_IF_MAJOR 1
>  #define DRM_IF_MINOR 4
>
> -/* drm_irq.c */
> -extern unsigned int drm_timestamp_monotonic;
> -
>  /* drm_fops.c */
>  extern struct mutex drm_global_mutex;
>  void drm_lastclose(struct drm_device *dev);
> @@ -52,6 +49,11 @@ int drm_clients_info(struct seq_file *m, void* data);
>  int drm_gem_name_info(struct seq_file *m, void *data);
>
>  /* drm_irq.c */
> +extern unsigned int drm_timestamp_monotonic;
> +
> +/* IOCTLS */
> +int drm_wait_vblank(struct drm_device *dev, void *data,
> +                   struct drm_file *filp);
>  int drm_control(struct drm_device *dev, void *data,
>                 struct drm_file *file_priv);
>  int drm_modeset_ctl(struct drm_device *dev, void *data,
> diff --git a/include/drm/drm_irq.h b/include/drm/drm_irq.h
> index 92e59d0a5ddb..293d08caab60 100644
> --- a/include/drm/drm_irq.h
> +++ b/include/drm/drm_irq.h
> @@ -130,39 +130,37 @@ struct drm_vblank_crtc {
>         bool enabled;
>  };
>
> -extern int drm_irq_install(struct drm_device *dev, int irq);
> -extern int drm_irq_uninstall(struct drm_device *dev);
> +int drm_irq_install(struct drm_device *dev, int irq);
> +int drm_irq_uninstall(struct drm_device *dev);
>
> -extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> -extern int drm_wait_vblank(struct drm_device *dev, void *data,
> -                          struct drm_file *filp);
> -extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
> -extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> -                                         struct timeval *vblanktime);
> -extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
> -                                      struct drm_pending_vblank_event *e);
> -extern void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
> -                                     struct drm_pending_vblank_event *e);
> -extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
> -extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
> -extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
> -extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
> -extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
> -extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
> -extern void drm_crtc_vblank_off(struct drm_crtc *crtc);
> -extern void drm_crtc_vblank_reset(struct drm_crtc *crtc);
> -extern void drm_crtc_vblank_on(struct drm_crtc *crtc);
> -extern void drm_vblank_cleanup(struct drm_device *dev);
> -extern u32 drm_accurate_vblank_count(struct drm_crtc *crtc);
> -extern u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe);
> +int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> +u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
> +u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> +                                  struct timeval *vblanktime);
> +void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
> +                              struct drm_pending_vblank_event *e);
> +void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
> +                             struct drm_pending_vblank_event *e);
> +bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
> +bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
> +int drm_crtc_vblank_get(struct drm_crtc *crtc);
> +void drm_crtc_vblank_put(struct drm_crtc *crtc);
> +void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
> +void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
> +void drm_crtc_vblank_off(struct drm_crtc *crtc);
> +void drm_crtc_vblank_reset(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);
>
> -extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
> -                                                unsigned int pipe, int *max_error,
> -                                                struct timeval *vblank_time,
> -                                                unsigned flags,
> -                                                const struct drm_display_mode *mode);
> -extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
> -                                           const struct drm_display_mode *mode);
> +int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
> +                                         unsigned int pipe, int *max_error,
> +                                         struct timeval *vblank_time,
> +                                         unsigned flags,
> +                                         const struct drm_display_mode *mode);
> +void drm_calc_timestamping_constants(struct drm_crtc *crtc,
> +                                    const struct drm_display_mode *mode);
>
>  /**
>   * drm_crtc_vblank_waitqueue - get vblank waitqueue for the CRTC
> --
> 2.10.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/6] drm/irq: Unexport drm_vblank_count
  2016-11-14  9:02 ` [PATCH 4/6] drm/irq: Unexport drm_vblank_count Daniel Vetter
@ 2016-11-14 17:51   ` Philipp Zabel
  0 siblings, 0 replies; 13+ messages in thread
From: Philipp Zabel @ 2016-11-14 17:51 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

Am Montag, den 14.11.2016, 10:02 +0100 schrieb Daniel Vetter:
> No one outside of drm_irq.c should ever need this. The correct way to
> implement get_vblank_count for hw lacking a vblank counter is
> drm_vblank_no_hw_counter. Fix this up in mtk, which is the only
> offender left over.
> 
> Cc: CK Hu <ck.hu@mediatek.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

> ---
>  drivers/gpu/drm/drm_irq.c              | 37 +++++++++-------------------------
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c |  2 +-
>  2 files changed, 11 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 2fb5861b04b7..1681e919b866 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -234,6 +234,16 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
>  	store_vblank(dev, pipe, diff, &t_vblank, cur_vblank);
>  }
>  
> +static u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> +{
> +	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> +
> +	if (WARN_ON(pipe >= dev->num_crtcs))
> +		return 0;
> +
> +	return vblank->count;
> +}
> +
>  /**
>   * drm_accurate_vblank_count - retrieve the master vblank counter
>   * @crtc: which counter to retrieve
> @@ -888,31 +898,6 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
>  }
>  
>  /**
> - * drm_vblank_count - retrieve "cooked" vblank counter value
> - * @dev: DRM device
> - * @pipe: index of CRTC for which to retrieve the counter
> - *
> - * Fetches the "cooked" vblank count value that represents the number of
> - * vblank events since the system was booted, including lost events due to
> - * modesetting activity.
> - *
> - * This is the legacy version of drm_crtc_vblank_count().
> - *
> - * Returns:
> - * The software vblank counter.
> - */
> -u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> -{
> -	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> -
> -	if (WARN_ON(pipe >= dev->num_crtcs))
> -		return 0;
> -
> -	return vblank->count;
> -}
> -EXPORT_SYMBOL(drm_vblank_count);
> -
> -/**
>   * drm_crtc_vblank_count - retrieve "cooked" vblank counter value
>   * @crtc: which counter to retrieve
>   *
> @@ -920,8 +905,6 @@ EXPORT_SYMBOL(drm_vblank_count);
>   * vblank events since the system was booted, including lost events due to
>   * modesetting activity.
>   *
> - * This is the native KMS version of drm_vblank_count().
> - *
>   * Returns:
>   * The software vblank counter.
>   */
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index d90152e85ed0..4b7fe7eaec01 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -256,7 +256,7 @@ static struct drm_driver mtk_drm_driver = {
>  	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
>  			   DRIVER_ATOMIC,
>  
> -	.get_vblank_counter = drm_vblank_count,
> +	.get_vblank_counter = drm_vblank_no_hw_counter,
>  	.enable_vblank = mtk_drm_crtc_enable_vblank,
>  	.disable_vblank = mtk_drm_crtc_disable_vblank,
>  


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: Use drm_crtc_vblank_off/on
  2016-11-14 11:41   ` [PATCH] " Daniel Vetter
@ 2016-11-15 21:59     ` Daniel Vetter
  2016-11-16  7:39     ` Ben Skeggs
  1 sibling, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-11-15 21:59 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Ben Skeggs, Daniel Vetter

On Mon, Nov 14, 2016 at 12:41:01PM +0100, Daniel Vetter wrote:
> With atomic nv50+ is already converted over to them, but the old
> display code is still using it. Found in a 2 year old patch I have
> lying around to un-export these old helpers!
> 
> v2: Drop the hand-rolled versions from resume/suspend code. Now that
> crtc callbacks do this, we don't need a special case for s/r anymore.
> 
> v3: Remove unused variables.
> 
> Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/nouveau/dispnv04/crtc.c   |  4 ++--
>  drivers/gpu/drm/nouveau/nouveau_display.c | 11 +----------
>  2 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
> index 0cb7a18cde26..59d1d1c5de5f 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
> @@ -702,7 +702,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
>  	if (nv_two_heads(dev))
>  		NVSetOwner(dev, nv_crtc->index);
>  
> -	drm_vblank_pre_modeset(dev, nv_crtc->index);
> +	drm_crtc_vblank_off(crtc);
>  	funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
>  
>  	NVBlankScreen(dev, nv_crtc->index, true);
> @@ -734,7 +734,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc)
>  #endif
>  
>  	funcs->dpms(crtc, DRM_MODE_DPMS_ON);
> -	drm_vblank_post_modeset(dev, nv_crtc->index);
> +	drm_crtc_vblank_on(crtc);
>  }
>  
>  static void nv_crtc_destroy(struct drm_crtc *crtc)
> diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
> index 75c90a8da18a..76c342bf047b 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_display.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_display.c
> @@ -380,15 +380,10 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
>  	struct nouveau_display *disp = nouveau_display(dev);
>  	struct nouveau_drm *drm = nouveau_drm(dev);
>  	struct drm_connector *connector;
> -	int head;
>  
>  	if (!suspend)
>  		drm_crtc_force_disable_all(dev);
>  
> -	/* Make sure that drm and hw vblank irqs get properly disabled. */
> -	for (head = 0; head < dev->mode_config.num_crtc; head++)
> -		drm_vblank_off(dev, head);
> -

compared with the pre-atomic-rebase patch and realized we still need this
part for pre-nv50, since we don't force-disable all the crtc on suspend.
Atomic otoh does that, so should be all good. With that change it again
matches a patch Mario tested (except for nv50), so figured it should be
safe and applied it to drm-misc.
-Daniel

>  	/* disable flip completion events */
>  	nvif_notify_put(&drm->flip);
>  
> @@ -723,7 +718,7 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
>  	struct nouveau_display *disp = nouveau_display(dev);
>  	struct nouveau_drm *drm = nouveau_drm(dev);
>  	struct drm_crtc *crtc;
> -	int ret, head;
> +	int ret;
>  
>  	if (dev->mode_config.funcs->atomic_commit) {
>  		nouveau_display_init(dev);
> @@ -777,10 +772,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
>  
>  	drm_helper_resume_force_mode(dev);
>  
> -	/* Make sure that drm and hw vblank irqs get resumed if needed. */
> -	for (head = 0; head < dev->mode_config.num_crtc; head++)
> -		drm_vblank_on(dev, head);
> -
>  	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
>  		struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
>  
> -- 
> 2.10.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 6/6] drm: drm_irq.h header cleanup
  2016-11-14 15:35   ` Alex Deucher
@ 2016-11-15 22:02     ` Daniel Vetter
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-11-15 22:02 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Daniel Vetter, DRI Development, Daniel Vetter

On Mon, Nov 14, 2016 at 10:35:23AM -0500, Alex Deucher wrote:
> On Mon, Nov 14, 2016 at 4:02 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > - Drop extern for functions, it's noise.
> > - Move&consolidate drm.ko internal parts into drm-internal.h.
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> 
> For the series:
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Thanks for the review, entire series applied to drm-misc.
-Daniel

> 
> > ---
> >  drivers/gpu/drm/drm_internal.h |  8 +++---
> >  include/drm/drm_irq.h          | 60 ++++++++++++++++++++----------------------
> >  2 files changed, 34 insertions(+), 34 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> > index abd209863ef4..1e29cbc556d5 100644
> > --- a/drivers/gpu/drm/drm_internal.h
> > +++ b/drivers/gpu/drm/drm_internal.h
> > @@ -24,9 +24,6 @@
> >  #define DRM_IF_MAJOR 1
> >  #define DRM_IF_MINOR 4
> >
> > -/* drm_irq.c */
> > -extern unsigned int drm_timestamp_monotonic;
> > -
> >  /* drm_fops.c */
> >  extern struct mutex drm_global_mutex;
> >  void drm_lastclose(struct drm_device *dev);
> > @@ -52,6 +49,11 @@ int drm_clients_info(struct seq_file *m, void* data);
> >  int drm_gem_name_info(struct seq_file *m, void *data);
> >
> >  /* drm_irq.c */
> > +extern unsigned int drm_timestamp_monotonic;
> > +
> > +/* IOCTLS */
> > +int drm_wait_vblank(struct drm_device *dev, void *data,
> > +                   struct drm_file *filp);
> >  int drm_control(struct drm_device *dev, void *data,
> >                 struct drm_file *file_priv);
> >  int drm_modeset_ctl(struct drm_device *dev, void *data,
> > diff --git a/include/drm/drm_irq.h b/include/drm/drm_irq.h
> > index 92e59d0a5ddb..293d08caab60 100644
> > --- a/include/drm/drm_irq.h
> > +++ b/include/drm/drm_irq.h
> > @@ -130,39 +130,37 @@ struct drm_vblank_crtc {
> >         bool enabled;
> >  };
> >
> > -extern int drm_irq_install(struct drm_device *dev, int irq);
> > -extern int drm_irq_uninstall(struct drm_device *dev);
> > +int drm_irq_install(struct drm_device *dev, int irq);
> > +int drm_irq_uninstall(struct drm_device *dev);
> >
> > -extern int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> > -extern int drm_wait_vblank(struct drm_device *dev, void *data,
> > -                          struct drm_file *filp);
> > -extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
> > -extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> > -                                         struct timeval *vblanktime);
> > -extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
> > -                                      struct drm_pending_vblank_event *e);
> > -extern void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
> > -                                     struct drm_pending_vblank_event *e);
> > -extern bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
> > -extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
> > -extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
> > -extern void drm_crtc_vblank_put(struct drm_crtc *crtc);
> > -extern void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
> > -extern void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
> > -extern void drm_crtc_vblank_off(struct drm_crtc *crtc);
> > -extern void drm_crtc_vblank_reset(struct drm_crtc *crtc);
> > -extern void drm_crtc_vblank_on(struct drm_crtc *crtc);
> > -extern void drm_vblank_cleanup(struct drm_device *dev);
> > -extern u32 drm_accurate_vblank_count(struct drm_crtc *crtc);
> > -extern u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe);
> > +int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
> > +u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
> > +u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> > +                                  struct timeval *vblanktime);
> > +void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
> > +                              struct drm_pending_vblank_event *e);
> > +void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
> > +                             struct drm_pending_vblank_event *e);
> > +bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
> > +bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
> > +int drm_crtc_vblank_get(struct drm_crtc *crtc);
> > +void drm_crtc_vblank_put(struct drm_crtc *crtc);
> > +void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe);
> > +void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);
> > +void drm_crtc_vblank_off(struct drm_crtc *crtc);
> > +void drm_crtc_vblank_reset(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);
> >
> > -extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
> > -                                                unsigned int pipe, int *max_error,
> > -                                                struct timeval *vblank_time,
> > -                                                unsigned flags,
> > -                                                const struct drm_display_mode *mode);
> > -extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
> > -                                           const struct drm_display_mode *mode);
> > +int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
> > +                                         unsigned int pipe, int *max_error,
> > +                                         struct timeval *vblank_time,
> > +                                         unsigned flags,
> > +                                         const struct drm_display_mode *mode);
> > +void drm_calc_timestamping_constants(struct drm_crtc *crtc,
> > +                                    const struct drm_display_mode *mode);
> >
> >  /**
> >   * drm_crtc_vblank_waitqueue - get vblank waitqueue for the CRTC
> > --
> > 2.10.2
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: Use drm_crtc_vblank_off/on
  2016-11-14 11:41   ` [PATCH] " Daniel Vetter
  2016-11-15 21:59     ` Daniel Vetter
@ 2016-11-16  7:39     ` Ben Skeggs
  1 sibling, 0 replies; 13+ messages in thread
From: Ben Skeggs @ 2016-11-16  7:39 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 3236 bytes --]

On 11/14/2016 09:41 PM, Daniel Vetter wrote:
> With atomic nv50+ is already converted over to them, but the old
> display code is still using it. Found in a 2 year old patch I have
> lying around to un-export these old helpers!
> 
> v2: Drop the hand-rolled versions from resume/suspend code. Now that
> crtc callbacks do this, we don't need a special case for s/r anymore.
> 
> v3: Remove unused variables.
> 
> Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>

> ---
>  drivers/gpu/drm/nouveau/dispnv04/crtc.c   |  4 ++--
>  drivers/gpu/drm/nouveau/nouveau_display.c | 11 +----------
>  2 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
> index 0cb7a18cde26..59d1d1c5de5f 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
> @@ -702,7 +702,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
>  	if (nv_two_heads(dev))
>  		NVSetOwner(dev, nv_crtc->index);
>  
> -	drm_vblank_pre_modeset(dev, nv_crtc->index);
> +	drm_crtc_vblank_off(crtc);
>  	funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
>  
>  	NVBlankScreen(dev, nv_crtc->index, true);
> @@ -734,7 +734,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc)
>  #endif
>  
>  	funcs->dpms(crtc, DRM_MODE_DPMS_ON);
> -	drm_vblank_post_modeset(dev, nv_crtc->index);
> +	drm_crtc_vblank_on(crtc);
>  }
>  
>  static void nv_crtc_destroy(struct drm_crtc *crtc)
> diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
> index 75c90a8da18a..76c342bf047b 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_display.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_display.c
> @@ -380,15 +380,10 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
>  	struct nouveau_display *disp = nouveau_display(dev);
>  	struct nouveau_drm *drm = nouveau_drm(dev);
>  	struct drm_connector *connector;
> -	int head;
>  
>  	if (!suspend)
>  		drm_crtc_force_disable_all(dev);
>  
> -	/* Make sure that drm and hw vblank irqs get properly disabled. */
> -	for (head = 0; head < dev->mode_config.num_crtc; head++)
> -		drm_vblank_off(dev, head);
> -
>  	/* disable flip completion events */
>  	nvif_notify_put(&drm->flip);
>  
> @@ -723,7 +718,7 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
>  	struct nouveau_display *disp = nouveau_display(dev);
>  	struct nouveau_drm *drm = nouveau_drm(dev);
>  	struct drm_crtc *crtc;
> -	int ret, head;
> +	int ret;
>  
>  	if (dev->mode_config.funcs->atomic_commit) {
>  		nouveau_display_init(dev);
> @@ -777,10 +772,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
>  
>  	drm_helper_resume_force_mode(dev);
>  
> -	/* Make sure that drm and hw vblank irqs get resumed if needed. */
> -	for (head = 0; head < dev->mode_config.num_crtc; head++)
> -		drm_vblank_on(dev, head);
> -
>  	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
>  		struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
>  
> 


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-11-16  7:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14  9:02 [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Daniel Vetter
2016-11-14  9:02 ` [PATCH 2/6] drm/nouveau: Use drm_crtc_vblank_off/on Daniel Vetter
2016-11-14 11:41   ` [PATCH] " Daniel Vetter
2016-11-15 21:59     ` Daniel Vetter
2016-11-16  7:39     ` Ben Skeggs
2016-11-14  9:02 ` [PATCH 3/6] drm/irq: Make drm_vblank_pre/post_modeset internal Daniel Vetter
2016-11-14  9:02 ` [PATCH 4/6] drm/irq: Unexport drm_vblank_count Daniel Vetter
2016-11-14 17:51   ` Philipp Zabel
2016-11-14  9:02 ` [PATCH 5/6] drm/irq: Unexport drm_vblank_on/off Daniel Vetter
2016-11-14  9:02 ` [PATCH 6/6] drm: drm_irq.h header cleanup Daniel Vetter
2016-11-14 15:35   ` Alex Deucher
2016-11-15 22:02     ` Daniel Vetter
2016-11-14 10:02 ` [PATCH 1/6] drm/amdgpu: Use drm_crtc_vblank_on/off for dce6 Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).