* [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats
@ 2019-03-19 10:57 Juha-Pekka Heikkila
2019-03-19 10:57 ` [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: reset plane alpha and blend in igt_plane_reset() Juha-Pekka Heikkila
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Juha-Pekka Heikkila @ 2019-03-19 10:57 UTC (permalink / raw)
To: igt-dev
This test is causing too much useless noise. Limit tested
fb formats to DRM_FORMAT_C8 and DRM_FORMAT_XBGR2101010 for now.
These two formats are currently not tested otherwise thus
they're left here for now. DRM_FORMAT_XBGR2101010 need to be
included into IGT supported formats and DRM_FORMAT_C8 test need
to be moved elsewhere, maybe into kms_plane.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/kms_available_modes_crc.c | 289 ++++++++++++++++------------------------
1 file changed, 116 insertions(+), 173 deletions(-)
diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index 7ff385f..50b5522 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -57,15 +57,15 @@ typedef struct {
} data_t;
-static int do_write(int fd, int handle, void *buf, int size)
-{
- struct drm_i915_gem_pwrite write;
- memset(&write, 0x00, sizeof(write));
- write.handle = handle;
- write.data_ptr = (uintptr_t)buf;
- write.size = size;
- write.offset = 0;
- return igt_ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &write);
+static void do_write(int fd, int handle, void *buf, int size)
+{ void *screenbuf;
+
+ gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+ screenbuf = gem_mmap__gtt(fd, handle, size, PROT_WRITE);
+ memcpy(screenbuf, buf, size);
+ gem_munmap(screenbuf, size);
+ gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ gem_sync(fd, handle);
}
@@ -96,74 +96,39 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
0.0, 0.0, 0.0);
igt_paint_color(cr, 0, 0, w, h, 1.0, 1.0, 1.0);
igt_assert(cairo_status(cr) == 0);
+ igt_put_cairo_ctx(data->gfx_fd, &data->primary_fb, cr);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
igt_plane_set_fb(primary, &data->primary_fb);
igt_display_commit2(&data->display, data->commit);
+ igt_pipe_crc_drain(data->pipe_crc);
igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, &data->cursor_crc);
igt_plane_set_fb(primary, NULL);
igt_display_commit2(&data->display, data->commit);
- intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9 ?
- igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0) :
- igt_paint_color_alpha(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0, 1.0);
+ cr = igt_get_cairo_ctx(data->gfx_fd, &data->primary_fb);
+ igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0);
+ igt_put_cairo_ctx(data->gfx_fd, &data->primary_fb, cr);
igt_plane_set_fb(primary, &data->primary_fb);
igt_display_commit2(&data->display, data->commit);
+ igt_pipe_crc_drain(data->pipe_crc);
igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, &data->fullscreen_crc);
- cairo_destroy(cr);
igt_remove_fb(data->gfx_fd, &data->primary_fb);
}
static const struct {
uint32_t fourcc;
char zeropadding;
- enum { BYTES_PP_1=1,
- BYTES_PP_2=2,
- BYTES_PP_4=4,
- NV12,
- P010,
- SKIP4 } bpp;
+ enum { BYTES_PP_1 = 1,
+ BYTES_PP_4 = 4} bpp;
uint32_t value;
} fillers[] = {
{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
- { DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
- { DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
- { DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
-
- /*
- * following two are skipped because blending seems to work
- * incorrectly with exception of AR24 on cursor plane.
- * Test still creates the planes, just filling plane
- * and getting crc is skipped.
- */
- { DRM_FORMAT_ARGB8888, 0, SKIP4, 0xffffffff},
- { DRM_FORMAT_ABGR8888, 0, SKIP4, 0x00ffffff},
-
- { DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
-
- { DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
- { DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
- { DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
- { DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
-
- /*
- * (semi-)planar formats
- */
- { DRM_FORMAT_NV12, 0, NV12, 0x80eb},
-#ifdef DRM_FORMAT_P010
- { DRM_FORMAT_P010, 0, P010, 0x8000eb00},
-#endif
-#ifdef DRM_FORMAT_P012
- { DRM_FORMAT_P012, 0, P010, 0x8000eb00},
-#endif
-#ifdef DRM_FORMAT_P016
- { DRM_FORMAT_P016, 0, P010, 0x8000eb00},
-#endif
{ 0, 0, 0, 0 }
};
@@ -175,11 +140,10 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
uint32_t format)
{
signed i, c, writesize;
- unsigned short* ptemp_16_buf;
unsigned int* ptemp_32_buf;
- for( i = 0; fillers[i].fourcc != 0; i++ ) {
- if( fillers[i].fourcc == format )
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
+ if (fillers[i].fourcc == format)
break;
}
@@ -190,57 +154,12 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
ptemp_32_buf[c] = fillers[i].value;
writesize = data->size;
break;
- case BYTES_PP_2:
- ptemp_16_buf = (unsigned short*)data->buf;
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)fillers[i].value;
- writesize = data->size;
- break;
case BYTES_PP_1:
memset((void *)data->buf, fillers[i].value, data->size);
writesize = data->size;
break;
- case NV12:
- memset((void *)data->buf, fillers[i].value&0xff,
- data->fb.offsets[1]);
-
- memset((void *)(data->buf+data->fb.offsets[1]),
- (fillers[i].value>>8)&0xff,
- data->size - data->fb.offsets[1]);
-
- writesize = data->size;
- break;
- case P010:
- ptemp_16_buf = (unsigned short*)data->buf;
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)fillers[i].value&0xffff;
-
- ptemp_16_buf = (unsigned short*)(data->buf+data->size);
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)(fillers[i].value>>16)&0xffff;
-
- writesize = data->size+data->size/2;
- break;
- case SKIP4:
- if (fillers[i].fourcc == DRM_FORMAT_ARGB8888 &&
- plane->type == DRM_PLANE_TYPE_CURSOR) {
- /*
- * special for cursor plane where blending works correctly.
- */
- ptemp_32_buf = (unsigned int*)data->buf;
- for (c = 0; c < data->size/4; c++)
- ptemp_32_buf[c] = fillers[i].value;
- writesize = data->size;
- break;
- }
- igt_info("Format %s CRC comparison skipped by design.\n",
- (char*)&fillers[i].fourcc);
-
- return false;
default:
- igt_info("Unsupported mode for test %s\n",
- (char*)&fillers[i].fourcc);
- return false;
+ igt_assert_f(0, "unknown bpp");
}
do_write(data->gfx_fd, data->gem_handle, (void*)data->buf, writesize);
@@ -271,26 +190,20 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
tiling = LOCAL_DRM_FORMAT_MOD_NONE;
}
- for (i = 0; fillers[i].fourcc != 0; i++) {
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
if (fillers[i].fourcc == format)
break;
}
switch (fillers[i].bpp) {
- case NV12:
case BYTES_PP_1:
bpp = 8;
break;
-
- case P010:
- case BYTES_PP_2:
- bpp = 16;
- break;
-
- case SKIP4:
case BYTES_PP_4:
bpp = 32;
break;
+ default:
+ igt_assert_f(0, "unknown bpp");
}
igt_get_fb_tile_size(data->gfx_fd, tiling, bpp,
@@ -298,23 +211,18 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
data->fb.offsets[0] = 0;
data->fb.strides[0] = ALIGN(w * bpp / 8, tile_width);
gemsize = data->size = data->fb.strides[0] * ALIGN(h, tile_height);
-
- if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
- data->fb.offsets[1] = data->size;
- data->fb.strides[1] = data->fb.strides[0];
- gemsize = data->size * 2;
-
- if (fillers[i].bpp == NV12)
- data->size += data->fb.strides[1] * ALIGN(h/2, tile_height);
-
- num_planes = 2;
- }
+ data->buf = (unsigned char *)calloc(data->size*2, 1);
data->gem_handle = gem_create(data->gfx_fd, gemsize);
ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
igt_fb_mod_to_tiling(tiling),
data->fb.strides[0]);
+ data->fb.gem_handle = data->gem_handle;
+ data->fb.width = w;
+ data->fb.height = h;
+ fill_in_fb(data, output, plane, format);
+
igt_assert_eq(ret, 0);
ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
@@ -329,9 +237,6 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
return false;
}
- data->fb.width = w;
- data->fb.height = h;
- data->fb.gem_handle = data->gem_handle;
return true;
}
@@ -378,63 +283,66 @@ static bool prepare_crtc(data_t *data, igt_output_t *output,
if (!setup_fb(data, output, plane, format))
return false;
- free((void*)data->buf);
- data->buf = (unsigned char*)calloc(data->size*2, 1);
return true;
}
static int
test_one_mode(data_t* data, igt_output_t *output, igt_plane_t* plane,
- int mode)
+ int mode, enum pipe pipe)
{
igt_crc_t current_crc;
signed rVal = 0;
- bool do_crc;
- char* crccompare[2];
+ int i;
- if (prepare_crtc(data, output, plane, mode)){
- /*
- * we have fb from prepare_crtc(..) so now fill it in
- * correctly in fill_in_fb(..)
- */
- do_crc = fill_in_fb(data, output, plane, mode);
+ /*
+ * Limit tests only to those fb formats listed in fillers table
+ */
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
+ if (fillers[i].fourcc == mode)
+ break;
+ }
+
+ if (fillers[i].bpp == 0)
+ return false;
+ if (prepare_crtc(data, output, plane, mode)) {
igt_plane_set_fb(plane, &data->fb);
igt_fb_set_size(&data->fb, plane, data->fb.width, data->fb.height);
igt_plane_set_size(plane, data->fb.width, data->fb.height);
igt_fb_set_position(&data->fb, plane, 0, 0);
igt_display_commit2(&data->display, data->commit);
- if (do_crc) {
- igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, ¤t_crc);
-
- if (plane->type != DRM_PLANE_TYPE_CURSOR) {
- if (!igt_check_crc_equal(¤t_crc,
- &data->fullscreen_crc)) {
- crccompare[0] = igt_crc_to_string(¤t_crc);
- crccompare[1] = igt_crc_to_string(&data->fullscreen_crc);
- igt_warn("crc mismatch. target %.8s, result %.8s.\n", crccompare[0], crccompare[1]);
- free(crccompare[0]);
- free(crccompare[1]);
- rVal++;
- }
- } else {
- if (!igt_check_crc_equal(¤t_crc,
- &data->cursor_crc)) {
- crccompare[0] = igt_crc_to_string(¤t_crc);
- crccompare[1] = igt_crc_to_string(&data->cursor_crc);
- igt_warn("crc mismatch. target %.8s, result %.8s.\n", crccompare[0], crccompare[1]);
- free(crccompare[0]);
- free(crccompare[1]);
- rVal++;
- }
+ igt_wait_for_vblank(data->gfx_fd, pipe);
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, ¤t_crc);
+
+ if (plane->type != DRM_PLANE_TYPE_CURSOR) {
+ if (!igt_check_crc_equal(¤t_crc,
+ &data->fullscreen_crc)) {
+ igt_warn("crc mismatch. connector %s using pipe %s" \
+ " plane index %d mode %.4s\n",
+ igt_output_name(output),
+ kmstest_pipe_name(pipe),
+ plane->index,
+ (char *)&mode);
+ rVal++;
+ }
+ } else {
+ if (!igt_check_crc_equal(¤t_crc,
+ &data->cursor_crc)) {
+ igt_warn("crc mismatch. connector %s using pipe %s" \
+ " plane index %d mode %.4s\n",
+ igt_output_name(output),
+ kmstest_pipe_name(pipe),
+ plane->index,
+ (char *)&mode);
+ rVal++;
}
}
- remove_fb(data, output, plane);
- return rVal;
}
- return 1;
+ remove_fb(data, output, plane);
+ return rVal;
}
@@ -445,14 +353,44 @@ test_available_modes(data_t* data)
igt_plane_t *plane;
int modeindex;
enum pipe pipe;
- int invalids = 0;
+ int invalids = 0, i, lut_size;
drmModePlane *modePlane;
- char planetype[3][8] = {"OVERLAY\0", "PRIMARY\0", "CURSOR\0" };
+
+ struct {
+ uint16_t red;
+ uint16_t green;
+ uint16_t blue;
+ uint16_t reserved;
+ } *lut = NULL;
for_each_pipe_with_valid_output(&data->display, pipe, output) {
igt_output_set_pipe(output, pipe);
igt_display_commit2(&data->display, data->commit);
+ if (igt_pipe_obj_has_prop(&data->display.pipes[pipe], IGT_CRTC_GAMMA_LUT_SIZE)) {
+ lut_size = igt_pipe_get_prop(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT_SIZE);
+
+ lut = calloc(sizeof(*lut), lut_size);
+
+ for (i = 0; i < lut_size; i++) {
+ lut[i].red = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ lut[i].green = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ lut[i].blue = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ }
+
+ igt_pipe_replace_prop_blob(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT,
+ lut, sizeof(*lut) * lut_size);
+ igt_display_commit2(&data->display, data->commit);
+
+ for (i = 0; i < lut_size; i++) {
+ lut[i].red = i * 0xffff / (lut_size - 1);
+ lut[i].green = i * 0xffff / (lut_size - 1);
+ lut[i].blue = i * 0xffff / (lut_size - 1);
+ }
+ }
+
data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
@@ -467,29 +405,34 @@ test_available_modes(data_t* data)
modePlane = drmModeGetPlane(data->gfx_fd,
plane->drm_plane->plane_id);
+ if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ continue;
+
for (modeindex = 0;
modeindex < modePlane->count_formats;
modeindex++) {
data->format.dword = modePlane->formats[modeindex];
- igt_info("Testing connector %s using pipe %s" \
- " plane index %d type %s mode %s\n",
- igt_output_name(output),
- kmstest_pipe_name(pipe),
- plane->index,
- planetype[plane->type],
- (char*)&data->format.name);
-
invalids += test_one_mode(data, output,
plane,
- modePlane->formats[modeindex]);
+ modePlane->formats[modeindex],
+ pipe);
}
drmModeFreePlane(modePlane);
}
igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
- igt_display_commit2(&data->display, data->commit);
+
+ if (lut != NULL) {
+ igt_pipe_replace_prop_blob(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT,
+ lut, sizeof(*lut) * lut_size);
+ free(lut);
+ lut = NULL;
+ }
+
igt_output_set_pipe(output, PIPE_NONE);
+ igt_display_commit2(&data->display, data->commit);
}
igt_assert(invalids == 0);
}
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: reset plane alpha and blend in igt_plane_reset()
2019-03-19 10:57 [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats Juha-Pekka Heikkila
@ 2019-03-19 10:57 ` Juha-Pekka Heikkila
2019-03-19 11:22 ` Ville Syrjälä
2019-03-19 11:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_available_modes_crc limit tested fb formats Patchwork
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Juha-Pekka Heikkila @ 2019-03-19 10:57 UTC (permalink / raw)
To: igt-dev
plane alpha and blend would affect other tests if left
in unexpected states
v2 (ville syrjälä): use "Pre-multiplied" as default for
IGT_PLANE_PIXEL_BLEND_MODE.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
lib/igt_kms.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e1eacc1..c788308 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1781,6 +1781,13 @@ static void igt_plane_reset(igt_plane_t *plane)
if (igt_plane_has_prop(plane, IGT_PLANE_ROTATION))
igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION, IGT_ROTATION_0);
+ if (igt_plane_has_prop(plane, IGT_PLANE_PIXEL_BLEND_MODE))
+ igt_plane_set_prop_enum(plane, IGT_PLANE_PIXEL_BLEND_MODE, "Pre-multiplied");
+
+ if (igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
+ igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, 0xffff);
+
+
igt_plane_clear_prop_changed(plane, IGT_PLANE_IN_FENCE_FD);
plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
plane->gem_handle = 0;
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: reset plane alpha and blend in igt_plane_reset()
2019-03-19 10:57 ` [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: reset plane alpha and blend in igt_plane_reset() Juha-Pekka Heikkila
@ 2019-03-19 11:22 ` Ville Syrjälä
0 siblings, 0 replies; 9+ messages in thread
From: Ville Syrjälä @ 2019-03-19 11:22 UTC (permalink / raw)
To: Juha-Pekka Heikkila; +Cc: igt-dev
On Tue, Mar 19, 2019 at 12:57:58PM +0200, Juha-Pekka Heikkila wrote:
> plane alpha and blend would affect other tests if left
> in unexpected states
>
> v2 (ville syrjälä): use "Pre-multiplied" as default for
> IGT_PLANE_PIXEL_BLEND_MODE.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> lib/igt_kms.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index e1eacc1..c788308 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1781,6 +1781,13 @@ static void igt_plane_reset(igt_plane_t *plane)
> if (igt_plane_has_prop(plane, IGT_PLANE_ROTATION))
> igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION, IGT_ROTATION_0);
>
> + if (igt_plane_has_prop(plane, IGT_PLANE_PIXEL_BLEND_MODE))
> + igt_plane_set_prop_enum(plane, IGT_PLANE_PIXEL_BLEND_MODE, "Pre-multiplied");
> +
> + if (igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
> + igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, 0xffff);
> +
> +
> igt_plane_clear_prop_changed(plane, IGT_PLANE_IN_FENCE_FD);
> plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
> plane->gem_handle = 0;
> --
> 2.7.4
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_available_modes_crc limit tested fb formats
2019-03-19 10:57 [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats Juha-Pekka Heikkila
2019-03-19 10:57 ` [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: reset plane alpha and blend in igt_plane_reset() Juha-Pekka Heikkila
@ 2019-03-19 11:34 ` Patchwork
2019-03-19 18:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-21 14:18 ` [igt-dev] [PATCH i-g-t 1/2] " Maarten Lankhorst
3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-03-19 11:34 UTC (permalink / raw)
To: Juha-Pekka Heikkila; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,1/2] tests/kms_available_modes_crc limit tested fb formats
URL : https://patchwork.freedesktop.org/series/58177/
State : success
== Summary ==
CI Bug Log - changes from IGT_4889 -> IGTPW_2659
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58177/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2659 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_basic@userptr:
- fi-whl-u: NOTRUN -> SKIP [fdo#109271] +41
* igt@amdgpu/amd_cs_nop@sync-fork-compute0:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109315] +17
* igt@gem_exec_basic@gtt-bsd1:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109276] +7
* igt@gem_exec_basic@gtt-bsd2:
- fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] +57
* igt@gem_exec_basic@readonly-bsd1:
- fi-snb-2520m: NOTRUN -> SKIP [fdo#109271] +57
* igt@gem_exec_parse@basic-rejected:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109289] +1
* igt@i915_module_load@reload:
- fi-blb-e6850: PASS -> INCOMPLETE [fdo#107718]
* igt@i915_selftest@live_contexts:
- fi-icl-u3: NOTRUN -> DMESG-FAIL [fdo#108569]
* igt@kms_busy@basic-flip-c:
- fi-byt-clapper: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-snb-2520m: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_chamelium@hdmi-edid-read:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109284] +8
* igt@kms_force_connector_basic@prune-stale-modes:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109285] +3
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u3: NOTRUN -> FAIL [fdo#103167]
- fi-byt-clapper: NOTRUN -> FAIL [fdo#103167]
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
- fi-byt-clapper: NOTRUN -> FAIL [fdo#103191] / [fdo#107362]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-whl-u: NOTRUN -> FAIL [fdo#103375] +3
* igt@kms_psr@cursor_plane_move:
- fi-skl-6260u: NOTRUN -> SKIP [fdo#109271] +37
- fi-whl-u: NOTRUN -> FAIL [fdo#107383] +3
* igt@kms_psr@primary_page_flip:
- fi-apl-guc: NOTRUN -> SKIP [fdo#109271] +50
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3:
- fi-snb-2600: DMESG-WARN [fdo#102365] -> PASS
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: DMESG-WARN [fdo#105541] -> PASS
[fdo#102365]: https://bugs.freedesktop.org/show_bug.cgi?id=102365
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#105541]: https://bugs.freedesktop.org/show_bug.cgi?id=105541
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
Participating hosts (40 -> 38)
------------------------------
Additional (6): fi-skl-6260u fi-apl-guc fi-snb-2520m fi-whl-u fi-icl-u3 fi-byt-clapper
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-gdg-551 fi-bdw-samus
Build changes
-------------
* IGT: IGT_4889 -> IGTPW_2659
CI_DRM_5771: c1500eaf9d004539bbc2b7458c6cbe3f6a6147dc @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2659: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2659/
IGT_4889: e3faf0fd49b7e3a763bf89e11fb4fdce81839da2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2659/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] tests/kms_available_modes_crc limit tested fb formats
2019-03-19 10:57 [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats Juha-Pekka Heikkila
2019-03-19 10:57 ` [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: reset plane alpha and blend in igt_plane_reset() Juha-Pekka Heikkila
2019-03-19 11:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_available_modes_crc limit tested fb formats Patchwork
@ 2019-03-19 18:53 ` Patchwork
2019-03-21 14:18 ` [igt-dev] [PATCH i-g-t 1/2] " Maarten Lankhorst
3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-03-19 18:53 UTC (permalink / raw)
To: Juha-Pekka Heikkila; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,1/2] tests/kms_available_modes_crc limit tested fb formats
URL : https://patchwork.freedesktop.org/series/58177/
State : success
== Summary ==
CI Bug Log - changes from IGT_4889_full -> IGTPW_2659_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58177/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2659_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rps@waitboost:
- shard-glk: PASS -> FAIL [fdo#102250]
* igt@kms_atomic_transition@3x-modeset-transitions-fencing:
- shard-glk: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_atomic_transition@3x-modeset-transitions-nonblocking:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +19
* igt@kms_busy@extended-pageflip-hang-oldfb-render-e:
- shard-apl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
- shard-snb: NOTRUN -> DMESG-WARN [fdo#107956]
* igt@kms_cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +26
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-blt:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] +6
* igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-onoff:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +5
* igt@kms_plane_alpha_blend@pipe-b-alpha-transparant-fb:
- shard-kbl: NOTRUN -> FAIL [fdo#108145]
* igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
- shard-apl: NOTRUN -> FAIL [fdo#108145]
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: PASS -> FAIL [fdo#109016]
* igt@kms_setmode@basic:
- shard-hsw: PASS -> FAIL [fdo#99912]
* igt@kms_universal_plane@disable-primary-vs-flip-pipe-e:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_vblank@pipe-b-query-forked-busy:
- shard-hsw: PASS -> INCOMPLETE [fdo#103540]
* igt@perf@short-reads:
- shard-kbl: PASS -> FAIL [fdo#103183]
* igt@perf_pmu@busy-start-vcs1:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +173
#### Possible fixes ####
* igt@kms_available_modes_crc@available_mode_test_crc:
- shard-apl: FAIL [fdo#106641] -> PASS
- shard-glk: FAIL [fdo#106641] -> PASS
- shard-kbl: FAIL [fdo#106641] -> PASS
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
- shard-snb: DMESG-WARN [fdo#107956] -> PASS
- shard-hsw: DMESG-WARN [fdo#107956] -> PASS
* igt@kms_cursor_crc@cursor-128x128-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-64x21-random:
- shard-apl: FAIL [fdo#103232] -> PASS +5
* igt@kms_cursor_crc@cursor-64x64-random:
- shard-kbl: FAIL [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-alpha-opaque:
- shard-apl: FAIL [fdo#109350] -> PASS
* igt@kms_cursor_crc@cursor-size-change:
- shard-glk: FAIL [fdo#103232] -> PASS
* igt@kms_flip@busy-flip-interruptible:
- shard-apl: INCOMPLETE [fdo#103927] -> PASS
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
- shard-apl: FAIL [fdo#103167] -> PASS +7
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
- shard-kbl: FAIL [fdo#103167] -> PASS +2
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move:
- shard-glk: FAIL [fdo#103167] -> PASS +3
* {igt@kms_plane@pixel-format-pipe-c-planes-source-clamping}:
- shard-glk: SKIP [fdo#109271] -> PASS
* {igt@kms_plane@plane-position-covered-pipe-a-planes}:
- shard-glk: FAIL [fdo#110038] -> PASS +1
* {igt@kms_plane_multiple@atomic-pipe-a-tiling-x}:
- shard-apl: FAIL [fdo#110037] -> PASS +4
* {igt@kms_plane_multiple@atomic-pipe-b-tiling-none}:
- shard-glk: FAIL [fdo#110037] -> PASS +3
* {igt@kms_plane_multiple@atomic-pipe-b-tiling-yf}:
- shard-kbl: FAIL [fdo#110037] -> PASS +1
* igt@kms_plane_scaling@pipe-a-scaler-with-clipping-clamping:
- shard-glk: SKIP [fdo#109271] / [fdo#109278] -> PASS
* igt@kms_rotation_crc@multiplane-rotation:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
* igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
- shard-apl: FAIL [fdo#104894] -> PASS +1
#### Warnings ####
* igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
- shard-glk: SKIP [fdo#109271] / [fdo#109278] -> FAIL [fdo#110098]
* igt@kms_plane_scaling@pipe-c-scaler-with-rotation:
- shard-glk: FAIL [fdo#110098] -> SKIP [fdo#109271] / [fdo#109278]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102250]: https://bugs.freedesktop.org/show_bug.cgi?id=102250
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103183]: https://bugs.freedesktop.org/show_bug.cgi?id=103183
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109350]: https://bugs.freedesktop.org/show_bug.cgi?id=109350
[fdo#110037]: https://bugs.freedesktop.org/show_bug.cgi?id=110037
[fdo#110038]: https://bugs.freedesktop.org/show_bug.cgi?id=110038
[fdo#110098]: https://bugs.freedesktop.org/show_bug.cgi?id=110098
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 5)
------------------------------
Missing (2): shard-skl shard-iclb
Build changes
-------------
* IGT: IGT_4889 -> IGTPW_2659
CI_DRM_5771: c1500eaf9d004539bbc2b7458c6cbe3f6a6147dc @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2659: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2659/
IGT_4889: e3faf0fd49b7e3a763bf89e11fb4fdce81839da2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2659/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats
2019-03-19 10:57 [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats Juha-Pekka Heikkila
` (2 preceding siblings ...)
2019-03-19 18:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-03-21 14:18 ` Maarten Lankhorst
2019-03-21 19:04 ` Juha-Pekka Heikkilä
3 siblings, 1 reply; 9+ messages in thread
From: Maarten Lankhorst @ 2019-03-21 14:18 UTC (permalink / raw)
To: Juha-Pekka Heikkila, igt-dev
Op 19-03-2019 om 11:57 schreef Juha-Pekka Heikkila:
> This test is causing too much useless noise. Limit tested
> fb formats to DRM_FORMAT_C8 and DRM_FORMAT_XBGR2101010 for now.
> These two formats are currently not tested otherwise thus
> they're left here for now. DRM_FORMAT_XBGR2101010 need to be
> included into IGT supported formats and DRM_FORMAT_C8 test need
> to be moved elsewhere, maybe into kms_plane.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
> tests/kms_available_modes_crc.c | 289 ++++++++++++++++------------------------
> 1 file changed, 116 insertions(+), 173 deletions(-)
>
I liked the fact we were testing the same white point everywhere, but I suppose
that's what kms_plane already does, and it makes sense to get rid of this. :)
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats
2019-03-21 14:18 ` [igt-dev] [PATCH i-g-t 1/2] " Maarten Lankhorst
@ 2019-03-21 19:04 ` Juha-Pekka Heikkilä
0 siblings, 0 replies; 9+ messages in thread
From: Juha-Pekka Heikkilä @ 2019-03-21 19:04 UTC (permalink / raw)
To: Maarten Lankhorst, igt-dev
Maarten Lankhorst kirjoitti 21.3.2019 klo 16.18:
> Op 19-03-2019 om 11:57 schreef Juha-Pekka Heikkila:
>> This test is causing too much useless noise. Limit tested
>> fb formats to DRM_FORMAT_C8 and DRM_FORMAT_XBGR2101010 for now.
>> These two formats are currently not tested otherwise thus
>> they're left here for now. DRM_FORMAT_XBGR2101010 need to be
>> included into IGT supported formats and DRM_FORMAT_C8 test need
>> to be moved elsewhere, maybe into kms_plane.
>>
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
>> ---
>> tests/kms_available_modes_crc.c | 289 ++++++++++++++++------------------------
>> 1 file changed, 116 insertions(+), 173 deletions(-)
>>
> I liked the fact we were testing the same white point everywhere, but I suppose
>
> that's what kms_plane already does, and it makes sense to get rid of this. :)
>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com
>
Hei, thanks for the review :)
I was also pondering about future of this test as kms_plane does test
everything in more comprehensive ways.
I was thinking once DRM_FORMAT_XBGR2101010 is made as IGT supported
format I'd maybe rename this test to someting about C8 and keep this
test. This is due to recently I saw there is some idea to have
completely separate plane test 'just for comparison' as kms_plane didn't
catch those errors where plane alpha was left at unexpected value. While
kms_plane was saying all is ok this test was nagging all the time.
I'll push this patch tomorrow so this test stop nagging for now, I hope.
/Juha-Pekka
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats
@ 2019-03-18 11:15 Juha-Pekka Heikkila
0 siblings, 0 replies; 9+ messages in thread
From: Juha-Pekka Heikkila @ 2019-03-18 11:15 UTC (permalink / raw)
To: igt-dev
This test is causing too much useless noise. Limit tested
fb formats to DRM_FORMAT_C8 and DRM_FORMAT_XBGR2101010 for now.
These two formats are currently not tested otherwise thus
they're left here for now. DRM_FORMAT_XBGR2101010 need to be
included into IGT supported formats and DRM_FORMAT_C8 test need
to be moved elsewhere, maybe into kms_plane.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/kms_available_modes_crc.c | 289 ++++++++++++++++------------------------
1 file changed, 116 insertions(+), 173 deletions(-)
diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index 7ff385f..50b5522 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -57,15 +57,15 @@ typedef struct {
} data_t;
-static int do_write(int fd, int handle, void *buf, int size)
-{
- struct drm_i915_gem_pwrite write;
- memset(&write, 0x00, sizeof(write));
- write.handle = handle;
- write.data_ptr = (uintptr_t)buf;
- write.size = size;
- write.offset = 0;
- return igt_ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &write);
+static void do_write(int fd, int handle, void *buf, int size)
+{ void *screenbuf;
+
+ gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+ screenbuf = gem_mmap__gtt(fd, handle, size, PROT_WRITE);
+ memcpy(screenbuf, buf, size);
+ gem_munmap(screenbuf, size);
+ gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ gem_sync(fd, handle);
}
@@ -96,74 +96,39 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
0.0, 0.0, 0.0);
igt_paint_color(cr, 0, 0, w, h, 1.0, 1.0, 1.0);
igt_assert(cairo_status(cr) == 0);
+ igt_put_cairo_ctx(data->gfx_fd, &data->primary_fb, cr);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
igt_plane_set_fb(primary, &data->primary_fb);
igt_display_commit2(&data->display, data->commit);
+ igt_pipe_crc_drain(data->pipe_crc);
igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, &data->cursor_crc);
igt_plane_set_fb(primary, NULL);
igt_display_commit2(&data->display, data->commit);
- intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9 ?
- igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0) :
- igt_paint_color_alpha(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0, 1.0);
+ cr = igt_get_cairo_ctx(data->gfx_fd, &data->primary_fb);
+ igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0);
+ igt_put_cairo_ctx(data->gfx_fd, &data->primary_fb, cr);
igt_plane_set_fb(primary, &data->primary_fb);
igt_display_commit2(&data->display, data->commit);
+ igt_pipe_crc_drain(data->pipe_crc);
igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, &data->fullscreen_crc);
- cairo_destroy(cr);
igt_remove_fb(data->gfx_fd, &data->primary_fb);
}
static const struct {
uint32_t fourcc;
char zeropadding;
- enum { BYTES_PP_1=1,
- BYTES_PP_2=2,
- BYTES_PP_4=4,
- NV12,
- P010,
- SKIP4 } bpp;
+ enum { BYTES_PP_1 = 1,
+ BYTES_PP_4 = 4} bpp;
uint32_t value;
} fillers[] = {
{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
- { DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
- { DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
- { DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
-
- /*
- * following two are skipped because blending seems to work
- * incorrectly with exception of AR24 on cursor plane.
- * Test still creates the planes, just filling plane
- * and getting crc is skipped.
- */
- { DRM_FORMAT_ARGB8888, 0, SKIP4, 0xffffffff},
- { DRM_FORMAT_ABGR8888, 0, SKIP4, 0x00ffffff},
-
- { DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
-
- { DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
- { DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
- { DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
- { DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
-
- /*
- * (semi-)planar formats
- */
- { DRM_FORMAT_NV12, 0, NV12, 0x80eb},
-#ifdef DRM_FORMAT_P010
- { DRM_FORMAT_P010, 0, P010, 0x8000eb00},
-#endif
-#ifdef DRM_FORMAT_P012
- { DRM_FORMAT_P012, 0, P010, 0x8000eb00},
-#endif
-#ifdef DRM_FORMAT_P016
- { DRM_FORMAT_P016, 0, P010, 0x8000eb00},
-#endif
{ 0, 0, 0, 0 }
};
@@ -175,11 +140,10 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
uint32_t format)
{
signed i, c, writesize;
- unsigned short* ptemp_16_buf;
unsigned int* ptemp_32_buf;
- for( i = 0; fillers[i].fourcc != 0; i++ ) {
- if( fillers[i].fourcc == format )
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
+ if (fillers[i].fourcc == format)
break;
}
@@ -190,57 +154,12 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
ptemp_32_buf[c] = fillers[i].value;
writesize = data->size;
break;
- case BYTES_PP_2:
- ptemp_16_buf = (unsigned short*)data->buf;
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)fillers[i].value;
- writesize = data->size;
- break;
case BYTES_PP_1:
memset((void *)data->buf, fillers[i].value, data->size);
writesize = data->size;
break;
- case NV12:
- memset((void *)data->buf, fillers[i].value&0xff,
- data->fb.offsets[1]);
-
- memset((void *)(data->buf+data->fb.offsets[1]),
- (fillers[i].value>>8)&0xff,
- data->size - data->fb.offsets[1]);
-
- writesize = data->size;
- break;
- case P010:
- ptemp_16_buf = (unsigned short*)data->buf;
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)fillers[i].value&0xffff;
-
- ptemp_16_buf = (unsigned short*)(data->buf+data->size);
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)(fillers[i].value>>16)&0xffff;
-
- writesize = data->size+data->size/2;
- break;
- case SKIP4:
- if (fillers[i].fourcc == DRM_FORMAT_ARGB8888 &&
- plane->type == DRM_PLANE_TYPE_CURSOR) {
- /*
- * special for cursor plane where blending works correctly.
- */
- ptemp_32_buf = (unsigned int*)data->buf;
- for (c = 0; c < data->size/4; c++)
- ptemp_32_buf[c] = fillers[i].value;
- writesize = data->size;
- break;
- }
- igt_info("Format %s CRC comparison skipped by design.\n",
- (char*)&fillers[i].fourcc);
-
- return false;
default:
- igt_info("Unsupported mode for test %s\n",
- (char*)&fillers[i].fourcc);
- return false;
+ igt_assert_f(0, "unknown bpp");
}
do_write(data->gfx_fd, data->gem_handle, (void*)data->buf, writesize);
@@ -271,26 +190,20 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
tiling = LOCAL_DRM_FORMAT_MOD_NONE;
}
- for (i = 0; fillers[i].fourcc != 0; i++) {
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
if (fillers[i].fourcc == format)
break;
}
switch (fillers[i].bpp) {
- case NV12:
case BYTES_PP_1:
bpp = 8;
break;
-
- case P010:
- case BYTES_PP_2:
- bpp = 16;
- break;
-
- case SKIP4:
case BYTES_PP_4:
bpp = 32;
break;
+ default:
+ igt_assert_f(0, "unknown bpp");
}
igt_get_fb_tile_size(data->gfx_fd, tiling, bpp,
@@ -298,23 +211,18 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
data->fb.offsets[0] = 0;
data->fb.strides[0] = ALIGN(w * bpp / 8, tile_width);
gemsize = data->size = data->fb.strides[0] * ALIGN(h, tile_height);
-
- if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
- data->fb.offsets[1] = data->size;
- data->fb.strides[1] = data->fb.strides[0];
- gemsize = data->size * 2;
-
- if (fillers[i].bpp == NV12)
- data->size += data->fb.strides[1] * ALIGN(h/2, tile_height);
-
- num_planes = 2;
- }
+ data->buf = (unsigned char *)calloc(data->size*2, 1);
data->gem_handle = gem_create(data->gfx_fd, gemsize);
ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
igt_fb_mod_to_tiling(tiling),
data->fb.strides[0]);
+ data->fb.gem_handle = data->gem_handle;
+ data->fb.width = w;
+ data->fb.height = h;
+ fill_in_fb(data, output, plane, format);
+
igt_assert_eq(ret, 0);
ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
@@ -329,9 +237,6 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
return false;
}
- data->fb.width = w;
- data->fb.height = h;
- data->fb.gem_handle = data->gem_handle;
return true;
}
@@ -378,63 +283,66 @@ static bool prepare_crtc(data_t *data, igt_output_t *output,
if (!setup_fb(data, output, plane, format))
return false;
- free((void*)data->buf);
- data->buf = (unsigned char*)calloc(data->size*2, 1);
return true;
}
static int
test_one_mode(data_t* data, igt_output_t *output, igt_plane_t* plane,
- int mode)
+ int mode, enum pipe pipe)
{
igt_crc_t current_crc;
signed rVal = 0;
- bool do_crc;
- char* crccompare[2];
+ int i;
- if (prepare_crtc(data, output, plane, mode)){
- /*
- * we have fb from prepare_crtc(..) so now fill it in
- * correctly in fill_in_fb(..)
- */
- do_crc = fill_in_fb(data, output, plane, mode);
+ /*
+ * Limit tests only to those fb formats listed in fillers table
+ */
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
+ if (fillers[i].fourcc == mode)
+ break;
+ }
+
+ if (fillers[i].bpp == 0)
+ return false;
+ if (prepare_crtc(data, output, plane, mode)) {
igt_plane_set_fb(plane, &data->fb);
igt_fb_set_size(&data->fb, plane, data->fb.width, data->fb.height);
igt_plane_set_size(plane, data->fb.width, data->fb.height);
igt_fb_set_position(&data->fb, plane, 0, 0);
igt_display_commit2(&data->display, data->commit);
- if (do_crc) {
- igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, ¤t_crc);
-
- if (plane->type != DRM_PLANE_TYPE_CURSOR) {
- if (!igt_check_crc_equal(¤t_crc,
- &data->fullscreen_crc)) {
- crccompare[0] = igt_crc_to_string(¤t_crc);
- crccompare[1] = igt_crc_to_string(&data->fullscreen_crc);
- igt_warn("crc mismatch. target %.8s, result %.8s.\n", crccompare[0], crccompare[1]);
- free(crccompare[0]);
- free(crccompare[1]);
- rVal++;
- }
- } else {
- if (!igt_check_crc_equal(¤t_crc,
- &data->cursor_crc)) {
- crccompare[0] = igt_crc_to_string(¤t_crc);
- crccompare[1] = igt_crc_to_string(&data->cursor_crc);
- igt_warn("crc mismatch. target %.8s, result %.8s.\n", crccompare[0], crccompare[1]);
- free(crccompare[0]);
- free(crccompare[1]);
- rVal++;
- }
+ igt_wait_for_vblank(data->gfx_fd, pipe);
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, ¤t_crc);
+
+ if (plane->type != DRM_PLANE_TYPE_CURSOR) {
+ if (!igt_check_crc_equal(¤t_crc,
+ &data->fullscreen_crc)) {
+ igt_warn("crc mismatch. connector %s using pipe %s" \
+ " plane index %d mode %.4s\n",
+ igt_output_name(output),
+ kmstest_pipe_name(pipe),
+ plane->index,
+ (char *)&mode);
+ rVal++;
+ }
+ } else {
+ if (!igt_check_crc_equal(¤t_crc,
+ &data->cursor_crc)) {
+ igt_warn("crc mismatch. connector %s using pipe %s" \
+ " plane index %d mode %.4s\n",
+ igt_output_name(output),
+ kmstest_pipe_name(pipe),
+ plane->index,
+ (char *)&mode);
+ rVal++;
}
}
- remove_fb(data, output, plane);
- return rVal;
}
- return 1;
+ remove_fb(data, output, plane);
+ return rVal;
}
@@ -445,14 +353,44 @@ test_available_modes(data_t* data)
igt_plane_t *plane;
int modeindex;
enum pipe pipe;
- int invalids = 0;
+ int invalids = 0, i, lut_size;
drmModePlane *modePlane;
- char planetype[3][8] = {"OVERLAY\0", "PRIMARY\0", "CURSOR\0" };
+
+ struct {
+ uint16_t red;
+ uint16_t green;
+ uint16_t blue;
+ uint16_t reserved;
+ } *lut = NULL;
for_each_pipe_with_valid_output(&data->display, pipe, output) {
igt_output_set_pipe(output, pipe);
igt_display_commit2(&data->display, data->commit);
+ if (igt_pipe_obj_has_prop(&data->display.pipes[pipe], IGT_CRTC_GAMMA_LUT_SIZE)) {
+ lut_size = igt_pipe_get_prop(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT_SIZE);
+
+ lut = calloc(sizeof(*lut), lut_size);
+
+ for (i = 0; i < lut_size; i++) {
+ lut[i].red = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ lut[i].green = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ lut[i].blue = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ }
+
+ igt_pipe_replace_prop_blob(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT,
+ lut, sizeof(*lut) * lut_size);
+ igt_display_commit2(&data->display, data->commit);
+
+ for (i = 0; i < lut_size; i++) {
+ lut[i].red = i * 0xffff / (lut_size - 1);
+ lut[i].green = i * 0xffff / (lut_size - 1);
+ lut[i].blue = i * 0xffff / (lut_size - 1);
+ }
+ }
+
data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
@@ -467,29 +405,34 @@ test_available_modes(data_t* data)
modePlane = drmModeGetPlane(data->gfx_fd,
plane->drm_plane->plane_id);
+ if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ continue;
+
for (modeindex = 0;
modeindex < modePlane->count_formats;
modeindex++) {
data->format.dword = modePlane->formats[modeindex];
- igt_info("Testing connector %s using pipe %s" \
- " plane index %d type %s mode %s\n",
- igt_output_name(output),
- kmstest_pipe_name(pipe),
- plane->index,
- planetype[plane->type],
- (char*)&data->format.name);
-
invalids += test_one_mode(data, output,
plane,
- modePlane->formats[modeindex]);
+ modePlane->formats[modeindex],
+ pipe);
}
drmModeFreePlane(modePlane);
}
igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
- igt_display_commit2(&data->display, data->commit);
+
+ if (lut != NULL) {
+ igt_pipe_replace_prop_blob(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT,
+ lut, sizeof(*lut) * lut_size);
+ free(lut);
+ lut = NULL;
+ }
+
igt_output_set_pipe(output, PIPE_NONE);
+ igt_display_commit2(&data->display, data->commit);
}
igt_assert(invalids == 0);
}
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats
@ 2019-03-15 15:42 Juha-Pekka Heikkila
0 siblings, 0 replies; 9+ messages in thread
From: Juha-Pekka Heikkila @ 2019-03-15 15:42 UTC (permalink / raw)
To: igt-dev
This test is causing too much useless noise. Limit tested
fb formats to DRM_FORMAT_C8 and DRM_FORMAT_XBGR2101010 for now.
These two formats are currently not tested otherwise thus
they're left here for now. DRM_FORMAT_XBGR2101010 need to be
included into IGT supported formats and DRM_FORMAT_C8 test need
to be moved elsewhere, maybe into kms_plane.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/kms_available_modes_crc.c | 289 ++++++++++++++++------------------------
1 file changed, 116 insertions(+), 173 deletions(-)
diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index 7ff385f..50b5522 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -57,15 +57,15 @@ typedef struct {
} data_t;
-static int do_write(int fd, int handle, void *buf, int size)
-{
- struct drm_i915_gem_pwrite write;
- memset(&write, 0x00, sizeof(write));
- write.handle = handle;
- write.data_ptr = (uintptr_t)buf;
- write.size = size;
- write.offset = 0;
- return igt_ioctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &write);
+static void do_write(int fd, int handle, void *buf, int size)
+{ void *screenbuf;
+
+ gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+ screenbuf = gem_mmap__gtt(fd, handle, size, PROT_WRITE);
+ memcpy(screenbuf, buf, size);
+ gem_munmap(screenbuf, size);
+ gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ gem_sync(fd, handle);
}
@@ -96,74 +96,39 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
0.0, 0.0, 0.0);
igt_paint_color(cr, 0, 0, w, h, 1.0, 1.0, 1.0);
igt_assert(cairo_status(cr) == 0);
+ igt_put_cairo_ctx(data->gfx_fd, &data->primary_fb, cr);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
igt_plane_set_fb(primary, &data->primary_fb);
igt_display_commit2(&data->display, data->commit);
+ igt_pipe_crc_drain(data->pipe_crc);
igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, &data->cursor_crc);
igt_plane_set_fb(primary, NULL);
igt_display_commit2(&data->display, data->commit);
- intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9 ?
- igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0) :
- igt_paint_color_alpha(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0, 1.0);
+ cr = igt_get_cairo_ctx(data->gfx_fd, &data->primary_fb);
+ igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay, 1.0, 1.0, 1.0);
+ igt_put_cairo_ctx(data->gfx_fd, &data->primary_fb, cr);
igt_plane_set_fb(primary, &data->primary_fb);
igt_display_commit2(&data->display, data->commit);
+ igt_pipe_crc_drain(data->pipe_crc);
igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, &data->fullscreen_crc);
- cairo_destroy(cr);
igt_remove_fb(data->gfx_fd, &data->primary_fb);
}
static const struct {
uint32_t fourcc;
char zeropadding;
- enum { BYTES_PP_1=1,
- BYTES_PP_2=2,
- BYTES_PP_4=4,
- NV12,
- P010,
- SKIP4 } bpp;
+ enum { BYTES_PP_1 = 1,
+ BYTES_PP_4 = 4} bpp;
uint32_t value;
} fillers[] = {
{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
- { DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
- { DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
- { DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
-
- /*
- * following two are skipped because blending seems to work
- * incorrectly with exception of AR24 on cursor plane.
- * Test still creates the planes, just filling plane
- * and getting crc is skipped.
- */
- { DRM_FORMAT_ARGB8888, 0, SKIP4, 0xffffffff},
- { DRM_FORMAT_ABGR8888, 0, SKIP4, 0x00ffffff},
-
- { DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
-
- { DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
- { DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
- { DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
- { DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
-
- /*
- * (semi-)planar formats
- */
- { DRM_FORMAT_NV12, 0, NV12, 0x80eb},
-#ifdef DRM_FORMAT_P010
- { DRM_FORMAT_P010, 0, P010, 0x8000eb00},
-#endif
-#ifdef DRM_FORMAT_P012
- { DRM_FORMAT_P012, 0, P010, 0x8000eb00},
-#endif
-#ifdef DRM_FORMAT_P016
- { DRM_FORMAT_P016, 0, P010, 0x8000eb00},
-#endif
{ 0, 0, 0, 0 }
};
@@ -175,11 +140,10 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
uint32_t format)
{
signed i, c, writesize;
- unsigned short* ptemp_16_buf;
unsigned int* ptemp_32_buf;
- for( i = 0; fillers[i].fourcc != 0; i++ ) {
- if( fillers[i].fourcc == format )
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
+ if (fillers[i].fourcc == format)
break;
}
@@ -190,57 +154,12 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
ptemp_32_buf[c] = fillers[i].value;
writesize = data->size;
break;
- case BYTES_PP_2:
- ptemp_16_buf = (unsigned short*)data->buf;
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)fillers[i].value;
- writesize = data->size;
- break;
case BYTES_PP_1:
memset((void *)data->buf, fillers[i].value, data->size);
writesize = data->size;
break;
- case NV12:
- memset((void *)data->buf, fillers[i].value&0xff,
- data->fb.offsets[1]);
-
- memset((void *)(data->buf+data->fb.offsets[1]),
- (fillers[i].value>>8)&0xff,
- data->size - data->fb.offsets[1]);
-
- writesize = data->size;
- break;
- case P010:
- ptemp_16_buf = (unsigned short*)data->buf;
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)fillers[i].value&0xffff;
-
- ptemp_16_buf = (unsigned short*)(data->buf+data->size);
- for (c = 0; c < data->size/2; c++)
- ptemp_16_buf[c] = (unsigned short)(fillers[i].value>>16)&0xffff;
-
- writesize = data->size+data->size/2;
- break;
- case SKIP4:
- if (fillers[i].fourcc == DRM_FORMAT_ARGB8888 &&
- plane->type == DRM_PLANE_TYPE_CURSOR) {
- /*
- * special for cursor plane where blending works correctly.
- */
- ptemp_32_buf = (unsigned int*)data->buf;
- for (c = 0; c < data->size/4; c++)
- ptemp_32_buf[c] = fillers[i].value;
- writesize = data->size;
- break;
- }
- igt_info("Format %s CRC comparison skipped by design.\n",
- (char*)&fillers[i].fourcc);
-
- return false;
default:
- igt_info("Unsupported mode for test %s\n",
- (char*)&fillers[i].fourcc);
- return false;
+ igt_assert_f(0, "unknown bpp");
}
do_write(data->gfx_fd, data->gem_handle, (void*)data->buf, writesize);
@@ -271,26 +190,20 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
tiling = LOCAL_DRM_FORMAT_MOD_NONE;
}
- for (i = 0; fillers[i].fourcc != 0; i++) {
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
if (fillers[i].fourcc == format)
break;
}
switch (fillers[i].bpp) {
- case NV12:
case BYTES_PP_1:
bpp = 8;
break;
-
- case P010:
- case BYTES_PP_2:
- bpp = 16;
- break;
-
- case SKIP4:
case BYTES_PP_4:
bpp = 32;
break;
+ default:
+ igt_assert_f(0, "unknown bpp");
}
igt_get_fb_tile_size(data->gfx_fd, tiling, bpp,
@@ -298,23 +211,18 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
data->fb.offsets[0] = 0;
data->fb.strides[0] = ALIGN(w * bpp / 8, tile_width);
gemsize = data->size = data->fb.strides[0] * ALIGN(h, tile_height);
-
- if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
- data->fb.offsets[1] = data->size;
- data->fb.strides[1] = data->fb.strides[0];
- gemsize = data->size * 2;
-
- if (fillers[i].bpp == NV12)
- data->size += data->fb.strides[1] * ALIGN(h/2, tile_height);
-
- num_planes = 2;
- }
+ data->buf = (unsigned char *)calloc(data->size*2, 1);
data->gem_handle = gem_create(data->gfx_fd, gemsize);
ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
igt_fb_mod_to_tiling(tiling),
data->fb.strides[0]);
+ data->fb.gem_handle = data->gem_handle;
+ data->fb.width = w;
+ data->fb.height = h;
+ fill_in_fb(data, output, plane, format);
+
igt_assert_eq(ret, 0);
ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
@@ -329,9 +237,6 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
return false;
}
- data->fb.width = w;
- data->fb.height = h;
- data->fb.gem_handle = data->gem_handle;
return true;
}
@@ -378,63 +283,66 @@ static bool prepare_crtc(data_t *data, igt_output_t *output,
if (!setup_fb(data, output, plane, format))
return false;
- free((void*)data->buf);
- data->buf = (unsigned char*)calloc(data->size*2, 1);
return true;
}
static int
test_one_mode(data_t* data, igt_output_t *output, igt_plane_t* plane,
- int mode)
+ int mode, enum pipe pipe)
{
igt_crc_t current_crc;
signed rVal = 0;
- bool do_crc;
- char* crccompare[2];
+ int i;
- if (prepare_crtc(data, output, plane, mode)){
- /*
- * we have fb from prepare_crtc(..) so now fill it in
- * correctly in fill_in_fb(..)
- */
- do_crc = fill_in_fb(data, output, plane, mode);
+ /*
+ * Limit tests only to those fb formats listed in fillers table
+ */
+ for (i = 0; i < ARRAY_SIZE(fillers)-1; i++) {
+ if (fillers[i].fourcc == mode)
+ break;
+ }
+
+ if (fillers[i].bpp == 0)
+ return false;
+ if (prepare_crtc(data, output, plane, mode)) {
igt_plane_set_fb(plane, &data->fb);
igt_fb_set_size(&data->fb, plane, data->fb.width, data->fb.height);
igt_plane_set_size(plane, data->fb.width, data->fb.height);
igt_fb_set_position(&data->fb, plane, 0, 0);
igt_display_commit2(&data->display, data->commit);
- if (do_crc) {
- igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, ¤t_crc);
-
- if (plane->type != DRM_PLANE_TYPE_CURSOR) {
- if (!igt_check_crc_equal(¤t_crc,
- &data->fullscreen_crc)) {
- crccompare[0] = igt_crc_to_string(¤t_crc);
- crccompare[1] = igt_crc_to_string(&data->fullscreen_crc);
- igt_warn("crc mismatch. target %.8s, result %.8s.\n", crccompare[0], crccompare[1]);
- free(crccompare[0]);
- free(crccompare[1]);
- rVal++;
- }
- } else {
- if (!igt_check_crc_equal(¤t_crc,
- &data->cursor_crc)) {
- crccompare[0] = igt_crc_to_string(¤t_crc);
- crccompare[1] = igt_crc_to_string(&data->cursor_crc);
- igt_warn("crc mismatch. target %.8s, result %.8s.\n", crccompare[0], crccompare[1]);
- free(crccompare[0]);
- free(crccompare[1]);
- rVal++;
- }
+ igt_wait_for_vblank(data->gfx_fd, pipe);
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, ¤t_crc);
+
+ if (plane->type != DRM_PLANE_TYPE_CURSOR) {
+ if (!igt_check_crc_equal(¤t_crc,
+ &data->fullscreen_crc)) {
+ igt_warn("crc mismatch. connector %s using pipe %s" \
+ " plane index %d mode %.4s\n",
+ igt_output_name(output),
+ kmstest_pipe_name(pipe),
+ plane->index,
+ (char *)&mode);
+ rVal++;
+ }
+ } else {
+ if (!igt_check_crc_equal(¤t_crc,
+ &data->cursor_crc)) {
+ igt_warn("crc mismatch. connector %s using pipe %s" \
+ " plane index %d mode %.4s\n",
+ igt_output_name(output),
+ kmstest_pipe_name(pipe),
+ plane->index,
+ (char *)&mode);
+ rVal++;
}
}
- remove_fb(data, output, plane);
- return rVal;
}
- return 1;
+ remove_fb(data, output, plane);
+ return rVal;
}
@@ -445,14 +353,44 @@ test_available_modes(data_t* data)
igt_plane_t *plane;
int modeindex;
enum pipe pipe;
- int invalids = 0;
+ int invalids = 0, i, lut_size;
drmModePlane *modePlane;
- char planetype[3][8] = {"OVERLAY\0", "PRIMARY\0", "CURSOR\0" };
+
+ struct {
+ uint16_t red;
+ uint16_t green;
+ uint16_t blue;
+ uint16_t reserved;
+ } *lut = NULL;
for_each_pipe_with_valid_output(&data->display, pipe, output) {
igt_output_set_pipe(output, pipe);
igt_display_commit2(&data->display, data->commit);
+ if (igt_pipe_obj_has_prop(&data->display.pipes[pipe], IGT_CRTC_GAMMA_LUT_SIZE)) {
+ lut_size = igt_pipe_get_prop(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT_SIZE);
+
+ lut = calloc(sizeof(*lut), lut_size);
+
+ for (i = 0; i < lut_size; i++) {
+ lut[i].red = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ lut[i].green = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ lut[i].blue = (i * 0xffff / (lut_size - 1)) & 0xfc00;
+ }
+
+ igt_pipe_replace_prop_blob(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT,
+ lut, sizeof(*lut) * lut_size);
+ igt_display_commit2(&data->display, data->commit);
+
+ for (i = 0; i < lut_size; i++) {
+ lut[i].red = i * 0xffff / (lut_size - 1);
+ lut[i].green = i * 0xffff / (lut_size - 1);
+ lut[i].blue = i * 0xffff / (lut_size - 1);
+ }
+ }
+
data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
@@ -467,29 +405,34 @@ test_available_modes(data_t* data)
modePlane = drmModeGetPlane(data->gfx_fd,
plane->drm_plane->plane_id);
+ if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ continue;
+
for (modeindex = 0;
modeindex < modePlane->count_formats;
modeindex++) {
data->format.dword = modePlane->formats[modeindex];
- igt_info("Testing connector %s using pipe %s" \
- " plane index %d type %s mode %s\n",
- igt_output_name(output),
- kmstest_pipe_name(pipe),
- plane->index,
- planetype[plane->type],
- (char*)&data->format.name);
-
invalids += test_one_mode(data, output,
plane,
- modePlane->formats[modeindex]);
+ modePlane->formats[modeindex],
+ pipe);
}
drmModeFreePlane(modePlane);
}
igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
- igt_display_commit2(&data->display, data->commit);
+
+ if (lut != NULL) {
+ igt_pipe_replace_prop_blob(&data->display, pipe,
+ IGT_CRTC_GAMMA_LUT,
+ lut, sizeof(*lut) * lut_size);
+ free(lut);
+ lut = NULL;
+ }
+
igt_output_set_pipe(output, PIPE_NONE);
+ igt_display_commit2(&data->display, data->commit);
}
igt_assert(invalids == 0);
}
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-03-21 19:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 10:57 [igt-dev] [PATCH i-g-t 1/2] tests/kms_available_modes_crc limit tested fb formats Juha-Pekka Heikkila
2019-03-19 10:57 ` [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: reset plane alpha and blend in igt_plane_reset() Juha-Pekka Heikkila
2019-03-19 11:22 ` Ville Syrjälä
2019-03-19 11:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_available_modes_crc limit tested fb formats Patchwork
2019-03-19 18:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-21 14:18 ` [igt-dev] [PATCH i-g-t 1/2] " Maarten Lankhorst
2019-03-21 19:04 ` Juha-Pekka Heikkilä
-- strict thread matches above, loose matches on Subject: below --
2019-03-18 11:15 Juha-Pekka Heikkila
2019-03-15 15:42 Juha-Pekka Heikkila
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.