Skip to contentSkip to conversation

drm: fix drm_update_vblank_count for software vblank counter

PATCH In review Vincent Abriou 2 participants 2 messages Sep 30, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: fix drm_update_vblank_count for software vblank counter

Drivers with software vblank counter relies on the on drm core to update vblank counter and they should not be concern about the warning that check hardware counter coherency.

Further, the generic message that tracks the current and last counter values must be counter type (hardware or software) agnostic.

Cc Ville Syrj�l� <[email protected]>
---
 drivers/gpu/drm/drm_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_irq.c +4 -3
index 88fbee4..88041b4 100644
@@ -219,11 +219,12 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
 	} else {
 		/* some kind of default for drivers w/o accurate vbl timestamping */
 		diff = (flags & DRM_CALLED_FROM_VBLIRQ) != 0;
+		if (diff == 0)
+			return;
 	}
 
-	DRM_DEBUG("updating vblank count on crtc %u:"
-		  " current=%u, diff=%u, hw=%u hw_last=%u\n",
-		  pipe, vblank->count, diff, cur_vblank, vblank->last);
+	DRM_DEBUG("updating vblank count on crtc %u: diff=%u cur=%u last=%u\n",
+		  pipe, diff, cur_vblank, vblank->last);
 
 	if (diff == 0) {
 		WARN_ON_ONCE(cur_vblank != vblank->last);
Signature · 1 line
1.9.1

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

#1 lore raw
Quoted 9 lines · Vincent Abriou

Drivers with software vblank counter relies on the on drm core to update vblank counter and they should not be concern about the warning that check hardware counter coherency.

Further, the generic message that tracks the current and last counter values must be counter type (hardware or software) agnostic.

I sent a patch to get rid of the drm_vblank_count() abuse in all drivers. That will get rid of the WARN too.

Quoted 26 lines
---
 drivers/gpu/drm/drm_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_irq.c +4 -3
index 88fbee4..88041b4 100644
@@ -219,11 +219,12 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
 	} else {
 		/* some kind of default for drivers w/o accurate vbl timestamping */
 		diff = (flags & DRM_CALLED_FROM_VBLIRQ) != 0;
+		if (diff == 0)
+			return;
 	}
 
-	DRM_DEBUG("updating vblank count on crtc %u:"
-		  " current=%u, diff=%u, hw=%u hw_last=%u\n",
-		  pipe, vblank->count, diff, cur_vblank, vblank->last);
+	DRM_DEBUG("updating vblank count on crtc %u: diff=%u cur=%u last=%u\n",
+		  pipe, diff, cur_vblank, vblank->last);
 
 	if (diff == 0) {
 		WARN_ON_ONCE(cur_vblank != vblank->last);
Signature · 1 line
1.9.1
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel