[CI_TEST] tests/kms_flip_tiling

Submitted by Mika Kahola on May 15, 2018, 10:28 a.m.

Details

Message ID 1526380099-14257-1-git-send-email-mika.kahola@intel.com
State New
Headers show
Series "tests/kms_flip_tiling" ( rev: 1 ) in IGT

Not browsing as part of any series.

Commit Message

Mika Kahola May 15, 2018, 10:28 a.m.
Make sure framebuffer compression is disabled when running this test.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_flip_tiling.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index 5aae29a..8dde5c8 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -33,12 +33,23 @@ 
 
 IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
 
+#define fbc_enable() igt_set_module_param_int("enable_fbc", 1)
+#define fbc_disable() igt_set_module_param_int("enable_fbc", 0)
+
 typedef struct {
 	int drm_fd;
 	igt_display_t display;
 	int gen;
 } data_t;
 
+static bool fbc_is_enabled(int fd)
+{
+	char buf[128];
+
+	igt_debugfs_read(fd, "i915_fbc_status", buf);
+	return strstr(buf, "FBC enabled\n");
+}
+
 static igt_pipe_crc_t *_pipe_crc;
 
 static igt_pipe_crc_t *pipe_crc_new(data_t *data, int pipe)
@@ -88,6 +99,10 @@  test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t ti
 	igt_pipe_crc_t *pipe_crc;
 	igt_crc_t reference_crc, crc;
 	int fb_id, ret, width;
+	bool fbc_enabled = fbc_is_enabled(data->drm_fd);
+
+	if (fbc_enabled)
+		fbc_disable();
 
 	pipe_crc = pipe_crc_new(data, pipe);
 	igt_output_set_pipe(output, pipe);
@@ -153,6 +168,9 @@  test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t ti
 
 	igt_remove_fb(data->drm_fd, &fb[0]);
 	igt_remove_fb(data->drm_fd, &fb[1]);
+
+	if (fbc_enabled)
+		fbc_enable();
 }
 
 static data_t data;

Comments

On Tue, May 15, 2018 at 01:28:19PM +0300, Mika Kahola wrote:
> Make sure framebuffer compression is disabled when running this test.

Why? Commit message shouldn't just explain what you're doing, but much
more important is why you're doing something.
-Daniel

> 
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
>  tests/kms_flip_tiling.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
> index 5aae29a..8dde5c8 100644
> --- a/tests/kms_flip_tiling.c
> +++ b/tests/kms_flip_tiling.c
> @@ -33,12 +33,23 @@
>  
>  IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
>  
> +#define fbc_enable() igt_set_module_param_int("enable_fbc", 1)
> +#define fbc_disable() igt_set_module_param_int("enable_fbc", 0)
> +
>  typedef struct {
>  	int drm_fd;
>  	igt_display_t display;
>  	int gen;
>  } data_t;
>  
> +static bool fbc_is_enabled(int fd)
> +{
> +	char buf[128];
> +
> +	igt_debugfs_read(fd, "i915_fbc_status", buf);
> +	return strstr(buf, "FBC enabled\n");
> +}
> +
>  static igt_pipe_crc_t *_pipe_crc;
>  
>  static igt_pipe_crc_t *pipe_crc_new(data_t *data, int pipe)
> @@ -88,6 +99,10 @@ test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t ti
>  	igt_pipe_crc_t *pipe_crc;
>  	igt_crc_t reference_crc, crc;
>  	int fb_id, ret, width;
> +	bool fbc_enabled = fbc_is_enabled(data->drm_fd);
> +
> +	if (fbc_enabled)
> +		fbc_disable();
>  
>  	pipe_crc = pipe_crc_new(data, pipe);
>  	igt_output_set_pipe(output, pipe);
> @@ -153,6 +168,9 @@ test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t ti
>  
>  	igt_remove_fb(data->drm_fd, &fb[0]);
>  	igt_remove_fb(data->drm_fd, &fb[1]);
> +
> +	if (fbc_enabled)
> +		fbc_enable();
>  }
>  
>  static data_t data;
> -- 
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
On Wed, May 16, 2018 at 01:36:31PM +0200, Daniel Vetter wrote:
> On Tue, May 15, 2018 at 01:28:19PM +0300, Mika Kahola wrote:
> > Make sure framebuffer compression is disabled when running this test.
> 
> Why? Commit message shouldn't just explain what you're doing, but much
> more important is why you're doing something.
> -Daniel

Since CI_TEST tag is used in the title I assume it's just to see how the
change (mis)behaves, without any interest in having it reviewed/merged.
-Arek
On Wed, 2018-05-16 at 14:45 +0300, Arkadiusz Hiler wrote:
> On Wed, May 16, 2018 at 01:36:31PM +0200, Daniel Vetter wrote:
> > 
> > On Tue, May 15, 2018 at 01:28:19PM +0300, Mika Kahola wrote:
> > > 
> > > Make sure framebuffer compression is disabled when running this
> > > test.
> > Why? Commit message shouldn't just explain what you're doing, but
> > much
> > more important is why you're doing something.
> > -Daniel
> Since CI_TEST tag is used in the title I assume it's just to see how
> the
> change (mis)behaves, without any interest in having it
> reviewed/merged.
That's right. The patch was only meant to exclude that fbc has nothing
to do with crc mismatches that we keep receiving from CI runs. The
patch was not meant for a review.

> -Arek