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 v4 1/4] lib/igt_chamelium Added chamelium_frame_match_or_dumpn which returns bool that the captured frame matches with reference framebuffer
Date: Thu, 23 Jan 2020 13:30:39 +0530 [thread overview]
Message-ID: <1579766442-20285-2-git-send-email-kunal1.joshi@intel.com> (raw)
In-Reply-To: <1579766442-20285-1-git-send-email-kunal1.joshi@intel.com>
Added chamelium_frame_match_or_dump which returns bool that the captured
frame matches with reference framebuffer.
(v2)
Removed previously added function chamelium_assert_frame_dump_eq.
(v3)
No change.
(v4)
Removed duplicate function code chamelium_assert_frame_dump_match
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 | 25 +++++++++++++++++++++++--
lib/igt_chamelium.h | 5 +++++
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 9971f51..95166e2 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -1583,6 +1583,27 @@ void chamelium_assert_frame_match_or_dump(struct chamelium *chamelium,
struct igt_fb *fb,
enum chamelium_check check)
{
+ igt_assert(chamelium_frame_match_or_dump(chamelium, port,
+ frame, fb, check));
+}
+
+/**
+ * chamelium_assert_frame_match_or_dump:
+ * @chamelium: The chamelium instance the frame dump belongs to
+ * @frame: The chamelium frame dump to match
+ * @fb: pointer to an #igt_fb structure
+ * @check: the type of frame matching check to use
+ *
+ * Returns bool that the provided captured frame matches the reference
+ * frame from the framebuffer. If they do not, this saves the reference
+ * and captured frames to a png file.
+ */
+bool chamelium_frame_match_or_dump(struct chamelium *chamelium,
+ struct chamelium_port *port,
+ const struct chamelium_frame_dump *frame,
+ struct igt_fb *fb,
+ enum chamelium_check check)
+{
cairo_surface_t *reference;
cairo_surface_t *capture;
igt_crc_t *reference_crc;
@@ -1625,10 +1646,10 @@ void chamelium_assert_frame_match_or_dump(struct chamelium *chamelium,
free(capture_crc);
}
- igt_assert(match);
-
cairo_surface_destroy(reference);
cairo_surface_destroy(capture);
+
+ return match;
}
/**
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index 08705a9..d03c924 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -204,6 +204,11 @@ void chamelium_assert_frame_match_or_dump(struct chamelium *chamelium,
const struct chamelium_frame_dump *frame,
struct igt_fb *fb,
enum chamelium_check check);
+bool chamelium_frame_match_or_dump(struct chamelium *chamelium,
+ struct chamelium_port *port,
+ const struct chamelium_frame_dump *frame,
+ struct igt_fb *fb,
+ enum chamelium_check check);
void chamelium_crop_analog_frame(struct chamelium_frame_dump *dump, int width,
int height);
void chamelium_destroy_frame_dump(struct chamelium_frame_dump *dump);
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-01-23 14:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 8:00 [igt-dev] [PATCH i-g-t v4 0/4] validate color tests using chamelium Kunal Joshi
2020-01-23 8:00 ` Kunal Joshi [this message]
2020-01-24 10:01 ` [igt-dev] [PATCH i-g-t v4 1/4] lib/igt_chamelium Added chamelium_frame_match_or_dumpn which returns bool that the captured frame matches with reference framebuffer Petri Latvala
2020-01-23 8:00 ` [igt-dev] [PATCH i-g-t v4 2/4] Moved common function in kms_color and kms_color_chamelium to kms_color_helper.c Kunal Joshi
2020-01-24 10:07 ` Petri Latvala
2020-01-24 10:38 ` Petri Latvala
2020-01-23 8:00 ` [igt-dev] [PATCH i-g-t v4 3/4] tests/kms_color_chamelium: add subtests to validate color Kunal Joshi
2020-01-24 10:11 ` Petri Latvala
2020-01-23 8:00 ` [igt-dev] [PATCH i-g-t v4 4/4] HAX: Run in BAT Kunal Joshi
2020-01-23 16:04 ` [igt-dev] ✓ Fi.CI.BAT: success for validate color tests using chamelium. (rev4) Patchwork
2020-01-24 10:15 ` Petri Latvala
2020-01-25 0:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=1579766442-20285-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