Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Nemesa Garg <nemesa.garg@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] tests/intel/kms_odd_pan: Add test to validate odd panning
Date: Tue, 18 Feb 2025 12:29:15 +0530	[thread overview]
Message-ID: <fb071eb9-fc2a-4bfc-ac5f-d2aad2c0e2b3@intel.com> (raw)
In-Reply-To: <20250217151444.2019299-1-nemesa.garg@intel.com>

Hi Nemesa,

On 17-02-2025 08:44 pm, Nemesa Garg wrote:
> Add a new test to check whether odd pan is supported or not.
Please elaborate more in the description whats the intention of this 
test, what is this feature
all about?
Also, why do we need to create a new binary to validate this feature? 
Why can't
we add subtest in existing binaries like kms_plane?
>
> Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
> ---
>   tests/intel/kms_odd_pan.c | 155 ++++++++++++++++++++++++++++++++++++++
>   tests/meson.build         |   1 +
>   2 files changed, 156 insertions(+)
>   create mode 100644 tests/intel/kms_odd_pan.c
>
> diff --git a/tests/intel/kms_odd_pan.c b/tests/intel/kms_odd_pan.c
> new file mode 100644
> index 000000000..46f9c8fe2
> --- /dev/null
> +++ b/tests/intel/kms_odd_pan.c
> @@ -0,0 +1,155 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2025 Intel Corporation
> + */
> +
> +/**
> + * TEST: kms odd pan
> + * Category: Display
> + * Description: Test to validate odd panning for planar format
> + * Driver requirement: xe
> + * Mega feature: General Display Features
> + * Test category: functionality test
> + * Functionality: panning
> + */
> +
> +#include "igt.h"
> +#include "igt_vec.h"
> +#include <errno.h>
> +#include <stdbool.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include "xe/xe_query.h"
> +
> +/**
> + * SUBTEST: odd-panning
> + * Description: Verify that odd panning in horizontal direction for planar format
> + * Driver requirement: i915, xe
> + * Functionality: kms_odd_pan
> + * Mega feature: General Display Features
> + * Test category: functionality test
> + */
> +
> +IGT_TEST_DESCRIPTION("Test to validate odd panning for planar format");
> +
> +typedef struct {
> +	int drm_fd;
> +	igt_display_t display;
> +	igt_output_t *output;
> +	igt_plane_t **plane;
> +	struct igt_fb *fb;
> +} data_t;
> +
> +#define PLANE_WIDTH 810
> +#define PLANE_HEIGHT 590
> +
> +static void
> +prepare_planes(igt_display_t *display, const enum pipe pipe_id,
> +	       igt_output_t *output)
> +{
> +	igt_plane_t *primary;
> +	struct igt_fb primary_fb_1, primary_fb_2;
> +	unsigned int fb_id_1, fb_id_2;
> +	int j = 0, ret;
> +
> +	igt_output_set_pipe(output, pipe_id);
> +
> +	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> +
> +	fb_id_1 = igt_create_pattern_fb(display->drm_fd,
> +					800, 590,
> +					DRM_FORMAT_NV12,
> +					DRM_FORMAT_MOD_LINEAR,
> +					&primary_fb_1);
> +
> +	fb_id_2 = igt_create_pattern_fb(display->drm_fd,
> +					800, 590,
> +					DRM_FORMAT_NV12,
> +					DRM_FORMAT_MOD_LINEAR,
> +					&primary_fb_2);
> +
> +	igt_assert(fb_id_1);
> +	igt_assert(fb_id_2);
> +
> +	igt_plane_set_fb(primary, &primary_fb_1);
> +
> +	igt_plane_set_size(primary, PLANE_WIDTH, PLANE_HEIGHT);
> +	igt_plane_set_position(primary, -501, 200);
> +
> +	ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	do {
> +		if (j % 2 == 0) {
> +			igt_plane_set_fb(primary, &primary_fb_1);
> +			igt_plane_set_size(primary, PLANE_WIDTH - j, PLANE_HEIGHT);
> +			ret = igt_display_try_commit_atomic(display, 0, NULL);
> +		} else {
> +			igt_plane_set_fb(primary, &primary_fb_2);
> +			igt_plane_set_size(primary, PLANE_WIDTH - j, PLANE_HEIGHT);
> +			ret = igt_display_try_commit_atomic(display, 0, NULL);
> +		}
> +		j++;
> +	} while (j < 20);
> +
> +	igt_assert_eq(ret, -22);
> +
> +	igt_plane_set_fb(primary, NULL);
> +	igt_output_set_pipe(output, PIPE_NONE);
> +	igt_display_try_commit2(display, COMMIT_ATOMIC);
> +
> +	igt_remove_fb(display->drm_fd, &primary_fb_1);
> +	igt_remove_fb(display->drm_fd, &primary_fb_2);
> +}
> +
> +static void run_test_pan(igt_display_t *display, const enum pipe pipe_id,
> +			 igt_output_t *output)
> +{
> +	prepare_planes(display, pipe_id, output);
> +}
> +
> +static void run_test_odd_pan(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +	enum pipe pipe;
> +	igt_output_t *output;
> +
> +	for_each_pipe_with_valid_output(display, pipe, output) {
> +		igt_display_reset(display);
> +
> +		igt_output_set_pipe(output, pipe);
> +		if (!intel_pipe_output_combo_valid(display))
> +			continue;
> +
> +		igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output))
> +			run_test_pan(display, pipe, output);
> +
> +		if (pipe == 0)
> +			break;
> +	}
> +}
> +
> +igt_main
> +{
> +	data_t data = {};
> +
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +		igt_require(data.drm_fd >= 0);
> +
> +		kmstest_set_vt_graphics_mode();
> +
> +		igt_display_require(&data.display, data.drm_fd);
> +		igt_require(data.display.is_atomic);
> +
> +		igt_display_require_output(&data.display);
> +	}
> +
> +	igt_describe("Tests odd  panning");
> +	igt_subtest_with_dynamic("odd-panning")
> +		run_test_odd_pan(&data);
> +
> +	igt_fixture {
> +		igt_display_fini(&data.display);
> +		drm_close_driver(data.drm_fd);
> +	}
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index f8a0ab836..97effb290 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -257,6 +257,7 @@ intel_kms_progs = [
>   	'kms_joiner',
>   	'kms_legacy_colorkey',
>   	'kms_mmap_write_crc',
> +	'kms_odd_pan',
>   	'kms_pipe_b_c_ivb',
>   	'kms_pipe_stress',
>   	'kms_pm_backlight',


  parent reply	other threads:[~2025-02-18  7:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 15:14 [PATCH i-g-t] tests/intel/kms_odd_pan: Add test to validate odd panning Nemesa Garg
2025-02-17 22:04 ` ✓ Xe.CI.BAT: success for tests/intel/kms_odd_pan: Add test to validate odd panning (rev2) Patchwork
2025-02-17 22:20 ` ✓ i915.CI.BAT: " Patchwork
2025-02-18  3:19 ` ✗ i915.CI.Full: failure " Patchwork
2025-02-18  6:59 ` Sharma, Swati2 [this message]
2025-02-18 14:34   ` [PATCH i-g-t] tests/intel/kms_odd_pan: Add test to validate odd panning Garg, Nemesa
2025-02-18 15:33 ` ✗ Xe.CI.Full: failure for tests/intel/kms_odd_pan: Add test to validate odd panning (rev2) 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=fb071eb9-fc2a-4bfc-ac5f-d2aad2c0e2b3@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=nemesa.garg@intel.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