* [PATCH v2 01/25] drm/vblank: Unexport drm_wait_one_vblank()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 02/25] drm/vblank: remove drm_wait_one_vblank() completely Jani Nikula
` (25 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
From: Thomas Zimmermann <tzimmermann@suse.de>
Make drm_wait_on_vblank() static. The function is an internal interface
and not invoked directly by drivers.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 14 +-------------
include/drm/drm_vblank.h | 1 -
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 32d013c5c8fc..c15d6d9d0082 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1286,18 +1286,7 @@ void drm_crtc_vblank_put(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_vblank_put);
-/**
- * drm_wait_one_vblank - wait for one vblank
- * @dev: DRM device
- * @pipe: CRTC index
- *
- * This waits for one vblank to pass on @pipe, using the irq driver interfaces.
- * It is a failure to call this when the vblank irq for @pipe is disabled, e.g.
- * due to lack of driver support or because the crtc is off.
- *
- * This is the legacy version of drm_crtc_wait_one_vblank().
- */
-void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
+static void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
{
struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
int ret;
@@ -1321,7 +1310,6 @@ void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
drm_vblank_put(dev, pipe);
}
-EXPORT_SYMBOL(drm_wait_one_vblank);
/**
* drm_crtc_wait_one_vblank - wait for one vblank
diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h
index ffa564d79638..94ee09b48895 100644
--- a/include/drm/drm_vblank.h
+++ b/include/drm/drm_vblank.h
@@ -302,7 +302,6 @@ 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);
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 02/25] drm/vblank: remove drm_wait_one_vblank() completely
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
2025-12-04 10:57 ` [PATCH v2 01/25] drm/vblank: Unexport drm_wait_one_vblank() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 03/25] drm/vblank: remove superfluous pipe check Jani Nikula
` (24 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
There's really no need for the extra static function at all.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index c15d6d9d0082..1d12836e3d80 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1286,8 +1286,18 @@ void drm_crtc_vblank_put(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_vblank_put);
-static void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
+/**
+ * drm_crtc_wait_one_vblank - wait for one vblank
+ * @crtc: DRM crtc
+ *
+ * This waits for one vblank to pass on @crtc, using the irq driver interfaces.
+ * It is a failure to call this when the vblank irq for @crtc is disabled, e.g.
+ * due to lack of driver support or because the crtc is off.
+ */
+void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
{
+ struct drm_device *dev = crtc->dev;
+ int pipe = drm_crtc_index(crtc);
struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
int ret;
u64 last;
@@ -1310,19 +1320,6 @@ static void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe)
drm_vblank_put(dev, pipe);
}
-
-/**
- * drm_crtc_wait_one_vblank - wait for one vblank
- * @crtc: DRM crtc
- *
- * This waits for one vblank to pass on @crtc, using the irq driver interfaces.
- * It is a failure to call this when the vblank irq for @crtc is disabled, e.g.
- * due to lack of driver support or because the crtc is off.
- */
-void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
-{
- drm_wait_one_vblank(crtc->dev, drm_crtc_index(crtc));
-}
EXPORT_SYMBOL(drm_crtc_wait_one_vblank);
/**
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 03/25] drm/vblank: remove superfluous pipe check
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
2025-12-04 10:57 ` [PATCH v2 01/25] drm/vblank: Unexport drm_wait_one_vblank() Jani Nikula
2025-12-04 10:57 ` [PATCH v2 02/25] drm/vblank: remove drm_wait_one_vblank() completely Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 04/25] drm/vblank: add return value to drm_crtc_wait_one_vblank() Jani Nikula
` (23 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Now that the pipe is crtc->pipe, there's no need to check it's within
range.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 1d12836e3d80..f4d1fe182a4d 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1302,9 +1302,6 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
int ret;
u64 last;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return;
-
ret = drm_vblank_get(dev, pipe);
if (drm_WARN(dev, ret, "vblank not available on crtc %i, ret=%i\n",
pipe, ret))
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 04/25] drm/vblank: add return value to drm_crtc_wait_one_vblank()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (2 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 03/25] drm/vblank: remove superfluous pipe check Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 05/25] drm/vblank: limit vblank variable scope to atomic Jani Nikula
` (22 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Let drivers deal with the vblank wait failures if they so desire. If the
current warning backtrace gets toned down to a simple warning message,
the drivers may wish to add the backtrace themselves.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 8 ++++++--
include/drm/drm_vblank.h | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index f4d1fe182a4d..503eb23d38d2 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1293,8 +1293,10 @@ EXPORT_SYMBOL(drm_crtc_vblank_put);
* This waits for one vblank to pass on @crtc, using the irq driver interfaces.
* It is a failure to call this when the vblank irq for @crtc is disabled, e.g.
* due to lack of driver support or because the crtc is off.
+ *
+ * Returns: 0 on success, negative error on failures.
*/
-void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
+int drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
int pipe = drm_crtc_index(crtc);
@@ -1305,7 +1307,7 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
ret = drm_vblank_get(dev, pipe);
if (drm_WARN(dev, ret, "vblank not available on crtc %i, ret=%i\n",
pipe, ret))
- return;
+ return ret;
last = drm_vblank_count(dev, pipe);
@@ -1316,6 +1318,8 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
drm_WARN(dev, ret == 0, "vblank wait timed out on crtc %i\n", pipe);
drm_vblank_put(dev, pipe);
+
+ return ret ? 0 : -ETIMEDOUT;
}
EXPORT_SYMBOL(drm_crtc_wait_one_vblank);
diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h
index 94ee09b48895..2fcef9c0f5b1 100644
--- a/include/drm/drm_vblank.h
+++ b/include/drm/drm_vblank.h
@@ -302,7 +302,7 @@ 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_crtc_wait_one_vblank(struct drm_crtc *crtc);
+int 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_config(struct drm_crtc *crtc,
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 05/25] drm/vblank: limit vblank variable scope to atomic
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (3 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 04/25] drm/vblank: add return value to drm_crtc_wait_one_vblank() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 06/25] drm/vblank: use the drm_vblank_crtc() and drm_crtc_vblank_crtc() helpers more Jani Nikula
` (21 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
In drm_crtc_vblank_helper_get_vblank_timestamp_internal(), we only need
the vblank variable for atomic modesetting. Limit the scope to make
upcoming changes easier.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 503eb23d38d2..91e63177daaf 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -710,7 +710,6 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
{
struct drm_device *dev = crtc->dev;
unsigned int pipe = crtc->index;
- struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
struct timespec64 ts_etime, ts_vblank_time;
ktime_t stime, etime;
bool vbl_status;
@@ -729,10 +728,13 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
return false;
}
- if (drm_drv_uses_atomic_modeset(dev))
+ if (drm_drv_uses_atomic_modeset(dev)) {
+ struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
+
mode = &vblank->hwmode;
- else
+ } else {
mode = &crtc->hwmode;
+ }
/* If mode timing undefined, just return as no-op:
* Happens during initial modesetting of a crtc.
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 06/25] drm/vblank: use the drm_vblank_crtc() and drm_crtc_vblank_crtc() helpers more
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (4 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 05/25] drm/vblank: limit vblank variable scope to atomic Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 07/25] drm/vblank: prefer drm_crtc_vblank_crtc() over drm_vblank_crtc() Jani Nikula
` (20 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
We have the helpers to avoid open coding dev->vblank[pipe] access.
v2: Rebase
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 91e63177daaf..a86561c4b999 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -551,7 +551,7 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs)
dev->num_crtcs = num_crtcs;
for (i = 0; i < num_crtcs; i++) {
- struct drm_vblank_crtc *vblank = &dev->vblank[i];
+ struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, i);
vblank->dev = dev;
vblank->pipe = i;
@@ -605,7 +605,9 @@ EXPORT_SYMBOL(drm_dev_has_vblank);
*/
wait_queue_head_t *drm_crtc_vblank_waitqueue(struct drm_crtc *crtc)
{
- return &crtc->dev->vblank[drm_crtc_index(crtc)].queue;
+ struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
+
+ return &vblank->queue;
}
EXPORT_SYMBOL(drm_crtc_vblank_waitqueue);
@@ -729,7 +731,7 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
}
if (drm_drv_uses_atomic_modeset(dev)) {
- struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
+ struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
mode = &vblank->hwmode;
} else {
@@ -1784,7 +1786,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (pipe >= dev->num_crtcs)
return -EINVAL;
- vblank = &dev->vblank[pipe];
+ vblank = drm_vblank_crtc(dev, pipe);
/* If the counter is currently enabled and accurate, short-circuit
* queries to return the cached timestamp of the last vblank.
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 07/25] drm/vblank: prefer drm_crtc_vblank_crtc() over drm_vblank_crtc()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (5 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 06/25] drm/vblank: use the drm_vblank_crtc() and drm_crtc_vblank_crtc() helpers more Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 08/25] drm/vblank: pass vlank to drm_vblank_get()/_put()/_count() Jani Nikula
` (19 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the higher level function where crtc is available.
v2: Rebase
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index a86561c4b999..498fc91450e6 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -731,7 +731,7 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
}
if (drm_drv_uses_atomic_modeset(dev)) {
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
mode = &vblank->hwmode;
} else {
@@ -1304,7 +1304,7 @@ int drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
int pipe = drm_crtc_index(crtc);
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
int ret;
u64 last;
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 08/25] drm/vblank: pass vlank to drm_vblank_get()/_put()/_count()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (6 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 07/25] drm/vblank: prefer drm_crtc_vblank_crtc() over drm_vblank_crtc() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 09/25] drm/vblank: pass vblank to drm_update_vblank_count() Jani Nikula
` (18 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Pass struct drm_vblank_crtc * to drm_vblank_get(), drm_vblank_put(), and
drm_vblank_count(). They'll figure out the vblank pointer as the first
thing anyway, so it's handy to pass it when available. We can also rely
on vblank having a valid pipe, and can reduce the number of checks we
do.
Rename the functions to drm_vblank_crtc_*() naming. Directly convert the
call sites that already have the vblank pointer available.
v2: Use drm_vblank_crtc_* naming (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_internal.h | 6 +--
drivers/gpu/drm/drm_vblank.c | 69 +++++++++++++++++++------------
drivers/gpu/drm/drm_vblank_work.c | 12 +++---
3 files changed, 51 insertions(+), 36 deletions(-)
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index f893b1e3a596..6e7ac5b16d92 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -112,9 +112,9 @@ static inline bool drm_vblank_passed(u64 seq, u64 ref)
}
void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe);
-int drm_vblank_get(struct drm_device *dev, unsigned int pipe);
-void drm_vblank_put(struct drm_device *dev, unsigned int pipe);
-u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
+int drm_vblank_crtc_get(struct drm_vblank_crtc *vblank);
+void drm_vblank_crtc_put(struct drm_vblank_crtc *vblank);
+u64 drm_vblank_crtc_count(struct drm_vblank_crtc *vblank);
/* drm_vblank_work.c */
static inline void drm_vblank_flush_worker(struct drm_vblank_crtc *vblank)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 498fc91450e6..aeb931c825ca 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -384,14 +384,10 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
store_vblank(dev, pipe, diff, t_vblank, cur_vblank);
}
-u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
+u64 drm_vblank_crtc_count(struct drm_vblank_crtc *vblank)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
u64 count;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return 0;
-
count = atomic64_read(&vblank->count);
/*
@@ -406,6 +402,14 @@ u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
return count;
}
+static u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
+{
+ if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
+ return 0;
+
+ return drm_vblank_crtc_count(drm_vblank_crtc(dev, pipe));
+}
+
/**
* drm_crtc_accurate_vblank_count - retrieve the master vblank counter
* @crtc: which counter to retrieve
@@ -1210,18 +1214,16 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
return ret;
}
-int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
+int drm_vblank_crtc_get(struct drm_vblank_crtc *vblank)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_device *dev = vblank->dev;
+ int pipe = vblank->pipe;
unsigned long irqflags;
int ret = 0;
if (!drm_dev_has_vblank(dev))
return -EINVAL;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return -EINVAL;
-
spin_lock_irqsave(&dev->vbl_lock, irqflags);
/* Going from 0->1 means we have to enable interrupts again */
if (atomic_add_return(1, &vblank->refcount) == 1) {
@@ -1237,6 +1239,14 @@ int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
return ret;
}
+static int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
+{
+ if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
+ return -EINVAL;
+
+ return drm_vblank_crtc_get(drm_vblank_crtc(dev, pipe));
+}
+
/**
* drm_crtc_vblank_get - get a reference count on vblank events
* @crtc: which CRTC to own
@@ -1253,14 +1263,11 @@ int drm_crtc_vblank_get(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_vblank_get);
-void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
+void drm_vblank_crtc_put(struct drm_vblank_crtc *vblank)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_device *dev = vblank->dev;
int vblank_offdelay = vblank->config.offdelay_ms;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return;
-
if (drm_WARN_ON(dev, atomic_read(&vblank->refcount) == 0))
return;
@@ -1276,6 +1283,14 @@ void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
}
}
+static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
+{
+ if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
+ return;
+
+ drm_vblank_crtc_put(drm_vblank_crtc(dev, pipe));
+}
+
/**
* drm_crtc_vblank_put - give up ownership of vblank events
* @crtc: which counter to give up
@@ -1308,20 +1323,20 @@ int drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
int ret;
u64 last;
- ret = drm_vblank_get(dev, pipe);
+ ret = drm_vblank_crtc_get(vblank);
if (drm_WARN(dev, ret, "vblank not available on crtc %i, ret=%i\n",
pipe, ret))
return ret;
- last = drm_vblank_count(dev, pipe);
+ last = drm_vblank_crtc_count(vblank);
ret = wait_event_timeout(vblank->queue,
- last != drm_vblank_count(dev, pipe),
+ last != drm_vblank_crtc_count(vblank),
msecs_to_jiffies(1000));
drm_WARN(dev, ret == 0, "vblank wait timed out on crtc %i\n", pipe);
- drm_vblank_put(dev, pipe);
+ drm_vblank_crtc_put(vblank);
return ret ? 0 : -ETIMEDOUT;
}
@@ -1368,7 +1383,7 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
wake_up(&vblank->queue);
/*
- * Prevent subsequent drm_vblank_get() from re-enabling
+ * Prevent subsequent drm_vblank_crtc_get() from re-enabling
* the vblank interrupt by bumping the refcount.
*/
if (!vblank->inmodeset) {
@@ -1424,7 +1439,7 @@ void drm_crtc_vblank_reset(struct drm_crtc *crtc)
spin_lock_irq(&dev->vbl_lock);
/*
- * Prevent subsequent drm_vblank_get() from enabling the vblank
+ * Prevent subsequent drm_vblank_crtc_get() from enabling the vblank
* interrupt by bumping the refcount.
*/
if (!vblank->inmodeset) {
@@ -1497,7 +1512,7 @@ void drm_crtc_vblank_on_config(struct drm_crtc *crtc,
vblank->config = *config;
- /* Drop our private "prevent drm_vblank_get" refcount */
+ /* Drop our private "prevent drm_vblank_crtc_get" refcount */
if (vblank->inmodeset) {
atomic_dec(&vblank->refcount);
vblank->inmodeset = 0;
@@ -1639,9 +1654,9 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
/*
* drm_crtc_vblank_off() might have been called after we called
- * drm_vblank_get(). drm_crtc_vblank_off() holds event_lock around the
+ * drm_vblank_crtc_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.
+ * drm_vblank_crtc_get() protects against vblank disable from another source.
*/
if (!READ_ONCE(vblank->enabled)) {
ret = -EINVAL;
@@ -1667,7 +1682,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
send_vblank_event(dev, e, seq, now);
vblwait->reply.sequence = seq;
} else {
- /* drm_handle_vblank_events will call drm_vblank_put */
+ /* drm_handle_vblank_events will call drm_vblank_crtc_put */
list_add_tail(&e->base.link, &dev->vblank_event_list);
vblwait->reply.sequence = req_seq;
}
@@ -1830,7 +1845,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (flags & _DRM_VBLANK_EVENT) {
/* must hold on to the vblank ref until the event fires
- * drm_vblank_put will be called asynchronously
+ * drm_vblank_crtc_put will be called asynchronously
*/
return drm_queue_vblank_event(dev, pipe, req_seq, vblwait, file_priv);
}
@@ -2148,7 +2163,7 @@ int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data,
send_vblank_event(dev, e, seq, now);
queue_seq->sequence = seq;
} else {
- /* drm_handle_vblank_events will call drm_vblank_put */
+ /* drm_handle_vblank_events will call drm_vblank_crtc_put */
list_add_tail(&e->base.link, &dev->vblank_event_list);
queue_seq->sequence = req_seq;
}
diff --git a/drivers/gpu/drm/drm_vblank_work.c b/drivers/gpu/drm/drm_vblank_work.c
index 70f0199251ea..52158f85c855 100644
--- a/drivers/gpu/drm/drm_vblank_work.c
+++ b/drivers/gpu/drm/drm_vblank_work.c
@@ -58,7 +58,7 @@ void drm_handle_vblank_works(struct drm_vblank_crtc *vblank)
continue;
list_del_init(&work->node);
- drm_vblank_put(vblank->dev, vblank->pipe);
+ drm_vblank_crtc_put(vblank);
kthread_queue_work(vblank->worker, &work->base);
wake = true;
}
@@ -80,7 +80,7 @@ void drm_vblank_cancel_pending_works(struct drm_vblank_crtc *vblank)
list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
list_del_init(&work->node);
- drm_vblank_put(vblank->dev, vblank->pipe);
+ drm_vblank_crtc_put(vblank);
}
wake_up_all(&vblank->work_wait_queue);
@@ -129,7 +129,7 @@ int drm_vblank_work_schedule(struct drm_vblank_work *work,
goto out;
if (list_empty(&work->node)) {
- ret = drm_vblank_get(dev, vblank->pipe);
+ ret = drm_vblank_crtc_get(vblank);
if (ret < 0)
goto out;
} else if (work->count == count) {
@@ -140,7 +140,7 @@ int drm_vblank_work_schedule(struct drm_vblank_work *work,
}
work->count = count;
- cur_vbl = drm_vblank_count(dev, vblank->pipe);
+ cur_vbl = drm_vblank_crtc_count(vblank);
passed = drm_vblank_passed(cur_vbl, count);
if (passed)
drm_dbg_core(dev,
@@ -148,7 +148,7 @@ int drm_vblank_work_schedule(struct drm_vblank_work *work,
vblank->pipe, count, cur_vbl);
if (!nextonmiss && passed) {
- drm_vblank_put(dev, vblank->pipe);
+ drm_vblank_crtc_put(vblank);
ret = kthread_queue_work(vblank->worker, &work->base);
if (rescheduling) {
@@ -193,7 +193,7 @@ bool drm_vblank_work_cancel_sync(struct drm_vblank_work *work)
spin_lock_irq(&dev->event_lock);
if (!list_empty(&work->node)) {
list_del_init(&work->node);
- drm_vblank_put(vblank->dev, vblank->pipe);
+ drm_vblank_crtc_put(vblank);
ret = true;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 09/25] drm/vblank: pass vblank to drm_update_vblank_count()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (7 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 08/25] drm/vblank: pass vlank to drm_vblank_get()/_put()/_count() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 10/25] drm/vblank: pass vblank to drm_handle_vblank_events() Jani Nikula
` (17 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_update_count().
v2: Rename the function (Thomas)
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> # v1
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index aeb931c825ca..da8ca8928232 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -292,10 +292,11 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe
* Note: caller must hold &drm_device.vbl_lock since this reads & writes
* device vblank fields.
*/
-static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
- bool in_vblank_irq)
+static void drm_vblank_crtc_update_count(struct drm_vblank_crtc *vblank,
+ bool in_vblank_irq)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_device *dev = vblank->dev;
+ unsigned int pipe = vblank->pipe;
u32 cur_vblank, diff;
bool rc;
ktime_t t_vblank;
@@ -424,8 +425,8 @@ static u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
u64 drm_crtc_accurate_vblank_count(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
- unsigned int pipe = drm_crtc_index(crtc);
- u64 vblank;
+ struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
+ u64 vblank_count;
unsigned long flags;
drm_WARN_ONCE(dev, drm_debug_enabled(DRM_UT_VBL) &&
@@ -434,12 +435,12 @@ u64 drm_crtc_accurate_vblank_count(struct drm_crtc *crtc)
spin_lock_irqsave(&dev->vblank_time_lock, flags);
- drm_update_vblank_count(dev, pipe, false);
- vblank = drm_vblank_count(dev, pipe);
+ drm_vblank_crtc_update_count(vblank, false);
+ vblank_count = drm_vblank_crtc_count(vblank);
spin_unlock_irqrestore(&dev->vblank_time_lock, flags);
- return vblank;
+ return vblank_count;
}
EXPORT_SYMBOL(drm_crtc_accurate_vblank_count);
@@ -490,7 +491,7 @@ void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
* this time. This makes the count account for the entire time
* between drm_crtc_vblank_on() and drm_crtc_vblank_off().
*/
- drm_update_vblank_count(dev, pipe, false);
+ drm_vblank_crtc_update_count(vblank, false);
__disable_vblank(dev, pipe);
vblank->enabled = false;
@@ -1199,11 +1200,12 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
if (ret) {
atomic_dec(&vblank->refcount);
} else {
- drm_update_vblank_count(dev, pipe, 0);
- /* drm_update_vblank_count() includes a wmb so we just
- * need to ensure that the compiler emits the write
- * to mark the vblank as enabled after the call
- * to drm_update_vblank_count().
+ drm_vblank_crtc_update_count(vblank, 0);
+ /*
+ * drm_vblank_crtc_update_count() includes a wmb so we
+ * just need to ensure that the compiler emits the write
+ * to mark the vblank as enabled after the call to
+ * drm_vblank_crtc_update_count().
*/
WRITE_ONCE(vblank->enabled, true);
}
@@ -1959,7 +1961,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
return false;
}
- drm_update_vblank_count(dev, pipe, true);
+ drm_vblank_crtc_update_count(vblank, true);
spin_unlock(&dev->vblank_time_lock);
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 10/25] drm/vblank: pass vblank to drm_handle_vblank_events()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (8 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 09/25] drm/vblank: pass vblank to drm_update_vblank_count() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 11/25] drm/vblank: use the vblank based interfaces more Jani Nikula
` (16 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_handle_events().
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index da8ca8928232..49b59af1512e 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1684,7 +1684,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
send_vblank_event(dev, e, seq, now);
vblwait->reply.sequence = seq;
} else {
- /* drm_handle_vblank_events will call drm_vblank_crtc_put */
+ /* drm_vblank_crtc_handle_events will call drm_vblank_crtc_put */
list_add_tail(&e->base.link, &dev->vblank_event_list);
vblwait->reply.sequence = req_seq;
}
@@ -1892,8 +1892,10 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
return ret;
}
-static void drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe)
+static void drm_vblank_crtc_handle_events(struct drm_vblank_crtc *vblank)
{
+ struct drm_device *dev = vblank->dev;
+ unsigned int pipe = vblank->pipe;
struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
bool high_prec = false;
struct drm_pending_vblank_event *e, *t;
@@ -1914,7 +1916,7 @@ static void drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe)
e->sequence, seq);
list_del(&e->base.link);
- drm_vblank_put(dev, pipe);
+ drm_vblank_crtc_put(vblank);
send_vblank_event(dev, e, seq, now);
}
@@ -1970,13 +1972,13 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
/* With instant-off, we defer disabling the interrupt until after
* we finish processing the following vblank after all events have
* been signaled. The disable has to be last (after
- * drm_handle_vblank_events) so that the timestamp is always accurate.
+ * drm_vblank_crtc_handle_events) so that the timestamp is always accurate.
*/
disable_irq = (vblank->config.disable_immediate &&
vblank->config.offdelay_ms > 0 &&
!atomic_read(&vblank->refcount));
- drm_handle_vblank_events(dev, pipe);
+ drm_vblank_crtc_handle_events(vblank);
drm_handle_vblank_works(vblank);
spin_unlock_irqrestore(&dev->event_lock, irqflags);
@@ -2165,7 +2167,7 @@ int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data,
send_vblank_event(dev, e, seq, now);
queue_seq->sequence = seq;
} else {
- /* drm_handle_vblank_events will call drm_vblank_crtc_put */
+ /* drm_vblank_crtc_handle_events will call drm_vblank_crtc_put */
list_add_tail(&e->base.link, &dev->vblank_event_list);
queue_seq->sequence = req_seq;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 11/25] drm/vblank: use the vblank based interfaces more
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (9 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 10/25] drm/vblank: pass vblank to drm_handle_vblank_events() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 12/25] drm/vblank: pass vblank to drm_queue_vblank_event() Jani Nikula
` (15 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
With the prep work in place, we can get rid of _drm_vblank_get(),
_drm_vblank_put(), and _drm_vblank_count().
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 44 ++++++++----------------------------
1 file changed, 10 insertions(+), 34 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 49b59af1512e..d0460cd5d345 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -403,14 +403,6 @@ u64 drm_vblank_crtc_count(struct drm_vblank_crtc *vblank)
return count;
}
-static u64 drm_vblank_count(struct drm_device *dev, unsigned int pipe)
-{
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return 0;
-
- return drm_vblank_crtc_count(drm_vblank_crtc(dev, pipe));
-}
-
/**
* drm_crtc_accurate_vblank_count - retrieve the master vblank counter
* @crtc: which counter to retrieve
@@ -942,7 +934,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
*/
u64 drm_crtc_vblank_count(struct drm_crtc *crtc)
{
- return drm_vblank_count(crtc->dev, drm_crtc_index(crtc));
+ return drm_vblank_crtc_count(drm_crtc_vblank_crtc(crtc));
}
EXPORT_SYMBOL(drm_crtc_vblank_count);
@@ -1241,14 +1233,6 @@ int drm_vblank_crtc_get(struct drm_vblank_crtc *vblank)
return ret;
}
-static int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
-{
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return -EINVAL;
-
- return drm_vblank_crtc_get(drm_vblank_crtc(dev, pipe));
-}
-
/**
* drm_crtc_vblank_get - get a reference count on vblank events
* @crtc: which CRTC to own
@@ -1261,7 +1245,7 @@ static int drm_vblank_get(struct drm_device *dev, unsigned int pipe)
*/
int drm_crtc_vblank_get(struct drm_crtc *crtc)
{
- return drm_vblank_get(crtc->dev, drm_crtc_index(crtc));
+ return drm_vblank_crtc_get(drm_crtc_vblank_crtc(crtc));
}
EXPORT_SYMBOL(drm_crtc_vblank_get);
@@ -1285,14 +1269,6 @@ void drm_vblank_crtc_put(struct drm_vblank_crtc *vblank)
}
}
-static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
-{
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return;
-
- drm_vblank_crtc_put(drm_vblank_crtc(dev, pipe));
-}
-
/**
* drm_crtc_vblank_put - give up ownership of vblank events
* @crtc: which counter to give up
@@ -1303,7 +1279,7 @@ static void drm_vblank_put(struct drm_device *dev, unsigned int pipe)
*/
void drm_crtc_vblank_put(struct drm_crtc *crtc)
{
- drm_vblank_put(crtc->dev, drm_crtc_index(crtc));
+ drm_vblank_crtc_put(drm_crtc_vblank_crtc(crtc));
}
EXPORT_SYMBOL(drm_crtc_vblank_put);
@@ -1404,7 +1380,7 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
"wanted %llu, current %llu\n",
e->sequence, seq);
list_del(&e->base.link);
- drm_vblank_put(dev, pipe);
+ drm_vblank_crtc_put(vblank);
send_vblank_event(dev, e, seq, now);
}
@@ -1680,7 +1656,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
e->sequence = req_seq;
if (drm_vblank_passed(seq, req_seq)) {
- drm_vblank_put(dev, pipe);
+ drm_vblank_crtc_put(vblank);
send_vblank_event(dev, e, seq, now);
vblwait->reply.sequence = seq;
} else {
@@ -1697,7 +1673,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
spin_unlock_irq(&dev->event_lock);
kfree(e);
err_put:
- drm_vblank_put(dev, pipe);
+ drm_vblank_crtc_put(vblank);
return ret;
}
@@ -1815,14 +1791,14 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
return 0;
}
- ret = drm_vblank_get(dev, pipe);
+ ret = drm_vblank_crtc_get(vblank);
if (ret) {
drm_dbg_core(dev,
"crtc %d failed to acquire vblank counter, %d\n",
pipe, ret);
return ret;
}
- seq = drm_vblank_count(dev, pipe);
+ seq = drm_vblank_crtc_count(vblank);
switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) {
case _DRM_VBLANK_RELATIVE:
@@ -1858,7 +1834,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
drm_dbg_core(dev, "waiting on vblank count %llu, crtc %u\n",
req_seq, pipe);
wait = wait_event_interruptible_timeout(vblank->queue,
- drm_vblank_passed(drm_vblank_count(dev, pipe), req_seq) ||
+ drm_vblank_passed(drm_vblank_crtc_count(vblank), req_seq) ||
!READ_ONCE(vblank->enabled),
msecs_to_jiffies(3000));
@@ -1888,7 +1864,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
}
done:
- drm_vblank_put(dev, pipe);
+ drm_vblank_crtc_put(vblank);
return ret;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 12/25] drm/vblank: pass vblank to drm_queue_vblank_event()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (10 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 11/25] drm/vblank: use the vblank based interfaces more Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 13/25] drm/vblank: pass vblank to drm_wait_vblank_reply() Jani Nikula
` (14 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_queue_event().
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index d0460cd5d345..6be354415529 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1599,12 +1599,13 @@ void drm_crtc_vblank_restore(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_vblank_restore);
-static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
- u64 req_seq,
- union drm_wait_vblank *vblwait,
- struct drm_file *file_priv)
+static int drm_vblank_crtc_queue_event(struct drm_vblank_crtc *vblank,
+ u64 req_seq,
+ union drm_wait_vblank *vblwait,
+ struct drm_file *file_priv)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_device *dev = vblank->dev;
+ unsigned int pipe = vblank->pipe;
struct drm_pending_vblank_event *e;
ktime_t now;
u64 seq;
@@ -1825,7 +1826,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
/* must hold on to the vblank ref until the event fires
* drm_vblank_crtc_put will be called asynchronously
*/
- return drm_queue_vblank_event(dev, pipe, req_seq, vblwait, file_priv);
+ return drm_vblank_crtc_queue_event(vblank, req_seq, vblwait, file_priv);
}
if (req_seq != seq) {
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 13/25] drm/vblank: pass vblank to drm_wait_vblank_reply()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (11 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 12/25] drm/vblank: pass vblank to drm_queue_vblank_event() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 14/25] drm/vblank: pass vblank to drm_vblank_count_and_time() Jani Nikula
` (13 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_wait_reply().
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 6be354415529..233c60860c78 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1705,18 +1705,18 @@ static u64 widen_32_to_64(u32 narrow, u64 near)
return near + (s32) (narrow - near);
}
-static void drm_wait_vblank_reply(struct drm_device *dev, unsigned int pipe,
- struct drm_wait_vblank_reply *reply)
+static void drm_vblank_crtc_wait_reply(struct drm_vblank_crtc *vblank,
+ struct drm_wait_vblank_reply *reply)
{
ktime_t now;
struct timespec64 ts;
/*
- * drm_wait_vblank_reply is a UAPI structure that uses 'long'
+ * drm_vblank_crtc_wait_reply is a UAPI structure that uses 'long'
* to store the seconds. This is safe as we always use monotonic
* timestamps since linux-4.15.
*/
- reply->sequence = drm_vblank_count_and_time(dev, pipe, &now);
+ reply->sequence = drm_vblank_count_and_time(vblank->dev, vblank->pipe, &now);
ts = ktime_to_timespec64(now);
reply->tval_sec = (u32)ts.tv_sec;
reply->tval_usec = ts.tv_nsec / 1000;
@@ -1788,7 +1788,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (vblank->config.disable_immediate &&
drm_wait_vblank_is_query(vblwait) &&
READ_ONCE(vblank->enabled)) {
- drm_wait_vblank_reply(dev, pipe, &vblwait->reply);
+ drm_vblank_crtc_wait_reply(vblank, &vblwait->reply);
return 0;
}
@@ -1855,7 +1855,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
}
if (ret != -EINTR) {
- drm_wait_vblank_reply(dev, pipe, &vblwait->reply);
+ drm_vblank_crtc_wait_reply(vblank, &vblwait->reply);
drm_dbg_core(dev, "crtc %d returning %u to client\n",
pipe, vblwait->reply.sequence);
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 14/25] drm/vblank: pass vblank to drm_vblank_count_and_time()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (12 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 13/25] drm/vblank: pass vblank to drm_wait_vblank_reply() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-05 5:18 ` kernel test robot
2025-12-04 10:57 ` [PATCH v2 15/25] drm/vblank: pass vblank to drm_reset_vblank_timestamp() Jani Nikula
` (12 subsequent siblings)
26 siblings, 1 reply; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_count_and_time().
Drop the pipe check warning, as we can be sure vblank->pipe is within
limits.
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 38 +++++++++++++++---------------------
1 file changed, 16 insertions(+), 22 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 233c60860c78..5182dfc7b930 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -395,8 +395,8 @@ u64 drm_vblank_crtc_count(struct drm_vblank_crtc *vblank)
* This read barrier corresponds to the implicit write barrier of the
* write seqlock in store_vblank(). Note that this is the only place
* where we need an explicit barrier, since all other access goes
- * through drm_vblank_count_and_time(), which already has the required
- * read barrier curtesy of the read seqlock.
+ * through drm_vblank_crtc_count_and_time(), which already has the
+ * required read barrier curtesy of the read seqlock.
*/
smp_rmb();
@@ -939,7 +939,7 @@ u64 drm_crtc_vblank_count(struct drm_crtc *crtc)
EXPORT_SYMBOL(drm_crtc_vblank_count);
/**
- * drm_vblank_count_and_time - retrieve "cooked" vblank counter value and the
+ * drm_vblank_crtc_count_and_time - retrieve "cooked" vblank counter value and the
* system timestamp corresponding to that vblank counter value.
* @dev: DRM device
* @pipe: index of CRTC whose counter to retrieve
@@ -952,18 +952,12 @@ EXPORT_SYMBOL(drm_crtc_vblank_count);
*
* This is the legacy version of drm_crtc_vblank_count_and_time().
*/
-static u64 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
- ktime_t *vblanktime)
+static u64 drm_vblank_crtc_count_and_time(struct drm_vblank_crtc *vblank,
+ ktime_t *vblanktime)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
u64 vblank_count;
unsigned int seq;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs)) {
- *vblanktime = 0;
- return 0;
- }
-
do {
seq = read_seqbegin(&vblank->seqlock);
vblank_count = atomic64_read(&vblank->count);
@@ -995,8 +989,8 @@ static u64 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
u64 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
ktime_t *vblanktime)
{
- return drm_vblank_count_and_time(crtc->dev, drm_crtc_index(crtc),
- vblanktime);
+ return drm_vblank_crtc_count_and_time(drm_crtc_vblank_crtc(crtc),
+ vblanktime);
}
EXPORT_SYMBOL(drm_crtc_vblank_count_and_time);
@@ -1138,18 +1132,18 @@ void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
struct drm_pending_vblank_event *e)
{
struct drm_device *dev = crtc->dev;
+ struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
u64 seq;
- unsigned int pipe = drm_crtc_index(crtc);
ktime_t now;
if (drm_dev_has_vblank(dev)) {
- seq = drm_vblank_count_and_time(dev, pipe, &now);
+ seq = drm_vblank_crtc_count_and_time(vblank, &now);
} else {
seq = 0;
now = ktime_get();
}
- e->pipe = pipe;
+ e->pipe = vblank->pipe;
send_vblank_event(dev, e, seq, now);
}
EXPORT_SYMBOL(drm_crtc_send_vblank_event);
@@ -1371,7 +1365,7 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
spin_unlock(&dev->vbl_lock);
/* Send any queued vblank events, lest the natives grow disquiet */
- seq = drm_vblank_count_and_time(dev, pipe, &now);
+ seq = drm_vblank_crtc_count_and_time(vblank, &now);
list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) {
if (e->pipe != pipe)
@@ -1648,7 +1642,7 @@ static int drm_vblank_crtc_queue_event(struct drm_vblank_crtc *vblank,
if (ret)
goto err_unlock;
- seq = drm_vblank_count_and_time(dev, pipe, &now);
+ seq = drm_vblank_crtc_count_and_time(vblank, &now);
drm_dbg_core(dev, "event on vblank count %llu, current %llu, crtc %u\n",
req_seq, seq, pipe);
@@ -1716,7 +1710,7 @@ static void drm_vblank_crtc_wait_reply(struct drm_vblank_crtc *vblank,
* to store the seconds. This is safe as we always use monotonic
* timestamps since linux-4.15.
*/
- reply->sequence = drm_vblank_count_and_time(vblank->dev, vblank->pipe, &now);
+ reply->sequence = drm_vblank_crtc_count_and_time(vblank, &now);
ts = ktime_to_timespec64(now);
reply->tval_sec = (u32)ts.tv_sec;
reply->tval_usec = ts.tv_nsec / 1000;
@@ -1881,7 +1875,7 @@ static void drm_vblank_crtc_handle_events(struct drm_vblank_crtc *vblank)
assert_spin_locked(&dev->event_lock);
- seq = drm_vblank_count_and_time(dev, pipe, &now);
+ seq = drm_vblank_crtc_count_and_time(vblank, &now);
list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) {
if (e->pipe != pipe)
@@ -2043,7 +2037,7 @@ int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,
else
get_seq->active = crtc->enabled;
drm_modeset_unlock(&crtc->mutex);
- get_seq->sequence = drm_vblank_count_and_time(dev, pipe, &now);
+ get_seq->sequence = drm_vblank_crtc_count_and_time(vblank, &now);
get_seq->sequence_ns = ktime_to_ns(now);
if (!vblank_enabled)
drm_crtc_vblank_put(crtc);
@@ -2104,7 +2098,7 @@ int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data,
goto err_free;
}
- seq = drm_vblank_count_and_time(dev, pipe, &now);
+ seq = drm_vblank_crtc_count_and_time(vblank, &now);
req_seq = queue_seq->sequence;
if (flags & DRM_CRTC_SEQUENCE_RELATIVE)
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* Re: [PATCH v2 14/25] drm/vblank: pass vblank to drm_vblank_count_and_time()
2025-12-04 10:57 ` [PATCH v2 14/25] drm/vblank: pass vblank to drm_vblank_count_and_time() Jani Nikula
@ 2025-12-05 5:18 ` kernel test robot
0 siblings, 0 replies; 34+ messages in thread
From: kernel test robot @ 2025-12-05 5:18 UTC (permalink / raw)
To: Jani Nikula, intel-gfx, intel-xe
Cc: llvm, oe-kbuild-all, tzimmermann, ville.syrjala, Jani Nikula
Hi Jani,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on drm-i915/for-linux-next drm-tip/drm-tip linus/master next-20251204]
[cannot apply to drm-i915/for-linux-next-fixes v6.18]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-vblank-Unexport-drm_wait_one_vblank/20251204-195701
base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
patch link: https://lore.kernel.org/r/2d2d9b12117be566ac63b9e67b79e50de4924ecc.1764845757.git.jani.nikula%40intel.com
patch subject: [PATCH v2 14/25] drm/vblank: pass vblank to drm_vblank_count_and_time()
config: i386-buildonly-randconfig-002-20251205 (https://download.01.org/0day-ci/archive/20251205/202512051216.oxayTqRt-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251205/202512051216.oxayTqRt-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512051216.oxayTqRt-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> Warning: drivers/gpu/drm/drm_vblank.c:956 function parameter 'vblank' not described in 'drm_vblank_crtc_count_and_time'
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v2 15/25] drm/vblank: pass vblank to drm_reset_vblank_timestamp()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (13 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 14/25] drm/vblank: pass vblank to drm_vblank_count_and_time() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 16/25] drm/vblank: pass vblank to store_vblank() Jani Nikula
` (11 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_reset_timestamp().
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 5182dfc7b930..ed4a589c408f 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -245,8 +245,10 @@ static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
* Note: caller must hold &drm_device.vbl_lock since this reads & writes
* device vblank fields.
*/
-static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe)
+static void drm_vblank_crtc_reset_timestamp(struct drm_vblank_crtc *vblank)
{
+ struct drm_device *dev = vblank->dev;
+ unsigned int pipe = vblank->pipe;
u32 cur_vblank;
bool rc;
ktime_t t_vblank;
@@ -1490,7 +1492,7 @@ void drm_crtc_vblank_on_config(struct drm_crtc *crtc,
vblank->inmodeset = 0;
}
- drm_reset_vblank_timestamp(dev, pipe);
+ drm_vblank_crtc_reset_timestamp(vblank);
/*
* re-enable interrupts if there are users left, or the
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 16/25] drm/vblank: pass vblank to store_vblank()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (14 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 15/25] drm/vblank: pass vblank to drm_reset_vblank_timestamp() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 17/25] drm/vblank: pass vblank to drm_vblank_enable() Jani Nikula
` (10 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_store().
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index ed4a589c408f..81224946df9d 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -188,11 +188,11 @@ drm_crtc_vblank_crtc(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_vblank_crtc);
-static void store_vblank(struct drm_device *dev, unsigned int pipe,
- u32 vblank_count_inc,
- ktime_t t_vblank, u32 last)
+static void drm_vblank_crtc_store(struct drm_vblank_crtc *vblank,
+ u32 vblank_count_inc,
+ ktime_t t_vblank, u32 last)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_device *dev = vblank->dev;
assert_spin_locked(&dev->vblank_time_lock);
@@ -277,7 +277,7 @@ static void drm_vblank_crtc_reset_timestamp(struct drm_vblank_crtc *vblank)
* +1 to make sure user will never see the same
* vblank counter value before and after a modeset
*/
- store_vblank(dev, pipe, 1, t_vblank, cur_vblank);
+ drm_vblank_crtc_store(vblank, 1, t_vblank, cur_vblank);
spin_unlock(&dev->vblank_time_lock);
}
@@ -384,7 +384,7 @@ static void drm_vblank_crtc_update_count(struct drm_vblank_crtc *vblank,
if (!rc && !in_vblank_irq)
t_vblank = 0;
- store_vblank(dev, pipe, diff, t_vblank, cur_vblank);
+ drm_vblank_crtc_store(vblank, diff, t_vblank, cur_vblank);
}
u64 drm_vblank_crtc_count(struct drm_vblank_crtc *vblank)
@@ -395,8 +395,8 @@ u64 drm_vblank_crtc_count(struct drm_vblank_crtc *vblank)
/*
* This read barrier corresponds to the implicit write barrier of the
- * write seqlock in store_vblank(). Note that this is the only place
- * where we need an explicit barrier, since all other access goes
+ * write seqlock in drm_vblank_crtc_store(). Note that this is the only
+ * place where we need an explicit barrier, since all other access goes
* through drm_vblank_crtc_count_and_time(), which already has the
* required read barrier curtesy of the read seqlock.
*/
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 17/25] drm/vblank: pass vblank to drm_vblank_enable()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (15 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 16/25] drm/vblank: pass vblank to store_vblank() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 18/25] drm/vblank: merge drm_vblank_restore() into drm_crtc_vblank_restore() Jani Nikula
` (9 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify code.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 81224946df9d..e4c8af7fb5db 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1165,9 +1165,10 @@ static int __enable_vblank(struct drm_device *dev, unsigned int pipe)
return -EINVAL;
}
-static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
+static int drm_vblank_enable(struct drm_vblank_crtc *vblank)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_device *dev = vblank->dev;
+ unsigned int pipe = vblank->pipe;
int ret = 0;
assert_spin_locked(&dev->vbl_lock);
@@ -1207,7 +1208,6 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
int drm_vblank_crtc_get(struct drm_vblank_crtc *vblank)
{
struct drm_device *dev = vblank->dev;
- int pipe = vblank->pipe;
unsigned long irqflags;
int ret = 0;
@@ -1217,7 +1217,7 @@ int drm_vblank_crtc_get(struct drm_vblank_crtc *vblank)
spin_lock_irqsave(&dev->vbl_lock, irqflags);
/* Going from 0->1 means we have to enable interrupts again */
if (atomic_add_return(1, &vblank->refcount) == 1) {
- ret = drm_vblank_enable(dev, pipe);
+ ret = drm_vblank_enable(vblank);
} else {
if (!vblank->enabled) {
atomic_dec(&vblank->refcount);
@@ -1499,7 +1499,7 @@ void drm_crtc_vblank_on_config(struct drm_crtc *crtc,
* user wishes vblank interrupts to be enabled all the time.
*/
if (atomic_read(&vblank->refcount) != 0 || !vblank->config.offdelay_ms)
- drm_WARN_ON(dev, drm_vblank_enable(dev, pipe));
+ drm_WARN_ON(dev, drm_vblank_enable(vblank));
spin_unlock_irq(&dev->vbl_lock);
}
EXPORT_SYMBOL(drm_crtc_vblank_on_config);
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 18/25] drm/vblank: merge drm_vblank_restore() into drm_crtc_vblank_restore()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (16 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 17/25] drm/vblank: pass vblank to drm_vblank_enable() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 19/25] drm/vblank: add drm_crtc_from_vblank() helper Jani Nikula
` (8 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
The extra function serves no useful purpose.
This allows us to drop another superfluous pipe check warning.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 57 +++++++++++++++---------------------
1 file changed, 23 insertions(+), 34 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index e4c8af7fb5db..ad44fea4ff67 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1527,23 +1527,41 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_vblank_on);
-static void drm_vblank_restore(struct drm_device *dev, unsigned int pipe)
+/**
+ * drm_crtc_vblank_restore - estimate missed vblanks and update vblank count.
+ * @crtc: CRTC in question
+ *
+ * Power manamement features can cause frame counter resets between vblank
+ * disable and enable. Drivers can use this function in their
+ * &drm_crtc_funcs.enable_vblank implementation to estimate missed vblanks since
+ * the last &drm_crtc_funcs.disable_vblank using timestamps and update the
+ * vblank counter.
+ *
+ * Note that drivers must have race-free high-precision timestamping support,
+ * i.e. &drm_crtc_funcs.get_vblank_timestamp must be hooked up and
+ * &drm_vblank_crtc_config.disable_immediate must be set to indicate the
+ * time-stamping functions are race-free against vblank hardware counter
+ * increments.
+ */
+void drm_crtc_vblank_restore(struct drm_crtc *crtc)
{
+ struct drm_device *dev = crtc->dev;
+ unsigned int pipe = drm_crtc_index(crtc);
+ struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
ktime_t t_vblank;
- struct drm_vblank_crtc *vblank;
int framedur_ns;
u64 diff_ns;
u32 cur_vblank, diff = 1;
int count = DRM_TIMESTAMP_MAXRETRIES;
u32 max_vblank_count = drm_max_vblank_count(dev, pipe);
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return;
+ drm_WARN_ON_ONCE(dev, !crtc->funcs->get_vblank_timestamp);
+ drm_WARN_ON_ONCE(dev, vblank->inmodeset);
+ drm_WARN_ON_ONCE(dev, !vblank->config.disable_immediate);
assert_spin_locked(&dev->vbl_lock);
assert_spin_locked(&dev->vblank_time_lock);
- vblank = drm_vblank_crtc(dev, pipe);
drm_WARN_ONCE(dev,
drm_debug_enabled(DRM_UT_VBL) && !vblank->framedur_ns,
"Cannot compute missed vblanks without frame duration\n");
@@ -1564,35 +1582,6 @@ static void drm_vblank_restore(struct drm_device *dev, unsigned int pipe)
diff, diff_ns, framedur_ns, cur_vblank - vblank->last);
vblank->last = (cur_vblank - diff) & max_vblank_count;
}
-
-/**
- * drm_crtc_vblank_restore - estimate missed vblanks and update vblank count.
- * @crtc: CRTC in question
- *
- * Power manamement features can cause frame counter resets between vblank
- * disable and enable. Drivers can use this function in their
- * &drm_crtc_funcs.enable_vblank implementation to estimate missed vblanks since
- * the last &drm_crtc_funcs.disable_vblank using timestamps and update the
- * vblank counter.
- *
- * Note that drivers must have race-free high-precision timestamping support,
- * i.e. &drm_crtc_funcs.get_vblank_timestamp must be hooked up and
- * &drm_vblank_crtc_config.disable_immediate must be set to indicate the
- * time-stamping functions are race-free against vblank hardware counter
- * increments.
- */
-void drm_crtc_vblank_restore(struct drm_crtc *crtc)
-{
- struct drm_device *dev = crtc->dev;
- unsigned int pipe = drm_crtc_index(crtc);
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
-
- drm_WARN_ON_ONCE(dev, !crtc->funcs->get_vblank_timestamp);
- drm_WARN_ON_ONCE(dev, vblank->inmodeset);
- drm_WARN_ON_ONCE(dev, !vblank->config.disable_immediate);
-
- drm_vblank_restore(dev, pipe);
-}
EXPORT_SYMBOL(drm_crtc_vblank_restore);
static int drm_vblank_crtc_queue_event(struct drm_vblank_crtc *vblank,
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 19/25] drm/vblank: add drm_crtc_from_vblank() helper
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (17 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 18/25] drm/vblank: merge drm_vblank_restore() into drm_crtc_vblank_restore() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 20/25] drm/vblank: pass vblank to __get_vblank_counter() and drm_max_vblank_count() Jani Nikula
` (7 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
We have a handful of places where we need to get the crtc from the
vblank. Add a small helper for it.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index ad44fea4ff67..d43165ee594a 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -188,6 +188,11 @@ drm_crtc_vblank_crtc(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_vblank_crtc);
+static struct drm_crtc *drm_crtc_from_vblank(struct drm_vblank_crtc *vblank)
+{
+ return drm_crtc_from_index(vblank->dev, vblank->pipe);
+}
+
static void drm_vblank_crtc_store(struct drm_vblank_crtc *vblank,
u32 vblank_count_inc,
ktime_t t_vblank, u32 last)
@@ -1608,7 +1613,7 @@ static int drm_vblank_crtc_queue_event(struct drm_vblank_crtc *vblank,
e->event.vbl.user_data = vblwait->request.signal;
e->event.vbl.crtc_id = 0;
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
- struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+ struct drm_crtc *crtc = drm_crtc_from_vblank(vblank);
if (crtc)
e->event.vbl.crtc_id = crtc->base.id;
@@ -1858,7 +1863,7 @@ static void drm_vblank_crtc_handle_events(struct drm_vblank_crtc *vblank)
{
struct drm_device *dev = vblank->dev;
unsigned int pipe = vblank->pipe;
- struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+ struct drm_crtc *crtc = drm_crtc_from_vblank(vblank);
bool high_prec = false;
struct drm_pending_vblank_event *e, *t;
ktime_t now;
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 20/25] drm/vblank: pass vblank to __get_vblank_counter() and drm_max_vblank_count()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (18 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 19/25] drm/vblank: add drm_crtc_from_vblank() helper Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 21/25] drm/vblank: pass vblank to __{enable, disable}_vblank() Jani Nikula
` (6 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename the functions to drm_vblank_crtc_get_counter() and
drm_vblank_crtc_max_count().
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index d43165ee594a..04c75cdbb916 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -209,27 +209,27 @@ static void drm_vblank_crtc_store(struct drm_vblank_crtc *vblank,
write_sequnlock(&vblank->seqlock);
}
-static u32 drm_max_vblank_count(struct drm_device *dev, unsigned int pipe)
+static u32 drm_vblank_crtc_max_count(struct drm_vblank_crtc *vblank)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
-
- return vblank->max_vblank_count ?: dev->max_vblank_count;
+ return vblank->max_vblank_count ?: vblank->dev->max_vblank_count;
}
/*
* "No hw counter" fallback implementation of .get_vblank_counter() hook,
* if there is no usable hardware frame counter available.
*/
-static u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe)
+static u32 drm_vblank_crtc_no_hw_counter(struct drm_vblank_crtc *vblank)
{
- drm_WARN_ON_ONCE(dev, drm_max_vblank_count(dev, pipe) != 0);
+ drm_WARN_ON_ONCE(vblank->dev, drm_vblank_crtc_max_count(vblank) != 0);
return 0;
}
-static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
+static u32 drm_vblank_crtc_get_counter(struct drm_vblank_crtc *vblank)
{
+ struct drm_device *dev = vblank->dev;
+
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
- struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+ struct drm_crtc *crtc = drm_crtc_from_vblank(vblank);
if (drm_WARN_ON(dev, !crtc))
return 0;
@@ -238,7 +238,7 @@ static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
return crtc->funcs->get_vblank_counter(crtc);
}
- return drm_vblank_no_hw_counter(dev, pipe);
+ return drm_vblank_crtc_no_hw_counter(vblank);
}
/*
@@ -266,9 +266,9 @@ static void drm_vblank_crtc_reset_timestamp(struct drm_vblank_crtc *vblank)
* when drm_vblank_enable() applies the diff
*/
do {
- cur_vblank = __get_vblank_counter(dev, pipe);
+ cur_vblank = drm_vblank_crtc_get_counter(vblank);
rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, false);
- } while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0);
+ } while (cur_vblank != drm_vblank_crtc_get_counter(vblank) && --count > 0);
/*
* Only reinitialize corresponding vblank timestamp if high-precision query
@@ -309,7 +309,7 @@ static void drm_vblank_crtc_update_count(struct drm_vblank_crtc *vblank,
ktime_t t_vblank;
int count = DRM_TIMESTAMP_MAXRETRIES;
int framedur_ns = vblank->framedur_ns;
- u32 max_vblank_count = drm_max_vblank_count(dev, pipe);
+ u32 max_vblank_count = drm_vblank_crtc_max_count(vblank);
/*
* Interrupts were disabled prior to this call, so deal with counter
@@ -324,9 +324,9 @@ static void drm_vblank_crtc_update_count(struct drm_vblank_crtc *vblank,
* corresponding vblank timestamp.
*/
do {
- cur_vblank = __get_vblank_counter(dev, pipe);
+ cur_vblank = drm_vblank_crtc_get_counter(vblank);
rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, in_vblank_irq);
- } while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0);
+ } while (cur_vblank != drm_vblank_crtc_get_counter(vblank) && --count > 0);
if (max_vblank_count) {
/* trust the hw counter when it's around */
@@ -1558,7 +1558,7 @@ void drm_crtc_vblank_restore(struct drm_crtc *crtc)
u64 diff_ns;
u32 cur_vblank, diff = 1;
int count = DRM_TIMESTAMP_MAXRETRIES;
- u32 max_vblank_count = drm_max_vblank_count(dev, pipe);
+ u32 max_vblank_count = drm_vblank_crtc_max_count(vblank);
drm_WARN_ON_ONCE(dev, !crtc->funcs->get_vblank_timestamp);
drm_WARN_ON_ONCE(dev, vblank->inmodeset);
@@ -1573,9 +1573,9 @@ void drm_crtc_vblank_restore(struct drm_crtc *crtc)
framedur_ns = vblank->framedur_ns;
do {
- cur_vblank = __get_vblank_counter(dev, pipe);
+ cur_vblank = drm_vblank_crtc_get_counter(vblank);
drm_get_last_vbltimestamp(dev, pipe, &t_vblank, false);
- } while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0);
+ } while (cur_vblank != drm_vblank_crtc_get_counter(vblank) && --count > 0);
diff_ns = ktime_to_ns(ktime_sub(t_vblank, vblank->time));
if (framedur_ns)
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 21/25] drm/vblank: pass vblank to __{enable, disable}_vblank()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (19 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 20/25] drm/vblank: pass vblank to __get_vblank_counter() and drm_max_vblank_count() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 22/25] drm/vblank: pass vblank to drm_get_last_vbltimestamp() Jani Nikula
` (5 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify code.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 04c75cdbb916..52fa4ca361e3 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -443,10 +443,12 @@ u64 drm_crtc_accurate_vblank_count(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_accurate_vblank_count);
-static void __disable_vblank(struct drm_device *dev, unsigned int pipe)
+static void __disable_vblank(struct drm_vblank_crtc *vblank)
{
+ struct drm_device *dev = vblank->dev;
+
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
- struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+ struct drm_crtc *crtc = drm_crtc_from_vblank(vblank);
if (drm_WARN_ON(dev, !crtc))
return;
@@ -491,7 +493,7 @@ void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
* between drm_crtc_vblank_on() and drm_crtc_vblank_off().
*/
drm_vblank_crtc_update_count(vblank, false);
- __disable_vblank(dev, pipe);
+ __disable_vblank(vblank);
vblank->enabled = false;
out:
@@ -1155,10 +1157,12 @@ 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)
+static int __enable_vblank(struct drm_vblank_crtc *vblank)
{
+ struct drm_device *dev = vblank->dev;
+
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
- struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+ struct drm_crtc *crtc = drm_crtc_from_vblank(vblank);
if (drm_WARN_ON(dev, !crtc))
return 0;
@@ -1188,7 +1192,7 @@ static int drm_vblank_enable(struct drm_vblank_crtc *vblank)
* timestamps. Filtercode in drm_handle_vblank() will
* prevent double-accounting of same vblank interval.
*/
- ret = __enable_vblank(dev, pipe);
+ ret = __enable_vblank(vblank);
drm_dbg_core(dev, "enabling vblank on crtc %u, ret: %d\n",
pipe, ret);
if (ret) {
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 22/25] drm/vblank: pass vblank to drm_get_last_vbltimestamp()
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (20 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 21/25] drm/vblank: pass vblank to __{enable, disable}_vblank() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 23/25] drm/vblank: pass vblank to drm_vblank_disable_and_save(), make static Jani Nikula
` (4 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_get_last_timestamp().
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 52fa4ca361e3..4a88cdea086d 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -162,9 +162,8 @@
*/
#define DRM_REDUNDANT_VBLIRQ_THRESH_NS 1000000
-static bool
-drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
- ktime_t *tvblank, bool in_vblank_irq);
+static bool drm_vblank_crtc_get_last_timestamp(struct drm_vblank_crtc *vblank,
+ ktime_t *tvblank, bool in_vblank_irq);
static unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */
@@ -253,7 +252,6 @@ static u32 drm_vblank_crtc_get_counter(struct drm_vblank_crtc *vblank)
static void drm_vblank_crtc_reset_timestamp(struct drm_vblank_crtc *vblank)
{
struct drm_device *dev = vblank->dev;
- unsigned int pipe = vblank->pipe;
u32 cur_vblank;
bool rc;
ktime_t t_vblank;
@@ -267,7 +265,7 @@ static void drm_vblank_crtc_reset_timestamp(struct drm_vblank_crtc *vblank)
*/
do {
cur_vblank = drm_vblank_crtc_get_counter(vblank);
- rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, false);
+ rc = drm_vblank_crtc_get_last_timestamp(vblank, &t_vblank, false);
} while (cur_vblank != drm_vblank_crtc_get_counter(vblank) && --count > 0);
/*
@@ -325,7 +323,7 @@ static void drm_vblank_crtc_update_count(struct drm_vblank_crtc *vblank,
*/
do {
cur_vblank = drm_vblank_crtc_get_counter(vblank);
- rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, in_vblank_irq);
+ rc = drm_vblank_crtc_get_last_timestamp(vblank, &t_vblank, in_vblank_irq);
} while (cur_vblank != drm_vblank_crtc_get_counter(vblank) && --count > 0);
if (max_vblank_count) {
@@ -911,11 +909,10 @@ drm_crtc_get_last_vbltimestamp(struct drm_crtc *crtc, ktime_t *tvblank,
return ret;
}
-static bool
-drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
- ktime_t *tvblank, bool in_vblank_irq)
+static bool drm_vblank_crtc_get_last_timestamp(struct drm_vblank_crtc *vblank,
+ ktime_t *tvblank, bool in_vblank_irq)
{
- struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+ struct drm_crtc *crtc = drm_crtc_from_vblank(vblank);
return drm_crtc_get_last_vbltimestamp(crtc, tvblank, in_vblank_irq);
}
@@ -1555,7 +1552,6 @@ EXPORT_SYMBOL(drm_crtc_vblank_on);
void drm_crtc_vblank_restore(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
- unsigned int pipe = drm_crtc_index(crtc);
struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
ktime_t t_vblank;
int framedur_ns;
@@ -1578,7 +1574,7 @@ void drm_crtc_vblank_restore(struct drm_crtc *crtc)
do {
cur_vblank = drm_vblank_crtc_get_counter(vblank);
- drm_get_last_vbltimestamp(dev, pipe, &t_vblank, false);
+ drm_vblank_crtc_get_last_timestamp(vblank, &t_vblank, false);
} while (cur_vblank != drm_vblank_crtc_get_counter(vblank) && --count > 0);
diff_ns = ktime_to_ns(ktime_sub(t_vblank, vblank->time));
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 23/25] drm/vblank: pass vblank to drm_vblank_disable_and_save(), make static
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (21 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 22/25] drm/vblank: pass vblank to drm_get_last_vbltimestamp() Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 24/25] drm/vblank: reduce pipe checks Jani Nikula
` (3 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the vblank pointer instead of a dev, pipe pair to simplify
code. Rename to drm_vblank_crtc_disable_and_save().
drm_vblank_disable_and_save() is also no longer used outside of
drm_vblank.c; make it static while at it.
v2: Rename (Thomas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_internal.h | 1 -
drivers/gpu/drm/drm_vblank.c | 8 ++++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index 6e7ac5b16d92..4458221685f7 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -111,7 +111,6 @@ static inline bool drm_vblank_passed(u64 seq, u64 ref)
return (seq - ref) <= (1 << 23);
}
-void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe);
int drm_vblank_crtc_get(struct drm_vblank_crtc *vblank);
void drm_vblank_crtc_put(struct drm_vblank_crtc *vblank);
u64 drm_vblank_crtc_count(struct drm_vblank_crtc *vblank);
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 4a88cdea086d..445b62b8b661 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -462,9 +462,9 @@ static void __disable_vblank(struct drm_vblank_crtc *vblank)
* are preserved, even if there are any spurious vblank irq's after
* disable.
*/
-void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
+static void drm_vblank_crtc_disable_and_save(struct drm_vblank_crtc *vblank)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_device *dev = vblank->dev;
unsigned long irqflags;
assert_spin_locked(&dev->vbl_lock);
@@ -509,7 +509,7 @@ static void vblank_disable_fn(struct timer_list *t)
spin_lock_irqsave(&dev->vbl_lock, irqflags);
if (atomic_read(&vblank->refcount) == 0 && vblank->enabled) {
drm_dbg_core(dev, "disabling vblank on crtc %u\n", pipe);
- drm_vblank_disable_and_save(dev, pipe);
+ drm_vblank_crtc_disable_and_save(vblank);
}
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
}
@@ -1358,7 +1358,7 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
/* Avoid redundant vblank disables without previous
* drm_crtc_vblank_on(). */
if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset)
- drm_vblank_disable_and_save(dev, pipe);
+ drm_vblank_crtc_disable_and_save(vblank);
wake_up(&vblank->queue);
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 24/25] drm/vblank: reduce pipe checks
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (22 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 23/25] drm/vblank: pass vblank to drm_vblank_disable_and_save(), make static Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 10:57 ` [PATCH v2 25/25] drm/vblank: clean up debug logging Jani Nikula
` (2 subsequent siblings)
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Now that drm_vblank_crtc() is the only place that indexes dev->vblank[],
and its usage has reduced considerably, add the primary pipe
out-of-bounds check there, and return NULL. Expect callers to check it
and act accordingly.
In drm_crtc_vblank_crtc(), warn and return NULL, and let it go boom. If
the crtc->pipe is out of bounds, it's a driver error that needs to be
fixed.
Remove superfluous pipe checks all around.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 445b62b8b661..ba16981a5b1e 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -177,13 +177,22 @@ MODULE_PARM_DESC(timestamp_precision_usec, "Max. error on timestamps [usecs]");
static struct drm_vblank_crtc *
drm_vblank_crtc(struct drm_device *dev, unsigned int pipe)
{
+ if (pipe >= dev->num_crtcs)
+ return NULL;
+
return &dev->vblank[pipe];
}
struct drm_vblank_crtc *
drm_crtc_vblank_crtc(struct drm_crtc *crtc)
{
- return drm_vblank_crtc(crtc->dev, drm_crtc_index(crtc));
+ struct drm_vblank_crtc *vblank;
+
+ vblank = drm_vblank_crtc(crtc->dev, drm_crtc_index(crtc));
+ if (drm_WARN_ON(crtc->dev, !vblank))
+ return NULL;
+
+ return vblank;
}
EXPORT_SYMBOL(drm_crtc_vblank_crtc);
@@ -631,7 +640,6 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
const struct drm_display_mode *mode)
{
struct drm_device *dev = crtc->dev;
- unsigned int pipe = drm_crtc_index(crtc);
struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
int linedur_ns = 0, framedur_ns = 0;
int dotclock = mode->crtc_clock;
@@ -639,9 +647,6 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
if (!drm_dev_has_vblank(dev))
return;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return;
-
/* Valid dotclock? */
if (dotclock > 0) {
int frame_size = mode->crtc_htotal * mode->crtc_vtotal;
@@ -723,11 +728,6 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
int vpos, hpos, i;
int delta_ns, duration_ns;
- if (pipe >= dev->num_crtcs) {
- drm_err(dev, "Invalid crtc %u\n", pipe);
- return false;
- }
-
/* Scanout position query not supported? Should not happen. */
if (!get_scanout_position) {
drm_err(dev, "Called from CRTC w/o get_scanout_position()!?\n");
@@ -1342,9 +1342,6 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
ktime_t now;
u64 seq;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return;
-
/*
* Grab event_lock early to prevent vblank work from being scheduled
* while we're in the middle of shutting down vblank interrupts
@@ -1483,9 +1480,6 @@ void drm_crtc_vblank_on_config(struct drm_crtc *crtc,
unsigned int pipe = drm_crtc_index(crtc);
struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
- return;
-
spin_lock_irq(&dev->vbl_lock);
drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n",
pipe, vblank->enabled, vblank->inmodeset);
@@ -1767,10 +1761,9 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
pipe = pipe_index;
}
- if (pipe >= dev->num_crtcs)
- return -EINVAL;
-
vblank = drm_vblank_crtc(dev, pipe);
+ if (!vblank)
+ return -EINVAL;
/* If the counter is currently enabled and accurate, short-circuit
* queries to return the cached timestamp of the last vblank.
@@ -1905,14 +1898,15 @@ static void drm_vblank_crtc_handle_events(struct drm_vblank_crtc *vblank)
*/
bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
{
- struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
+ struct drm_vblank_crtc *vblank;
unsigned long irqflags;
bool disable_irq;
if (drm_WARN_ON_ONCE(dev, !drm_dev_has_vblank(dev)))
return false;
- if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
+ vblank = drm_vblank_crtc(dev, pipe);
+ if (drm_WARN_ON(dev, !vblank))
return false;
spin_lock_irqsave(&dev->event_lock, irqflags);
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* [PATCH v2 25/25] drm/vblank: clean up debug logging
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (23 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 24/25] drm/vblank: reduce pipe checks Jani Nikula
@ 2025-12-04 10:57 ` Jani Nikula
2025-12-04 12:46 ` [PATCH v2 00/25] drm/vblank: refactoring and cleanups Thomas Zimmermann
2025-12-04 13:55 ` ✗ CI.KUnit: failure for drm/vblank: refactoring and cleanups (rev2) Patchwork
26 siblings, 0 replies; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 10:57 UTC (permalink / raw)
To: intel-gfx, intel-xe; +Cc: tzimmermann, ville.syrjala, Jani Nikula
Use the usual [CRTC:%d:%s] when crtc is available. Start using a new
uniform [VBLANK:%u] prefix with the pipe when crtc is not
available. Remove extra line breaks. Use string choice helpers here and
there. Use %pe to decode error returns.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_vblank.c | 109 ++++++++++++++++-------------------
1 file changed, 50 insertions(+), 59 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index ba16981a5b1e..653ee422e697 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -27,6 +27,7 @@
#include <linux/export.h>
#include <linux/kthread.h>
#include <linux/moduleparam.h>
+#include <linux/string_choices.h>
#include <drm/drm_crtc.h>
#include <drm/drm_drv.h>
@@ -347,14 +348,13 @@ static void drm_vblank_crtc_update_count(struct drm_vblank_crtc *vblank,
* frame/field duration.
*/
- drm_dbg_vbl(dev, "crtc %u: Calculating number of vblanks."
- " diff_ns = %lld, framedur_ns = %d)\n",
+ drm_dbg_vbl(dev, "[VBLANK:%u] Calculating number of vblanks. diff_ns = %lld, framedur_ns = %d)\n",
pipe, (long long)diff_ns, framedur_ns);
diff = DIV_ROUND_CLOSEST_ULL(diff_ns, framedur_ns);
if (diff == 0 && in_vblank_irq)
- drm_dbg_vbl(dev, "crtc %u: Redundant vblirq ignored\n",
+ drm_dbg_vbl(dev, "[VBLANK:%u] Redundant vblirq ignored\n",
pipe);
} else {
/* some kind of default for drivers w/o accurate vbl timestamping */
@@ -372,13 +372,12 @@ static void drm_vblank_crtc_update_count(struct drm_vblank_crtc *vblank,
*/
if (diff > 1 && (vblank->inmodeset & 0x2)) {
drm_dbg_vbl(dev,
- "clamping vblank bump to 1 on crtc %u: diffr=%u"
- " due to pre-modeset.\n", pipe, diff);
+ "[VBLANK:%u] clamping vblank bump to 1: diffr=%u due to pre-modeset.\n",
+ pipe, diff);
diff = 1;
}
- drm_dbg_vbl(dev, "updating vblank count on crtc %u:"
- " current=%llu, diff=%u, hw=%u hw_last=%u\n",
+ drm_dbg_vbl(dev, "[VBLANK:%u] updating vblank count: current=%llu, diff=%u, hw=%u hw_last=%u\n",
pipe, (unsigned long long)atomic64_read(&vblank->count),
diff, cur_vblank, vblank->last);
@@ -517,7 +516,7 @@ static void vblank_disable_fn(struct timer_list *t)
spin_lock_irqsave(&dev->vbl_lock, irqflags);
if (atomic_read(&vblank->refcount) == 0 && vblank->enabled) {
- drm_dbg_core(dev, "disabling vblank on crtc %u\n", pipe);
+ drm_dbg_core(dev, "[VBLANK:%u] disabling vblank\n", pipe);
drm_vblank_crtc_disable_and_save(vblank);
}
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
@@ -665,8 +664,8 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
framedur_ns /= 2;
} else {
- drm_err(dev, "crtc %u: Can't calculate constants, dotclock = 0!\n",
- crtc->base.id);
+ drm_err(dev, "[CRTC:%d:%s] Can't calculate constants, dotclock = 0!\n",
+ crtc->base.id, crtc->name);
}
vblank->linedur_ns = linedur_ns;
@@ -674,11 +673,11 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
drm_mode_copy(&vblank->hwmode, mode);
drm_dbg_core(dev,
- "crtc %u: hwmode: htotal %d, vtotal %d, vdisplay %d\n",
- crtc->base.id, mode->crtc_htotal,
+ "[CRTC:%d:%s] hwmode: htotal %d, vtotal %d, vdisplay %d\n",
+ crtc->base.id, crtc->name, mode->crtc_htotal,
mode->crtc_vtotal, mode->crtc_vdisplay);
- drm_dbg_core(dev, "crtc %u: clock %d kHz framedur %d linedur %d\n",
- crtc->base.id, dotclock, framedur_ns, linedur_ns);
+ drm_dbg_core(dev, "[CRTC:%d:%s] clock %d kHz framedur %d linedur %d\n",
+ crtc->base.id, crtc->name, dotclock, framedur_ns, linedur_ns);
}
EXPORT_SYMBOL(drm_calc_timestamping_constants);
@@ -730,7 +729,8 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
/* Scanout position query not supported? Should not happen. */
if (!get_scanout_position) {
- drm_err(dev, "Called from CRTC w/o get_scanout_position()!?\n");
+ drm_err(dev, "[CRTC:%d:%s] Called from CRTC w/o get_scanout_position()!?\n",
+ crtc->base.id, crtc->name);
return false;
}
@@ -746,7 +746,7 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
* Happens during initial modesetting of a crtc.
*/
if (mode->crtc_clock == 0) {
- drm_dbg_core(dev, "crtc %u: Noop due to uninitialized mode.\n",
+ drm_dbg_core(dev, "[VBLANK:%u] Noop due to uninitialized mode.\n",
pipe);
drm_WARN_ON_ONCE(dev, drm_drv_uses_atomic_modeset(dev));
return false;
@@ -771,9 +771,8 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
/* Return as no-op if scanout query unsupported or failed. */
if (!vbl_status) {
- drm_dbg_core(dev,
- "crtc %u : scanoutpos query failed.\n",
- pipe);
+ drm_dbg_core(dev, "[CRTC:%d:%s] scanoutpos query failed.\n",
+ crtc->base.id, crtc->name);
return false;
}
@@ -787,9 +786,8 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
/* Noisy system timing? */
if (i == DRM_TIMESTAMP_MAXRETRIES) {
- drm_dbg_core(dev,
- "crtc %u: Noisy timestamp %d us > %d us [%d reps].\n",
- pipe, duration_ns / 1000, *max_error / 1000, i);
+ drm_dbg_core(dev, "[CRTC:%d:%s] Noisy timestamp %d us > %d us [%d reps].\n",
+ crtc->base.id, crtc->name, duration_ns / 1000, *max_error / 1000, i);
}
/* Return upper bound of timestamp precision error. */
@@ -813,9 +811,8 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
ts_etime = ktime_to_timespec64(etime);
ts_vblank_time = ktime_to_timespec64(*vblank_time);
- drm_dbg_vbl(dev,
- "crtc %u : v p(%d,%d)@ %lld.%06ld -> %lld.%06ld [e %d us, %d rep]\n",
- pipe, hpos, vpos,
+ drm_dbg_vbl(dev, "[CRTC:%d:%s] v p(%d,%d)@ %lld.%06ld -> %lld.%06ld [e %d us, %d rep]\n",
+ crtc->base.id, crtc->name, hpos, vpos,
(u64)ts_etime.tv_sec, ts_etime.tv_nsec / 1000,
(u64)ts_vblank_time.tv_sec, ts_vblank_time.tv_nsec / 1000,
duration_ns / 1000, i);
@@ -1190,7 +1187,7 @@ static int drm_vblank_enable(struct drm_vblank_crtc *vblank)
* prevent double-accounting of same vblank interval.
*/
ret = __enable_vblank(vblank);
- drm_dbg_core(dev, "enabling vblank on crtc %u, ret: %d\n",
+ drm_dbg_core(dev, "[VBLANK:%u] enabling vblank, ret: %d\n",
pipe, ret);
if (ret) {
atomic_dec(&vblank->refcount);
@@ -1349,8 +1346,9 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
spin_lock_irq(&dev->event_lock);
spin_lock(&dev->vbl_lock);
- drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n",
- pipe, vblank->enabled, vblank->inmodeset);
+ drm_dbg_vbl(dev, "[CRTC:%d:%s] vblank %s, inmodeset: %s\n",
+ crtc->base.id, crtc->name, str_enabled_disabled(vblank->enabled),
+ str_yes_no(vblank->inmodeset));
/* Avoid redundant vblank disables without previous
* drm_crtc_vblank_on(). */
@@ -1375,9 +1373,8 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) {
if (e->pipe != pipe)
continue;
- drm_dbg_core(dev, "Sending premature vblank event on disable: "
- "wanted %llu, current %llu\n",
- e->sequence, seq);
+ drm_dbg_core(dev, "[CRTC:%d:%s] Sending premature vblank event on disable: wanted %llu, current %llu\n",
+ crtc->base.id, crtc->name, e->sequence, seq);
list_del(&e->base.link);
drm_vblank_crtc_put(vblank);
send_vblank_event(dev, e, seq, now);
@@ -1477,12 +1474,12 @@ void drm_crtc_vblank_on_config(struct drm_crtc *crtc,
const struct drm_vblank_crtc_config *config)
{
struct drm_device *dev = crtc->dev;
- unsigned int pipe = drm_crtc_index(crtc);
struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
spin_lock_irq(&dev->vbl_lock);
- drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n",
- pipe, vblank->enabled, vblank->inmodeset);
+ drm_dbg_vbl(dev, "[CRTC:%d:%s] vblank %s, inmodeset: %s\n",
+ crtc->base.id, crtc->name, str_enabled_disabled(vblank->enabled),
+ str_yes_no(vblank->inmodeset));
vblank->config = *config;
@@ -1576,8 +1573,8 @@ void drm_crtc_vblank_restore(struct drm_crtc *crtc)
diff = DIV_ROUND_CLOSEST_ULL(diff_ns, framedur_ns);
- drm_dbg_vbl(dev,
- "missed %d vblanks in %lld ns, frame duration=%d ns, hw_diff=%d\n",
+ drm_dbg_vbl(dev, "[CRTC:%d:%s] missed %d vblanks in %lld ns, frame duration=%d ns, hw_diff=%d\n",
+ crtc->base.id, crtc->name,
diff, diff_ns, framedur_ns, cur_vblank - vblank->last);
vblank->last = (cur_vblank - diff) & max_vblank_count;
}
@@ -1634,8 +1631,8 @@ static int drm_vblank_crtc_queue_event(struct drm_vblank_crtc *vblank,
seq = drm_vblank_crtc_count_and_time(vblank, &now);
- drm_dbg_core(dev, "event on vblank count %llu, current %llu, crtc %u\n",
- req_seq, seq, pipe);
+ drm_dbg_core(dev, "[VBLANK:%u] event on vblank count %llu, current %llu\n",
+ pipe, req_seq, seq);
trace_drm_vblank_event_queued(file_priv, pipe, req_seq);
@@ -1731,8 +1728,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (vblwait->request.type &
~(_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK |
_DRM_VBLANK_HIGH_CRTC_MASK)) {
- drm_dbg_core(dev,
- "Unsupported type value 0x%x, supported mask 0x%x\n",
+ drm_dbg_core(dev, "Unsupported type value 0x%x, supported mask 0x%x\n",
vblwait->request.type,
(_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK |
_DRM_VBLANK_HIGH_CRTC_MASK));
@@ -1777,9 +1773,8 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
ret = drm_vblank_crtc_get(vblank);
if (ret) {
- drm_dbg_core(dev,
- "crtc %d failed to acquire vblank counter, %d\n",
- pipe, ret);
+ drm_dbg_core(dev, "[VBLANK:%u] failed to acquire vblank counter %pe\n",
+ pipe, ERR_PTR(ret));
return ret;
}
seq = drm_vblank_crtc_count(vblank);
@@ -1815,8 +1810,8 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (req_seq != seq) {
int wait;
- drm_dbg_core(dev, "waiting on vblank count %llu, crtc %u\n",
- req_seq, pipe);
+ drm_dbg_core(dev, "[VBLANK:%d] waiting on vblank count %llu\n",
+ pipe, req_seq);
wait = wait_event_interruptible_timeout(vblank->queue,
drm_vblank_passed(drm_vblank_crtc_count(vblank), req_seq) ||
!READ_ONCE(vblank->enabled),
@@ -1840,10 +1835,10 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (ret != -EINTR) {
drm_vblank_crtc_wait_reply(vblank, &vblwait->reply);
- drm_dbg_core(dev, "crtc %d returning %u to client\n",
+ drm_dbg_core(dev, "[VBLANK:%u] returning %u to client\n",
pipe, vblwait->reply.sequence);
} else {
- drm_dbg_core(dev, "crtc %d vblank wait interrupted by signal\n",
+ drm_dbg_core(dev, "[VBLANK:%u] vblank wait interrupted by signal\n",
pipe);
}
@@ -1872,8 +1867,8 @@ static void drm_vblank_crtc_handle_events(struct drm_vblank_crtc *vblank)
if (!drm_vblank_passed(seq, e->sequence))
continue;
- drm_dbg_core(dev, "vblank event on %llu, current %llu\n",
- e->sequence, seq);
+ drm_dbg_core(dev, "[VBLANK:%u] vblank event on %llu, current %llu\n",
+ pipe, e->sequence, seq);
list_del(&e->base.link);
drm_vblank_crtc_put(vblank);
@@ -1990,7 +1985,6 @@ int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,
{
struct drm_crtc *crtc;
struct drm_vblank_crtc *vblank;
- int pipe;
struct drm_crtc_get_sequence *get_seq = data;
ktime_t now;
bool vblank_enabled;
@@ -2006,8 +2000,6 @@ int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,
if (!crtc)
return -ENOENT;
- pipe = drm_crtc_index(crtc);
-
vblank = drm_crtc_vblank_crtc(crtc);
vblank_enabled = READ_ONCE(vblank->config.disable_immediate) &&
READ_ONCE(vblank->enabled);
@@ -2015,9 +2007,8 @@ int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,
if (!vblank_enabled) {
ret = drm_crtc_vblank_get(crtc);
if (ret) {
- drm_dbg_core(dev,
- "crtc %d failed to acquire vblank counter, %d\n",
- pipe, ret);
+ drm_dbg_core(dev, "[CRTC:%d:%s] failed to acquire vblank counter %pe\n",
+ crtc->base.id, crtc->name, ERR_PTR(ret));
return ret;
}
}
@@ -2082,9 +2073,8 @@ int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data,
ret = drm_crtc_vblank_get(crtc);
if (ret) {
- drm_dbg_core(dev,
- "crtc %d failed to acquire vblank counter, %d\n",
- pipe, ret);
+ drm_dbg_core(dev, "[CRTC:%d:%s] failed to acquire vblank counter %pe\n",
+ crtc->base.id, crtc->name, ERR_PTR(ret));
goto err_free;
}
@@ -2169,7 +2159,8 @@ static enum hrtimer_restart drm_vblank_timer_function(struct hrtimer *timer)
ret_overrun = hrtimer_forward_now(&vtimer->timer, interval);
if (ret_overrun != 1)
- drm_dbg_vbl(dev, "vblank timer overrun\n");
+ drm_dbg_vbl(dev, "[CRTC:%d:%s] vblank timer overrun\n",
+ crtc->base.id, crtc->name);
if (crtc_funcs->handle_vblank_timeout)
succ = crtc_funcs->handle_vblank_timeout(crtc);
--
2.47.3
^ permalink raw reply related [flat|nested] 34+ messages in thread* Re: [PATCH v2 00/25] drm/vblank: refactoring and cleanups
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (24 preceding siblings ...)
2025-12-04 10:57 ` [PATCH v2 25/25] drm/vblank: clean up debug logging Jani Nikula
@ 2025-12-04 12:46 ` Thomas Zimmermann
2025-12-04 12:57 ` Jani Nikula
2025-12-04 13:55 ` ✗ CI.KUnit: failure for drm/vblank: refactoring and cleanups (rev2) Patchwork
26 siblings, 1 reply; 34+ messages in thread
From: Thomas Zimmermann @ 2025-12-04 12:46 UTC (permalink / raw)
To: Jani Nikula, intel-gfx, intel-xe; +Cc: ville.syrjala
Hi
Am 04.12.25 um 11:57 schrieb Jani Nikula:
> v2 of [1], hopefully addressing all review comments.
I gave an r-b to most of the patches in v1 of this series. Why didn't
you keep those?
Best regards
Thomas
>
> BR,
> Jani.
>
>
> [1] https://lore.kernel.org/r/cover.1762791343.git.jani.nikula@intel.com
>
>
> Jani Nikula (24):
> drm/vblank: remove drm_wait_one_vblank() completely
> drm/vblank: remove superfluous pipe check
> drm/vblank: add return value to drm_crtc_wait_one_vblank()
> drm/vblank: limit vblank variable scope to atomic
> drm/vblank: use the drm_vblank_crtc() and drm_crtc_vblank_crtc()
> helpers more
> drm/vblank: prefer drm_crtc_vblank_crtc() over drm_vblank_crtc()
> drm/vblank: pass vlank to drm_vblank_get()/_put()/_count()
> drm/vblank: pass vblank to drm_update_vblank_count()
> drm/vblank: pass vblank to drm_handle_vblank_events()
> drm/vblank: use the vblank based interfaces more
> drm/vblank: pass vblank to drm_queue_vblank_event()
> drm/vblank: pass vblank to drm_wait_vblank_reply()
> drm/vblank: pass vblank to drm_vblank_count_and_time()
> drm/vblank: pass vblank to drm_reset_vblank_timestamp()
> drm/vblank: pass vblank to store_vblank()
> drm/vblank: pass vblank to drm_vblank_enable()
> drm/vblank: merge drm_vblank_restore() into drm_crtc_vblank_restore()
> drm/vblank: add drm_crtc_from_vblank() helper
> drm/vblank: pass vblank to __get_vblank_counter() and
> drm_max_vblank_count()
> drm/vblank: pass vblank to __{enable,disable}_vblank()
> drm/vblank: pass vblank to drm_get_last_vbltimestamp()
> drm/vblank: pass vblank to drm_vblank_disable_and_save(), make static
> drm/vblank: reduce pipe checks
> drm/vblank: clean up debug logging
>
> Thomas Zimmermann (1):
> drm/vblank: Unexport drm_wait_one_vblank()
>
> drivers/gpu/drm/drm_internal.h | 7 +-
> drivers/gpu/drm/drm_vblank.c | 533 ++++++++++++++----------------
> drivers/gpu/drm/drm_vblank_work.c | 12 +-
> include/drm/drm_vblank.h | 3 +-
> 4 files changed, 257 insertions(+), 298 deletions(-)
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
^ permalink raw reply [flat|nested] 34+ messages in thread* Re: [PATCH v2 00/25] drm/vblank: refactoring and cleanups
2025-12-04 12:46 ` [PATCH v2 00/25] drm/vblank: refactoring and cleanups Thomas Zimmermann
@ 2025-12-04 12:57 ` Jani Nikula
2025-12-04 13:06 ` Thomas Zimmermann
0 siblings, 1 reply; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 12:57 UTC (permalink / raw)
To: Thomas Zimmermann, intel-gfx, intel-xe; +Cc: ville.syrjala
On Thu, 04 Dec 2025, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Hi
>
> Am 04.12.25 um 11:57 schrieb Jani Nikula:
>> v2 of [1], hopefully addressing all review comments.
>
> I gave an r-b to most of the patches in v1 of this series. Why didn't
> you keep those?
Aww crap, sorry, I meant to, but forgot. :(
BR,
Jani.
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 00/25] drm/vblank: refactoring and cleanups
2025-12-04 12:57 ` Jani Nikula
@ 2025-12-04 13:06 ` Thomas Zimmermann
2025-12-04 13:07 ` Thomas Zimmermann
0 siblings, 1 reply; 34+ messages in thread
From: Thomas Zimmermann @ 2025-12-04 13:06 UTC (permalink / raw)
To: Jani Nikula, intel-gfx, intel-xe; +Cc: ville.syrjala
Hi
Am 04.12.25 um 13:57 schrieb Jani Nikula:
> On Thu, 04 Dec 2025, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Hi
>>
>> Am 04.12.25 um 11:57 schrieb Jani Nikula:
>>> v2 of [1], hopefully addressing all review comments.
>> I gave an r-b to most of the patches in v1 of this series. Why didn't
>> you keep those?
> Aww crap, sorry, I meant to, but forgot. :(
I see. I looked through the rename changes. Seems good. For the whole series
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for this cleanup.
Best regards
Thomas
>
> BR,
> Jani.
>
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 00/25] drm/vblank: refactoring and cleanups
2025-12-04 13:06 ` Thomas Zimmermann
@ 2025-12-04 13:07 ` Thomas Zimmermann
2025-12-04 13:12 ` Jani Nikula
0 siblings, 1 reply; 34+ messages in thread
From: Thomas Zimmermann @ 2025-12-04 13:07 UTC (permalink / raw)
To: Jani Nikula, intel-gfx, intel-xe; +Cc: ville.syrjala
And another thing I noticed is that this series didn't go to dri-devel.
Am 04.12.25 um 14:06 schrieb Thomas Zimmermann:
> Hi
>
> Am 04.12.25 um 13:57 schrieb Jani Nikula:
>> On Thu, 04 Dec 2025, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>> Hi
>>>
>>> Am 04.12.25 um 11:57 schrieb Jani Nikula:
>>>> v2 of [1], hopefully addressing all review comments.
>>> I gave an r-b to most of the patches in v1 of this series. Why didn't
>>> you keep those?
>> Aww crap, sorry, I meant to, but forgot. :(
>
> I see. I looked through the rename changes. Seems good. For the whole
> series
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
> Thanks for this cleanup.
>
> Best regards
> Thomas
>
>>
>> BR,
>> Jani.
>>
>>
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 00/25] drm/vblank: refactoring and cleanups
2025-12-04 13:07 ` Thomas Zimmermann
@ 2025-12-04 13:12 ` Jani Nikula
2025-12-04 13:15 ` Thomas Zimmermann
0 siblings, 1 reply; 34+ messages in thread
From: Jani Nikula @ 2025-12-04 13:12 UTC (permalink / raw)
To: Thomas Zimmermann, intel-gfx, intel-xe; +Cc: ville.syrjala
On Thu, 04 Dec 2025, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> And another thing I noticed is that this series didn't go to dri-devel.
*facepalm*
Should I just resend the entire series?
>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks a lot for the reviews, and sorry about the goof-ups.
BR,
Jani.
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v2 00/25] drm/vblank: refactoring and cleanups
2025-12-04 13:12 ` Jani Nikula
@ 2025-12-04 13:15 ` Thomas Zimmermann
0 siblings, 0 replies; 34+ messages in thread
From: Thomas Zimmermann @ 2025-12-04 13:15 UTC (permalink / raw)
To: Jani Nikula, intel-gfx, intel-xe; +Cc: ville.syrjala
Hi
Am 04.12.25 um 14:12 schrieb Jani Nikula:
> On Thu, 04 Dec 2025, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> And another thing I noticed is that this series didn't go to dri-devel.
> *facepalm*
Happens :)
>
> Should I just resend the entire series?
I'd include the r-bs and send it as v3 to dri-devel and the others.
Best regards
Thomas
>
>>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> Thanks a lot for the reviews, and sorry about the goof-ups.
>
> BR,
> Jani.
>
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
^ permalink raw reply [flat|nested] 34+ messages in thread
* ✗ CI.KUnit: failure for drm/vblank: refactoring and cleanups (rev2)
2025-12-04 10:57 [PATCH v2 00/25] drm/vblank: refactoring and cleanups Jani Nikula
` (25 preceding siblings ...)
2025-12-04 12:46 ` [PATCH v2 00/25] drm/vblank: refactoring and cleanups Thomas Zimmermann
@ 2025-12-04 13:55 ` Patchwork
26 siblings, 0 replies; 34+ messages in thread
From: Patchwork @ 2025-12-04 13:55 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-xe
== Series Details ==
Series: drm/vblank: refactoring and cleanups (rev2)
URL : https://patchwork.freedesktop.org/series/157332/
State : failure
== Summary ==
+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
[13:53:52] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[13:53:56] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=25
[13:54:33] Starting KUnit Kernel (1/1)...
[13:54:33] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[13:54:33] ================== guc_buf (11 subtests) ===================
[13:54:33] [PASSED] test_smallest
[13:54:33] [PASSED] test_largest
[13:54:34] [PASSED] test_granular
[13:54:34] [PASSED] test_unique
[13:54:34] [PASSED] test_overlap
[13:54:34] [PASSED] test_reusable
[13:54:34] [PASSED] test_too_big
[13:54:34] [PASSED] test_flush
[13:54:34] [PASSED] test_lookup
[13:54:34] [PASSED] test_data
[13:54:34] [PASSED] test_class
[13:54:34] ===================== [PASSED] guc_buf =====================
[13:54:34] =================== guc_dbm (7 subtests) ===================
[13:54:34] [PASSED] test_empty
[13:54:34] [PASSED] test_default
[13:54:34] ======================== test_size ========================
[13:54:34] [PASSED] 4
[13:54:34] [PASSED] 8
[13:54:34] [PASSED] 32
[13:54:34] [PASSED] 256
[13:54:34] ==================== [PASSED] test_size ====================
[13:54:34] ======================= test_reuse ========================
[13:54:34] [PASSED] 4
[13:54:34] [PASSED] 8
[13:54:34] [PASSED] 32
[13:54:34] [PASSED] 256
[13:54:34] =================== [PASSED] test_reuse ====================
[13:54:34] =================== test_range_overlap ====================
[13:54:34] [PASSED] 4
[13:54:34] [PASSED] 8
[13:54:34] [PASSED] 32
[13:54:34] [PASSED] 256
[13:54:34] =============== [PASSED] test_range_overlap ================
[13:54:34] =================== test_range_compact ====================
[13:54:34] [PASSED] 4
[13:54:34] [PASSED] 8
[13:54:34] [PASSED] 32
[13:54:34] [PASSED] 256
[13:54:34] =============== [PASSED] test_range_compact ================
[13:54:34] ==================== test_range_spare =====================
[13:54:34] [PASSED] 4
[13:54:34] [PASSED] 8
[13:54:34] [PASSED] 32
[13:54:34] [PASSED] 256
[13:54:34] ================ [PASSED] test_range_spare =================
[13:54:34] ===================== [PASSED] guc_dbm =====================
[13:54:34] =================== guc_idm (6 subtests) ===================
[13:54:34] [PASSED] bad_init
[13:54:34] [PASSED] no_init
[13:54:34] [PASSED] init_fini
[13:54:34] [PASSED] check_used
[13:54:34] [PASSED] check_quota
[13:54:34] [PASSED] check_all
[13:54:34] ===================== [PASSED] guc_idm =====================
[13:54:34] ================== no_relay (3 subtests) ===================
[13:54:34] [PASSED] xe_drops_guc2pf_if_not_ready
[13:54:34] [PASSED] xe_drops_guc2vf_if_not_ready
[13:54:34] [PASSED] xe_rejects_send_if_not_ready
[13:54:34] ==================== [PASSED] no_relay =====================
[13:54:34] ================== pf_relay (14 subtests) ==================
[13:54:34] [PASSED] pf_rejects_guc2pf_too_short
[13:54:34] [PASSED] pf_rejects_guc2pf_too_long
[13:54:34] [PASSED] pf_rejects_guc2pf_no_payload
[13:54:34] [PASSED] pf_fails_no_payload
[13:54:34] [PASSED] pf_fails_bad_origin
[13:54:34] [PASSED] pf_fails_bad_type
[13:54:34] [PASSED] pf_txn_reports_error
[13:54:34] [PASSED] pf_txn_sends_pf2guc
[13:54:34] [PASSED] pf_sends_pf2guc
[13:54:34] [SKIPPED] pf_loopback_nop
[13:54:34] [SKIPPED] pf_loopback_echo
[13:54:34] [SKIPPED] pf_loopback_fail
[13:54:34] [SKIPPED] pf_loopback_busy
[13:54:34] [SKIPPED] pf_loopback_retry
[13:54:34] ==================== [PASSED] pf_relay =====================
[13:54:34] ================== vf_relay (3 subtests) ===================
[13:54:34] [PASSED] vf_rejects_guc2vf_too_short
[13:54:34] [PASSED] vf_rejects_guc2vf_too_long
[13:54:34] [PASSED] vf_rejects_guc2vf_no_payload
[13:54:34] ==================== [PASSED] vf_relay =====================
[13:54:34] ================ pf_gt_config (6 subtests) =================
[13:54:34] [PASSED] fair_contexts_1vf
[13:54:34] [PASSED] fair_doorbells_1vf
[13:54:34] [PASSED] fair_ggtt_1vf
[13:54:34] ====================== fair_contexts ======================
[13:54:34] [PASSED] 1 VF
[13:54:34] [PASSED] 2 VFs
[13:54:34] [PASSED] 3 VFs
[13:54:34] [PASSED] 4 VFs
[13:54:34] [PASSED] 5 VFs
[13:54:34] [PASSED] 6 VFs
[13:54:34] [PASSED] 7 VFs
[13:54:34] [PASSED] 8 VFs
[13:54:34] [PASSED] 9 VFs
[13:54:34] [PASSED] 10 VFs
[13:54:34] [PASSED] 11 VFs
[13:54:34] [PASSED] 12 VFs
[13:54:34] [PASSED] 13 VFs
[13:54:34] [PASSED] 14 VFs
[13:54:34] [PASSED] 15 VFs
[13:54:34] [PASSED] 16 VFs
[13:54:34] [PASSED] 17 VFs
[13:54:34] [PASSED] 18 VFs
[13:54:34] [PASSED] 19 VFs
[13:54:34] [PASSED] 20 VFs
[13:54:34] [PASSED] 21 VFs
[13:54:34] [PASSED] 22 VFs
[13:54:34] [PASSED] 23 VFs
[13:54:34] [PASSED] 24 VFs
[13:54:34] [PASSED] 25 VFs
[13:54:34] [PASSED] 26 VFs
[13:54:34] [PASSED] 27 VFs
[13:54:34] [PASSED] 28 VFs
[13:54:34] [PASSED] 29 VFs
[13:54:34] [PASSED] 30 VFs
[13:54:34] [PASSED] 31 VFs
[13:54:34] [PASSED] 32 VFs
[13:54:34] [PASSED] 33 VFs
[13:54:34] [PASSED] 34 VFs
[13:54:34] [PASSED] 35 VFs
[13:54:34] [PASSED] 36 VFs
[13:54:34] [PASSED] 37 VFs
[13:54:34] [PASSED] 38 VFs
[13:54:34] [PASSED] 39 VFs
[13:54:34] [PASSED] 40 VFs
[13:54:34] [PASSED] 41 VFs
[13:54:34] [PASSED] 42 VFs
[13:54:34] [PASSED] 43 VFs
[13:54:34] [PASSED] 44 VFs
[13:54:34] [PASSED] 45 VFs
[13:54:34] [PASSED] 46 VFs
[13:54:34] [PASSED] 47 VFs
[13:54:34] [PASSED] 48 VFs
[13:54:34] [PASSED] 49 VFs
[13:54:34] [PASSED] 50 VFs
[13:54:34] [PASSED] 51 VFs
[13:54:34] [PASSED] 52 VFs
[13:54:34] [PASSED] 53 VFs
[13:54:34] [PASSED] 54 VFs
[13:54:34] [PASSED] 55 VFs
[13:54:34] [PASSED] 56 VFs
[13:54:34] [PASSED] 57 VFs
[13:54:34] [PASSED] 58 VFs
[13:54:34] [PASSED] 59 VFs
[13:54:34] [PASSED] 60 VFs
[13:54:34] [PASSED] 61 VFs
[13:54:34] [PASSED] 62 VFs
[13:54:34] [PASSED] 63 VFs
[13:54:34] ================== [PASSED] fair_contexts ==================
[13:54:34] ===================== fair_doorbells ======================
[13:54:34] [PASSED] 1 VF
[13:54:34] [PASSED] 2 VFs
[13:54:34] [PASSED] 3 VFs
[13:54:34] [PASSED] 4 VFs
[13:54:34] [PASSED] 5 VFs
[13:54:34] [PASSED] 6 VFs
[13:54:34] [PASSED] 7 VFs
[13:54:34] [PASSED] 8 VFs
[13:54:34] [PASSED] 9 VFs
[13:54:34] [PASSED] 10 VFs
[13:54:34] [PASSED] 11 VFs
[13:54:34] [PASSED] 12 VFs
[13:54:34] [PASSED] 13 VFs
[13:54:34] [PASSED] 14 VFs
[13:54:34] [PASSED] 15 VFs
[13:54:34] [PASSED] 16 VFs
[13:54:34] [PASSED] 17 VFs
[13:54:34] [PASSED] 18 VFs
[13:54:34] [PASSED] 19 VFs
[13:54:34] [PASSED] 20 VFs
[13:54:34] [PASSED] 21 VFs
[13:54:34] [PASSED] 22 VFs
[13:54:34] [PASSED] 23 VFs
[13:54:34] [PASSED] 24 VFs
[13:54:34] [PASSED] 25 VFs
[13:54:34] [PASSED] 26 VFs
[13:54:34] [PASSED] 27 VFs
[13:54:34] [PASSED] 28 VFs
[13:54:34] [PASSED] 29 VFs
[13:54:34] [PASSED] 30 VFs
[13:54:34] [PASSED] 31 VFs
[13:54:34] [PASSED] 32 VFs
[13:54:34] [PASSED] 33 VFs
[13:54:34] [PASSED] 34 VFs
[13:54:34] [PASSED] 35 VFs
[13:54:34] [PASSED] 36 VFs
[13:54:34] [PASSED] 37 VFs
[13:54:34] [PASSED] 38 VFs
[13:54:34] [PASSED] 39 VFs
[13:54:34] [PASSED] 40 VFs
[13:54:34] [PASSED] 41 VFs
[13:54:34] [PASSED] 42 VFs
[13:54:34] [PASSED] 43 VFs
[13:54:34] [PASSED] 44 VFs
[13:54:34] [PASSED] 45 VFs
[13:54:34] [PASSED] 46 VFs
[13:54:34] [PASSED] 47 VFs
[13:54:34] [PASSED] 48 VFs
[13:54:34] [PASSED] 49 VFs
[13:54:34] [PASSED] 50 VFs
[13:54:34] [PASSED] 51 VFs
[13:54:34] [PASSED] 52 VFs
[13:54:34] [PASSED] 53 VFs
[13:54:34] [PASSED] 54 VFs
[13:54:34] [PASSED] 55 VFs
[13:54:34] [PASSED] 56 VFs
[13:54:34] [PASSED] 57 VFs
[13:54:34] [PASSED] 58 VFs
[13:54:34] [PASSED] 59 VFs
[13:54:34] [PASSED] 60 VFs
[13:54:34] [PASSED] 61 VFs
[13:54:34] [PASSED] 62 VFs
[13:54:34] [PASSED] 63 VFs
[13:54:34] ================= [PASSED] fair_doorbells ==================
[13:54:34] ======================== fair_ggtt ========================
[13:54:34] [PASSED] 1 VF
[13:54:34] [PASSED] 2 VFs
[13:54:34] [PASSED] 3 VFs
[13:54:34] [PASSED] 4 VFs
[13:54:34] [PASSED] 5 VFs
[13:54:34] [PASSED] 6 VFs
[13:54:34] [PASSED] 7 VFs
[13:54:34] [PASSED] 8 VFs
[13:54:34] [PASSED] 9 VFs
[13:54:34] [PASSED] 10 VFs
[13:54:34] [PASSED] 11 VFs
[13:54:34] [PASSED] 12 VFs
[13:54:34] [PASSED] 13 VFs
[13:54:34] [PASSED] 14 VFs
[13:54:34] [PASSED] 15 VFs
[13:54:34] [PASSED] 16 VFs
[13:54:34] [PASSED] 17 VFs
[13:54:34] [PASSED] 18 VFs
[13:54:34] [PASSED] 19 VFs
[13:54:34] [PASSED] 20 VFs
[13:54:34] [PASSED] 21 VFs
[13:54:34] [PASSED] 22 VFs
[13:54:34] [PASSED] 23 VFs
[13:54:34] [PASSED] 24 VFs
[13:54:34] [PASSED] 25 VFs
[13:54:34] [PASSED] 26 VFs
[13:54:34] [PASSED] 27 VFs
[13:54:34] [PASSED] 28 VFs
[13:54:34] [PASSED] 29 VFs
[13:54:34] [PASSED] 30 VFs
[13:54:34] [PASSED] 31 VFs
[13:54:34] [PASSED] 32 VFs
[13:54:34] [PASSED] 33 VFs
[13:54:34] [PASSED] 34 VFs
[13:54:34] [PASSED] 35 VFs
[13:54:34] [PASSED] 36 VFs
[13:54:34] [PASSED] 37 VFs
[13:54:34] [PASSED] 38 VFs
[13:54:34] [PASSED] 39 VFs
[13:54:34] [PASSED] 40 VFs
[13:54:34] [PASSED] 41 VFs
[13:54:34] [PASSED] 42 VFs
[13:54:34] [PASSED] 43 VFs
[13:54:34] [PASSED] 44 VFs
[13:54:34] [PASSED] 45 VFs
[13:54:34] [PASSED] 46 VFs
[13:54:34] [PASSED] 47 VFs
[13:54:34] [PASSED] 48 VFs
[13:54:34] [PASSED] 49 VFs
[13:54:34] [PASSED] 50 VFs
[13:54:34] [PASSED] 51 VFs
[13:54:34] [PASSED] 52 VFs
[13:54:34] [PASSED] 53 VFs
[13:54:34] [PASSED] 54 VFs
[13:54:34] [PASSED] 55 VFs
[13:54:34] [PASSED] 56 VFs
[13:54:34] [PASSED] 57 VFs
[13:54:34] [PASSED] 58 VFs
[13:54:34] [PASSED] 59 VFs
[13:54:34] [PASSED] 60 VFs
[13:54:34] [PASSED] 61 VFs
[13:54:34] [PASSED] 62 VFs
[13:54:34] [PASSED] 63 VFs
[13:54:34] ==================== [PASSED] fair_ggtt ====================
[13:54:34] ================== [PASSED] pf_gt_config ===================
[13:54:34] ===================== lmtt (1 subtest) =====================
[13:54:34] ======================== test_ops =========================
[13:54:34] [PASSED] 2-level
[13:54:34] [PASSED] multi-level
[13:54:34] ==================== [PASSED] test_ops =====================
[13:54:34] ====================== [PASSED] lmtt =======================
[13:54:34] ================= pf_service (11 subtests) =================
[13:54:34] [PASSED] pf_negotiate_any
[13:54:34] [PASSED] pf_negotiate_base_match
[13:54:34] [PASSED] pf_negotiate_base_newer
[13:54:34] [PASSED] pf_negotiate_base_next
[13:54:34] [SKIPPED] pf_negotiate_base_older
[13:54:34] [PASSED] pf_negotiate_base_prev
[13:54:34] [PASSED] pf_negotiate_latest_match
[13:54:34] [PASSED] pf_negotiate_latest_newer
[13:54:34] [PASSED] pf_negotiate_latest_next
[13:54:34] [SKIPPED] pf_negotiate_latest_older
[13:54:34] [SKIPPED] pf_negotiate_latest_prev
[13:54:34] =================== [PASSED] pf_service ====================
[13:54:34] ================= xe_guc_g2g (2 subtests) ==================
[13:54:34] ============== xe_live_guc_g2g_kunit_default ==============
[13:54:34] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ==========
[13:54:34] ============== xe_live_guc_g2g_kunit_allmem ===============
[13:54:34] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ==========
[13:54:34] =================== [SKIPPED] xe_guc_g2g ===================
[13:54:34] =================== xe_mocs (2 subtests) ===================
[13:54:34] ================ xe_live_mocs_kernel_kunit ================
[13:54:34] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============
[13:54:34] ================ xe_live_mocs_reset_kunit =================
[13:54:34] ============ [SKIPPED] xe_live_mocs_reset_kunit ============
[13:54:34] ==================== [SKIPPED] xe_mocs =====================
[13:54:34] ================= xe_migrate (2 subtests) ==================
[13:54:34] ================= xe_migrate_sanity_kunit =================
[13:54:34] ============ [SKIPPED] xe_migrate_sanity_kunit =============
[13:54:34] ================== xe_validate_ccs_kunit ==================
[13:54:34] ============= [SKIPPED] xe_validate_ccs_kunit ==============
[13:54:34] =================== [SKIPPED] xe_migrate ===================
[13:54:34] ================== xe_dma_buf (1 subtest) ==================
[13:54:34] ==================== xe_dma_buf_kunit =====================
[13:54:34] ================ [SKIPPED] xe_dma_buf_kunit ================
[13:54:34] =================== [SKIPPED] xe_dma_buf ===================
[13:54:34] ================= xe_bo_shrink (1 subtest) =================
[13:54:34] =================== xe_bo_shrink_kunit ====================
[13:54:34] =============== [SKIPPED] xe_bo_shrink_kunit ===============
[13:54:34] ================== [SKIPPED] xe_bo_shrink ==================
[13:54:34] ==================== xe_bo (2 subtests) ====================
[13:54:34] ================== xe_ccs_migrate_kunit ===================
[13:54:34] ============== [SKIPPED] xe_ccs_migrate_kunit ==============
[13:54:34] ==================== xe_bo_evict_kunit ====================
[13:54:34] =============== [SKIPPED] xe_bo_evict_kunit ================
[13:54:34] ===================== [SKIPPED] xe_bo ======================
[13:54:34] ==================== args (11 subtests) ====================
[13:54:34] [PASSED] count_args_test
[13:54:34] [PASSED] call_args_example
[13:54:34] [PASSED] call_args_test
[13:54:34] [PASSED] drop_first_arg_example
[13:54:34] [PASSED] drop_first_arg_test
[13:54:34] [PASSED] first_arg_example
[13:54:34] [PASSED] first_arg_test
[13:54:34] [PASSED] last_arg_example
[13:54:34] [PASSED] last_arg_test
[13:54:34] [PASSED] pick_arg_example
[13:54:34] [PASSED] sep_comma_example
[13:54:34] ====================== [PASSED] args =======================
[13:54:34] =================== xe_pci (3 subtests) ====================
[13:54:34] ==================== check_graphics_ip ====================
[13:54:34] [PASSED] 12.00 Xe_LP
[13:54:34] [PASSED] 12.10 Xe_LP+
[13:54:34] [PASSED] 12.55 Xe_HPG
[13:54:34] [PASSED] 12.60 Xe_HPC
[13:54:34] [PASSED] 12.70 Xe_LPG
[13:54:34] [PASSED] 12.71 Xe_LPG
[13:54:34] [PASSED] 12.74 Xe_LPG+
[13:54:34] [PASSED] 20.01 Xe2_HPG
[13:54:34] [PASSED] 20.02 Xe2_HPG
[13:54:34] [PASSED] 20.04 Xe2_LPG
[13:54:34] [PASSED] 30.00 Xe3_LPG
[13:54:34] [PASSED] 30.01 Xe3_LPG
[13:54:34] [PASSED] 30.03 Xe3_LPG
[13:54:34] [PASSED] 30.04 Xe3_LPG
[13:54:34] [PASSED] 30.05 Xe3_LPG
[13:54:34] [PASSED] 35.11 Xe3p_XPC
[13:54:34] ================ [PASSED] check_graphics_ip ================
[13:54:34] ===================== check_media_ip ======================
[13:54:34] [PASSED] 12.00 Xe_M
[13:54:34] [PASSED] 12.55 Xe_HPM
[13:54:34] [PASSED] 13.00 Xe_LPM+
[13:54:34] [PASSED] 13.01 Xe2_HPM
[13:54:34] [PASSED] 20.00 Xe2_LPM
[13:54:34] [PASSED] 30.00 Xe3_LPM
[13:54:34] [PASSED] 30.02 Xe3_LPM
[13:54:34] [PASSED] 35.00 Xe3p_LPM
[13:54:34] [PASSED] 35.03 Xe3p_HPM
[13:54:34] ================= [PASSED] check_media_ip ==================
[13:54:34] =================== check_platform_desc ===================
[13:54:34] [PASSED] 0x9A60 (TIGERLAKE)
[13:54:34] [PASSED] 0x9A68 (TIGERLAKE)
[13:54:34] [PASSED] 0x9A70 (TIGERLAKE)
[13:54:34] [PASSED] 0x9A40 (TIGERLAKE)
[13:54:34] [PASSED] 0x9A49 (TIGERLAKE)
[13:54:34] [PASSED] 0x9A59 (TIGERLAKE)
[13:54:34] [PASSED] 0x9A78 (TIGERLAKE)
[13:54:34] [PASSED] 0x9AC0 (TIGERLAKE)
[13:54:34] [PASSED] 0x9AC9 (TIGERLAKE)
[13:54:34] [PASSED] 0x9AD9 (TIGERLAKE)
[13:54:34] [PASSED] 0x9AF8 (TIGERLAKE)
[13:54:34] [PASSED] 0x4C80 (ROCKETLAKE)
[13:54:34] [PASSED] 0x4C8A (ROCKETLAKE)
[13:54:34] [PASSED] 0x4C8B (ROCKETLAKE)
[13:54:34] [PASSED] 0x4C8C (ROCKETLAKE)
[13:54:34] [PASSED] 0x4C90 (ROCKETLAKE)
[13:54:34] [PASSED] 0x4C9A (ROCKETLAKE)
[13:54:34] [PASSED] 0x4680 (ALDERLAKE_S)
[13:54:34] [PASSED] 0x4682 (ALDERLAKE_S)
[13:54:34] [PASSED] 0x4688 (ALDERLAKE_S)
[13:54:34] [PASSED] 0x468A (ALDERLAKE_S)
[13:54:34] [PASSED] 0x468B (ALDERLAKE_S)
[13:54:34] [PASSED] 0x4690 (ALDERLAKE_S)
[13:54:34] [PASSED] 0x4692 (ALDERLAKE_S)
[13:54:34] [PASSED] 0x4693 (ALDERLAKE_S)
[13:54:34] [PASSED] 0x46A0 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46A1 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46A2 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46A3 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46A6 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46A8 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46AA (ALDERLAKE_P)
[13:54:34] [PASSED] 0x462A (ALDERLAKE_P)
[13:54:34] [PASSED] 0x4626 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x4628 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46B0 (ALDERLAKE_P)
stty: 'standard input': Inappropriate ioctl for device
[13:54:34] [PASSED] 0x46B1 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46B2 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46B3 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46C0 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46C1 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46C2 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46C3 (ALDERLAKE_P)
[13:54:34] [PASSED] 0x46D0 (ALDERLAKE_N)
[13:54:34] [PASSED] 0x46D1 (ALDERLAKE_N)
[13:54:34] [PASSED] 0x46D2 (ALDERLAKE_N)
[13:54:34] [PASSED] 0x46D3 (ALDERLAKE_N)
[13:54:34] [PASSED] 0x46D4 (ALDERLAKE_N)
[13:54:34] [PASSED] 0xA721 (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7A1 (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7A9 (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7AC (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7AD (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA720 (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7A0 (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7A8 (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7AA (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA7AB (ALDERLAKE_P)
[13:54:34] [PASSED] 0xA780 (ALDERLAKE_S)
[13:54:34] [PASSED] 0xA781 (ALDERLAKE_S)
[13:54:34] [PASSED] 0xA782 (ALDERLAKE_S)
[13:54:34] [PASSED] 0xA783 (ALDERLAKE_S)
[13:54:34] [PASSED] 0xA788 (ALDERLAKE_S)
[13:54:34] [PASSED] 0xA789 (ALDERLAKE_S)
[13:54:34] [PASSED] 0xA78A (ALDERLAKE_S)
[13:54:34] [PASSED] 0xA78B (ALDERLAKE_S)
[13:54:34] [PASSED] 0x4905 (DG1)
[13:54:34] [PASSED] 0x4906 (DG1)
[13:54:34] [PASSED] 0x4907 (DG1)
[13:54:34] [PASSED] 0x4908 (DG1)
[13:54:34] [PASSED] 0x4909 (DG1)
[13:54:34] [PASSED] 0x56C0 (DG2)
[13:54:34] [PASSED] 0x56C2 (DG2)
[13:54:34] [PASSED] 0x56C1 (DG2)
[13:54:34] [PASSED] 0x7D51 (METEORLAKE)
[13:54:34] [PASSED] 0x7DD1 (METEORLAKE)
[13:54:34] [PASSED] 0x7D41 (METEORLAKE)
[13:54:34] [PASSED] 0x7D67 (METEORLAKE)
[13:54:34] [PASSED] 0xB640 (METEORLAKE)
[13:54:34] [PASSED] 0x56A0 (DG2)
[13:54:34] [PASSED] 0x56A1 (DG2)
[13:54:34] [PASSED] 0x56A2 (DG2)
[13:54:34] [PASSED] 0x56BE (DG2)
[13:54:34] [PASSED] 0x56BF (DG2)
[13:54:34] [PASSED] 0x5690 (DG2)
[13:54:34] [PASSED] 0x5691 (DG2)
[13:54:34] [PASSED] 0x5692 (DG2)
[13:54:34] [PASSED] 0x56A5 (DG2)
[13:54:34] [PASSED] 0x56A6 (DG2)
[13:54:34] [PASSED] 0x56B0 (DG2)
[13:54:34] [PASSED] 0x56B1 (DG2)
[13:54:34] [PASSED] 0x56BA (DG2)
[13:54:34] [PASSED] 0x56BB (DG2)
[13:54:34] [PASSED] 0x56BC (DG2)
[13:54:34] [PASSED] 0x56BD (DG2)
[13:54:34] [PASSED] 0x5693 (DG2)
[13:54:34] [PASSED] 0x5694 (DG2)
[13:54:34] [PASSED] 0x5695 (DG2)
[13:54:34] [PASSED] 0x56A3 (DG2)
[13:54:34] [PASSED] 0x56A4 (DG2)
[13:54:34] [PASSED] 0x56B2 (DG2)
[13:54:34] [PASSED] 0x56B3 (DG2)
[13:54:34] [PASSED] 0x5696 (DG2)
[13:54:34] [PASSED] 0x5697 (DG2)
[13:54:34] [PASSED] 0xB69 (PVC)
[13:54:34] [PASSED] 0xB6E (PVC)
[13:54:34] [PASSED] 0xBD4 (PVC)
[13:54:34] [PASSED] 0xBD5 (PVC)
[13:54:34] [PASSED] 0xBD6 (PVC)
[13:54:34] [PASSED] 0xBD7 (PVC)
[13:54:34] [PASSED] 0xBD8 (PVC)
[13:54:34] [PASSED] 0xBD9 (PVC)
[13:54:34] [PASSED] 0xBDA (PVC)
[13:54:34] [PASSED] 0xBDB (PVC)
[13:54:34] [PASSED] 0xBE0 (PVC)
[13:54:34] [PASSED] 0xBE1 (PVC)
[13:54:34] [PASSED] 0xBE5 (PVC)
[13:54:34] [PASSED] 0x7D40 (METEORLAKE)
[13:54:34] [PASSED] 0x7D45 (METEORLAKE)
[13:54:34] [PASSED] 0x7D55 (METEORLAKE)
[13:54:34] [PASSED] 0x7D60 (METEORLAKE)
[13:54:34] [PASSED] 0x7DD5 (METEORLAKE)
[13:54:34] [PASSED] 0x6420 (LUNARLAKE)
[13:54:34] [PASSED] 0x64A0 (LUNARLAKE)
[13:54:34] [PASSED] 0x64B0 (LUNARLAKE)
[13:54:34] [PASSED] 0xE202 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE209 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE20B (BATTLEMAGE)
[13:54:34] [PASSED] 0xE20C (BATTLEMAGE)
[13:54:34] [PASSED] 0xE20D (BATTLEMAGE)
[13:54:34] [PASSED] 0xE210 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE211 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE212 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE216 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE220 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE221 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE222 (BATTLEMAGE)
[13:54:34] [PASSED] 0xE223 (BATTLEMAGE)
[13:54:34] [PASSED] 0xB080 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB081 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB082 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB083 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB084 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB085 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB086 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB087 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB08F (PANTHERLAKE)
[13:54:34] [PASSED] 0xB090 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB0A0 (PANTHERLAKE)
[13:54:34] [PASSED] 0xB0B0 (PANTHERLAKE)
[13:54:34] [PASSED] 0xD740 (NOVALAKE_S)
[13:54:34] [PASSED] 0xD741 (NOVALAKE_S)
[13:54:34] [PASSED] 0xD742 (NOVALAKE_S)
[13:54:34] [PASSED] 0xD743 (NOVALAKE_S)
[13:54:34] [PASSED] 0xD744 (NOVALAKE_S)
[13:54:34] [PASSED] 0xD745 (NOVALAKE_S)
[13:54:34] [PASSED] 0x674C (CRESCENTISLAND)
[13:54:34] [PASSED] 0xFD80 (PANTHERLAKE)
[13:54:34] [PASSED] 0xFD81 (PANTHERLAKE)
[13:54:34] =============== [PASSED] check_platform_desc ===============
[13:54:34] ===================== [PASSED] xe_pci ======================
[13:54:34] =================== xe_rtp (2 subtests) ====================
[13:54:34] =============== xe_rtp_process_to_sr_tests ================
[13:54:34] [PASSED] coalesce-same-reg
[13:54:34] [PASSED] no-match-no-add
[13:54:34] [PASSED] match-or
[13:54:34] [PASSED] match-or-xfail
[13:54:34] [PASSED] no-match-no-add-multiple-rules
[13:54:34] [PASSED] two-regs-two-entries
[13:54:34] [PASSED] clr-one-set-other
[13:54:34] [PASSED] set-field
[13:54:34] [PASSED] conflict-duplicate
[13:54:34] [PASSED] conflict-not-disjoint
[13:54:34] [PASSED] conflict-reg-type
[13:54:34] =========== [PASSED] xe_rtp_process_to_sr_tests ============
[13:54:34] ================== xe_rtp_process_tests ===================
[13:54:34] [PASSED] active1
[13:54:34] [PASSED] active2
[13:54:34] [PASSED] active-inactive
[13:54:34] [PASSED] inactive-active
[13:54:34] [PASSED] inactive-1st_or_active-inactive
[13:54:34] [PASSED] inactive-2nd_or_active-inactive
[13:54:34] [PASSED] inactive-last_or_active-inactive
[13:54:34] [PASSED] inactive-no_or_active-inactive
[13:54:34] ============== [PASSED] xe_rtp_process_tests ===============
[13:54:34] ===================== [PASSED] xe_rtp ======================
[13:54:34] ==================== xe_wa (1 subtest) =====================
[13:54:34] ======================== xe_wa_gt =========================
[13:54:34] [PASSED] TIGERLAKE B0
[13:54:34] [PASSED] DG1 A0
[13:54:34] [PASSED] DG1 B0
[13:54:34] [PASSED] ALDERLAKE_S A0
[13:54:34] [PASSED] ALDERLAKE_S B0
[13:54:34] [PASSED] ALDERLAKE_S C0
[13:54:34] [PASSED] ALDERLAKE_S D0
[13:54:34] [PASSED] ALDERLAKE_P A0
[13:54:34] [PASSED] ALDERLAKE_P B0
[13:54:34] [PASSED] ALDERLAKE_P C0
[13:54:34] [PASSED] ALDERLAKE_S RPLS D0
[13:54:34] [PASSED] ALDERLAKE_P RPLU E0
[13:54:34] [PASSED] DG2 G10 C0
[13:54:34] [PASSED] DG2 G11 B1
[13:54:34] [PASSED] DG2 G12 A1
[13:54:34] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0
[13:54:34] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0
[13:54:34] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0
[13:54:34] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0
[13:54:34] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0
[13:54:34] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1
[13:54:34] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0
[13:54:34] ==================== [PASSED] xe_wa_gt =====================
[13:54:34] ====================== [PASSED] xe_wa ======================
[13:54:34] ============================================================
[13:54:34] Testing complete. Ran 510 tests: passed: 492, skipped: 18
[13:54:34] Elapsed time: 42.133s total, 4.292s configuring, 37.374s building, 0.458s running
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig
stty: 'standard input': Inappropriate ioctl for device
[13:54:34] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[13:54:35] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=25
[13:55:06] Starting KUnit Kernel (1/1)...
[13:55:06] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[13:55:06] ============ drm_test_pick_cmdline (2 subtests) ============
[13:55:06] [PASSED] drm_test_pick_cmdline_res_1920_1080_60
[13:55:06] =============== drm_test_pick_cmdline_named ===============
[13:55:06] [PASSED] NTSC
[13:55:06] [PASSED] NTSC-J
[13:55:06] [PASSED] PAL
[13:55:06] [PASSED] PAL-M
[13:55:06] =========== [PASSED] drm_test_pick_cmdline_named ===========
[13:55:06] ============== [PASSED] drm_test_pick_cmdline ==============
[13:55:06] == drm_test_atomic_get_connector_for_encoder (1 subtest) ===
[13:55:06] [ERROR] Test: drm_test_atomic_get_connector_for_encoder: missing expected subtest!
[13:55:06] ------------[ cut here ]------------
[13:55:06] WARNING: CPU: 0 PID: 28 at drivers/gpu/drm/drm_vblank.c:193 drm_crtc_vblank_crtc+0x94/0xa0
[13:55:06] drm-kunit-mock-device drm_test_drm_atomic_get_connector_for_encoder.drm-kunit-mock-device: [drm] drm_WARN_ON(!vblank)
[13:55:06] CPU: 0 UID: 0 PID: 28 Comm: kunit_try_catch Tainted: G W N 6.18.0-ge807bd2ceb31 #2 NONE
[13:55:06] Tainted: [W]=WARN, [N]=TEST
[13:55:06] Stack:
[13:55:06] 604c4d93 00000000 00000000 00000001
[13:55:06] ffffff00 604c4d93 602dc1a4 00000009
[13:55:06] 000000c1 60047084 600237b9 d238bc20
[13:55:06] Call Trace:
[13:55:06] [<602dc1a4>] ? drm_crtc_vblank_crtc+0x94/0xa0
[13:55:06] [<60047084>] ? dump_stack_lvl+0x5b/0x77
[13:55:06] [<600237b9>] ? _printk+0x0/0x65
[13:55:06] [<6001f07a>] ? __warn.cold+0x71/0x10b
[13:55:06] [<6001f1a8>] ? warn_slowpath_fmt+0x94/0xa1
[13:55:06] [<602a2f50>] ? drm_atomic_get_connector_state+0x0/0x2f0
[13:55:06] [<60055bf9>] ? um_set_signals+0x59/0x70
[13:55:06] [<602d5720>] ? __drm_dev_dbg+0x0/0xb0
[13:55:06] [<602dc1a4>] ? drm_crtc_vblank_crtc+0x94/0xa0
[13:55:06] [<602dc162>] ? drm_crtc_vblank_crtc+0x52/0xa0
[13:55:06] [<602dc3d7>] ? drm_calc_timestamping_constants+0x27/0x170
[13:55:06] [<60055ba0>] ? um_set_signals+0x0/0x70
[13:55:06] [<602dc3b0>] ? drm_calc_timestamping_constants+0x0/0x170
[13:55:06] [<602d5720>] ? __drm_dev_dbg+0x0/0xb0
[13:55:06] [<602ec9ac>] ? drm_atomic_helper_calc_timestamping_constants+0x6c/0x90
[13:55:06] [<602efb8c>] ? drm_atomic_helper_commit_modeset_disables+0x43c/0x7f0
[13:55:06] [<600ced00>] ? ktime_get+0x0/0x150
[13:55:06] [<602cfe70>] ? drm_modeset_backoff+0x0/0x1d0
[13:55:06] [<602f0853>] ? drm_atomic_helper_commit_tail+0x23/0xa0
[13:55:06] [<602f1a94>] ? commit_tail+0xf4/0x180
[13:55:06] [<60300b50>] ? drm_kunit_helper_enable_crtc_connector+0x0/0x140
[13:55:06] [<602f1ccf>] ? drm_atomic_helper_commit+0x18f/0x1d0
[13:55:06] [<602a5179>] ? drm_atomic_commit+0xb9/0xe0
[13:55:06] [<6003dbfc>] ? __drm_printfn_info+0x0/0x23
[13:55:06] [<60300eb0>] ? drm_test_drm_atomic_get_connector_for_encoder+0x220/0x590
[13:55:06] [<6008b2c6>] ? finish_task_switch.isra.0+0x76/0x1b0
[13:55:06] [<600cf280>] ? ktime_get_ts64+0x0/0x1a0
[13:55:06] [<60082650>] ? to_kthread+0x0/0x40
[13:55:06] [<6025306f>] ? kunit_try_run_case+0x7f/0x100
[13:55:06] [<60082650>] ? to_kthread+0x0/0x40
[13:55:06] [<602553c0>] ? kunit_generic_run_threadfn_adapter+0x0/0x30
[13:55:06] [<602553d6>] ? kunit_generic_run_threadfn_adapter+0x16/0x30
[13:55:06] [<60083035>] ? kthread+0xf5/0x270
[13:55:06] [<60049595>] ? new_thread_handler+0x45/0x60
[13:55:06] ---[ end trace 0000000000000000 ]---
[13:55:06] ------------[ cut here ]------------
[13:55:06] WARNING: CPU: 0 PID: 28 at drivers/gpu/drm/drm_vblank.c:193 drm_crtc_vblank_crtc+0x94/0xa0
[13:55:06] drm-kunit-mock-device drm_test_drm_atomic_get_connector_for_encoder.drm-kunit-mock-device: [drm] drm_WARN_ON(!vblank)
[13:55:06] CPU: 0 UID: 0 PID: 28 Comm: kunit_try_catch Tainted: G W N 6.18.0-ge807bd2ceb31 #2 NONE
[13:55:06] Tainted: [W]=WARN, [N]=TEST
[13:55:06] Stack:
[13:55:06] 604c4d93 00000000 00000000 00000000
[13:55:06] ffffff00 604c4d93 602dc1a4 00000009
[13:55:06] 000000c1 60047084 600237b9 d238bc90
[13:55:06] Call Trace:
[13:55:06] [<602dc1a4>] ? drm_crtc_vblank_crtc+0x94/0xa0
[13:55:06] [<60047084>] ? dump_stack_lvl+0x5b/0x77
[13:55:06] [<600237b9>] ? _printk+0x0/0x65
[13:55:06] [<6001f07a>] ? __warn.cold+0x71/0x10b
[13:55:06] [<6001f1a8>] ? warn_slowpath_fmt+0x94/0xa1
[13:55:06] [<602dc3d7>] ? drm_calc_timestamping_constants+0x27/0x170
[13:55:06] [<60055ba0>] ? um_set_signals+0x0/0x70
[13:55:06] [<602dc1a4>] ? drm_crtc_vblank_crtc+0x94/0xa0
[13:55:06] [<602dc162>] ? drm_crtc_vblank_crtc+0x52/0xa0
[13:55:06] [<602dc64a>] ? drm_crtc_send_vblank_event+0x1a/0x80
[13:55:06] [<60055ba0>] ? um_set_signals+0x0/0x70
[13:55:06] [<602ecffc>] ? drm_atomic_helper_fake_vblank+0x8c/0xd0
[13:55:06] [<600ced00>] ? ktime_get+0x0/0x150
[13:55:06] [<602cfe70>] ? drm_modeset_backoff+0x0/0x1d0
[13:55:06] [<602f0888>] ? drm_atomic_helper_commit_tail+0x58/0xa0
[13:55:06] [<602f1a94>] ? commit_tail+0xf4/0x180
[13:55:06] [<60300b50>] ? drm_kunit_helper_enable_crtc_connector+0x0/0x140
[13:55:06] [<602f1ccf>] ? drm_atomic_helper_commit+0x18f/0x1d0
[13:55:06] [<602a5179>] ? drm_atomic_commit+0xb9/0xe0
[13:55:06] [<6003dbfc>] ? __drm_printfn_info+0x0/0x23
[13:55:06] [<60300eb0>] ? drm_test_drm_atomic_get_connector_for_encoder+0x220/0x590
[13:55:06] [<6008b2c6>] ? finish_task_switch.isra.0+0x76/0x1b0
[13:55:06] [<600cf280>] ? ktime_get_ts64+0x0/0x1a0
[13:55:06] [<60082650>] ? to_kthread+0x0/0x40
[13:55:06] [<6025306f>] ? kunit_try_run_case+0x7f/0x100
[13:55:06] [<60082650>] ? to_kthread+0x0/0x40
[13:55:06] [<602553c0>] ? kunit_generic_run_threadfn_adapter+0x0/0x30
[13:55:06] [<602553d6>] ? kunit_generic_run_threadfn_adapter+0x16/0x30
[13:55:06] [<60083035>] ? kthread+0xf5/0x270
[13:55:06] [<60049595>] ? new_thread_handler+0x45/0x60
[13:55:06] ---[ end trace 0000000000000000 ]---
[13:55:06]
[13:55:06] Pid: 28, comm: kunit_try_catch Tainted: G W N 6.18.0-ge807bd2ceb31
[13:55:06] RIP: 0033:drm_crtc_send_vblank_event+0x3f/0x80
[13:55:06] RSP: 00000000d238bd30 EFLAGS: 00010246
[13:55:06] RAX: 00000000061fb280 RBX: 0000000000000000 RCX: 00000000061fb280
[13:55:06] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[13:55:06] RBP: 0000000092aecd80 R08: 0000000000000000 R09: 0000000000000000
[13:55:06] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000092a48000
[13:55:06] R13: 0000000092aece00 R14: 0000000092880828 R15: 0000000000000001
[13:55:06] Kernel panic - not syncing: Segfault with no mm
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: drm_test_atomic_get_connector_for_encoder: missing subtest result line!
[13:55:06] # module: drm_atomic_test
[13:55:06] === [CRASHED] drm_test_atomic_get_connector_for_encoder ====
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] [ERROR] Test: main: missing expected subtest!
[13:55:06] [CRASHED]
[13:55:06] ============================================================
[13:55:06] Testing complete. Ran 41 tests: passed: 5, crashed: 36, errors: 37
The kernel seems to have crashed; you can decode the stack traces with:
$ scripts/decode_stacktrace.sh .kunit/vmlinux .kunit < .kunit/test.log | tee .kunit/decoded.log | /kernel/tools/testing/kunit/kunit.py parse
[13:55:06] Elapsed time: 32.044s total, 1.631s configuring, 30.095s building, 0.318s running
+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel
^ permalink raw reply [flat|nested] 34+ messages in thread