Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: "Sasha McIntosh" <sashamcintosh@google.com>,
	"Liviu Dudau" <Liviu.Dudau@arm.com>,
	"Victoria Brekenfeld" <victoria@system76.com>,
	"Michel Dänzer" <mdaenzer@redhat.com>,
	"Sebastian Wick" <sebastian.wick@redhat.com>,
	"Shashank Sharma" <shashank.sharma@amd.com>,
	"Christopher Braga" <quic_cbraga@quicinc.com>,
	"Jonas Ådahl" <jadahl@redhat.com>,
	"Naseer Ahmed" <quic_naseer@quicinc.com>,
	"Aleix Pol" <aleixpol@kde.org>,
	"Alexander Goins" <agoins@nvidia.com>,
	"Pekka Paalanen" <pekka.paalanen@collabora.com>,
	"Simon Ser" <contact@emersion.fr>,
	"Hector Martin" <marcan@marcan.st>,
	"Xaver Hugl" <xaver.hugl@gmail.com>, Sima <daniel@ffwll.ch>,
	"Joshua Ashton" <joshua@froggi.es>
Subject: [igt-dev] [RFC PATCH v2 5/8] tests/kms_properties: Add colorop properties test
Date: Thu, 19 Oct 2023 17:22:58 -0400	[thread overview]
Message-ID: <20231019212301.245282-6-harry.wentland@amd.com> (raw)
In-Reply-To: <20231019212301.245282-1-harry.wentland@amd.com>

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Melissa Wen <mwen@igalia.com>
Cc: Jonas Ådahl <jadahl@redhat.com>
Cc: Sebastian Wick <sebastian.wick@redhat.com>
Cc: Shashank Sharma <shashank.sharma@amd.com>
Cc: Alexander Goins <agoins@nvidia.com>
Cc: Joshua Ashton <joshua@froggi.es>
Cc: Michel Dänzer <mdaenzer@redhat.com>
Cc: Aleix Pol <aleixpol@kde.org>
Cc: Xaver Hugl <xaver.hugl@gmail.com>
Cc: Victoria Brekenfeld <victoria@system76.com>
Cc: Sima <daniel@ffwll.ch>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Naseer Ahmed <quic_naseer@quicinc.com>
Cc: Christopher Braga <quic_cbraga@quicinc.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Arthur Grillo <arthurgrillo@riseup.net>
Cc: Hector Martin <marcan@marcan.st>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Sasha McIntosh <sashamcintosh@google.com>
---
 tests/kms_properties.c | 67 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/tests/kms_properties.c b/tests/kms_properties.c
index 3284366228c0..45744c64a54f 100644
--- a/tests/kms_properties.c
+++ b/tests/kms_properties.c
@@ -46,6 +46,7 @@
  * @crtc:            CRTC
  * @plane:           Plane
  * @invalid:         Invalid (connector/crtc/plane)
+ * @colorop:         Colorop
  *
  * arg[2]:
  *
@@ -208,6 +209,39 @@ static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic)
 	}
 }
 
+static void run_colorop_property_tests(igt_display_t *display, enum pipe pipe, igt_output_t *output)
+{
+	struct igt_fb fb;
+	igt_plane_t *plane;
+	int i;
+
+	prepare_pipe(display, pipe, output, &fb);
+
+	for_each_plane_on_pipe(display, pipe, plane) {
+		igt_info("Testing colorop properties on plane %s.#%d-%s (output: %s)\n",
+			 kmstest_pipe_name(pipe), plane->index, kmstest_plane_type_name(plane->type), output->name);
+
+		for (i = 0; i < display->n_colorops; i++) {
+			igt_colorop_t *global_colorop = &display->colorops[i];
+			drmModeColorop *drm_colorop = global_colorop->drm_colorop;
+
+			igt_info("Testing colorop properties on %s.#%d.#%d-%s (output: %s)\n",
+				kmstest_pipe_name(pipe), plane->index, drm_colorop->colorop_id, kmstest_plane_type_name(plane->type), output->name);
+
+			if (drm_colorop->plane_id != plane->drm_plane->plane_id) {
+				printf("bla: colorop %d is on plane %d, not on plane %d\n",
+					drm_colorop->colorop_id,
+					drm_colorop->plane_id,
+					plane->drm_plane->plane_id);
+				continue;
+			}
+			test_properties(display->drm_fd, DRM_MODE_OBJECT_COLOROP, drm_colorop->colorop_id, true);
+		}
+	}
+
+	cleanup_pipe(display, pipe, output, &fb);
+}
+
 static void run_plane_property_tests(igt_display_t *display, enum pipe pipe, igt_output_t *output, bool atomic)
 {
 	struct igt_fb fb;
@@ -253,6 +287,35 @@ static void run_connector_property_tests(igt_display_t *display, enum pipe pipe,
 		cleanup_pipe(display, pipe, output, &fb);
 }
 
+static void colorop_properties(igt_display_t *display)
+{
+	bool found_any = false, found;
+	igt_output_t *output;
+	enum pipe pipe;
+
+	/* colorops are only available with atomic */
+	igt_skip_on(!display->is_atomic);
+
+	for_each_pipe(display, pipe) {
+		found = false;
+
+		for_each_valid_output_on_pipe(display, pipe, output) {
+			igt_display_reset(display);
+
+			igt_output_set_pipe(output, pipe);
+			if (!i915_pipe_output_combo_valid(display))
+				continue;
+
+			found_any = found = true;
+
+			run_colorop_property_tests(display, pipe, output);
+			break;
+		}
+	}
+
+	igt_skip_on(!found_any);
+}
+
 static void plane_properties(igt_display_t *display, bool atomic)
 {
 	bool found_any = false, found;
@@ -800,6 +863,10 @@ igt_main
 	igt_subtest("plane-properties-atomic")
 		plane_properties(&display, true);
 
+	igt_describe("Tests colorop properties with atomic commit");
+	igt_subtest("colorop-properties-atomic")
+		colorop_properties(&display);
+
 	igt_describe("Tests crtc properties with legacy commit");
 	igt_subtest("crtc-properties-legacy")
 		crtc_properties(&display, false);
-- 
2.42.0

  parent reply	other threads:[~2023-10-19 21:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 21:22 [igt-dev] [RFC PATCH v2 0/8] IGT tests for the KMS Color Pipeline API Harry Wentland
2023-10-19 21:22 ` [igt-dev] [RFC PATCH v2 1/8] lib/drmtest: Add is_vkms_device() Harry Wentland
2023-10-19 21:22 ` [igt-dev] [RFC PATCH v2 2/8] include/drm-uapi: Add COLOROP object Harry Wentland
2023-10-19 21:22 ` [igt-dev] [RFC PATCH v2 3/8] lib/igt_kms: Introduce drm_colorop object Harry Wentland
2023-10-19 21:22 ` [igt-dev] [RFC PATCH v2 4/8] lib/igt_kms: Add new COLOR PIPELINE plane property Harry Wentland
2023-10-19 21:22 ` Harry Wentland [this message]
2023-10-19 21:22 ` [igt-dev] [RFC PATCH v2 6/8] igt/color: Add SW color transform functionality Harry Wentland
2023-10-19 21:23 ` [igt-dev] [RFC PATCH v2 7/8] lib/igt_fb: Add copy_fb function Harry Wentland
2023-10-19 21:23 ` [igt-dev] [RFC PATCH v2 8/8] tests/kms_colorop: Add kms_colorop tests Harry Wentland
2023-10-23 21:16 ` [igt-dev] ✗ Fi.CI.BUILD: failure for IGT tests for the KMS Color Pipeline API (rev2) Patchwork
2023-10-23 21:23 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231019212301.245282-6-harry.wentland@amd.com \
    --to=harry.wentland@amd.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=agoins@nvidia.com \
    --cc=aleixpol@kde.org \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jadahl@redhat.com \
    --cc=joshua@froggi.es \
    --cc=marcan@marcan.st \
    --cc=mdaenzer@redhat.com \
    --cc=pekka.paalanen@collabora.com \
    --cc=quic_cbraga@quicinc.com \
    --cc=quic_naseer@quicinc.com \
    --cc=sashamcintosh@google.com \
    --cc=sebastian.wick@redhat.com \
    --cc=shashank.sharma@amd.com \
    --cc=victoria@system76.com \
    --cc=xaver.hugl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox