[PATCH] drm/tests: make reflect-x catch a skipped reflection

From: bennettpayoyo3 . 14

Date: Fri Dec 04 2026 - 11:05:11 EST


From: Bennett P. Payoyo <bennettpayoyo3.14@xxxxxxxxx>

The reflect-x test uses a rectangle that takes up the whole width.
Flipping it left to right leaves it in the same place, so the test
passes even if the code skips the flip.

Use a narrower rectangle that starts on the left and should end up
on the right. With X reflection disabled, the old test still passed
and the new one failed in both directions.

All 43 drm_rect KUnit tests passed on x86_64 QEMU with the patch.

ChatGPT helped find the gap and draft the change and this message.
Codex reviewed the diff.

Signed-off-by: Bennett P. Payoyo <bennettpayoyo3.14@xxxxxxxxx>
---
diff --git a/drivers/gpu/drm/tests/drm_rect_test.c
b/drivers/gpu/drm/tests/drm_rect_test.c
index 3402f993d..13ca6cb9f 100644
--- a/drivers/gpu/drm/tests/drm_rect_test.c
+++ b/drivers/gpu/drm/tests/drm_rect_test.c
@@ -472,9 +472,9 @@ static const struct drm_rect_rotate_case
drm_rect_rotate_cases[] = {
{
.name = "reflect-x",
.rotation = DRM_MODE_REFLECT_X,
- .rect = DRM_RECT_INIT(0, 0, 5, 5),
+ .rect = DRM_RECT_INIT(0, 0, 2, 5),
.width = 5, .height = 10,
- .expected = DRM_RECT_INIT(0, 0, 5, 5),
+ .expected = DRM_RECT_INIT(3, 0, 2, 5),
},
{
.name = "reflect-y",