From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: "Juha-Pekka Heikkilä" <juhapekka.heikkila@gmail.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 2/4] tests/intel/kms_sharpness_filter: refactor test_sharpness_filter function
Date: Fri, 17 Apr 2026 01:20:50 +0530 [thread overview]
Message-ID: <4c42053d-a31f-4c69-8e1b-d8018c429b4d@intel.com> (raw)
In-Reply-To: <CAJ=qYWQGiwPsu3ObRyWkgHnL=Mjph6Op5Ntw3sxah2LGRbHddw@mail.gmail.com>
On 15-04-2026 05:13 pm, Juha-Pekka Heikkilä wrote:
> On Thu, Apr 9, 2026 at 3:04 PM Sharma, Swati2 <swati2.sharma@intel.com> wrote:
>> Hi JP,
>>
>> Overall patch LGTM. One small nit.
>>
>> On 01-04-2026 12:34 am, Juha-Pekka Heikkila wrote:
>>> refactor to make it look more nice
>>>
>>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
>>> ---
>>> tests/intel/kms_sharpness_filter.c | 108 ++++++++++++++++-------------
>>> 1 file changed, 59 insertions(+), 49 deletions(-)
>>>
>>> diff --git a/tests/intel/kms_sharpness_filter.c b/tests/intel/kms_sharpness_filter.c
>>> index 029b735bd..ed8d2e48c 100644
>>> --- a/tests/intel/kms_sharpness_filter.c
>>> +++ b/tests/intel/kms_sharpness_filter.c
>>> @@ -88,15 +88,6 @@ IGT_TEST_DESCRIPTION("Test to validate content adaptive sharpness filter");
>>> #define MAX_PIXELS_FOR_3_TAP_FILTER (1920 * 1080)
>>> #define MAX_PIXELS_FOR_5_TAP_FILTER (3840 * 2160)
>>> #define NROUNDS 10
>>> -#define INVALID_TEST ((type == TEST_INVALID_FILTER_WITH_SCALER) \
>>> - || (type == TEST_INVALID_FILTER_WITH_PLANE) \
>>> - || (type == TEST_INVALID_PLANE_WITH_FILTER) \
>>> - || (type == TEST_INVALID_FILTER_WITH_SCALING_MODE))
>>> -#define SET_PLANES ((type == TEST_FILTER_UPSCALE) \
>>> - || (type == TEST_FILTER_DOWNSCALE) \
>>> - || (type == TEST_INVALID_FILTER_WITH_SCALER) \
>>> - || (type == TEST_INVALID_FILTER_WITH_PLANE) \
>>> - || (type == TEST_INVALID_FILTER_WITH_SCALING_MODE))
>>>
>>> enum test_type {
>>> TEST_FILTER_BASIC,
>>> @@ -327,12 +318,37 @@ static int test_filter_toggle(data_t *data)
>>> return ret;
>>> }
>>>
>>> -static void test_sharpness_filter(data_t *data, enum test_type type)
>>> +static bool is_invalid_test(enum test_type type)
>>> +{
>>> + switch (type) {
>>> + case TEST_INVALID_FILTER_WITH_SCALER:
>>> + case TEST_INVALID_FILTER_WITH_PLANE:
>>> + case TEST_INVALID_PLANE_WITH_FILTER:
>>> + case TEST_INVALID_FILTER_WITH_SCALING_MODE:
>>> + return true;
>>> + default:
>>> + return false;
>>> + }
>>> +}
>>> +
>>> +static bool needs_extra_planes(enum test_type type)
>>> +{
>>> + switch (type) {
>>> + case TEST_FILTER_UPSCALE:
>>> + case TEST_FILTER_DOWNSCALE:
>>> + case TEST_INVALID_FILTER_WITH_SCALER:
>>> + case TEST_INVALID_FILTER_WITH_PLANE:
>>> + case TEST_INVALID_FILTER_WITH_SCALING_MODE:
>>> + return true;
>>> + default:
>>> + return false;
>>> + }
>>> +}
>>> +
>>> +static void test_sharpness_filter(data_t *data, enum test_type type)
>>> {
>>> igt_output_t *output = data->output;
>>> drmModeModeInfo *mode = data->mode;
>>> - int height = mode->hdisplay;
>>> - int width = mode->vdisplay;
>>> igt_crc_t ref_crc, crc;
>>> igt_pipe_crc_t *pipe_crc = NULL;
>>> int ret;
>>> @@ -343,57 +359,31 @@ static void test_sharpness_filter(data_t *data, enum test_type type)
>>> "No requested format/modifier on pipe %s\n",
>>> igt_crtc_name(data->crtc));
>>>
>>> - setup_fb(data->drm_fd, height, width, data->format, data->modifier, &data->fb[0]);
>>> + setup_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
>>> + data->format, data->modifier, &data->fb[0]);
>>> igt_plane_set_fb(data->plane[0], &data->fb[0]);
>>>
>>> if (type == TEST_FILTER_ROTATION) {
>>> - if (igt_plane_has_rotation(data->plane[0], data->rotation))
>>> - igt_plane_set_rotation(data->plane[0], data->rotation);
>>> - else
>>> - igt_skip("No requested rotation on pipe %s\n",
>>> - igt_crtc_name(data->crtc));
>>> + igt_skip_on_f(!igt_plane_has_rotation(data->plane[0],
>>> + data->rotation),
>>> + "No requested rotation on pipe %s\n",
>>> + igt_crtc_name(data->crtc));
>>> + igt_plane_set_rotation(data->plane[0], data->rotation);
>>> }
>>>
>>> if (type == TEST_INVALID_FILTER_WITH_SCALING_MODE)
>>> igt_require_f(has_scaling_mode(output), "No connecter scaling mode found on %s\n", output->name);
>>>
>>> - if (SET_PLANES)
>>> + if (needs_extra_planes(type))
>>> set_planes(data, type);
>>>
>>> set_filter_strength_on_pipe(data);
>>>
>>> - if (!INVALID_TEST && data->filter_strength != 0)
>>> - igt_debug("Sharpened image should be observed for filter strength > 0\n");
>> Since this in NON-CRC based test, should we keep this debug msg?
> I don't think this debug message help here. Maybe these tests should
> be moved behind command line flag so they wouldn't be run on CI?
Ok. No, we need to run these tests on CI; else we won't be able to catch
regression.
>
>>> -
>>> if (type == TEST_INVALID_FILTER_WITH_SCALING_MODE)
>>> ret = igt_display_try_commit_atomic(&data->display, 0, NULL);
>>> else
>>> ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
>>>
>>> - if (type == TEST_FILTER_DPMS || type == TEST_FILTER_SUSPEND) {
>>> - pipe_crc = igt_crtc_crc_new(data->crtc,
>>> - IGT_PIPE_CRC_SOURCE_AUTO);
>>> - igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
>>> - }
>>> -
>>> - if (type == TEST_FILTER_DPMS) {
>>> - kmstest_set_connector_dpms(data->drm_fd,
>>> - output->config.connector,
>>> - DRM_MODE_DPMS_OFF);
>>> - kmstest_set_connector_dpms(data->drm_fd,
>>> - output->config.connector,
>>> - DRM_MODE_DPMS_ON);
>>> - }
>>> -
>>> - if (type == TEST_FILTER_SUSPEND)
>>> - igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
>>> - SUSPEND_TEST_NONE);
>>> -
>>> - if (type == TEST_FILTER_DPMS || type == TEST_FILTER_SUSPEND) {
>>> - igt_pipe_crc_collect_crc(pipe_crc, &crc);
>>> - igt_assert_crc_equal(&crc, &ref_crc);
>>> - }
>>> -
>>> if (type == TEST_FILTER_TOGGLE)
>>> ret |= test_filter_toggle(data);
>>>
>>> @@ -409,13 +399,33 @@ static void test_sharpness_filter(data_t *data, enum test_type type)
>>> ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
>>> }
>>>
>>> - if (INVALID_TEST)
>>> + if (type == TEST_FILTER_DPMS || type == TEST_FILTER_SUSPEND) {
>>> + pipe_crc = igt_crtc_crc_new(data->crtc,
>>> + IGT_PIPE_CRC_SOURCE_AUTO);
>>> + igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
>>> +
>>> + if (type == TEST_FILTER_DPMS) {
>>> + kmstest_set_connector_dpms(data->drm_fd,
>>> + output->config.connector,
>>> + DRM_MODE_DPMS_OFF);
>>> + kmstest_set_connector_dpms(data->drm_fd,
>>> + output->config.connector,
>>> + DRM_MODE_DPMS_ON);
>>> + } else {
>>> + igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
>>> + SUSPEND_TEST_NONE);
>>> + }
>>> +
>>> + igt_pipe_crc_collect_crc(pipe_crc, &crc);
>>> + igt_assert_crc_equal(&crc, &ref_crc);
>>> + igt_pipe_crc_free(pipe_crc);
>>> + }
>>> +
>>> + if (is_invalid_test(type))
>>> igt_assert_eq(ret, -EINVAL);
>>> else
>>> igt_assert_eq(ret, 0);
>>>
>>> - /* clean-up */
>>> - igt_pipe_crc_free(pipe_crc);
>>> cleanup(data);
>>> }
>>>
next prev parent reply other threads:[~2026-04-16 19:51 UTC|newest]
Thread overview: 17+ 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-04-16 19:50 ` Sharma, Swati2 [this message]
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
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=4c42053d-a31f-4c69-8e1b-d8018c429b4d@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