From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx@lists.freedesktop.org, rodrigo.vivi@intel.com, daniel@ffwll.ch
Cc: paulo.r.zanoni@intel.com
Subject: [PATCH] tests/kms_drrs: fb change notification through debugfs
Date: Mon, 23 Mar 2015 23:14:44 +0530 [thread overview]
Message-ID: <1427132684-27946-4-git-send-email-ramalingam.c@intel.com> (raw)
In-Reply-To: <1427132684-27946-1-git-send-email-ramalingam.c@intel.com>
At present there are some functional issues at front buffer tracking.
So to test the DRRS feature and the DRRS test apps, we have added a
debugfs to provide the fb change notification. Corresponding calls
implemented in this change
DO NOT MERGE: As this is a temperary fix to test the DRRS independent
of the front buffer tracking. This will be dropped once the front buffer
tracking is fixed.
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
tests/kms_drrs.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/tests/kms_drrs.c b/tests/kms_drrs.c
index 91bda5c..8e2338d 100644
--- a/tests/kms_drrs.c
+++ b/tests/kms_drrs.c
@@ -37,6 +37,20 @@ IGT_TEST_DESCRIPTION(
#define DRRS_STATUS_BYTES_CNT 1000
+#define INTEL_FRONTBUFFER_BITS_PER_PIPE 4
+#define INTEL_FRONTBUFFER_BITS \
+ (INTEL_FRONTBUFFER_BITS_PER_PIPE * I915_MAX_PIPES)
+#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
+ (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
+#define INTEL_FRONTBUFFER_CURSOR(pipe) \
+ (1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
+#define INTEL_FRONTBUFFER_SPRITE(pipe) \
+ (1 << (2 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
+#define INTEL_FRONTBUFFER_OVERLAY(pipe) \
+ (1 << (3 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
+#define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
+ (0xf << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
+
typedef struct {
int drm_fd;
uint32_t devid;
@@ -126,6 +140,36 @@ static bool is_drrs_state(data_t *data, const char str[15])
return strstr(status, str) != NULL;
}
+/*
+ * drrs_fb_status_update:
+ *
+ * drm front buffer tracking is not notifying the FB status change in
+ * many cases.
+ * Hence to test the DRRS module independently we are providing the DRRS
+ * invalidate and flush calls through a debugfs. NOTE: Additional kernel
+ * patch is required to add the required debugfs and to detach the DRRS module
+ * from the front buffer tracking implementation
+ */
+static void drrs_fb_status_update(data_t *data, unsigned fb_status_bits,
+ bool rendered)
+{
+ FILE *ctl;
+ size_t written;
+ struct fb_status fb_status;
+
+ igt_info("Entry to drrs_fb_status_update with fb_status_bits %u\n",
+ fb_status_bits);
+
+ ctl = igt_debugfs_fopen("i915_drrs_fb_status", "r+");
+
+ fb_status.rendered = rendered;
+ fb_status.fb_bits = fb_status_bits;
+
+ written = fwrite(&fb_status, sizeof(fb_status), 1, ctl);
+ igt_assert_eq(written, 1);
+
+ fclose(ctl);
+}
static bool prepare_crtc(data_t *data)
{
@@ -196,6 +240,15 @@ static bool execute_test(data_t *data)
return false;
}
+ /*
+ * FIXME: When Front buffer tracking is fixed, remove
+ * next two function calls.
+ */
+ drrs_fb_status_update(data, INTEL_FRONTBUFFER_PRIMARY(data->pipe),
+ false);
+ drrs_fb_status_update(data, INTEL_FRONTBUFFER_PRIMARY(data->pipe),
+ true);
+
igt_wait_for_vblank(data->drm_fd, data->pipe);
@@ -222,6 +275,15 @@ static bool execute_test(data_t *data)
igt_plane_set_fb(data->primary, &data->fb[0]);
igt_display_commit(display);
+ /*
+ * FIXME: When Front buffer tracking is fixed, remove
+ * next two function calls.
+ */
+ drrs_fb_status_update(data, INTEL_FRONTBUFFER_PRIMARY(data->pipe),
+ false);
+ drrs_fb_status_update(data, INTEL_FRONTBUFFER_PRIMARY(data->pipe),
+ true);
+
igt_wait_for_vblank(data->drm_fd, data->pipe);
if (is_drrs_state(data, "DRRS_HIGH_RR")) {
@@ -246,6 +308,15 @@ static bool execute_test(data_t *data)
igt_plane_set_fb(data->primary, &data->fb[1]);
igt_display_commit(display);
+ /*
+ * FIXME: When Front buffer tracking is fixed, remove
+ * next two function calls.
+ */
+ drrs_fb_status_update(data, INTEL_FRONTBUFFER_PRIMARY(data->pipe),
+ false);
+ drrs_fb_status_update(data, INTEL_FRONTBUFFER_PRIMARY(data->pipe),
+ true);
+
igt_wait_for_vblank(data->drm_fd, data->pipe);
if (is_drrs_state(data, "DRRS_HIGH_RR")) {
--
1.7.9.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-23 17:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 17:44 [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking Ramalingam C
2015-03-23 17:44 ` [PATCH 1/2] drm/i915: Removing the drrs from front buffer tracker Ramalingam C
2015-03-23 17:44 ` [PATCH 2/2] drm/i915/drrs: debugfs for notifying the fb status change Ramalingam C
2015-03-25 1:24 ` shuang.he
2015-03-23 17:44 ` Ramalingam C [this message]
2015-03-24 9:35 ` [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking Daniel Vetter
2015-03-24 9:47 ` Ramalingam C
2015-03-24 10:53 ` Daniel Vetter
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=1427132684-27946-4-git-send-email-ramalingam.c@intel.com \
--to=ramalingam.c@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=rodrigo.vivi@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