From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 3/4] tests/intel/kms_sharpness_filter: restructure igt_main
Date: Fri, 10 Apr 2026 11:01:20 +0530 [thread overview]
Message-ID: <16c209b3-7a17-4ab3-8e97-1946fb8b05b1@intel.com> (raw)
In-Reply-To: <20260331190412.1907571-4-juhapekka.heikkila@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 12053 bytes --]
Hi JP
On 01-04-2026 12:34 am, Juha-Pekka Heikkila wrote:
> collect tests into list and call them through there
>
> Signed-off-by: Juha-Pekka Heikkila<juhapekka.heikkila@gmail.com>
> ---
> tests/intel/kms_sharpness_filter.c | 312 +++++++++++++++++------------
> 1 file changed, 180 insertions(+), 132 deletions(-)
>
> diff --git a/tests/intel/kms_sharpness_filter.c b/tests/intel/kms_sharpness_filter.c
> index ed8d2e48c..f08d33d7a 100644
> --- a/tests/intel/kms_sharpness_filter.c
> +++ b/tests/intel/kms_sharpness_filter.c
> @@ -143,6 +143,131 @@ static const uint32_t scaling_modes[] = {
> DRM_MODE_SCALE_ASPECT,
> };
>
> +enum subtest_iter {
> + ITER_NONE,
> + ITER_STRENGTH,
> + ITER_MODIFIER,
> + ITER_ROTATION,
> + ITER_FORMAT,
> + ITER_SCALING_MODE,
> +};
> +
> +const struct subtest_entry {
Make this static
> + const char *name;
> + const char *describe;
> + enum test_type type;
> + int filter_strength;
> + uint32_t format;
> + enum subtest_iter iter;
> +} subtests[] = {
> + {
> + .name = "filter-basic",
> + .describe = "Verify basic content adaptive sharpness filter.",
> + .type = TEST_FILTER_BASIC,
> + .filter_strength = -1,
Can we have #define DEFAULT_FILTER_STRENGTH as -1 ?
Also, shall we make iter/format explicit for clarity?
.iter=ITER_NONE,
.format= DRM_FORMAT_XRGB8888,
> + },
> + {
> + .name = "filter-strength",
> + .describe = "Verify that varying strength (0-255) affects the degree of sharpeness applied.",
Typo s/sharpeness/sharpness
> + .type = TEST_FILTER_STRENGTH,
> + .filter_strength = -1,
> + .iter = ITER_STRENGTH,
> + },
> + {
> + .name = "filter-modifiers",
> + .describe = "Verify content adaptive sharpness filter with varying modifiers.",
> + .type = TEST_FILTER_MODIFIERS,
> + .filter_strength = -1,
> + .iter = ITER_MODIFIER,
> + },
> + {
> + .name = "filter-rotations",
> + .describe = "Verify content adaptive sharpness filter with varying rotations.",
> + .type = TEST_FILTER_ROTATION,
> + .filter_strength = -1,
> + .iter = ITER_ROTATION,
> + },
> + {
> + .name = "filter-formats",
> + .describe = "Verify content adaptive sharpness filter with varying formats.",
> + .type = TEST_FILTER_FORMATS,
> + .filter_strength = -1,
> + .iter = ITER_FORMAT,
> + },
> + {
> + .name = "filter-toggle",
> + .describe = "Verify toggling between enabling and disabling content adaptive sharpness filter.",
> + .type = TEST_FILTER_TOGGLE,
> + .filter_strength = MAX_FILTER_STRENGTH,
> + },
> + {
> + .name = "filter-tap",
> + .describe = "Verify content adaptive sharpness filter with resolution change; "
> + "resolution change will lead to selection of distinct taps.",
> + .type = TEST_FILTER_TAP,
> + .filter_strength = -1,
> + },
> + {
> + .name = "filter-dpms",
> + .describe = "Verify content adaptive sharpness filter with DPMS.",
> + .type = TEST_FILTER_DPMS,
> + .filter_strength = -1,
> + },
> + {
> + .name = "filter-suspend",
> + .describe = "Verify content adaptive sharpness filter with suspend.",
> + .type = TEST_FILTER_SUSPEND,
> + .filter_strength = -1,
> + },
> + {
> + .name = "filter-scaler-upscale",
> + .describe = "Verify content adaptive sharpness filter with 1 plane scaler enabled during upscaling.",
> + .type = TEST_FILTER_UPSCALE,
> + .filter_strength = -1,
> + },
> + {
> + .name = "filter-scaler-downscale",
> + .describe = "Verify content adaptive sharpness filter with 1 plane scaler enabled during downscaling.",
> + .type = TEST_FILTER_DOWNSCALE,
> + .filter_strength = -1,
> + },
> + {
> + .name = "invalid-filter-with-scaler",
> + .describe = "Negative check for content adaptive sharpness filter "
> + "when 2 plane scalers have already been enabled and "
> + "attempt is made to enable sharpness filter.",
> + .type = TEST_INVALID_FILTER_WITH_SCALER,
> + .filter_strength = -1,
> + },
> + {
> + .name = "invalid-filter-with-plane",
> + .describe = "Negative check for content adaptive sharpness filter "
> + "when 2 NV12 planes have already been enabled and "
> + "attempt is made to enable the sharpness filter.",
> + .type = TEST_INVALID_FILTER_WITH_PLANE,
> + .filter_strength = -1,
> + .format = DRM_FORMAT_NV12,
> + },
> + {
> + .name = "invalid-plane-with-filter",
> + .describe = "Negative check for content adaptive sharpness filter "
> + "when 1 NV12 plane and sharpness filter have already been enabled "
> + "and attempt is made to enable the second NV12 plane.",
> + .type = TEST_INVALID_PLANE_WITH_FILTER,
> + .filter_strength = -1,
> + .format = DRM_FORMAT_NV12,
> + },
> + {
> + .name = "invalid-filter-with-scaling-mode",
> + .describe = "Negative check for content adaptive sharpness filter "
> + "when scaling mode is already enabled and attempt is made "
> + "to enable sharpness filter.",
> + .type = TEST_INVALID_FILTER_WITH_SCALING_MODE,
> + .filter_strength = -1,
> + .iter = ITER_SCALING_MODE,
> + },
> +};
> +
> typedef struct {
> int drm_fd;
> bool limited;
> @@ -588,6 +713,48 @@ static void set_data_defaults(data_t *data)
> data->filter_strength = MID_FILTER_STRENGTH;
> }
>
> +static int iter_count(enum subtest_iter iter)
> +{
> + switch (iter) {
> + case ITER_STRENGTH:
> + return ARRAY_SIZE(filter_strength_list);
> + case ITER_MODIFIER:
> + return ARRAY_SIZE(modifiers);
> + case ITER_ROTATION:
> + return ARRAY_SIZE(rotations);
> + case ITER_FORMAT:
> + return ARRAY_SIZE(formats);
> + case ITER_SCALING_MODE:
> + return ARRAY_SIZE(scaling_modes);
> + default:
> + return 1;
> + }
> +}
> +
> +static void apply_iter_param(data_t *data, const struct subtest_entry *st, int idx)
> +{
> + switch (st->iter) {
> + case ITER_STRENGTH:
> + data->filter_strength = filter_strength_list[idx];
> + break;
> + case ITER_MODIFIER:
> + data->modifier = modifiers[idx].modifier;
> + data->modifier_name = modifiers[idx].name;
> + break;
> + case ITER_ROTATION:
> + data->rotation = rotations[idx];
> + break;
> + case ITER_FORMAT:
> + data->format = formats[idx];
> + break;
> + case ITER_SCALING_MODE:
> + data->scaling_mode = scaling_modes[idx];
> + break;
> + default:
> + break;
> + }
> +}
> +
> static int opt_handler(int opt, int opt_index, void *_data)
> {
> data_t *data = _data;
> @@ -620,142 +787,23 @@ int igt_main_args("l", NULL, help_str, opt_handler, &data)
> igt_display_require_output(&data.display);
> }
>
> - igt_describe("Verify basic content adaptive sharpness filter.");
> - igt_subtest_with_dynamic("filter-basic") {
> - set_data_defaults(&data);
> - run_sharpness_filter_test(&data, TEST_FILTER_BASIC);
> - }
> -
> - igt_describe("Verify that varying strength(0-255), affects "
> - "the degree of sharpeness applied.");
> - igt_subtest_with_dynamic("filter-strength") {
> - set_data_defaults(&data);
> -
> - for (int i = 0; i < ARRAY_SIZE(filter_strength_list); i++) {
> - data.filter_strength = filter_strength_list[i];
> -
> - run_sharpness_filter_test(&data, TEST_FILTER_STRENGTH);
> - }
> - }
> -
> - igt_describe("Verify content adaptive sharpness filter with "
> - "varying modifiers.");
> - igt_subtest_with_dynamic("filter-modifiers") {
> - set_data_defaults(&data);
> -
> - for (int i = 0; i < ARRAY_SIZE(modifiers); i++) {
> - data.modifier = modifiers[i].modifier;
> - data.modifier_name = modifiers[i].name;
> -
> - run_sharpness_filter_test(&data, TEST_FILTER_MODIFIERS);
> - }
> - }
> -
> - igt_describe("Verify content adaptive sharpness filter with "
> - "varying rotations.");
> - igt_subtest_with_dynamic("filter-rotations") {
> - set_data_defaults(&data);
> -
> - for (int i = 0; i < ARRAY_SIZE(rotations); i++) {
> - data.rotation = rotations[i];
> -
> - run_sharpness_filter_test(&data, TEST_FILTER_ROTATION);
> - }
> - }
> -
> - igt_describe("Verify content adaptive sharpness filter with "
> - "varying formats.");
> - igt_subtest_with_dynamic("filter-formats") {
> - set_data_defaults(&data);
> -
> - for (int i = 0; i < ARRAY_SIZE(formats); i++) {
> - data.format = formats[i];
> -
> - run_sharpness_filter_test(&data, TEST_FILTER_FORMATS);
> - }
> - }
> -
> - igt_describe("Verify toggling between enabling and disabling "
> - "content adaptive sharpness filter.");
> - igt_subtest_with_dynamic("filter-toggle") {
> - set_data_defaults(&data);
> - data.filter_strength = MAX_FILTER_STRENGTH;
> - run_sharpness_filter_test(&data, TEST_FILTER_TOGGLE);
> - }
> -
> - igt_describe("Verify that following a resolution change, "
> - "distict taps are selected.");
> - igt_subtest_with_dynamic("filter-tap") {
> - set_data_defaults(&data);
> - run_sharpness_filter_test(&data, TEST_FILTER_TAP);
> - }
> -
> - igt_describe("Verify content adaptive sharpness filter "
> - "with DPMS.");
> - igt_subtest_with_dynamic("filter-dpms") {
> - set_data_defaults(&data);
> - run_sharpness_filter_test(&data, TEST_FILTER_DPMS);
> - }
> -
> - igt_describe("Verify content adaptive sharpness filter "
> - "with suspend.");
> - igt_subtest_with_dynamic("filter-suspend") {
> - set_data_defaults(&data);
> - run_sharpness_filter_test(&data, TEST_FILTER_SUSPEND);
> - }
> -
> - igt_describe("Verify content adaptive sharpness filter "
> - "with 1 plane scaler enabled.");
> - igt_subtest_with_dynamic("filter-scaler-upscale") {
> - set_data_defaults(&data);
> - run_sharpness_filter_test(&data, TEST_FILTER_UPSCALE);
> - }
> -
> - igt_describe("Verify content adaptive sharpness filter "
> - "with 1 plane scaler enabled.");
> - igt_subtest_with_dynamic("filter-scaler-downscale") {
> - set_data_defaults(&data);
> - run_sharpness_filter_test(&data, TEST_FILTER_DOWNSCALE);
> - }
> -
> - igt_describe("Negative check for content adaptive sharpness filter "
> - "when 2 plane scalers have already been enabled and "
> - "attempt is made to enable sharpness filter.");
> - igt_subtest_with_dynamic("invalid-filter-with-scaler") {
> - set_data_defaults(&data);
> - run_sharpness_filter_test(&data, TEST_INVALID_FILTER_WITH_SCALER);
> - }
> -
> - igt_describe("Negative check for content adaptive sharpness filter "
> - "when 2 NV12 planes have already been enabled and attempt is "
> - "made to enable the sharpness filter.");
> - igt_subtest_with_dynamic("invalid-filter-with-plane") {
> - set_data_defaults(&data);
> - data.format = DRM_FORMAT_NV12;
> -
> - run_sharpness_filter_test(&data, TEST_INVALID_FILTER_WITH_PLANE);
> - }
> -
> - igt_describe("Negative check for content adaptive sharpness filter "
> - "when 1 NV12 plane and sharpness filter have already been enabled "
> - "and attempt is made to enable the second NV12 plane.");
> - igt_subtest_with_dynamic("invalid-plane-with-filter") {
> - set_data_defaults(&data);
> - data.format = DRM_FORMAT_NV12;
> + for (int s = 0; s < ARRAY_SIZE(subtests); s++) {
> + const struct subtest_entry *p = &subtests[s];
>
> - run_sharpness_filter_test(&data, TEST_INVALID_PLANE_WITH_FILTER);
> - }
> + igt_describe(p->describe);
> + igt_subtest_with_dynamic(p->name) {
> + set_data_defaults(&data);
>
> - igt_describe("Negative check for content adaptive sharpness filter "
> - "when scaling mode is already enabled and attempt is made "
> - "to enable sharpness filter.");
> - igt_subtest_with_dynamic("invalid-filter-with-scaling-mode") {
> - set_data_defaults(&data);
> + if (p->filter_strength != -1)
> + data.filter_strength = p->filter_strength;
>
> - for (int k = 0; k < ARRAY_SIZE(scaling_modes); k++) {
> - data.scaling_mode = scaling_modes[k];
> + if (p->format != 0)
> + data.format = p->format;
>
> - run_sharpness_filter_test(&data, TEST_INVALID_FILTER_WITH_SCALING_MODE);
> + for (int i = 0; i < iter_count(p->iter); i++) {
> + apply_iter_param(&data, p, i);
> + run_sharpness_filter_test(&data, p->type);
> + }
> }
> }
>
[-- Attachment #2: Type: text/html, Size: 13734 bytes --]
next prev parent reply other threads:[~2026-04-10 5:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 19:04 [PATCH i-g-t 0/4] Refactor kms_sharpness_filter tests Juha-Pekka Heikkila
2026-03-31 19:04 ` [PATCH i-g-t 1/4] tests/intel/kms_sharpness_filter: sanitize subtest init Juha-Pekka Heikkila
2026-04-10 5:40 ` Sharma, Swati2
2026-03-31 19:04 ` [PATCH i-g-t 2/4] tests/intel/kms_sharpness_filter: refactor test_sharpness_filter function Juha-Pekka Heikkila
2026-04-09 12:03 ` Sharma, Swati2
2026-04-15 11:43 ` Juha-Pekka Heikkilä
2026-03-31 19:04 ` [PATCH i-g-t 3/4] tests/intel/kms_sharpness_filter: restructure igt_main Juha-Pekka Heikkila
2026-04-10 5:31 ` Sharma, Swati2 [this message]
2026-04-15 11:38 ` Juha-Pekka Heikkilä
2026-03-31 19:04 ` [PATCH i-g-t 4/4] tests/intel/kms_sharpness_filter: Find mode with lowest bw requirement for test Juha-Pekka Heikkila
2026-04-10 6:00 ` Sharma, Swati2
2026-04-15 11:08 ` Juha-Pekka Heikkilä
2026-04-01 0:32 ` ✓ Xe.CI.BAT: success for Refactor kms_sharpness_filter tests Patchwork
2026-04-01 0:33 ` ✓ i915.CI.BAT: " Patchwork
2026-04-01 8:28 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-01 18:41 ` ✗ i915.CI.Full: failure " 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=16c209b3-7a17-4ab3-8e97-1946fb8b05b1@intel.com \
--to=swati2.sharma@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=juhapekka.heikkila@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