All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking
@ 2015-03-23 17:44 Ramalingam C
  2015-03-23 17:44 ` [PATCH 1/2] drm/i915: Removing the drrs from front buffer tracker Ramalingam C
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ramalingam C @ 2015-03-23 17:44 UTC (permalink / raw)
  To: intel-gfx, rodrigo.vivi, daniel; +Cc: paulo.r.zanoni

These patches removes the dependancy of DRRS with front buffer tracking.
This will help us to test the DRRS and the IGT app for DRRS.

As we have some functional issues with front buffer tracking, We are
adding a debugfs, so that IGT can notify the content change to DRRS.
Once the front buffer tracking is fully functional these patches are not
required.


Ramalingam C (3):
  drm/i915: Removing the drrs from front buffer tracker
  drm/i915/drrs: debugfs for notifying the fb status change
  tests/kms_drrs: fb change notification through debugfs

 drivers/gpu/drm/i915/i915_debugfs.c      |   61 ++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_frontbuffer.c |    2 -
 tests/kms_drrs.c 			  |   71 ++++++++++++++++++++++++++++++
 3 files changed, 132 insertions(+), 2 deletions(-)

-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 1/2] drm/i915: Removing the drrs from front buffer tracker
  2015-03-23 17:44 [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking Ramalingam C
@ 2015-03-23 17:44 ` Ramalingam C
  2015-03-23 17:44 ` [PATCH 2/2] drm/i915/drrs: debugfs for notifying the fb status change Ramalingam C
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Ramalingam C @ 2015-03-23 17:44 UTC (permalink / raw)
  To: intel-gfx, rodrigo.vivi, daniel; +Cc: paulo.r.zanoni

Calls from front buffer tracker module to DRRS is removed.

DO NOT MERGE: This change is to test the DRRS with IGT, independent of
front buffer tracking. This change will be dropped as soon as front
buffer tracker fully functional.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/intel_frontbuffer.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_frontbuffer.c b/drivers/gpu/drm/i915/intel_frontbuffer.c
index 0a1bac8..23c9fcb 100644
--- a/drivers/gpu/drm/i915/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/intel_frontbuffer.c
@@ -157,7 +157,6 @@ void intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
 	intel_mark_fb_busy(dev, obj->frontbuffer_bits, ring);
 
 	intel_psr_invalidate(dev, obj->frontbuffer_bits);
-	intel_edp_drrs_invalidate(dev, obj->frontbuffer_bits);
 	intel_fbc_invalidate(dev_priv, obj->frontbuffer_bits, origin);
 }
 
@@ -184,7 +183,6 @@ void intel_frontbuffer_flush(struct drm_device *dev,
 
 	intel_mark_fb_busy(dev, frontbuffer_bits, NULL);
 
-	intel_edp_drrs_flush(dev, frontbuffer_bits);
 	intel_psr_flush(dev, frontbuffer_bits);
 	intel_fbc_flush(dev_priv, frontbuffer_bits);
 }
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 2/2] drm/i915/drrs: debugfs for notifying the fb status change
  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 ` Ramalingam C
  2015-03-25  1:24   ` shuang.he
  2015-03-23 17:44 ` [PATCH] tests/kms_drrs: fb change notification through debugfs Ramalingam C
  2015-03-24  9:35 ` [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking Daniel Vetter
  3 siblings, 1 reply; 8+ messages in thread
From: Ramalingam C @ 2015-03-23 17:44 UTC (permalink / raw)
  To: intel-gfx, rodrigo.vivi, daniel; +Cc: paulo.r.zanoni

Debugfs entry called i915_drrs_fb_status is created to provide
the fb status change notifications.

This will call the drrs_invalidate and drrs_flush funcs, based on
debugfs write instead of front buffer tracking.

DO NOT MERGE: This change is to test the DRRS with IGT, independent of
front buffer tracking. This change will be dropped as soon as front
buffer tracker fully functional.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c |   61 +++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 007c7d7..0ce4d94 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -51,6 +51,11 @@ static const char *yesno(int v)
 	return v ? "yes" : "no";
 }
 
+struct __attribute__((packed, aligned(16))) fb_status {
+	bool rendered;
+	unsigned fb_bits;
+};
+
 /* As the drm_debugfs_init() routines are called before dev->dev_private is
  * allocated we need to hook into the minor for release. */
 static int
@@ -3866,6 +3871,61 @@ static const struct file_operations i915_display_crc_ctl_fops = {
 	.write = display_crc_ctl_write
 };
 
+static int drrs_fb_status_show(struct seq_file *m, void *data)
+{
+	seq_puts(m, "\n");
+	return 0;
+}
+
+static int drrs_fb_status_open(struct inode *inode, struct file *file)
+{
+	struct drm_device *dev = inode->i_private;
+
+	return single_open(file, drrs_fb_status_show, dev);
+}
+
+static ssize_t drrs_fb_status_write(struct file *file, const char __user *ubuf,
+				     size_t len, loff_t *offp)
+{
+	struct seq_file *m = file->private_data;
+	struct drm_device *dev = m->private;
+	struct fb_status fb_status;
+	int ret;
+
+	DRM_DEBUG("\n");
+	if (len == 0)
+		return 0;
+
+	if (copy_from_user(&fb_status, ubuf, sizeof(fb_status))) {
+		ret = -EFAULT;
+		goto out;
+	}
+
+	DRM_DEBUG("FB rendered:%s fb_bits: %u\n",
+				fb_status.rendered ? "Yes" : "No",
+						fb_status.fb_bits);
+
+	if (fb_status.rendered)
+		intel_edp_drrs_flush(dev, fb_status.fb_bits);
+	else
+		intel_edp_drrs_invalidate(dev, fb_status.fb_bits);
+
+out:
+	if (ret < 0)
+		return ret;
+
+	*offp += len;
+	return len;
+}
+static const struct file_operations i915_drrs_fb_status_fops = {
+	.owner = THIS_MODULE,
+	.open = drrs_fb_status_open,
+	.read = seq_read,
+	.llseek = seq_lseek,
+	.release = single_release,
+	.write = drrs_fb_status_write
+};
+
 static void wm_latency_show(struct seq_file *m, const uint16_t wm[8])
 {
 	struct drm_device *dev = m->private;
@@ -4713,6 +4773,7 @@ static const struct i915_debugfs_files {
 	{"i915_spr_wm_latency", &i915_spr_wm_latency_fops},
 	{"i915_cur_wm_latency", &i915_cur_wm_latency_fops},
 	{"i915_fbc_false_color", &i915_fbc_fc_fops},
+	{"i915_drrs_fb_status", &i915_drrs_fb_status_fops},
 };
 
 void intel_display_crc_init(struct drm_device *dev)
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] tests/kms_drrs: fb change notification through debugfs
  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-23 17:44 ` Ramalingam C
  2015-03-24  9:35 ` [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking Daniel Vetter
  3 siblings, 0 replies; 8+ messages in thread
From: Ramalingam C @ 2015-03-23 17:44 UTC (permalink / raw)
  To: intel-gfx, rodrigo.vivi, daniel; +Cc: paulo.r.zanoni

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

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

* Re: [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking
  2015-03-23 17:44 [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking Ramalingam C
                   ` (2 preceding siblings ...)
  2015-03-23 17:44 ` [PATCH] tests/kms_drrs: fb change notification through debugfs Ramalingam C
@ 2015-03-24  9:35 ` Daniel Vetter
  2015-03-24  9:47   ` Ramalingam C
  3 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2015-03-24  9:35 UTC (permalink / raw)
  To: Ramalingam C; +Cc: intel-gfx, paulo.r.zanoni, rodrigo.vivi

On Mon, Mar 23, 2015 at 11:14:41PM +0530, Ramalingam C wrote:
> These patches removes the dependancy of DRRS with front buffer tracking.
> This will help us to test the DRRS and the IGT app for DRRS.
> 
> As we have some functional issues with front buffer tracking, We are
> adding a debugfs, so that IGT can notify the content change to DRRS.
> Once the front buffer tracking is fully functional these patches are not
> required.

Nope, we need to track down the bugs in frontbuffer tracking and use the
existing interface to kick updates to the kernel. Yes I know this is hard,
but we've been struggling with frontbuffer tracking issues with fbc, psr
and drrs for years, adding more hacks will not magically resolve them.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Ramalingam C @ 2015-03-24  9:47 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx, paulo.r.zanoni, rodrigo.vivi


On Tuesday 24 March 2015 03:05 PM, Daniel Vetter wrote:
> On Mon, Mar 23, 2015 at 11:14:41PM +0530, Ramalingam C wrote:
>> These patches removes the dependancy of DRRS with front buffer tracking.
>> This will help us to test the DRRS and the IGT app for DRRS.
>>
>> As we have some functional issues with front buffer tracking, We are
>> adding a debugfs, so that IGT can notify the content change to DRRS.
>> Once the front buffer tracking is fully functional these patches are not
>> required.
> Nope, we need to track down the bugs in frontbuffer tracking and use the
> existing interface to kick updates to the kernel. Yes I know this is hard,
> but we've been struggling with frontbuffer tracking issues with fbc, psr
> and drrs for years, adding more hacks will not magically resolve them.
> -Daniel
Daniel,  I completely  I agree with you. These patch series is not meant 
to be reviewed or merged.
Intention of these patch creation is to enable the DRRS so that we 
develop the DRRS test cases.
With these test cases it will be easy to narrow down on the missing fb 
status update call.

-- 
Ram

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 0/3] Hack to test DRRS, independent of front buffer tracking
  2015-03-24  9:47   ` Ramalingam C
@ 2015-03-24 10:53     ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2015-03-24 10:53 UTC (permalink / raw)
  To: Ramalingam C; +Cc: intel-gfx, paulo.r.zanoni, rodrigo.vivi

On Tue, Mar 24, 2015 at 03:17:35PM +0530, Ramalingam C wrote:
> 
> On Tuesday 24 March 2015 03:05 PM, Daniel Vetter wrote:
> >On Mon, Mar 23, 2015 at 11:14:41PM +0530, Ramalingam C wrote:
> >>These patches removes the dependancy of DRRS with front buffer tracking.
> >>This will help us to test the DRRS and the IGT app for DRRS.
> >>
> >>As we have some functional issues with front buffer tracking, We are
> >>adding a debugfs, so that IGT can notify the content change to DRRS.
> >>Once the front buffer tracking is fully functional these patches are not
> >>required.
> >Nope, we need to track down the bugs in frontbuffer tracking and use the
> >existing interface to kick updates to the kernel. Yes I know this is hard,
> >but we've been struggling with frontbuffer tracking issues with fbc, psr
> >and drrs for years, adding more hacks will not magically resolve them.
> >-Daniel
> Daniel,  I completely  I agree with you. These patch series is not meant to
> be reviewed or merged.
> Intention of these patch creation is to enable the DRRS so that we develop
> the DRRS test cases.
> With these test cases it will be easy to narrow down on the missing fb
> status update call.

Ah, sounds excellent and makes sense. Usually I mention this in the cover
letter to avoid ppl reviewing something that I don't intend to get merged.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915/drrs: debugfs for notifying the fb status change
  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
  0 siblings, 0 replies; 8+ messages in thread
From: shuang.he @ 2015-03-25  1:24 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, ramalingam.c

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6032
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                                  275/275              275/275
ILK                                  303/303              303/303
SNB                 -1              304/304              303/304
IVB                                  339/339              339/339
BYT                                  287/287              287/287
HSW                                  361/361              361/361
BDW                                  310/310              310/310
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*SNB  igt@pm_rpm@fences      PASS(2)      DMESG_WARN(1)PASS(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-03-25  1:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH] tests/kms_drrs: fb change notification through debugfs Ramalingam C
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

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.