public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kunal Joshi <kunal1.joshi@intel.com>,
	ville.syrjala@intel.com, petri.latvala@intel.com,
	daniel.vetter@intel.com
Subject: [igt-dev] [PATCH i-g-t 1/2] lib/igt_chamelium: add function to compare two frame dumps.
Date: Tue, 14 Jan 2020 19:05:03 +0530	[thread overview]
Message-ID: <1579008904-22441-2-git-send-email-kunal1.joshi@intel.com> (raw)
In-Reply-To: <1579008904-22441-1-git-send-email-kunal1.joshi@intel.com>

Added chamelium_assert_frame_dump_eq() into lib. Function
is used to compare two frame dumps.

Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Suggested-by: Uma Shankar <uma.shankar@intel.com>
---
 lib/igt_chamelium.c | 22 ++++++++++++++++++++++
 lib/igt_chamelium.h |  3 +++
 2 files changed, 25 insertions(+)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 9971f51..0baf5bc 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -1519,6 +1519,28 @@ void chamelium_assert_frame_eq(const struct chamelium *chamelium,
 }
 
 /**
+ * chamelium_assert_frame_eq:
+ * @chamelium: The chamelium instance the frame dump belongs to
+ * @dump1: The chamelium frame dump to check
+ * @dump2: The chamelium frame dump to check
+ *
+ * Asserts that the image contained in the chamelium frame dump is
+ * identical to the other chamelium frame dump.
+ */
+bool chamelium_assert_frame_dump_eq(const struct chamelium *chamelium,
+				    const struct chamelium_frame_dump *dump1,
+				    const struct chamelium_frame_dump *dump2)
+{
+	bool eq;
+
+	/* Frame dump comparison */
+	eq = memcmp(dump1->bgr, dump2->bgr,
+		    dump1->size) == 0;
+
+	return eq;
+}
+
+/**
  * chamelium_assert_crc_eq_or_dump:
  * @chamelium: The chamelium instance the frame dump belongs to
  * @reference_crc: The CRC for the reference frame
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index 08705a9..6ff2d76 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -195,6 +195,9 @@ int chamelium_get_frame_limit(struct chamelium *chamelium,
 void chamelium_assert_frame_eq(const struct chamelium *chamelium,
 			       const struct chamelium_frame_dump *dump,
 			       struct igt_fb *fb);
+bool chamelium_assert_frame_dump_eq(const struct chamelium *chamelium,
+				    const struct chamelium_frame_dump *dump1,
+				    const struct chamelium_frame_dump *dump2);
 void chamelium_assert_crc_eq_or_dump(struct chamelium *chamelium,
 				     igt_crc_t *reference_crc,
 				     igt_crc_t *capture_crc, struct igt_fb *fb,
-- 
2.7.4

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

  reply	other threads:[~2020-01-14 13:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 13:35 [igt-dev] [PATCH i-g-t 0/2] validate color tests using chamelium Kunal Joshi
2020-01-14 13:35 ` Kunal Joshi [this message]
2020-01-14 13:35 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_color_chamelium: add subtests to validate color Kunal Joshi
2020-01-15  9:59   ` Arkadiusz Hiler
2020-01-14 14:22 ` [igt-dev] ✓ Fi.CI.BAT: success for validate color tests using chamelium Patchwork
2020-01-16 16:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=1579008904-22441-2-git-send-email-kunal1.joshi@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    --cc=ville.syrjala@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox