All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane
@ 2017-09-21 14:39 Ville Syrjala
  2017-09-21 14:39 ` [PATCH i-g-t 2/6] tests/kms_mmio_vs_cs_flip: Reduce blit width Ville Syrjala
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Ville Syrjala @ 2017-09-21 14:39 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Skip when a test can't find a plane by the index. Previously
in commit 5426dc0a889a ("lib/kms: Skip rather than fail when
a suitable plane can't be found") we added similar handling for
tests trying to find a non-existent plane by type. Saves from
every test with hardcoded plane numbers having to check the
number of planes available.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 7bcafc072f70..83ebb42e6c9a 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2008,9 +2008,9 @@ static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output)
 
 static igt_plane_t *igt_pipe_get_plane(igt_pipe_t *pipe, int plane_idx)
 {
-	igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
-		"Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
-		plane_idx, pipe->n_planes);
+	igt_require_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
+		      "Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
+		      plane_idx, pipe->n_planes);
 
 	return &pipe->planes[plane_idx];
 }
-- 
2.13.5

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

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

* [PATCH i-g-t 2/6] tests/kms_mmio_vs_cs_flip: Reduce blit width
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
@ 2017-09-21 14:39 ` Ville Syrjala
  2017-09-21 14:39 ` [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png() Ville Syrjala
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Ville Syrjala @ 2017-09-21 14:39 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The blit stride is a two's complement 16 bit number, so trying to
use a stride of 32k would in fact give us -32k. Not sure how this
ever worked on anything, but my 945gm sure doesn't like it. The
machine dies pretty much instantly. Let's reduce the blit to use
a 16k stride instead. Also put in the missing bits for a proper
32bpp blit.

Or maybe time to retire this test since we no longer use CS flips?

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_mmio_vs_cs_flip.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/kms_mmio_vs_cs_flip.c b/tests/kms_mmio_vs_cs_flip.c
index fa947d9cd7f4..851f9a66ebbf 100644
--- a/tests/kms_mmio_vs_cs_flip.c
+++ b/tests/kms_mmio_vs_cs_flip.c
@@ -72,12 +72,13 @@ static void exec_blt(data_t *data)
 	batch = intel_batchbuffer_alloc(data->bufmgr, data->devid);
 	igt_assert(batch);
 
-	w = 8192;
-	h = data->busy_bo->size / (8192 * 4);
+	w = 4096;
+	h = data->busy_bo->size / (4096 * 4);
 	pitch = w * 4;
 
 	for (i = 0; i < 40; i++) {
-		BLIT_COPY_BATCH_START(0);
+		BLIT_COPY_BATCH_START(XY_SRC_COPY_BLT_WRITE_ALPHA |
+				      XY_SRC_COPY_BLT_WRITE_RGB);
 		OUT_BATCH((3 << 24) | /* 32 bits */
 			  (0xcc << 16) | /* copy ROP */
 			  pitch);
-- 
2.13.5

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

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

* [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png()
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
  2017-09-21 14:39 ` [PATCH i-g-t 2/6] tests/kms_mmio_vs_cs_flip: Reduce blit width Ville Syrjala
@ 2017-09-21 14:39 ` Ville Syrjala
  2017-09-22  9:52   ` Petri Latvala
  2017-09-21 14:39 ` [PATCH i-g-t 4/6] tests/kms_panel_fitting: Use igt_cairo_image_surface_create_from_png_file() Ville Syrjala
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Ville Syrjala @ 2017-09-21 14:39 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Raw usage of cairo_image_surface_create_from_png() doesn't work
since it doesn't know about IGT_DATADIR and IGT_SRCDIR. Let's extract
the helper from igt_paint_image() that uses igt_fopen_data() +
cairo_image_surface_create_from_png_stream() and call it
igt_cairo_image_surface_create_from_png_file().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_fb.c | 21 ++++++++++++++-------
 lib/igt_fb.h |  1 +
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 95434a699dcf..d4eaed71acef 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -583,6 +583,18 @@ stdio_read_func(void *closure, unsigned char* data, unsigned int size)
 	return CAIRO_STATUS_SUCCESS;
 }
 
+cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename)
+{
+	cairo_surface_t *image;
+	FILE *f;
+
+	f = igt_fopen_data(filename);
+	image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
+	fclose(f);
+
+	return image;
+}
+
 /**
  * igt_paint_image:
  * @cr: cairo drawing context
@@ -601,11 +613,8 @@ void igt_paint_image(cairo_t *cr, const char *filename,
 	cairo_surface_t *image;
 	int img_width, img_height;
 	double scale_x, scale_y;
-	FILE* f;
-
-	f = igt_fopen_data(filename);
 
-	image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
+	image = igt_cairo_image_surface_create_from_png(filename);
 	igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
 
 	img_width = cairo_image_surface_get_width(image);
@@ -624,8 +633,6 @@ void igt_paint_image(cairo_t *cr, const char *filename,
 	cairo_surface_destroy(image);
 
 	cairo_restore(cr);
-
-	fclose(f);
 }
 
 /**
@@ -877,7 +884,7 @@ unsigned int igt_create_image_fb(int fd, int width, int height,
 	uint32_t fb_id;
 	cairo_t *cr;
 
-	image = cairo_image_surface_create_from_png(filename);
+	image = igt_cairo_image_surface_create_from_png(filename);
 	igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
 	if (width == 0)
 		width = cairo_image_surface_get_width(image);
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index a193a1e7572d..3f549036abc5 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -136,6 +136,7 @@ uint64_t igt_fb_tiling_to_mod(uint64_t tiling);
 
 /* cairo-based painting */
 cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb);
+cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename);
 cairo_t *igt_get_cairo_ctx(int fd, struct igt_fb *fb);
 void igt_paint_color(cairo_t *cr, int x, int y, int w, int h,
 			 double r, double g, double b);
-- 
2.13.5

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

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

* [PATCH i-g-t 4/6] tests/kms_panel_fitting: Use igt_cairo_image_surface_create_from_png_file()
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
  2017-09-21 14:39 ` [PATCH i-g-t 2/6] tests/kms_mmio_vs_cs_flip: Reduce blit width Ville Syrjala
  2017-09-21 14:39 ` [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png() Ville Syrjala
@ 2017-09-21 14:39 ` Ville Syrjala
  2017-09-22  9:53   ` Petri Latvala
  2017-09-21 14:39 ` [PATCH i-g-t 5/6] tests/kms_panel_fitting: Skip sprite test if we exceed sprite scaling limits Ville Syrjala
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Ville Syrjala @ 2017-09-21 14:39 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Switch to using igt_cairo_image_surface_create_from_png_file() over the
raw cairo version so that the test can actually find the image file
no matter where we run it from.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_panel_fitting.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index e145a2dfc970..5266862a70cf 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -159,7 +159,7 @@ static void test_panel_fitting(data_t *d)
 		native_mode = *mode;
 
 		/* allocate fb2 with image size */
-		image = cairo_image_surface_create_from_png(FILE_NAME);
+		image = igt_cairo_image_surface_create_from_png(FILE_NAME);
 		igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
 		d->image_w = cairo_image_surface_get_width(image);
 		d->image_h = cairo_image_surface_get_height(image);
-- 
2.13.5

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

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

* [PATCH i-g-t 5/6] tests/kms_panel_fitting: Skip sprite test if we exceed sprite scaling limits
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
                   ` (2 preceding siblings ...)
  2017-09-21 14:39 ` [PATCH i-g-t 4/6] tests/kms_panel_fitting: Use igt_cairo_image_surface_create_from_png_file() Ville Syrjala
@ 2017-09-21 14:39 ` Ville Syrjala
  2017-09-27 11:34   ` Petri Latvala
  2017-09-21 14:39 ` [PATCH i-g-t 6/6] tests/kms_draw_crc: Skip tests for unsupported formats Ville Syrjala
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Ville Syrjala @ 2017-09-21 14:39 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

g4x-bdw surface isn't allowed to exceed 2kx2k pixels when scaling, and
the stride must not exceed 4k bytes. The test tries to scale a 1920x1080
32bpp image which exceeds the sprite's stride limitations. Let's make
the test a bit more tolerant and just ignore failures from the sprite
tests. This does reduce the usefulness of the test somewhat, but without
CRC support the test isn't all that useful anyway.

Bugzilla: https://bugs.freedesktop.org/attachment.cgi?id=132953
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_panel_fitting.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index 5266862a70cf..af3e39fd7b22 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -197,12 +197,16 @@ static void test_panel_fitting(data_t *d)
 		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
 		igt_plane_set_position(d->plane2, 100, 100);
 		igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
-		/* enable panel fitting along with sprite scaling */
-		mode->hdisplay = 1024;
-		mode->vdisplay = 768;
-		prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
+		/*
+		 * The sprite may not be able to scale such a large image.
+		 * Just skip the sprite scaling tests in that case.
+		 */
+		if (!igt_display_try_commit2(display, COMMIT_UNIVERSAL)) {
+			/* enable panel fitting along with sprite scaling */
+			mode->hdisplay = 1024;
+			mode->vdisplay = 768;
+			prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
+		}
 
 		/* back to single plane mode */
 		igt_plane_set_fb(d->plane2, NULL);
-- 
2.13.5

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

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

* [PATCH i-g-t 6/6] tests/kms_draw_crc: Skip tests for unsupported formats
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
                   ` (3 preceding siblings ...)
  2017-09-21 14:39 ` [PATCH i-g-t 5/6] tests/kms_panel_fitting: Skip sprite test if we exceed sprite scaling limits Ville Syrjala
@ 2017-09-21 14:39 ` Ville Syrjala
  2017-09-27 11:38   ` Petri Latvala
  2017-09-21 16:20 ` ✗ Fi.CI.BAT: warning for series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane Patchwork
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 16+ messages in thread
From: Ville Syrjala @ 2017-09-21 14:39 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

10bpc formats aren't supported on all platforms, so skip the test when
we can't create the framebuffer.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_draw_crc.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index 260950c76e00..723e7a182c95 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -153,16 +153,33 @@ static void get_method_crc(enum igt_draw_method method, uint32_t drm_format,
 	igt_remove_fb(drm_fd, &fb);
 }
 
+static bool format_is_supported(uint32_t format, uint64_t modifier)
+{
+	uint32_t gem_handle, fb_id;
+	unsigned int stride;
+	int ret;
+
+	gem_handle = igt_create_bo_with_dimensions(drm_fd, 64, 64,
+						   format, modifier,
+						   0, NULL, &stride, NULL);
+	ret =  __kms_addfb(drm_fd, gem_handle, 64, 64,
+			   stride, format, modifier,
+			   LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id);
+	drmModeRmFB(drm_fd, fb_id);
+	gem_close(drm_fd, gem_handle);
+
+	return ret == 0;
+}
+
 static void draw_method_subtest(enum igt_draw_method method,
 				uint32_t format_index, uint64_t tiling)
 {
 	igt_crc_t crc;
 
-	if (tiling == LOCAL_I915_FORMAT_MOD_Y_TILED)
-		igt_require(intel_gen(intel_get_drm_devid(drm_fd)) >= 9);
-
 	igt_skip_on(method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd));
 
+	igt_require(format_is_supported(formats[format_index], tiling));
+
 	/* Use IGT_DRAW_MMAP_GTT on an untiled buffer as the parameter for
 	 * comparison. Cache the value so we don't recompute it for every single
 	 * subtest. */
-- 
2.13.5

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

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

* ✗ Fi.CI.BAT: warning for series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
                   ` (4 preceding siblings ...)
  2017-09-21 14:39 ` [PATCH i-g-t 6/6] tests/kms_draw_crc: Skip tests for unsupported formats Ville Syrjala
@ 2017-09-21 16:20 ` Patchwork
  2017-09-22 15:53 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2017-09-21 16:20 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane
URL   : https://patchwork.freedesktop.org/series/30706/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build
f86dc17cfc81f53f3bf216009ffda1ac05208bcc igt/prime_vgem: Split out the fine-grain coherency check

with latest DRM-Tip kernel build CI_DRM_3118
01a2040bb790 drm-tip: 2017y-09m-21d-13h-23m-06s UTC integration manifest

Test chamelium:
        Subgroup hdmi-crc-fast:
                pass       -> DMESG-WARN (fi-skl-6700k)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                fail       -> PASS       (fi-snb-2600) fdo#100215 +1

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:442s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:478s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:417s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:527s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:276s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:504s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:497s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:501s
fi-cfl-s         total:289  pass:223  dwarn:34  dfail:0   fail:0   skip:32  time:591s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:424s
fi-glk-1         total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:569s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:429s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:414s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:438s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:485s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:466s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:470s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:577s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:600s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:544s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:454s
fi-skl-6700k     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:755s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:496s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:474s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:578s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:1   skip:39  time:419s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_238/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png()
  2017-09-21 14:39 ` [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png() Ville Syrjala
@ 2017-09-22  9:52   ` Petri Latvala
  2017-09-22 12:05     ` Ville Syrjälä
  0 siblings, 1 reply; 16+ messages in thread
From: Petri Latvala @ 2017-09-22  9:52 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Thu, Sep 21, 2017 at 05:39:30PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Raw usage of cairo_image_surface_create_from_png() doesn't work
> since it doesn't know about IGT_DATADIR and IGT_SRCDIR. Let's extract
> the helper from igt_paint_image() that uses igt_fopen_data() +
> cairo_image_surface_create_from_png_stream() and call it
> igt_cairo_image_surface_create_from_png_file().


s/from_png_file/from_png/


> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks for fixing this.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92248
(Not sure if this patch fixes it yet or if CI switch to make install -deployment is also needed)
kms_plane_fitting doesn't seem to have a separate bug report.

Reviewed-by: Petri Latvala <petri.latvala@intel.com>






> ---
>  lib/igt_fb.c | 21 ++++++++++++++-------
>  lib/igt_fb.h |  1 +
>  2 files changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 95434a699dcf..d4eaed71acef 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -583,6 +583,18 @@ stdio_read_func(void *closure, unsigned char* data, unsigned int size)
>  	return CAIRO_STATUS_SUCCESS;
>  }
>  
> +cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename)
> +{
> +	cairo_surface_t *image;
> +	FILE *f;
> +
> +	f = igt_fopen_data(filename);
> +	image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> +	fclose(f);
> +
> +	return image;
> +}
> +
>  /**
>   * igt_paint_image:
>   * @cr: cairo drawing context
> @@ -601,11 +613,8 @@ void igt_paint_image(cairo_t *cr, const char *filename,
>  	cairo_surface_t *image;
>  	int img_width, img_height;
>  	double scale_x, scale_y;
> -	FILE* f;
> -
> -	f = igt_fopen_data(filename);
>  
> -	image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> +	image = igt_cairo_image_surface_create_from_png(filename);
>  	igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
>  
>  	img_width = cairo_image_surface_get_width(image);
> @@ -624,8 +633,6 @@ void igt_paint_image(cairo_t *cr, const char *filename,
>  	cairo_surface_destroy(image);
>  
>  	cairo_restore(cr);
> -
> -	fclose(f);
>  }
>  
>  /**
> @@ -877,7 +884,7 @@ unsigned int igt_create_image_fb(int fd, int width, int height,
>  	uint32_t fb_id;
>  	cairo_t *cr;
>  
> -	image = cairo_image_surface_create_from_png(filename);
> +	image = igt_cairo_image_surface_create_from_png(filename);
>  	igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
>  	if (width == 0)
>  		width = cairo_image_surface_get_width(image);
> diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> index a193a1e7572d..3f549036abc5 100644
> --- a/lib/igt_fb.h
> +++ b/lib/igt_fb.h
> @@ -136,6 +136,7 @@ uint64_t igt_fb_tiling_to_mod(uint64_t tiling);
>  
>  /* cairo-based painting */
>  cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb);
> +cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename);
>  cairo_t *igt_get_cairo_ctx(int fd, struct igt_fb *fb);
>  void igt_paint_color(cairo_t *cr, int x, int y, int w, int h,
>  			 double r, double g, double b);
> -- 
> 2.13.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 4/6] tests/kms_panel_fitting: Use igt_cairo_image_surface_create_from_png_file()
  2017-09-21 14:39 ` [PATCH i-g-t 4/6] tests/kms_panel_fitting: Use igt_cairo_image_surface_create_from_png_file() Ville Syrjala
@ 2017-09-22  9:53   ` Petri Latvala
  0 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2017-09-22  9:53 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Thu, Sep 21, 2017 at 05:39:31PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Switch to using igt_cairo_image_surface_create_from_png_file() over the
> raw cairo version so that the test can actually find the image file
> no matter where we run it from.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>


Reviewed-by: Petri Latvala <petri.latvala@intel.com>


> ---
>  tests/kms_panel_fitting.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
> index e145a2dfc970..5266862a70cf 100644
> --- a/tests/kms_panel_fitting.c
> +++ b/tests/kms_panel_fitting.c
> @@ -159,7 +159,7 @@ static void test_panel_fitting(data_t *d)
>  		native_mode = *mode;
>  
>  		/* allocate fb2 with image size */
> -		image = cairo_image_surface_create_from_png(FILE_NAME);
> +		image = igt_cairo_image_surface_create_from_png(FILE_NAME);
>  		igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
>  		d->image_w = cairo_image_surface_get_width(image);
>  		d->image_h = cairo_image_surface_get_height(image);
> -- 
> 2.13.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png()
  2017-09-22  9:52   ` Petri Latvala
@ 2017-09-22 12:05     ` Ville Syrjälä
  2017-09-22 12:33       ` Petri Latvala
  0 siblings, 1 reply; 16+ messages in thread
From: Ville Syrjälä @ 2017-09-22 12:05 UTC (permalink / raw)
  To: Petri Latvala; +Cc: intel-gfx

On Fri, Sep 22, 2017 at 12:52:59PM +0300, Petri Latvala wrote:
> On Thu, Sep 21, 2017 at 05:39:30PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Raw usage of cairo_image_surface_create_from_png() doesn't work
> > since it doesn't know about IGT_DATADIR and IGT_SRCDIR. Let's extract
> > the helper from igt_paint_image() that uses igt_fopen_data() +
> > cairo_image_surface_create_from_png_stream() and call it
> > igt_cairo_image_surface_create_from_png_file().
> 
> 
> s/from_png_file/from_png/

Argh, still one left. My brain kept subconsciously adding the _file()
(to match the _stream() I suppose). In fact at one point I was scratching
my head for quite a while wondering why it wasn't compiling...

> 
> 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Thanks for fixing this.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92248
> (Not sure if this patch fixes it yet or if CI switch to make install -deployment is also needed)

Hmm. The asserts I see there seem to be about display commits failing.

> kms_plane_fitting doesn't seem to have a separate bug report.

I'm pretty sure such a bug report did exist in the past. But I
wasn't able to find it either. I guess it was closed for some reason.

> 
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>

Thanks.

> 
> 
> 
> 
> 
> 
> > ---
> >  lib/igt_fb.c | 21 ++++++++++++++-------
> >  lib/igt_fb.h |  1 +
> >  2 files changed, 15 insertions(+), 7 deletions(-)
> > 
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index 95434a699dcf..d4eaed71acef 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -583,6 +583,18 @@ stdio_read_func(void *closure, unsigned char* data, unsigned int size)
> >  	return CAIRO_STATUS_SUCCESS;
> >  }
> >  
> > +cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename)
> > +{
> > +	cairo_surface_t *image;
> > +	FILE *f;
> > +
> > +	f = igt_fopen_data(filename);
> > +	image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> > +	fclose(f);
> > +
> > +	return image;
> > +}
> > +
> >  /**
> >   * igt_paint_image:
> >   * @cr: cairo drawing context
> > @@ -601,11 +613,8 @@ void igt_paint_image(cairo_t *cr, const char *filename,
> >  	cairo_surface_t *image;
> >  	int img_width, img_height;
> >  	double scale_x, scale_y;
> > -	FILE* f;
> > -
> > -	f = igt_fopen_data(filename);
> >  
> > -	image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> > +	image = igt_cairo_image_surface_create_from_png(filename);
> >  	igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
> >  
> >  	img_width = cairo_image_surface_get_width(image);
> > @@ -624,8 +633,6 @@ void igt_paint_image(cairo_t *cr, const char *filename,
> >  	cairo_surface_destroy(image);
> >  
> >  	cairo_restore(cr);
> > -
> > -	fclose(f);
> >  }
> >  
> >  /**
> > @@ -877,7 +884,7 @@ unsigned int igt_create_image_fb(int fd, int width, int height,
> >  	uint32_t fb_id;
> >  	cairo_t *cr;
> >  
> > -	image = cairo_image_surface_create_from_png(filename);
> > +	image = igt_cairo_image_surface_create_from_png(filename);
> >  	igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
> >  	if (width == 0)
> >  		width = cairo_image_surface_get_width(image);
> > diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> > index a193a1e7572d..3f549036abc5 100644
> > --- a/lib/igt_fb.h
> > +++ b/lib/igt_fb.h
> > @@ -136,6 +136,7 @@ uint64_t igt_fb_tiling_to_mod(uint64_t tiling);
> >  
> >  /* cairo-based painting */
> >  cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb);
> > +cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename);
> >  cairo_t *igt_get_cairo_ctx(int fd, struct igt_fb *fb);
> >  void igt_paint_color(cairo_t *cr, int x, int y, int w, int h,
> >  			 double r, double g, double b);
> > -- 
> > 2.13.5
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png()
  2017-09-22 12:05     ` Ville Syrjälä
@ 2017-09-22 12:33       ` Petri Latvala
  0 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2017-09-22 12:33 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

On Fri, Sep 22, 2017 at 03:05:44PM +0300, Ville Syrjälä wrote:
> On Fri, Sep 22, 2017 at 12:52:59PM +0300, Petri Latvala wrote:
> > On Thu, Sep 21, 2017 at 05:39:30PM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Raw usage of cairo_image_surface_create_from_png() doesn't work
> > > since it doesn't know about IGT_DATADIR and IGT_SRCDIR. Let's extract
> > > the helper from igt_paint_image() that uses igt_fopen_data() +
> > > cairo_image_surface_create_from_png_stream() and call it
> > > igt_cairo_image_surface_create_from_png_file().
> > 
> > 
> > s/from_png_file/from_png/
> 
> Argh, still one left. My brain kept subconsciously adding the _file()
> (to match the _stream() I suppose). In fact at one point I was scratching
> my head for quite a while wondering why it wasn't compiling...
> 
> > 
> > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Thanks for fixing this.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92248
> > (Not sure if this patch fixes it yet or if CI switch to make install -deployment is also needed)
> 
> Hmm. The asserts I see there seem to be about display commits failing.


Oh, gah. The bug report has changed meaning. I was looking at the
original description that had

Failed assertion: cairo_surface_status(image) == CAIRO_STATUS_SUCCESS



> 
> > kms_plane_fitting doesn't seem to have a separate bug report.
> 
> I'm pretty sure such a bug report did exist in the past. But I
> wasn't able to find it either. I guess it was closed for some reason.

(For those following along, I did search for kms_panel_fitting too,
not just that brainfart of a misname.)

I suppose kms_panel_fitting failure is bundled up in #92248 along with
kms_plane_scaling.


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

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

* ✓ Fi.CI.BAT: success for series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
                   ` (5 preceding siblings ...)
  2017-09-21 16:20 ` ✗ Fi.CI.BAT: warning for series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane Patchwork
@ 2017-09-22 15:53 ` Patchwork
  2017-09-22 21:41 ` ✓ Fi.CI.IGT: " Patchwork
  2017-09-27 11:53 ` [PATCH i-g-t 1/6] " Petri Latvala
  8 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2017-09-22 15:53 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane
URL   : https://patchwork.freedesktop.org/series/30706/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
b94a17d13fb5e03bbc7ef50ce88352b37ad06c85 tests/psr: Don't strcmp CRCs that are not NULL terminated.

with latest DRM-Tip kernel build CI_DRM_3124
e0e308721fd2 drm-tip: 2017y-09m-22d-13h-31m-38s UTC integration manifest

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> FAIL       (fi-snb-2600) fdo#100215
Test drv_module_reload:
        Subgroup basic-reload:
                pass       -> DMESG-WARN (fi-glk-1) fdo#102777 +1

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#102777 https://bugs.freedesktop.org/show_bug.cgi?id=102777

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:447s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:474s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:420s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:519s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:275s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:505s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:499s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:494s
fi-cfl-s         total:289  pass:223  dwarn:34  dfail:0   fail:0   skip:32  time:548s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:419s
fi-glk-1         total:289  pass:259  dwarn:1   dfail:0   fail:0   skip:29  time:568s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:439s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:409s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:432s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:496s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:475s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:470s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:575s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:600s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:542s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:448s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:753s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:489s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:473s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:569s
fi-snb-2600      total:289  pass:248  dwarn:0   dfail:0   fail:2   skip:39  time:419s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_241/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
                   ` (6 preceding siblings ...)
  2017-09-22 15:53 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2017-09-22 21:41 ` Patchwork
  2017-09-27 11:53 ` [PATCH i-g-t 1/6] " Petri Latvala
  8 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2017-09-22 21:41 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane
URL   : https://patchwork.freedesktop.org/series/30706/
State : success

== Summary ==

Test gem_eio:
        Subgroup throttle:
                pass       -> DMESG-WARN (shard-hsw) fdo#102886 +3
Test perf:
        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-indfb-draw-blt:
                skip       -> PASS       (shard-hsw)

fdo#102886 https://bugs.freedesktop.org/show_bug.cgi?id=102886
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2429 pass:1329 dwarn:5   dfail:0   fail:12  skip:1083 time:9889s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_241/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 5/6] tests/kms_panel_fitting: Skip sprite test if we exceed sprite scaling limits
  2017-09-21 14:39 ` [PATCH i-g-t 5/6] tests/kms_panel_fitting: Skip sprite test if we exceed sprite scaling limits Ville Syrjala
@ 2017-09-27 11:34   ` Petri Latvala
  0 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2017-09-27 11:34 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Thu, Sep 21, 2017 at 05:39:32PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> g4x-bdw surface isn't allowed to exceed 2kx2k pixels when scaling, and
> the stride must not exceed 4k bytes. The test tries to scale a 1920x1080
> 32bpp image which exceeds the sprite's stride limitations. Let's make
> the test a bit more tolerant and just ignore failures from the sprite
> tests. This does reduce the usefulness of the test somewhat, but without
> CRC support the test isn't all that useful anyway.
> 
> Bugzilla: https://bugs.freedesktop.org/attachment.cgi?id=132953
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_panel_fitting.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
> index 5266862a70cf..af3e39fd7b22 100644
> --- a/tests/kms_panel_fitting.c
> +++ b/tests/kms_panel_fitting.c
> @@ -197,12 +197,16 @@ static void test_panel_fitting(data_t *d)
>  		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
>  		igt_plane_set_position(d->plane2, 100, 100);
>  		igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> -
> -		/* enable panel fitting along with sprite scaling */
> -		mode->hdisplay = 1024;
> -		mode->vdisplay = 768;
> -		prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
> +		/*
> +		 * The sprite may not be able to scale such a large image.
> +		 * Just skip the sprite scaling tests in that case.
> +		 */
> +		if (!igt_display_try_commit2(display, COMMIT_UNIVERSAL)) {
> +			/* enable panel fitting along with sprite scaling */
> +			mode->hdisplay = 1024;
> +			mode->vdisplay = 768;
> +			prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
> +		}


else
 igt_info("Not gonna do sprite scaling\n");


maybe? With a better string.



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

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

* Re: [PATCH i-g-t 6/6] tests/kms_draw_crc: Skip tests for unsupported formats
  2017-09-21 14:39 ` [PATCH i-g-t 6/6] tests/kms_draw_crc: Skip tests for unsupported formats Ville Syrjala
@ 2017-09-27 11:38   ` Petri Latvala
  0 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2017-09-27 11:38 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Thu, Sep 21, 2017 at 05:39:33PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 10bpc formats aren't supported on all platforms, so skip the test when
> we can't create the framebuffer.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>


Reviewed-by: Petri Latvala <petri.latvala@intel.com>



> ---
>  tests/kms_draw_crc.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
> index 260950c76e00..723e7a182c95 100644
> --- a/tests/kms_draw_crc.c
> +++ b/tests/kms_draw_crc.c
> @@ -153,16 +153,33 @@ static void get_method_crc(enum igt_draw_method method, uint32_t drm_format,
>  	igt_remove_fb(drm_fd, &fb);
>  }
>  
> +static bool format_is_supported(uint32_t format, uint64_t modifier)
> +{
> +	uint32_t gem_handle, fb_id;
> +	unsigned int stride;
> +	int ret;
> +
> +	gem_handle = igt_create_bo_with_dimensions(drm_fd, 64, 64,
> +						   format, modifier,
> +						   0, NULL, &stride, NULL);
> +	ret =  __kms_addfb(drm_fd, gem_handle, 64, 64,
> +			   stride, format, modifier,
> +			   LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id);
> +	drmModeRmFB(drm_fd, fb_id);
> +	gem_close(drm_fd, gem_handle);
> +
> +	return ret == 0;
> +}
> +
>  static void draw_method_subtest(enum igt_draw_method method,
>  				uint32_t format_index, uint64_t tiling)
>  {
>  	igt_crc_t crc;
>  
> -	if (tiling == LOCAL_I915_FORMAT_MOD_Y_TILED)
> -		igt_require(intel_gen(intel_get_drm_devid(drm_fd)) >= 9);
> -
>  	igt_skip_on(method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd));
>  
> +	igt_require(format_is_supported(formats[format_index], tiling));
> +
>  	/* Use IGT_DRAW_MMAP_GTT on an untiled buffer as the parameter for
>  	 * comparison. Cache the value so we don't recompute it for every single
>  	 * subtest. */
> -- 
> 2.13.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane
  2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
                   ` (7 preceding siblings ...)
  2017-09-22 21:41 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-09-27 11:53 ` Petri Latvala
  8 siblings, 0 replies; 16+ messages in thread
From: Petri Latvala @ 2017-09-27 11:53 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

On Thu, Sep 21, 2017 at 05:39:28PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Skip when a test can't find a plane by the index. Previously
> in commit 5426dc0a889a ("lib/kms: Skip rather than fail when
> a suitable plane can't be found") we added similar handling for
> tests trying to find a non-existent plane by type. Saves from
> every test with hardcoded plane numbers having to check the
> number of planes available.

Do you have a list of such tests? I didn't see any results in CI
change from fail to skip so I presume this means all existing tests
check the number of planes available.



> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Petri Latvala <petri.latvala@intel.com>


> ---
>  lib/igt_kms.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 7bcafc072f70..83ebb42e6c9a 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2008,9 +2008,9 @@ static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output)
>  
>  static igt_plane_t *igt_pipe_get_plane(igt_pipe_t *pipe, int plane_idx)
>  {
> -	igt_assert_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
> -		"Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
> -		plane_idx, pipe->n_planes);
> +	igt_require_f(plane_idx >= 0 && plane_idx < pipe->n_planes,
> +		      "Valid pipe->planes plane_idx not found, plane_idx=%d n_planes=%d",
> +		      plane_idx, pipe->n_planes);
>  
>  	return &pipe->planes[plane_idx];
>  }
> -- 
> 2.13.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-09-27 11:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
2017-09-21 14:39 ` [PATCH i-g-t 2/6] tests/kms_mmio_vs_cs_flip: Reduce blit width Ville Syrjala
2017-09-21 14:39 ` [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png() Ville Syrjala
2017-09-22  9:52   ` Petri Latvala
2017-09-22 12:05     ` Ville Syrjälä
2017-09-22 12:33       ` Petri Latvala
2017-09-21 14:39 ` [PATCH i-g-t 4/6] tests/kms_panel_fitting: Use igt_cairo_image_surface_create_from_png_file() Ville Syrjala
2017-09-22  9:53   ` Petri Latvala
2017-09-21 14:39 ` [PATCH i-g-t 5/6] tests/kms_panel_fitting: Skip sprite test if we exceed sprite scaling limits Ville Syrjala
2017-09-27 11:34   ` Petri Latvala
2017-09-21 14:39 ` [PATCH i-g-t 6/6] tests/kms_draw_crc: Skip tests for unsupported formats Ville Syrjala
2017-09-27 11:38   ` Petri Latvala
2017-09-21 16:20 ` ✗ Fi.CI.BAT: warning for series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane Patchwork
2017-09-22 15:53 ` ✓ Fi.CI.BAT: success " Patchwork
2017-09-22 21:41 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-27 11:53 ` [PATCH i-g-t 1/6] " Petri Latvala

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.