Skip to contentSkip to conversation

lib/igt_fb: Add support for C8 pixel format

PATCH New Ville Syrjala 2 participants 4 messages May 10, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lib/igt_fb: Add support for C8 pixel format

From: Ville Syrjälä <[email protected]>

Expose C8 support by utilizing pixman's rgb332 support. By using rgb332 we don't have to worry too much about how to populate the LUT, though for now we still leave that responsibility to individual tests. If desired we could make igt_kms generate a suitable LUT when the test itself didn't bother. But meh for now.

---
 lib/igt_fb.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
lib/igt_fb.c +15 -0
index d4929019971c..19523a4def54 100644
@@ -98,6 +98,12 @@ static const struct format_desc_struct {
 	  .num_planes = 1, .plane_bpp = { 16, },
 	  .hsub = 1, .vsub = 1,
 	},
+	{ .name = "C8", .depth = -1, .drm_id = DRM_FORMAT_C8,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_r3g3b2,
+	  .num_planes = 1, .plane_bpp = { 8, },
+	  .hsub = 1, .vsub = 1,
+	},
 	{ .name = "XRGB1555", .depth = -1, .drm_id = DRM_FORMAT_XRGB1555,
 	  .cairo_id = CAIRO_FORMAT_INVALID,
 	  .pixman_id = PIXMAN_x1r5g5b5,
@@ -3248,6 +3254,15 @@ bool igt_fb_supported_format(uint32_t drm_format)
 {
 	const struct format_desc_struct *f;
 
+	/*
+	 * C8 needs a LUT which (at least for the time being)
+	 * is the responsibility of each test. Not all tests
+	 * have the required code so let's keep C8 hidden from
+	 * most eyes.
+	 */
+	if (drm_format == DRM_FORMAT_C8)
+		return false;
+
 	for_each_format(f)
 		if (f->drm_id == drm_format)
 			return (f->cairo_id != CAIRO_FORMAT_INVALID) ||
Signature · 6 lines
2.21.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 2/2 tests/kms_plane: Test C8 pixel format

From: Ville Syrjälä <[email protected]>

Now that igt_fb has rudimentary C8 support let's test it. We have to generate a custom palette for it of course.

---
 tests/kms_plane.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)
tests/kms_plane.c +43 -2
index 471bcbeb8f77..6f30a95efc7a 100644
@@ -389,6 +389,39 @@ static void set_legacy_lut(data_t *data, enum pipe pipe,
 	free(lut);
 }
 
+static bool set_c8_legacy_lut(data_t *data, enum pipe pipe,
+			      uint16_t mask)
+{
+	igt_pipe_t *pipe_obj = &data->display.pipes[pipe];
+	drmModeCrtc *crtc;
+	uint16_t *r, *g, *b;
+	int i, lut_size;
+
+	crtc = drmModeGetCrtc(data->drm_fd, pipe_obj->crtc_id);
+	lut_size = crtc->gamma_size;
+	drmModeFreeCrtc(crtc);
+
+	if (lut_size != 256)
+		return false;
+
+	r = malloc(sizeof(uint16_t) * 3 * lut_size);
+	g = r + lut_size;
+	b = g + lut_size;
+
+	/* igt_fb uses RGB332 for C8 */
+	for (i = 0; i < lut_size; i++) {
+		r[i] = (((i & 0xe0) >> 5) * 0xffff / 0x7) & mask;
+		g[i] = (((i & 0x1c) >> 2) * 0xffff / 0x7) & mask;
+		b[i] = (((i & 0x03) >> 0) * 0xffff / 0x3) & mask;
+	}
+
+	igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, pipe_obj->crtc_id,
+					  lut_size, r, g, b), 0);
+
+	free(r);
+
+	return true;
+}
 
 static void test_format_plane_color(data_t *data, enum pipe pipe,
 				    igt_plane_t *plane,
@@ -532,8 +565,13 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 		    modifier == ref_modifier)
 			continue;
 
-		if (!igt_fb_supported_format(format))
-			continue;
+		if (format == DRM_FORMAT_C8) {
+			if (!set_c8_legacy_lut(data, pipe, 0xfc00))
+				continue;
+		} else {
+			if (!igt_fb_supported_format(format))
+				continue;
+		}
 
 		igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
 			 IGT_FORMAT_ARGS(format), modifier,
@@ -552,6 +590,9 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 			}
 		}
 
+		if (format == DRM_FORMAT_C8)
+			set_legacy_lut(data, pipe, 0xfc00);
+
 		if (crc_mismatch_count)
 			igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
 				 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
Signature · 6 lines
2.21.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/igt_fb: Add support for C8 pixel format

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] lib/igt_fb: Add support for C8 pixel format
URL : https://patchwork.freedesktop.org/series/60521/
State : success

== Summary ==

CI Bug Log - changes from IGT_4981 -> IGTPW_2967
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/60521/revisions/1/mbox/

Known issues
------------

Here are the changes found in IGTPW_2967 that come from known issues:

### IGT changes ###

#### Warnings ####

* igt@i915_selftest@live_hangcheck:
- fi-apl-guc: [DMESG-FAIL][1] ([fdo#110620]) -> [INCOMPLETE][2] ([fdo#103927] / [fdo#110624])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/fi-apl-guc/igt@i915_selftest@live_hangcheck.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/fi-apl-guc/igt@i915_selftest@live_hangcheck.html

* igt@runner@aborted:
- fi-apl-guc: [FAIL][3] ([fdo#110622]) -> [FAIL][4] ([fdo#110624])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/fi-apl-guc/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/fi-apl-guc/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#110620]: https://bugs.freedesktop.org/show_bug.cgi?id=110620
[fdo#110622]: https://bugs.freedesktop.org/show_bug.cgi?id=110622
[fdo#110624]: https://bugs.freedesktop.org/show_bug.cgi?id=110624

Participating hosts (53 -> 45)
------------------------------

Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus

Build changes
-------------

* IGT: IGT_4981 -> IGTPW_2967

CI_DRM_6073: c059ddabfe60a5072ace44a34a9de9b4202df6ec @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2967: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/
IGT_4981: 709bd6869e2aff01a67eef729f9dc330f404387e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

[igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] lib/igt_fb: Add support for C8 pixel format

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] lib/igt_fb: Add support for C8 pixel format
URL : https://patchwork.freedesktop.org/series/60521/
State : failure

== Summary ==

CI Bug Log - changes from IGT_4981_full -> IGTPW_2967_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_2967_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_2967_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/60521/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_2967_full:

### IGT changes ###

#### Possible regressions ####

* igt@kms_plane@pixel-format-pipe-a-planes:
- shard-iclb: [PASS][1] -> [FAIL][2] +5 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb8/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb6/igt@[email protected]

* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-snb: [PASS][3] -> [FAIL][4] +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-snb4/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-snb2/igt@[email protected]

* igt@kms_plane@pixel-format-pipe-b-planes:
- shard-hsw: [PASS][5] -> [FAIL][6] +5 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-hsw5/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-hsw5/igt@[email protected]
- shard-kbl: [PASS][7] -> [FAIL][8] +5 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-kbl4/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-kbl1/igt@[email protected]

* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-apl: [PASS][9] -> [FAIL][10] +5 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-apl4/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-apl4/igt@[email protected]

* igt@kms_plane@pixel-format-pipe-c-planes-source-clamping:
- shard-glk: [PASS][11] -> [FAIL][12] +5 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-glk7/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-glk5/igt@[email protected]

Known issues
------------

Here are the changes found in IGTPW_2967_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_tiled_swapping@non-threaded:
- shard-iclb: [PASS][13] -> [DMESG-WARN][14] ([fdo#108686])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb7/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb6/igt@[email protected]
- shard-hsw: [PASS][15] -> [FAIL][16] ([fdo#108686])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-hsw7/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-hsw8/igt@[email protected]

* igt@i915_suspend@sysfs-reader:
- shard-apl: [PASS][17] -> [DMESG-WARN][18] ([fdo#108566]) +3 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-apl2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-apl6/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-hsw: [PASS][19] -> [FAIL][20] ([fdo#105767])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-hsw5/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-hsw6/igt@[email protected]

* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [PASS][21] -> [SKIP][22] ([fdo#109349])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb2/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb1/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render:
- shard-iclb: [PASS][23] -> [FAIL][24] ([fdo#103167]) +6 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-render.html

* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: [PASS][25] -> [FAIL][26] ([fdo#103166])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb2/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb1/igt@[email protected]

* igt@kms_psr2_su@page_flip:
- shard-iclb: [PASS][27] -> [SKIP][28] ([fdo#109642])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb2/igt@kms_psr2_su@page_flip.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb1/igt@kms_psr2_su@page_flip.html

* igt@kms_vblank@pipe-b-ts-continuation-suspend:
- shard-kbl: [PASS][29] -> [DMESG-WARN][30] ([fdo#108566])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-kbl3/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-kbl3/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live_hangcheck:
- shard-iclb: [INCOMPLETE][31] ([fdo#107713] / [fdo#108569]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb4/igt@i915_selftest@live_hangcheck.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb8/igt@i915_selftest@live_hangcheck.html

* igt@kms_cursor_crc@cursor-256x85-sliding:
- shard-hsw: [INCOMPLETE][33] ([fdo#103540]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-hsw1/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-hsw7/igt@[email protected]

* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-glk: [FAIL][35] ([fdo#105363]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-glk8/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-glk5/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: [FAIL][37] ([fdo#102887] / [fdo#105363]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-glk3/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-glk8/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-glk: [INCOMPLETE][39] ([fdo#103359] / [k.org#198133]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-glk8/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-glk4/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite:
- shard-glk: [FAIL][41] ([fdo#103167]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-glk5/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-glk4/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-pwrite.html

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite:
- shard-iclb: [FAIL][43] ([fdo#103167]) -> [PASS][44] +6 similar issues
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-iclb4/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite.html

* igt@kms_setmode@basic:
- shard-kbl: [FAIL][45] ([fdo#99912]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-kbl6/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-kbl4/igt@[email protected]

* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-apl: [DMESG-WARN][47] ([fdo#108566]) -> [PASS][48] +1 similar issue
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-apl5/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-apl6/igt@[email protected]

* igt@perf@short-reads:
- shard-kbl: [FAIL][49] ([fdo#103183]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-kbl3/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-kbl6/igt@[email protected]

* igt@perf_pmu@rc6:
- shard-kbl: [SKIP][51] ([fdo#109271]) -> [PASS][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_4981/shard-kbl1/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/shard-kbl6/igt@[email protected]

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103183]: https://bugs.freedesktop.org/show_bug.cgi?id=103183
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

Participating hosts (7 -> 6)
------------------------------

Missing (1): shard-skl

Build changes
-------------

* IGT: IGT_4981 -> IGTPW_2967

CI_DRM_6073: c059ddabfe60a5072ace44a34a9de9b4202df6ec @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2967: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/
IGT_4981: 709bd6869e2aff01a67eef729f9dc330f404387e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2967/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev