Skip to contentSkip to conversation

drm/vkms: guard the empty-plane path, re-enable the cursor CRC tests

PATCH New Oarora Etimis 2 participants 4 messages Dec 2

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

v2 cover drm/vkms: guard the empty-plane path, re-enable the cursor CRC tests

drm_atomic_plane_check() rejects crtc && !fb, and the active-plane list is built from crtc_state->plane_mask. That check chain is the same in 6.9 and now, yet 6.9 panicked in compose_active_planes().

vkms is not a hardware driver: the composer runs on a workqueue and reads the state asynchronously, so the plane list it walks can differ from the one the atomic check just validated. The panic was seen in a worker, not in the ioctl path.

Patch 1 drops the skip, the expected failures and the panic blocks. It keeps one skip for cursor-suspend, which passes on real hardware.

Patch 2 keeps planes without a framebuffer out of active_planes.

Changes in v2:
- ran the whole kms_cursor_crc suite: 62 subtests pass in vng on 7.4.0-rc2 and on a cloud runner; all 63 pass on a real machine (55 SUCCESS, 8 SKIP, no FAIL, including cursor-suspend and cursor-dpms)
- dropped the panic comment blocks together with the skip
- kept the empty-plane guard and explained why

---
Oarora Etimis (2):
drm/ci: re-enable the vkms cursor CRC tests drm/vkms: skip planes that have no framebuffer

 drivers/gpu/drm/ci/xfails/vkms-none-fails.txt |   3 -
 drivers/gpu/drm/ci/xfails/vkms-none-skips.txt | 678 +-------------------------
 drivers/gpu/drm/vkms/vkms_crtc.c              |   4 +-
 3 files changed, 4 insertions(+), 681 deletions(-)

---
base-commit: 5ce32a0c94a827ff44ee60898c28060714dcff75
change-id: 20261130-vkms-cursor-ci-94264c8f9f46

Best regards,

Signature · 1 line
Oarora Etimis <[email protected]>
#1 lore raw

PATCH v2 1/2 drm/ci: re-enable the vkms cursor CRC tests

The skip was added after a panic in compose_active_planes(). 62 of the 63 subtests pass in vng on 7.4.0-rc2 and on a cloud runner; all 63 pass on a real machine: 55 SUCCESS, 8 SKIP, no FAIL, including cursor-suspend and cursor-dpms. cursor-suspend keeps a skip for runners without suspend/resume.

Drop the skip, the three expected failures and the panic blocks.

---
 drivers/gpu/drm/ci/xfails/vkms-none-fails.txt |   3 -
 drivers/gpu/drm/ci/xfails/vkms-none-skips.txt | 678 +-------------------------
 2 files changed, 2 insertions(+), 679 deletions(-)
drivers/gpu/drm/ci/xfails/vkms-none-fails.txt +0 -3
index 029bd4956e85..83346e60e211 100644
@@ -1,6 +1,3 @@
-kms_cursor_crc@cursor-rapid-movement-256x85,Fail
-kms_cursor_crc@cursor-rapid-movement-32x10,Fail
-kms_cursor_crc@cursor-rapid-movement-64x64,Fail
 kms_cursor_legacy@basic-flip-before-cursor-atomic,Fail
 kms_cursor_legacy@basic-flip-before-cursor-legacy,Fail
 kms_cursor_legacy@cursor-vs-flip-atomic,Fail
drivers/gpu/drm/ci/xfails/vkms-none-skips.txt +2 -676

696 lines not on this page · raw message

Signature · 1 line
2.56.1
#2 lore raw

PATCH v2 2/2 drm/vkms: skip planes that have no framebuffer

In reply to Oarora Etimis

A visible plane with no framebuffer has no mapping, so check_iosys_map() rejects the whole frame. Leave such planes out of active_planes.

---
 drivers/gpu/drm/vkms/vkms_crtc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vkms/vkms_crtc.c +2 -2
index 019d7bc90cdc..3f98fac7ce92 100644
@@ -133,7 +133,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
 		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
 		WARN_ON(!plane_state);
 
-		if (!plane_state->visible)
+		if (!plane_state->visible || !plane_state->fb)
 			continue;
 
 		i++;
@@ -148,7 +148,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
 	drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) {
 		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
 
-		if (!plane_state->visible)
+		if (!plane_state->visible || !plane_state->fb)
 			continue;
 
 		vkms_state->active_planes[i++] =
Signature · 1 line
2.56.1
#3 lore raw

Re: [PATCH v2 2/2] drm/vkms: skip planes that have no framebuffer

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/vkms: dead !plane_state->fb check in vkms_crtc_atomic_check() --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] drm/vkms: dead !plane_state->fb check in vkms_crtc_atomic_check()
--

commit ff2475266a72766f837c669474a13dc8e53ca901
Author: Oarora Etimis <[email protected]>

drm/vkms: skip planes that have no framebuffer

This commit adds a !plane_state->fb check alongside !plane_state->visible when populating vkms_state->active_planes in vkms_crtc_atomic_check().

Quoted 14 lines
drivers/gpu/drm/vkms/vkms_crtc.c +1 -1
index 019d7bc90cdcb..3f98fac7ce92b 100644
@@ -133,7 +133,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
 		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
 		WARN_ON(!plane_state);
 
-		if (!plane_state->visible)
+		if (!plane_state->visible || !plane_state->fb)
 			continue;
 
 		i++;

drivers/gpu/drm/vkms/vkms_crtc.c static int vkms_crtc_atomic_check(struct drm_crtc *crtc, · line 154

Quoted 8 lines
drivers/gpu/drm/vkms/vkms_crtc.c +1 -1
@@ -148,7 +148,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
 	drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) {
 		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
 
-		if (!plane_state->visible)
+		if (!plane_state->visible || !plane_state->fb)
 			continue;
 
 		vkms_state->active_planes[i++] =

[Severity: Medium]
Can plane_state->fb ever be NULL for a plane in crtc_state->plane_mask?

drm_atomic_set_crtc_for_plane() only keeps a plane in crtc_state->plane_mask while plane_state->crtc == crtc, and drm_atomic_check_only() runs drm_atomic_plane_check() before vkms_crtc_atomic_check(), rejecting any plane state with crtc && !fb with -EINVAL. Every plane visited by drm_for_each_plane_mask(..., crtc_state->plane_mask) therefore already has a non-NULL plane_state->fb, making !plane_state->fb dead code here.

If a disabled plane retains a stale plane_state->visible == true, that happens because vkms_plane_atomic_check() returns early when !new_plane_state->fb before calling drm_atomic_helper_check_plane_state(), without clearing new_plane_state->visible:

drivers/gpu/drm/vkms/vkms_plane.c:vkms_plane_atomic_check() {
	...
	if (!new_plane_state->fb || WARN_ON(!new_plane_state->crtc))
		return 0;

	ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
						  DRM_PLANE_NO_SCALING,
						  DRM_PLANE_NO_SCALING,
						  can_position, true);
	...
}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2