Skip to contentSkip to conversation

drm: Fix oops in damage self-tests by mocking damage property

PATCH In review Daniel Vetter 4 participants 8 messages Jul 30, 2021 – Aug 2, 2021

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

PATCH 1/1 drm: Fix oops in damage self-tests by mocking damage property

I've added a new check to make sure that drivers which insepct the damage property have it set up correctly, but somehow missed that this borke the damage selftest in the CI result noise.

Fix it up by mocking enough of drm_device and drm_plane so we can call drm_plane_enable_fb_damage_clips() to make the new check happy.

Since there's a lot of duplicated mock code already copy-pasted into each test I've also refactored this a bit to trim it down.

Fixes c7fcbf251397 ("drm/plane: check that fb_damage is set up when used")
Cc José Roberto de Souza <[email protected]> (v1)
Cc Ville Syrjälä <[email protected]>
Cc Gwan-gyeong Mun <[email protected]>
Cc José Roberto de Souza <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
---
 .../drm/selftests/test-drm_damage_helper.c    | 287 +++++-------------
 1 file changed, 71 insertions(+), 216 deletions(-)
drivers/gpu/drm/selftests/test-drm_damage_helper.c +71 -216
index 9d2bcdf8bc29..1b585c13e042 100644
@@ -6,9 +6,37 @@
 #define pr_fmt(fmt) "drm_damage_helper: " fmt
 
 #include <drm/drm_damage_helper.h>
+#include <drm/drm_plane.h>
+#include <drm/drm_drv.h>
 
 #include "test-drm_modeset_common.h"
 
+struct drm_driver mock_driver;
+struct drm_device mock_device;
+struct drm_object_properties mock_obj_props;
+struct drm_plane mock_plane;
+struct drm_property mock_prop;
+
+static void mock_setup(struct drm_plane_state *state)
+{
+	static bool setup_done = false;
+
+	state->plane = &mock_plane;
+
+	if (setup_done)
+		return;
+
+	/* just enough so that drm_plane_enable_fb_damage_clips() works */
+	mock_device.driver = &mock_driver;
+	mock_device.mode_config.prop_fb_damage_clips = &mock_prop;
+	mock_plane.dev = &mock_device;
+	mock_plane.base.properties = &mock_obj_props;
+	mock_prop.base.id = 1; /* 0 is an invalid id */
+	mock_prop.dev = &mock_device;
+
+	drm_plane_enable_fb_damage_clips(&mock_plane);
+}
+
 static void set_plane_src(struct drm_plane_state *state, int x1, int y1, int x2,
 			  int y2)
 {
@@ -70,23 +98,29 @@ static bool check_damage_clip(struct drm_plane_state *state, struct drm_rect *r,
 	return true;
 }
 
+const struct drm_framebuffer fb = {
+	.width = 2048,
+	.height = 2048
+};
+
+/* common mocked structs many tests need */
+#define MOCK_VARIABLES() \
+	struct drm_plane_state old_state; \
+	struct drm_plane_state state = { \
+		.crtc = ZERO_SIZE_PTR, \
+		.fb = (struct drm_framebuffer *) &fb, \
+		.visible = true, \
+	}; \
+	mock_setup(&old_state); \
+	mock_setup(&state);
+
 int igt_damage_iter_no_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src same as fb size. */
 	set_plane_src(&old_state, 0, 0, fb.width << 16, fb.height << 16);
@@ -104,20 +138,10 @@ int igt_damage_iter_no_damage(void *ignored)
 int igt_damage_iter_no_damage_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x3fffe, 0x3fffe,
@@ -137,20 +161,10 @@ int igt_damage_iter_no_damage_fractional_src(void *ignored)
 int igt_damage_iter_no_damage_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src moved since old plane state. */
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
@@ -169,20 +183,10 @@ int igt_damage_iter_no_damage_src_moved(void *ignored)
 int igt_damage_iter_no_damage_fractional_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part and it moved since old plane state. */
 	set_plane_src(&old_state, 0x3fffe, 0x3fffe,
@@ -202,20 +206,14 @@ int igt_damage_iter_no_damage_fractional_src_moved(void *ignored)
 int igt_damage_iter_no_damage_not_visible(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
+	MOCK_VARIABLES();
 
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = false,
-	};
+	state.visible = false;
+
+	mock_setup(&old_state);
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -231,19 +229,12 @@ int igt_damage_iter_no_damage_not_visible(void *ignored)
 int igt_damage_iter_no_damage_no_crtc(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
+	MOCK_VARIABLES();
 
-	struct drm_plane_state state = {
-		.crtc = 0,
-		.fb = &fb,
-	};
+	state.crtc = NULL;
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -268,6 +259,8 @@ int igt_damage_iter_no_damage_no_fb(void *ignored)
 		.fb = 0,
 	};
 
+	mock_setup(&old_state);
+
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
 	drm_atomic_helper_damage_iter_init(&iter, &old_state, &state);
@@ -282,22 +275,12 @@ int igt_damage_iter_no_damage_no_fb(void *ignored)
 int igt_damage_iter_simple_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -318,22 +301,12 @@ int igt_damage_iter_simple_damage(void *ignored)
 int igt_damage_iter_single_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -353,22 +326,12 @@ int igt_damage_iter_single_damage(void *ignored)
 int igt_damage_iter_single_damage_intersect_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -389,22 +352,12 @@ int igt_damage_iter_single_damage_intersect_src(void *ignored)
 int igt_damage_iter_single_damage_outside_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -424,22 +377,12 @@ int igt_damage_iter_single_damage_outside_src(void *ignored)
 int igt_damage_iter_single_damage_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x40002, 0x40002,
@@ -462,22 +405,12 @@ int igt_damage_iter_single_damage_fractional_src(void *ignored)
 int igt_damage_iter_single_damage_intersect_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x40002, 0x40002,
@@ -501,22 +434,12 @@ int igt_damage_iter_single_damage_intersect_fractional_src(void *ignored)
 int igt_damage_iter_single_damage_outside_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x40002, 0x40002,
@@ -539,22 +462,12 @@ int igt_damage_iter_single_damage_outside_fractional_src(void *ignored)
 int igt_damage_iter_single_damage_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src moved since old plane state. */
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
@@ -576,22 +489,12 @@ int igt_damage_iter_single_damage_src_moved(void *ignored)
 int igt_damage_iter_single_damage_fractional_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src with fractional part moved since old plane state. */
 	set_plane_src(&old_state, 0x3fffe, 0x3fffe,
@@ -615,22 +518,12 @@ int igt_damage_iter_single_damage_fractional_src_moved(void *ignored)
 int igt_damage_iter_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -656,22 +549,12 @@ int igt_damage_iter_damage(void *ignored)
 int igt_damage_iter_damage_one_intersect(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0x40002, 0x40002,
 		      0x40002 + (1024 << 16), 0x40002 + (768 << 16));
@@ -699,22 +582,12 @@ int igt_damage_iter_damage_one_intersect(void *ignored)
 int igt_damage_iter_damage_one_outside(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -736,22 +609,12 @@ int igt_damage_iter_damage_one_outside(void *ignored)
 int igt_damage_iter_damage_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0x40002, 0x40002,
 		      0x40002 + (1024 << 16), 0x40002 + (768 << 16));
@@ -775,22 +638,14 @@ int igt_damage_iter_damage_src_moved(void *ignored)
 int igt_damage_iter_damage_not_visible(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
+	MOCK_VARIABLES();
 
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = false,
-	};
+	state.visible = false;
 
 	set_plane_src(&old_state, 0x40002, 0x40002,
 		      0x40002 + (1024 << 16), 0x40002 + (768 << 16));
Signature · 1 line
2.24.1
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Fix oops in damage self-tests by mocking damage property

== Series Details ==

== Series Details ==

Series: drm: Fix oops in damage self-tests by mocking damage property
URL : https://patchwork.freedesktop.org/series/93233/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
3efd59452f81 drm: Fix oops in damage self-tests by mocking damage property
-:52: ERROR:INITIALISED_STATIC: do not initialise statics to false
#52: FILE: drivers/gpu/drm/selftests/test-drm_damage_helper.c:22:
+	static bool setup_done = false;

-:83: WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon #83: FILE: drivers/gpu/drm/selftests/test-drm_damage_helper.c:107:
+#define MOCK_VARIABLES() \
+ struct drm_plane_state old_state; \
+ struct drm_plane_state state = { \
+ .crtc = ZERO_SIZE_PTR, \
+ .fb = (struct drm_framebuffer *) &fb, \
+ .visible = true, \
+ }; \
+ mock_setup(&old_state); \
+ mock_setup(&state);

-:87: CHECK:SPACING: No space is necessary after a cast #87: FILE: drivers/gpu/drm/selftests/test-drm_damage_helper.c:111:
+ .fb = (struct drm_framebuffer *) &fb, \

-:572: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <[email protected]>' != 'Signed-off-by: Daniel Vetter <[email protected]>'

total: 1 errors, 2 warnings, 1 checks, 516 lines checked

#2 lore raw

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm: Fix oops in damage self-tests by mocking damage property

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm: Fix oops in damage self-tests by mocking damage property
URL : https://patchwork.freedesktop.org/series/93233/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
-O:drivers/gpu/drm/selftests/test-drm_damage_helper.c:244:25: warning: Using plain integer as NULL pointer
-O:drivers/gpu/drm/selftests/test-drm_damage_helper.c:268:23: warning: Using plain integer as NULL pointer
+drivers/gpu/drm/selftests/test-drm_damage_helper.c:101:30: warning: symbol 'fb' was not declared. Should it be static?
+drivers/gpu/drm/selftests/test-drm_damage_helper.c:14:19: warning: symbol 'mock_driver' was not declared. Should it be static?
+drivers/gpu/drm/selftests/test-drm_damage_helper.c:15:19: warning: symbol 'mock_device' was not declared. Should it be static?
+drivers/gpu/drm/selftests/test-drm_damage_helper.c:16:30: warning: symbol 'mock_obj_props' was not declared. Should it be static?
+drivers/gpu/drm/selftests/test-drm_damage_helper.c:17:18: warning: symbol 'mock_plane' was not declared. Should it be static?
+drivers/gpu/drm/selftests/test-drm_damage_helper.c:18:21: warning: symbol 'mock_prop' was not declared. Should it be static?
+drivers/gpu/drm/selftests/test-drm_damage_helper.c:259:23: warning: Using plain integer as NULL pointer
#3 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm: Fix oops in damage self-tests by mocking damage property

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm: Fix oops in damage self-tests by mocking damage property
URL : https://patchwork.freedesktop.org/series/93233/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10426 -> Patchwork_20748
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/index.html

Known issues
------------

Here are the changes found in Patchwork_20748 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@execlists:
- fi-bsw-nick: [PASS][1] -> [INCOMPLETE][2] ([i915#2782] / [i915#2940])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/fi-bsw-nick/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/fi-bsw-nick/igt@i915_selftest@[email protected]

* igt@runner@aborted:
- fi-bsw-nick: NOTRUN -> [FAIL][3] ([fdo#109271] / [i915#1436])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/fi-bsw-nick/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s0:
- fi-tgl-1115g4: [FAIL][4] ([i915#1888]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/fi-tgl-1115g4/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/fi-tgl-1115g4/igt@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940

Participating hosts (38 -> 31)
------------------------------

Missing (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-apl-guc fi-bdw-samus bat-jsl-1

Build changes
-------------

* Linux: CI_DRM_10426 -> Patchwork_20748

CI-20190529: 20190529
CI_DRM_10426: 58e0d826a80edc36a35a3d394448ccfb3428f237 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6159: 6135b9cc319ed965e3aafb5b2ae2abf4762a06b2 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_20748: 3efd59452f81f0b99cf1b063fe82707dcdc1bd79 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

3efd59452f81 drm: Fix oops in damage self-tests by mocking damage property

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/index.html

#4 lore raw
In reply to Daniel Vetter
I love your patch! Perhaps something to improve:

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master v5.14-rc3 next-20210729] [cannot apply to drm/drm-next]
[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]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-Fix-oops-in-damage-self-tests-by-mocking-damage-property/20210730-175415
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-randconfig-s001-20210730 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/cfe1add77c3c78aec60eb1645950c6aa2daf8b4d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-Fix-oops-in-damage-self-tests-by-mocking-damage-property/20210730-175415
        git checkout cfe1add77c3c78aec60eb1645950c6aa2daf8b4d
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/selftests/

If you fix the issue, kindly add following tag as appropriate

sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/selftests/test-drm_damage_helper.c:15:19: sparse: sparse: symbol 'mock_device' was not declared. Should it be static?
>> drivers/gpu/drm/selftests/test-drm_damage_helper.c:16:30: sparse: sparse: symbol 'mock_obj_props' was not declared. Should it be static?
>> drivers/gpu/drm/selftests/test-drm_damage_helper.c:17:18: sparse: sparse: symbol 'mock_plane' was not declared. Should it be static?
>> drivers/gpu/drm/selftests/test-drm_damage_helper.c:18:21: sparse: sparse: symbol 'mock_prop' was not declared. Should it be static?

drivers/gpu/drm/selftests/test-drm_damage_helper.c:101:30: sparse: sparse: symbol 'fb' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:259:23: sparse: sparse: Using plain integer as NULL pointer

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#5 lore raw

[RFC PATCH] drm: mock_device can be static

In reply to Daniel Vetter
drivers/gpu/drm/selftests/test-drm_damage_helper.c:15:19: warning: symbol 'mock_device' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:16:30: warning…

drivers/gpu/drm/selftests/test-drm_damage_helper.c:15:19: warning: symbol 'mock_device' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:16:30: warning: symbol 'mock_obj_props' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:17:18: warning: symbol 'mock_plane' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:18:21: warning: symbol 'mock_prop' was not declared. Should it be static?

---
 test-drm_damage_helper.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/selftests/test-drm_damage_helper.c +4 -4
index 1b585c13e042fe..1c19a5d3eefbf8 100644
@@ -12,10 +12,10 @@
 #include "test-drm_modeset_common.h"
 
 struct drm_driver mock_driver;
-struct drm_device mock_device;
-struct drm_object_properties mock_obj_props;
-struct drm_plane mock_plane;
-struct drm_property mock_prop;
+static struct drm_device mock_device;
+static struct drm_object_properties mock_obj_props;
+static struct drm_plane mock_plane;
+static struct drm_property mock_prop;
 
 static void mock_setup(struct drm_plane_state *state)
 {
#6 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for drm: Fix oops in damage self-tests by mocking damage property

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: drm: Fix oops in damage self-tests by mocking damage property
URL : https://patchwork.freedesktop.org/series/93233/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10426_full -> Patchwork_20748_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Known issues
------------

Here are the changes found in Patchwork_20748_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@feature_discovery@display-2x:
- shard-iclb: NOTRUN -> [SKIP][1] ([i915#1839])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb4/igt@[email protected]

* igt@gem_create@create-massive:
- shard-skl: NOTRUN -> [DMESG-WARN][2] ([i915#3002])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl8/igt@[email protected]
- shard-apl: NOTRUN -> [DMESG-WARN][3] ([i915#3002])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl1/igt@[email protected]

* igt@gem_ctx_persistence@idempotent:
- shard-snb: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#1099]) +5 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-snb2/igt@[email protected]

* igt@gem_ctx_persistence@legacy-engines-hang@render:
- shard-tglb: [PASS][5] -> [FAIL][6] ([i915#2410])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-tglb8/igt@gem_ctx_persistence@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb3/igt@gem_ctx_persistence@[email protected]

* igt@gem_eio@unwedge-stress:
- shard-tglb: [PASS][7] -> [TIMEOUT][8] ([i915#2369] / [i915#3063] / [i915#3648])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-tglb1/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb7/igt@[email protected]

* igt@gem_exec_fair@basic-deadline:
- shard-apl: NOTRUN -> [FAIL][9] ([i915#2846])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl3/igt@[email protected]

* igt@gem_exec_fair@basic-pace-solo@rcs0:
- shard-kbl: [PASS][10] -> [FAIL][11] ([i915#2842])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-kbl1/igt@gem_exec_fair@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl7/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs1:
- shard-tglb: [PASS][12] -> [FAIL][13] ([i915#2842])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-tglb5/igt@gem_exec_fair@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb5/igt@gem_exec_fair@[email protected]

* igt@gem_pwrite@basic-exhaustion:
- shard-iclb: NOTRUN -> [WARN][14] ([i915#2658])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]
- shard-tglb: NOTRUN -> [WARN][15] ([i915#2658])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]
- shard-glk: NOTRUN -> [WARN][16] ([i915#2658])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk6/igt@[email protected]

* igt@gem_render_copy@y-tiled-mc-ccs-to-y-tiled-ccs:
- shard-iclb: NOTRUN -> [SKIP][17] ([i915#768])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@gem_userptr_blits@access-control:
- shard-tglb: NOTRUN -> [SKIP][18] ([i915#3297])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][19] ([i915#3297])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@gem_userptr_blits@dmabuf-sync:
- shard-apl: NOTRUN -> [SKIP][20] ([fdo#109271] / [i915#3323])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl3/igt@[email protected]

* igt@gem_userptr_blits@vma-merge:
- shard-snb: NOTRUN -> [FAIL][21] ([i915#2724])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-snb2/igt@[email protected]

* igt@gen3_render_tiledy_blits:
- shard-tglb: NOTRUN -> [SKIP][22] ([fdo#109289])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@gen3_render_tiledy_blits.html
- shard-iclb: NOTRUN -> [SKIP][23] ([fdo#109289])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@gen3_render_tiledy_blits.html

* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
- shard-kbl: NOTRUN -> [SKIP][24] ([fdo#109271] / [i915#1937])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl3/igt@i915_pm_lpsp@[email protected]

* igt@i915_pm_rpm@modeset-lpsp-stress:
- shard-tglb: NOTRUN -> [SKIP][25] ([i915#579]) +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb3/igt@[email protected]

* igt@i915_pm_rpm@reg-read-ioctl:
- shard-iclb: NOTRUN -> [SKIP][26] ([i915#579])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@i915_suspend@fence-restore-untiled:
- shard-apl: NOTRUN -> [DMESG-WARN][27] ([i915#180])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl8/igt@[email protected]

* igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-hflip:
- shard-apl: NOTRUN -> [SKIP][28] ([fdo#109271] / [i915#3777]) +2 similar issues
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl8/igt@[email protected]

* igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0-hflip-async-flip:
- shard-iclb: [PASS][29] -> [DMESG-WARN][30] ([i915#3621])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-iclb5/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0-hflip-async-flip.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb1/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0-hflip-async-flip.html

* igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip:
- shard-glk: NOTRUN -> [SKIP][31] ([fdo#109271] / [i915#3777]) +1 similar issue
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk6/igt@[email protected]

* igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-async-flip:
- shard-iclb: NOTRUN -> [SKIP][32] ([fdo#110723]) +1 similar issue
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-async-flip.html
- shard-tglb: NOTRUN -> [SKIP][33] ([fdo#111615])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-async-flip.html

* igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
- shard-skl: NOTRUN -> [SKIP][34] ([fdo#109271]) +85 similar issues
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl8/igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html

* igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_ccs:
- shard-snb: NOTRUN -> [SKIP][35] ([fdo#109271]) +355 similar issues
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-snb2/igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_ccs.html

* igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_mc_ccs:
- shard-tglb: NOTRUN -> [SKIP][36] ([i915#3689]) +5 similar issues
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb3/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_mc_ccs.html

* igt@kms_ccs@pipe-d-crc-sprite-planes-basic-yf_tiled_ccs:
- shard-glk: NOTRUN -> [SKIP][37] ([fdo#109271]) +44 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk2/igt@kms_ccs@pipe-d-crc-sprite-planes-basic-yf_tiled_ccs.html

* igt@kms_chamelium@vga-hpd-after-suspend:
- shard-tglb: NOTRUN -> [SKIP][38] ([fdo#109284] / [fdo#111827]) +2 similar issues
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]
- shard-glk: NOTRUN -> [SKIP][39] ([fdo#109271] / [fdo#111827]) +2 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk6/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][40] ([fdo#109284] / [fdo#111827]) +1 similar issue
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@kms_color_chamelium@pipe-a-ctm-blue-to-red:
- shard-snb: NOTRUN -> [SKIP][41] ([fdo#109271] / [fdo#111827]) +18 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-snb7/igt@[email protected]

* igt@kms_color_chamelium@pipe-a-ctm-limited-range:
- shard-apl: NOTRUN -> [SKIP][42] ([fdo#109271] / [fdo#111827]) +19 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl8/igt@[email protected]

* igt@kms_color_chamelium@pipe-c-ctm-limited-range:
- shard-kbl: NOTRUN -> [SKIP][43] ([fdo#109271] / [fdo#111827]) +7 similar issues
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl3/igt@[email protected]

* igt@kms_color_chamelium@pipe-invalid-ctm-matrix-sizes:
- shard-skl: NOTRUN -> [SKIP][44] ([fdo#109271] / [fdo#111827]) +6 similar issues
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl5/igt@[email protected]

* igt@kms_content_protection@atomic-dpms:
- shard-apl: NOTRUN -> [TIMEOUT][45] ([i915#1319]) +1 similar issue
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl2/igt@[email protected]

* igt@kms_content_protection@dp-mst-type-0:
- shard-tglb: NOTRUN -> [SKIP][46] ([i915#3116])
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][47] ([i915#3116])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@kms_content_protection@legacy:
- shard-tglb: NOTRUN -> [SKIP][48] ([fdo#111828])
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb1/igt@[email protected]

* igt@kms_cursor_crc@pipe-b-cursor-128x128-sliding:
- shard-skl: [PASS][49] -> [FAIL][50] ([i915#3444])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-skl10/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl9/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-512x170-onscreen:
- shard-iclb: NOTRUN -> [SKIP][51] ([fdo#109278] / [fdo#109279])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb4/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-max-size-onscreen:
- shard-tglb: NOTRUN -> [SKIP][52] ([i915#3359]) +2 similar issues
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]

* igt@kms_cursor_crc@pipe-d-cursor-32x32-sliding:
- shard-tglb: NOTRUN -> [SKIP][53] ([i915#3319]) +1 similar issue
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]

* igt@kms_cursor_crc@pipe-d-cursor-512x512-sliding:
- shard-tglb: NOTRUN -> [SKIP][54] ([fdo#109279] / [i915#3359])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb3/igt@[email protected]

* igt@kms_cursor_legacy@cursorb-vs-flipa-atomic:
- shard-iclb: NOTRUN -> [SKIP][55] ([fdo#109274] / [fdo#109278])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: [PASS][56] -> [FAIL][57] ([i915#2346] / [i915#533])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-skl3/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

* igt@kms_cursor_legacy@pipe-d-torture-bo:
- shard-apl: NOTRUN -> [SKIP][58] ([fdo#109271] / [i915#533]) +2 similar issues
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl2/igt@[email protected]

* igt@kms_fbcon_fbt@fbc-suspend:
- shard-kbl: [PASS][59] -> [INCOMPLETE][60] ([i915#155] / [i915#180] / [i915#636])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-kbl7/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl7/igt@[email protected]

* igt@kms_flip@2x-blocking-wf_vblank:
- shard-iclb: NOTRUN -> [SKIP][61] ([fdo#109274]) +1 similar issue
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb4/igt@kms_flip@2x-blocking-wf_vblank.html

* igt@kms_flip@flip-vs-suspend@a-edp1:
- shard-skl: [PASS][62] -> [INCOMPLETE][63] ([i915#198] / [i915#2910])
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-skl9/igt@kms_flip@[email protected]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl3/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-suspend@c-dp1:
- shard-apl: [PASS][64] -> [DMESG-WARN][65] ([i915#180])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-apl8/igt@kms_flip@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl7/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-ts-check-interruptible@a-hdmi-a2:
- shard-glk: [PASS][66] -> [FAIL][67] ([i915#2122]) +1 similar issue
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-glk6/igt@kms_flip@[email protected]
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk5/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile:
- shard-tglb: NOTRUN -> [SKIP][68] ([i915#2587])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb1/igt@[email protected]

* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytilercccs:
- shard-glk: NOTRUN -> [SKIP][69] ([fdo#109271] / [i915#2672])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk6/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][70] ([i915#2587])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-pgflip-blt:
- shard-iclb: NOTRUN -> [SKIP][71] ([fdo#109280]) +8 similar issues
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-shrfb-msflip-blt:
- shard-tglb: NOTRUN -> [SKIP][72] ([fdo#111825]) +15 similar issues
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-wc:
- shard-kbl: NOTRUN -> [SKIP][73] ([fdo#109271]) +77 similar issues
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl7/igt@[email protected]

* igt@kms_hdr@bpc-switch:
- shard-skl: [PASS][74] -> [FAIL][75] ([i915#1188])
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-skl7/igt@[email protected]
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl3/igt@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes:
- shard-kbl: [PASS][76] -> [DMESG-WARN][77] ([i915#180]) +2 similar issues
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-kbl3/igt@kms_plane@[email protected]
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl6/igt@kms_plane@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
- shard-apl: NOTRUN -> [FAIL][78] ([fdo#108145] / [i915#265]) +3 similar issues
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl2/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
- shard-skl: NOTRUN -> [FAIL][79] ([fdo#108145] / [i915#265])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl5/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][80] -> [FAIL][81] ([fdo#108145] / [i915#265])
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-skl7/igt@[email protected]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl5/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-d-constant-alpha-max:
- shard-iclb: NOTRUN -> [SKIP][82] ([fdo#109278]) +7 similar issues
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@kms_plane_lowres@pipe-c-tiling-y:
- shard-iclb: NOTRUN -> [SKIP][83] ([i915#3536])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][84] ([i915#3536])
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]

* igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
- shard-apl: NOTRUN -> [SKIP][85] ([fdo#109271] / [i915#2733])
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl8/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html

* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2:
- shard-apl: NOTRUN -> [SKIP][86] ([fdo#109271] / [i915#658]) +5 similar issues
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl1/igt@[email protected]

* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4:
- shard-glk: NOTRUN -> [SKIP][87] ([fdo#109271] / [i915#658])
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk2/igt@[email protected]

* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-2:
- shard-kbl: NOTRUN -> [SKIP][88] ([fdo#109271] / [i915#658])
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl3/igt@[email protected]

* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-5:
- shard-skl: NOTRUN -> [SKIP][89] ([fdo#109271] / [i915#658])
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl5/igt@[email protected]

* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][90] -> [SKIP][91] ([fdo#109441]) +3 similar issues
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb3/igt@kms_psr@psr2_cursor_render.html

* igt@kms_vblank@pipe-a-query-forked-busy:
- shard-snb: [PASS][92] -> [SKIP][93] ([fdo#109271])
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-snb6/igt@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-snb2/igt@[email protected]

* igt@kms_vblank@pipe-b-ts-continuation-suspend:
- shard-kbl: NOTRUN -> [DMESG-WARN][94] ([i915#180]) +1 similar issue
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl7/igt@[email protected]

* igt@kms_vblank@pipe-d-wait-idle:
- shard-skl: NOTRUN -> [SKIP][95] ([fdo#109271] / [i915#533]) +1 similar issue
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl5/igt@[email protected]

* igt@kms_writeback@writeback-check-output:
- shard-apl: NOTRUN -> [SKIP][96] ([fdo#109271] / [i915#2437])
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl2/igt@[email protected]

* igt@nouveau_crc@pipe-a-ctx-flip-skip-current-frame:
- shard-tglb: NOTRUN -> [SKIP][97] ([i915#2530])
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb1/igt@[email protected]

* igt@prime_nv_api@i915_nv_reimport_twice_check_flink_name:
- shard-apl: NOTRUN -> [SKIP][98] ([fdo#109271]) +243 similar issues
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl8/igt@prime_nv_api@i915_nv_reimport_twice_check_flink_name.html

* igt@prime_vgem@fence-read-hang:
- shard-tglb: NOTRUN -> [SKIP][99] ([fdo#109295])
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb2/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][100] ([fdo#109295])
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb8/igt@[email protected]

* igt@sysfs_clients@pidname:
- shard-apl: NOTRUN -> [SKIP][101] ([fdo#109271] / [i915#2994]) +4 similar issues
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-apl2/igt@[email protected]

* igt@sysfs_clients@split-10:
- shard-skl: NOTRUN -> [SKIP][102] ([fdo#109271] / [i915#2994]) +1 similar issue
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl4/igt@[email protected]

* igt@sysfs_clients@split-25:
- shard-kbl: NOTRUN -> [SKIP][103] ([fdo#109271] / [i915#2994]) +1 similar issue
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-kbl3/igt@[email protected]

* igt@sysfs_preempt_timeout@timeout@bcs0:
- shard-skl: [PASS][104] -> [FAIL][105] ([i915#2821])
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-skl8/igt@sysfs_preempt_timeout@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl10/igt@sysfs_preempt_timeout@[email protected]

#### Possible fixes ####

* igt@fbdev@read:
- {shard-rkl}: [SKIP][106] ([i915#2582]) -> [PASS][107]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-2/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-6/igt@[email protected]

* igt@gem_ctx_persistence@many-contexts:
- {shard-rkl}: [FAIL][108] ([i915#2410]) -> [PASS][109]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-1/igt@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-5/igt@[email protected]

* igt@gem_eio@in-flight-contexts-10ms:
- shard-tglb: [TIMEOUT][110] ([i915#3063]) -> [PASS][111] +1 similar issue
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-tglb3/igt@[email protected]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb8/igt@[email protected]

* igt@gem_eio@reset-stress:
- {shard-rkl}: [FAIL][112] ([i915#3115]) -> [PASS][113]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-2/igt@[email protected]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-6/igt@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [FAIL][114] ([i915#2842]) -> [PASS][115] +1 similar issue
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-glk6/igt@gem_exec_fair@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk5/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@rcs0:
- {shard-rkl}: [FAIL][116] ([i915#2842]) -> [PASS][117] +2 similar issues
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-6/igt@gem_exec_fair@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-5/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vecs0:
- shard-tglb: [FAIL][118] ([i915#2842]) -> [PASS][119] +1 similar issue
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-tglb5/igt@gem_exec_fair@[email protected]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-tglb5/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-throttle@rcs0:
- shard-iclb: [FAIL][120] ([i915#2849]) -> [PASS][121]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-iclb6/igt@gem_exec_fair@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-iclb6/igt@gem_exec_fair@[email protected]

* igt@gem_exec_suspend@basic-s4-devices:
- {shard-rkl}: [INCOMPLETE][122] ([i915#3189] / [i915#3810]) -> [PASS][123]
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-2/igt@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-6/igt@[email protected]

* igt@gem_exec_whisper@basic-queues-forked:
- shard-glk: [DMESG-WARN][124] ([i915#118] / [i915#95]) -> [PASS][125]
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-glk8/igt@[email protected]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk7/igt@[email protected]

* igt@gem_mmap_gtt@cpuset-big-copy:
- shard-glk: [FAIL][126] ([i915#1888] / [i915#307]) -> [PASS][127]
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-glk8/igt@[email protected]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-glk7/igt@[email protected]

* igt@gem_mmap_wc@set-cache-level:
- {shard-rkl}: [SKIP][128] ([i915#1850]) -> [PASS][129]
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-5/igt@[email protected]
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-6/igt@[email protected]

* igt@gen9_exec_parse@allowed-single:
- shard-skl: [DMESG-WARN][130] ([i915#1436] / [i915#716]) -> [PASS][131]
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-skl6/igt@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-skl8/igt@[email protected]

* igt@i915_pm_dc@dc5-psr:
- {shard-rkl}: [SKIP][132] ([i915#658]) -> [PASS][133]
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-5/igt@[email protected]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-6/igt@[email protected]

* igt@i915_pm_rpm@gem-evict-pwrite:
- {shard-rkl}: [SKIP][134] ([i915#3844] / [i915#579]) -> [PASS][135] +3 similar issues
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-6/igt@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-rkl-1/igt@[email protected]

* igt@i915_selftest@live@hangcheck:
- shard-snb: [INCOMPLETE][136] ([i915#2782]) -> [PASS][137]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-snb7/igt@i915_selftest@[email protected]
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/shard-snb7/igt@i915_selftest@[email protected]

* igt@i915_suspend@fence-restore-tiled2untiled:
- {shard-rkl}: [FAIL][138] ([fdo#103375]) -> [PASS][139]
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10426/shard-rkl-6/igt@[email protected]
[139]: https://intel-gfx-

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20748/index.html

maintainer Reviewed-by on v1 1/1
#7 lore raw
In reply to Daniel Vetter

Op 30-07-2021 om 11:52 schreef Daniel Vetter:

Quoted 557 lines

I've added a new check to make sure that drivers which insepct the damage property have it set up correctly, but somehow missed that this borke the damage selftest in the CI result noise.

Fix it up by mocking enough of drm_device and drm_plane so we can call drm_plane_enable_fb_damage_clips() to make the new check happy.

Since there's a lot of duplicated mock code already copy-pasted into each test I've also refactored this a bit to trim it down.

Fixes c7fcbf251397 ("drm/plane: check that fb_damage is set up when used")
Cc José Roberto de Souza <[email protected]> (v1)
Cc Ville Syrjälä <[email protected]>
Cc Gwan-gyeong Mun <[email protected]>
Cc José Roberto de Souza <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
---
 .../drm/selftests/test-drm_damage_helper.c    | 287 +++++-------------
 1 file changed, 71 insertions(+), 216 deletions(-)
drivers/gpu/drm/selftests/test-drm_damage_helper.c +70 -211
index 9d2bcdf8bc29..1b585c13e042 100644
@@ -6,9 +6,37 @@
 #define pr_fmt(fmt) "drm_damage_helper: " fmt
 
 #include <drm/drm_damage_helper.h>
+#include <drm/drm_plane.h>
+#include <drm/drm_drv.h>
 
 #include "test-drm_modeset_common.h"
 
+struct drm_driver mock_driver;
+struct drm_device mock_device;
+struct drm_object_properties mock_obj_props;
+struct drm_plane mock_plane;
+struct drm_property mock_prop;
+
+static void mock_setup(struct drm_plane_state *state)
+{
+	static bool setup_done = false;
+
+	state->plane = &mock_plane;
+
+	if (setup_done)
+		return;
+
+	/* just enough so that drm_plane_enable_fb_damage_clips() works */
+	mock_device.driver = &mock_driver;
+	mock_device.mode_config.prop_fb_damage_clips = &mock_prop;
+	mock_plane.dev = &mock_device;
+	mock_plane.base.properties = &mock_obj_props;
+	mock_prop.base.id = 1; /* 0 is an invalid id */
+	mock_prop.dev = &mock_device;
+
+	drm_plane_enable_fb_damage_clips(&mock_plane);
+}
+
 static void set_plane_src(struct drm_plane_state *state, int x1, int y1, int x2,
 			  int y2)
 {
@@ -70,23 +98,29 @@ static bool check_damage_clip(struct drm_plane_state *state, struct drm_rect *r,
 	return true;
 }
 
+const struct drm_framebuffer fb = {
+	.width = 2048,
+	.height = 2048
+};
+
+/* common mocked structs many tests need */
+#define MOCK_VARIABLES() \
+	struct drm_plane_state old_state; \
+	struct drm_plane_state state = { \
+		.crtc = ZERO_SIZE_PTR, \
+		.fb = (struct drm_framebuffer *) &fb, \
+		.visible = true, \
+	}; \
+	mock_setup(&old_state); \
+	mock_setup(&state);
+
 int igt_damage_iter_no_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src same as fb size. */
 	set_plane_src(&old_state, 0, 0, fb.width << 16, fb.height << 16);
@@ -104,20 +138,10 @@ int igt_damage_iter_no_damage(void *ignored)
 int igt_damage_iter_no_damage_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x3fffe, 0x3fffe,
@@ -137,20 +161,10 @@ int igt_damage_iter_no_damage_fractional_src(void *ignored)
 int igt_damage_iter_no_damage_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src moved since old plane state. */
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
@@ -169,20 +183,10 @@ int igt_damage_iter_no_damage_src_moved(void *ignored)
 int igt_damage_iter_no_damage_fractional_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part and it moved since old plane state. */
 	set_plane_src(&old_state, 0x3fffe, 0x3fffe,
@@ -202,20 +206,14 @@ int igt_damage_iter_no_damage_fractional_src_moved(void *ignored)
 int igt_damage_iter_no_damage_not_visible(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
+	MOCK_VARIABLES();
 
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = false,
-	};
+	state.visible = false;
+
+	mock_setup(&old_state);
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -231,19 +229,12 @@ int igt_damage_iter_no_damage_not_visible(void *ignored)
 int igt_damage_iter_no_damage_no_crtc(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
+	MOCK_VARIABLES();
 
-	struct drm_plane_state state = {
-		.crtc = 0,
-		.fb = &fb,
-	};
+	state.crtc = NULL;
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -268,6 +259,8 @@ int igt_damage_iter_no_damage_no_fb(void *ignored)
 		.fb = 0,
 	};
 
+	mock_setup(&old_state);
+
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
 	drm_atomic_helper_damage_iter_init(&iter, &old_state, &state);
@@ -282,22 +275,12 @@ int igt_damage_iter_no_damage_no_fb(void *ignored)
 int igt_damage_iter_simple_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -318,22 +301,12 @@ int igt_damage_iter_simple_damage(void *ignored)
 int igt_damage_iter_single_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -353,22 +326,12 @@ int igt_damage_iter_single_damage(void *ignored)
 int igt_damage_iter_single_damage_intersect_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -389,22 +352,12 @@ int igt_damage_iter_single_damage_intersect_src(void *ignored)
 int igt_damage_iter_single_damage_outside_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -424,22 +377,12 @@ int igt_damage_iter_single_damage_outside_src(void *ignored)
 int igt_damage_iter_single_damage_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x40002, 0x40002,
@@ -462,22 +405,12 @@ int igt_damage_iter_single_damage_fractional_src(void *ignored)
 int igt_damage_iter_single_damage_intersect_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x40002, 0x40002,
@@ -501,22 +434,12 @@ int igt_damage_iter_single_damage_intersect_fractional_src(void *ignored)
 int igt_damage_iter_single_damage_outside_fractional_src(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src has fractional part. */
 	set_plane_src(&old_state, 0x40002, 0x40002,
@@ -539,22 +462,12 @@ int igt_damage_iter_single_damage_outside_fractional_src(void *ignored)
 int igt_damage_iter_single_damage_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src moved since old plane state. */
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
@@ -576,22 +489,12 @@ int igt_damage_iter_single_damage_src_moved(void *ignored)
 int igt_damage_iter_single_damage_fractional_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage;
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	/* Plane src with fractional part moved since old plane state. */
 	set_plane_src(&old_state, 0x3fffe, 0x3fffe,
@@ -615,22 +518,12 @@ int igt_damage_iter_single_damage_fractional_src_moved(void *ignored)
 int igt_damage_iter_damage(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -656,22 +549,12 @@ int igt_damage_iter_damage(void *ignored)
 int igt_damage_iter_damage_one_intersect(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0x40002, 0x40002,
 		      0x40002 + (1024 << 16), 0x40002 + (768 << 16));
@@ -699,22 +582,12 @@ int igt_damage_iter_damage_one_intersect(void *ignored)
 int igt_damage_iter_damage_one_outside(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0, 0, 1024 << 16, 768 << 16);
 	set_plane_src(&state, 0, 0, 1024 << 16, 768 << 16);
@@ -736,22 +609,12 @@ int igt_damage_iter_damage_one_outside(void *ignored)
 int igt_damage_iter_damage_src_moved(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
-
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = true,
-	};
+	MOCK_VARIABLES();
 
 	set_plane_src(&old_state, 0x40002, 0x40002,
 		      0x40002 + (1024 << 16), 0x40002 + (768 << 16));
@@ -775,22 +638,14 @@ int igt_damage_iter_damage_src_moved(void *ignored)
 int igt_damage_iter_damage_not_visible(void *ignored)
 {
 	struct drm_atomic_helper_damage_iter iter;
-	struct drm_plane_state old_state;
 	struct drm_property_blob damage_blob;
 	struct drm_mode_rect damage[2];
 	struct drm_rect clip;
 	uint32_t num_hits = 0;
 
-	struct drm_framebuffer fb = {
-		.width = 2048,
-		.height = 2048
-	};
+	MOCK_VARIABLES();

drivers/gpu/drm/selftests/test-drm_damage_helper.c int igt_damage_iter_damage_src_moved(void *ignored) · line 651

Quoted 10 lines
drivers/gpu/drm/selftests/test-drm_damage_helper.c +1 -5
 
-	struct drm_plane_state state = {
-		.crtc = ZERO_SIZE_PTR,
-		.fb = &fb,
-		.visible = false,
-	};
+	state.visible = false;
 
 	set_plane_src(&old_state, 0x40002, 0x40002,
 		      0x40002 + (1024 << 16), 0x40002 + (768 << 16));