Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/4] tests/kms_async_flips: Ger rid of i915 specific fb creation
@ 2023-05-16  6:22 Arun R Murthy
  2023-05-16  6:22 ` [igt-dev] [PATCH i-g-t 2/4] " Arun R Murthy
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Arun R Murthy @ 2023-05-16  6:22 UTC (permalink / raw)
  To: igt-dev; +Cc: Arun R Murthy

No idea why the test wants to create the fb differently between i915
vs. others. Unify it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
---
 tests/kms_async_flips.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 51ffa523..fe27a9ec 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -115,6 +115,15 @@ static void wait_flip_event(data_t *data)
 	}
 }
 
+static uint64_t default_modifier(data_t *data)
+{
+	if (igt_display_has_format_mod(&data->display, DRM_FORMAT_XRGB8888,
+				       I915_FORMAT_MOD_X_TILED))
+		return I915_FORMAT_MOD_X_TILED;
+	else
+		return DRM_FORMAT_MOD_LINEAR;
+}
+
 static void make_fb(data_t *data, struct igt_fb *fb,
 		    uint32_t width, uint32_t height, int index)
 {
@@ -123,14 +132,8 @@ static void make_fb(data_t *data, struct igt_fb *fb,
 
 	rec_width = width / (ARRAY_SIZE(data->bufs) * 2);
 
-	if (is_i915_device(data->drm_fd)) {
-		igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
-			      I915_FORMAT_MOD_X_TILED, fb);
-		igt_draw_fill_fb(data->drm_fd, fb, 0x88);
-	} else {
-		igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
-				    DRM_FORMAT_MOD_LINEAR, 0.0, 0.0, 0.5, fb);
-	}
+	igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
+			    default_modifier(data), 0.0, 0.0, 0.5, fb);
 
 	cr = igt_get_cairo_ctx(data->drm_fd, fb);
 	igt_paint_color_rand(cr, rec_width * 2 + rec_width * index, 0, rec_width, height);
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread
* [igt-dev] [PATCHv2 i-g-t 1/4] tests/kms_async_flips: Get rid of i915 specific fb creation
@ 2023-05-18 12:13 Arun R Murthy
  2023-05-18 12:13 ` [igt-dev] [PATCHv3 i-g-t 2/4] tests/kms_async_flips: Run the test for all outputs Arun R Murthy
  0 siblings, 1 reply; 26+ messages in thread
From: Arun R Murthy @ 2023-05-18 12:13 UTC (permalink / raw)
  To: igt-dev; +Cc: Arun R Murthy

No idea why the test wants to create the fb differently between i915
vs. others. Unify it.

v2: some correction in commit message

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
---
 tests/kms_async_flips.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 51ffa523..fe27a9ec 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -115,6 +115,15 @@ static void wait_flip_event(data_t *data)
 	}
 }
 
+static uint64_t default_modifier(data_t *data)
+{
+	if (igt_display_has_format_mod(&data->display, DRM_FORMAT_XRGB8888,
+				       I915_FORMAT_MOD_X_TILED))
+		return I915_FORMAT_MOD_X_TILED;
+	else
+		return DRM_FORMAT_MOD_LINEAR;
+}
+
 static void make_fb(data_t *data, struct igt_fb *fb,
 		    uint32_t width, uint32_t height, int index)
 {
@@ -123,14 +132,8 @@ static void make_fb(data_t *data, struct igt_fb *fb,
 
 	rec_width = width / (ARRAY_SIZE(data->bufs) * 2);
 
-	if (is_i915_device(data->drm_fd)) {
-		igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
-			      I915_FORMAT_MOD_X_TILED, fb);
-		igt_draw_fill_fb(data->drm_fd, fb, 0x88);
-	} else {
-		igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
-				    DRM_FORMAT_MOD_LINEAR, 0.0, 0.0, 0.5, fb);
-	}
+	igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
+			    default_modifier(data), 0.0, 0.0, 0.5, fb);
 
 	cr = igt_get_cairo_ctx(data->drm_fd, fb);
 	igt_paint_color_rand(cr, rec_width * 2 + rec_width * index, 0, rec_width, height);
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-05-19  5:09 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16  6:22 [igt-dev] [PATCH i-g-t 1/4] tests/kms_async_flips: Ger rid of i915 specific fb creation Arun R Murthy
2023-05-16  6:22 ` [igt-dev] [PATCH i-g-t 2/4] " Arun R Murthy
2023-05-17 11:10   ` Kamil Konieczny
2023-05-17 11:26     ` Murthy, Arun R
2023-05-16  6:22 ` [igt-dev] [PATCH i-g-t 3/4] tests/kms_async_flips: Split test_init() Arun R Murthy
2023-05-17  9:04   ` Karthik B S
2023-05-16  6:22 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_async_flips: Test all modifiers Arun R Murthy
2023-05-17  9:01   ` Karthik B S
2023-05-16  6:55 ` [igt-dev] [PATCH i-g-t 1/4] tests/kms_async_flips: Ger rid of i915 specific fb creation Saarinen, Jani
2023-05-16  7:24 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] " Patchwork
2023-05-17  3:50 ` [igt-dev] [PATCHv2 i-g-t 1/4] tests/kms_async_flips: Get " Arun R Murthy
2023-05-17  3:50   ` [igt-dev] [PATCHv2 i-g-t 2/4] tests/kms_async_flips: Run the test only once per pipe Arun R Murthy
2023-05-17  6:33     ` Karthik B S
2023-05-17  7:51       ` Murthy, Arun R
2023-05-17  5:49   ` [igt-dev] [PATCHv2 i-g-t 1/4] tests/kms_async_flips: Get rid of i915 specific fb creation Karthik B S
2023-05-17  4:45 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [PATCHv2,i-g-t,1/4] tests/kms_async_flips: Get rid of i915 specific fb creation (rev2) Patchwork
2023-05-17 14:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-05-18 11:25 ` [igt-dev] [PATCHv2 i-g-t 1/4] tests/kms_async_flips: Get rid of i915 specific fb creation Arun R Murthy
2023-05-18 11:25   ` [igt-dev] [PATCHv3 i-g-t 2/4] tests/kms_async_flips: Run the test for all outputs Arun R Murthy
2023-05-18 11:56     ` Karthik B S
2023-05-18 11:25   ` [igt-dev] [PATCH i-g-t 3/4] tests/kms_async_flips: Split test_init() Arun R Murthy
2023-05-18 11:25   ` [igt-dev] [PATCHv2 i-g-t 4/4] tests/kms_async_flips: Test all modifiers Arun R Murthy
2023-05-18 11:58     ` Karthik B S
2023-05-18 11:58 ` [igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [i-g-t,3/4] tests/kms_async_flips: Split test_init() (rev5) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-05-18 12:13 [igt-dev] [PATCHv2 i-g-t 1/4] tests/kms_async_flips: Get rid of i915 specific fb creation Arun R Murthy
2023-05-18 12:13 ` [igt-dev] [PATCHv3 i-g-t 2/4] tests/kms_async_flips: Run the test for all outputs Arun R Murthy
2023-05-19  5:08   ` Karthik B S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox