Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 01/10] lib/igt_fb: add igt_format_get_subsampling() function
@ 2026-10-28 14:51 Juha-Pekka Heikkila
  2026-10-28 14:51 ` [PATCH i-g-t 02/10] tests/kms_plane_scaling: add search for scaling limit Juha-Pekka Heikkila
                   ` (15 more replies)
  0 siblings, 16 replies; 25+ messages in thread
From: Juha-Pekka Heikkila @ 2026-10-28 14:51 UTC (permalink / raw)
  To: igt-dev; +Cc: Juha-Pekka Heikkila, Luca Coelho

add function to query given pixel format hsub and vsub
parameters.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
---
 lib/igt_fb.c | 22 ++++++++++++++++++++++
 lib/igt_fb.h |  1 +
 2 files changed, 23 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 6c3b9b0b9..3d15f0595 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -5300,6 +5300,28 @@ int igt_format_plane_bpp(uint32_t drm_format, int plane)
 	return format->plane_bpp[plane];
 }
 
+/**
+ * igt_format_get_subsampling:
+ * @drm_format: drm fourcc
+ * @hsub: chroma subsampling factor in the horizontal direction (out)
+ * @vsub: chroma subsampling factor in the vertical direction (out)
+ *
+ * This function returns the chroma subsampling factors of the @drm_format.
+ * For non-subsampled (e.g. RGB or 4:4:4 YUV) formats both factors are 1.
+ */
+void igt_format_get_subsampling(uint32_t drm_format, int *hsub, int *vsub)
+{
+	const struct format_desc_struct *format =
+		lookup_drm_format(drm_format);
+
+	igt_assert(format);
+
+	if (hsub)
+		*hsub = format->hsub;
+	if (vsub)
+		*vsub = format->vsub;
+}
+
 /**
  * igt_format_array_fill:
  * @formats_array: a pointer to the formats array pointer to be allocated
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 213e2d777..4562164df 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -237,6 +237,7 @@ uint32_t igt_drm_format_str_to_format(const char *drm_format);
 
 bool igt_format_is_fp16(uint32_t drm_format);
 int igt_format_plane_bpp(uint32_t drm_format, int plane);
+void igt_format_get_subsampling(uint32_t drm_format, int *hsub, int *vsub);
 void igt_format_array_fill(uint32_t **formats_array, unsigned int *count,
 			   bool allow_yuv);
 int igt_fill_cts_color_ramp_framebuffer(uint32_t *pixmap, uint32_t video_width,
-- 
2.43.0


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

end of thread, other threads:[~2026-11-10 10:57 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-28 14:51 [PATCH i-g-t 01/10] lib/igt_fb: add igt_format_get_subsampling() function Juha-Pekka Heikkila
2026-10-28 14:51 ` [PATCH i-g-t 02/10] tests/kms_plane_scaling: add search for scaling limit Juha-Pekka Heikkila
2026-10-28 14:51 ` [PATCH i-g-t 03/10] tests/kms_plane_scaling: add plane-downscale-max-crc subtest Juha-Pekka Heikkila
2026-11-08 12:56   ` Luca Coelho
2026-10-28 14:51 ` [PATCH i-g-t 04/10] tests/kms_plane_scaling: change plane-downscale-max-crc to do variations Juha-Pekka Heikkila
2026-10-28 14:51 ` [PATCH i-g-t 05/10] tests/kms_plane_scaling: add plane-upscale-max-crc subtest Juha-Pekka Heikkila
2026-10-28 14:51 ` [PATCH i-g-t 06/10] tests/kms_plane_scaling: run plane-*-max-crc on all pipes Juha-Pekka Heikkila
2026-11-08 13:30   ` Luca Coelho
2026-10-28 14:51 ` [PATCH i-g-t 07/10] tests/kms_plane_scaling: add rotated plane-*-max-crc subtests Juha-Pekka Heikkila
2026-10-28 14:52 ` [PATCH i-g-t 08/10] tests/kms_plane_scaling: test overlay plane in plane-*-max-crc Juha-Pekka Heikkila
2026-11-08 13:38   ` Luca Coelho
2026-10-28 14:52 ` [PATCH i-g-t 09/10] tests/kms_plane_scaling: scale overlay opposite to primary in max-crc Juha-Pekka Heikkila
2026-11-08 13:39   ` Luca Coelho
2026-10-28 14:52 ` [PATCH i-g-t 10/10] tests/kms_plane_scaling: remove legacy subtests covered by max-crc tests Juha-Pekka Heikkila
2026-11-09  9:34   ` Luca Coelho
2026-11-09 18:07     ` Juha-Pekka Heikkilä
2026-11-10  8:02       ` Luca Coelho
2026-11-10 10:55         ` Juha-Pekka Heikkilä
2026-10-28 22:46 ` ✓ Xe.CI.BAT: success for series starting with [i-g-t,01/10] lib/igt_fb: add igt_format_get_subsampling() function Patchwork
2026-10-28 23:02 ` ✗ i915.CI.BAT: failure " Patchwork
2026-10-29 10:31 ` ✗ Xe.CI.FULL: " Patchwork
2026-10-29 16:42 ` ✓ Xe.CI.BAT: success for series starting with [i-g-t,01/10] lib/igt_fb: add igt_format_get_subsampling() function (rev2) Patchwork
2026-10-29 16:58 ` ✓ i915.CI.BAT: " Patchwork
2026-10-30  8:01 ` ✗ i915.CI.Full: failure " Patchwork
2026-10-30 10:43 ` ✗ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox