Hack to test DRRS, independent of front buffer tracking
Subsystems (2)
cover Hack to test DRRS, independent of front buffer tracking
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(-)
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/2 drm/i915: Removing the drrs from front buffer tracker
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.
--- drivers/gpu/drm/i915/intel_frontbuffer.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/intel_frontbuffer.c +0 -2
@@ -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); }
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915/drrs: debugfs for notifying the fb status change
In reply to Ramalingam CDebugfs 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.
--- drivers/gpu/drm/i915/i915_debugfs.c | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +61 -0
@@ -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)
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915/drrs: debugfs for notifying the fb status change
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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 tests/kms_drrs: fb change notification through debugfs
In reply to Ramalingam CAt 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.
--- tests/kms_drrs.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+)
tests/kms_drrs.c +71 -0
@@ -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" )) {
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Ramalingam C
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
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Ramalingam C
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.
Quoted 5 lines
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.
Signature · 6 lines
Ram _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 15 lines · Ramalingam C
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Ramalingam C
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.
Quoted 5 lines
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
Quoted 6 lines
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
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx