All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: igt-dev@lists.freedesktop.org
Cc: Rob Clark <robdclark@chromium.org>
Subject: [PATCH 2/2] tests/kms_plane_scaling: msm get_num_scalars() support
Date: Wed, 14 Aug 2024 11:53:39 -0700	[thread overview]
Message-ID: <20240814185339.70097-2-robdclark@gmail.com> (raw)
In-Reply-To: <20240814185339.70097-1-robdclark@gmail.com>

From: Rob Clark <robdclark@chromium.org>

This may undercount # of scalars on hw with rgb pipes, but the scaling
on yuv and rgb pipes is functionally equivalent, so for test coverage
this is a good enough approximation.

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 lib/igt_kms.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 99cdeeb76033..dd530dbabf89 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6682,6 +6682,25 @@ int get_num_scalers(igt_display_t *display, enum pipe pipe)
 			igt_assert(start_loc2 = strstr(start_loc1, "num_scalers="));
 			igt_assert_eq(sscanf(start_loc2, "num_scalers=%d", &num_scalers), 1);
 		}
+	} else if (is_msm_device(drm_fd)) {
+		igt_plane_t *plane;
+
+		/*
+		 * msm devices have dma pipes (no csc, no scaling), rgb
+		 * pipes (no csc, has scaling), and vid pipes (has csc,
+		 * has scaling), but not all devices have rgb pipes.
+		 * We can use the # of pipes that support YUV formats
+		 * as a rough approximation of the # of scalars.. it may
+		 * undercount on some hw, but it will not overcount
+		 */
+		for_each_plane_on_pipe(display, pipe, plane) {
+			for (unsigned i = 0; i < plane->format_mod_count; i++) {
+				if (igt_format_is_yuv(plane->formats[i])) {
+					num_scalers++;
+					break;
+				}
+			}
+		}
 	}
 
 	return num_scalers;
-- 
2.46.0


  reply	other threads:[~2024-08-14 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 18:53 [PATCH 1/2] tests/kms_plane_scaling: Pass display to get_num_scalers() Rob Clark
2024-08-14 18:53 ` Rob Clark [this message]
2024-08-19 18:24   ` [PATCH 2/2] tests/kms_plane_scaling: msm get_num_scalars() support Kamil Konieczny
2024-08-14 20:20 ` ✓ Fi.CI.BAT: success for series starting with [1/2] tests/kms_plane_scaling: Pass display to get_num_scalers() Patchwork
2024-08-14 20:23 ` ✓ CI.xeBAT: " Patchwork
2024-08-15  5:30 ` ✗ CI.xeFULL: failure " Patchwork
2024-08-16  5:04 ` ✓ Fi.CI.IGT: success " Patchwork
2024-08-19 18:20 ` [PATCH 1/2] " Kamil Konieczny

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=20240814185339.70097-2-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=robdclark@chromium.org \
    /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 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.