All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/6] tests/kms_flip_scaled_crc: Remove open coded igt_create_color_fb()
Date: Fri, 16 Apr 2021 20:53:07 +0300	[thread overview]
Message-ID: <20210416175312.25190-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20210416175312.25190-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Replace the hand rolled igt_create_color_fb() with the
real thing.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_flip_scaled_crc.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/tests/kms_flip_scaled_crc.c b/tests/kms_flip_scaled_crc.c
index 35417396e980..8153fb890a17 100644
--- a/tests/kms_flip_scaled_crc.c
+++ b/tests/kms_flip_scaled_crc.c
@@ -94,34 +94,11 @@ const struct {
 static void setup_fb(data_t *data, struct igt_fb *newfb, uint32_t width,
 		     uint32_t height, uint64_t format, uint64_t modifier)
 {
-	struct drm_mode_fb_cmd2 f = {0};
-	cairo_t *cr;
-
 	igt_require(igt_display_has_format_mod(&data->display, format,
 					       modifier));
 
-	igt_create_bo_for_fb(data->drm_fd, width, height, format, modifier,
-			     newfb);
-	igt_assert(newfb->gem_handle > 0);
-
-	f.width = newfb->width;
-	f.height = newfb->height;
-	f.pixel_format = newfb->drm_format;
-	f.flags = LOCAL_DRM_MODE_FB_MODIFIERS;
-
-	for (int n = 0; n < newfb->num_planes; n++) {
-		f.handles[n] = newfb->gem_handle;
-		f.modifier[n] = newfb->modifier;
-		f.pitches[n] = newfb->strides[n];
-		f.offsets[n] = newfb->offsets[n];
-	}
-
-	cr = igt_get_cairo_ctx(data->drm_fd, newfb);
-	igt_paint_color(cr, 0, 0, newfb->width, newfb->height, 0, 1, 0);
-	igt_put_cairo_ctx(cr);
-
-	igt_assert(drmIoctl(data->drm_fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0);
-	newfb->fb_id = f.fb_id;
+	igt_create_color_fb(data->drm_fd, width, height,
+			    format, modifier, 0, 1, 0, newfb);
 }
 
 static void free_fbs(data_t *data)
-- 
2.26.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-04-16 17:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 17:53 [igt-dev] [PATCH i-g-t 0/6] tests/kms_flip_scaled_crc: Fix a bunch of fail Ville Syrjala
2021-04-16 17:53 ` Ville Syrjala [this message]
2021-04-16 17:53 ` [igt-dev] [PATCH i-g-t 2/6] tests/kms_flip_scaled_crc: Don't leak the fbs between subtests Ville Syrjala
2021-04-16 17:53 ` [igt-dev] [PATCH i-g-t 3/6] tests/kms_flip_scaled_crc: Use igt_assert_crc_equal() Ville Syrjala
2021-04-16 17:53 ` [igt-dev] [PATCH i-g-t 4/6] tests/kms_flip_scaled_crc: Clean up pipe crc before subtest Ville Syrjala
2021-04-16 17:53 ` [igt-dev] [PATCH i-g-t 5/6] tests/kms_flip_scaled_crc: Check that the plane supports the format+modifier Ville Syrjala
2021-04-16 17:53 ` [igt-dev] [PATCH i-g-t 6/6] tests/kms_flip_scaled_crc: Limit pipe output to 8bpc Ville Syrjala
2021-04-16 19:17 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_flip_scaled_crc: Fix a bunch of fail Patchwork
2021-04-16 20:59 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-04-20 12:21 ` [igt-dev] [PATCH i-g-t 0/6] " Juha-Pekka Heikkila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210416175312.25190-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.