* [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests
@ 2022-06-28 18:51 Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 1/4] tests/i915/kms_flip_scaled_crc: Convert tests to dynamic Swati Sharma
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Swati Sharma @ 2022-06-28 18:51 UTC (permalink / raw)
To: igt-dev
Convert subtest to dynamic subtests.
Add new tests in the list covering pixel formats and tiling.
Also, 2 additional patches are added to validate
NN scaling filter.
Swati Sharma (4):
tests/i915/kms_flip_scaled_crc: Convert tests to dynamic
tests/i915/kms_flip_scaled_crc: Add new tests covering modifiers and
pixel-formats
lib/igt_kms: Add scaling filter property
tests/kms_flip_scaled_crc: Validate NN scaling filter
lib/igt_kms.c | 30 +++
lib/igt_kms.h | 3 +
tests/i915/kms_flip_scaled_crc.c | 403 +++++++++++++++++++++++++------
3 files changed, 358 insertions(+), 78 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [igt-dev] [v5 PATCH i-g-t 1/4] tests/i915/kms_flip_scaled_crc: Convert tests to dynamic
2022-06-28 18:51 [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests Swati Sharma
@ 2022-06-28 18:51 ` Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 2/4] tests/i915/kms_flip_scaled_crc: Add new tests covering modifiers and pixel-formats Swati Sharma
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Swati Sharma @ 2022-06-28 18:51 UTC (permalink / raw)
To: igt-dev; +Cc: Petri Latvala
Convert the existing subtests to dynamic subtests at pipe/output level.
v2: Refactored code in such a manner that once test has been run
successfully on chosen pipe that pipe will not be tested again
as this test is testing pipe feature. No need to run separately
for each connector using all pipes.
v3: Changed seq to avoid modetoset as a dangling ptr
v4: On eDP 1080p with 144Hz vrefresh, test fails with cdclk
lim, however it passes with 90Hz vrefresh. Added the check
to handle this scenario.
v5: Minor fixes
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/i915/kms_flip_scaled_crc.c | 129 ++++++++++++++-----------------
1 file changed, 57 insertions(+), 72 deletions(-)
diff --git a/tests/i915/kms_flip_scaled_crc.c b/tests/i915/kms_flip_scaled_crc.c
index 9740715f..d6edb01c 100644
--- a/tests/i915/kms_flip_scaled_crc.c
+++ b/tests/i915/kms_flip_scaled_crc.c
@@ -163,8 +163,6 @@ const struct {
},
};
-enum subrval {CONNECTORFAIL, CONNECTORSUCCESS, TESTSKIP, NOREQUESTEDFORMATONPIPE};
-
static void setup_fb(data_t *data, struct igt_fb *newfb, uint32_t width,
uint32_t height, uint64_t format, uint64_t modifier)
{
@@ -220,12 +218,12 @@ static void clear_lut(data_t *data, enum pipe pipe)
igt_pipe_obj_set_prop_value(pipe_obj, IGT_CRTC_GAMMA_LUT, 0);
}
-static enum subrval test_flip_to_scaled(data_t *data, uint32_t index,
- enum pipe pipe, igt_output_t *output)
+static void test_flip_to_scaled(data_t *data, uint32_t index,
+ enum pipe pipe, igt_output_t *output,
+ drmModeModeInfoPtr modetoset)
{
igt_plane_t *primary;
igt_crc_t small_crc, big_crc;
- drmModeModeInfoPtr modetoset = NULL;
struct drm_event_vblank ev;
int ret;
@@ -254,18 +252,23 @@ static enum subrval test_flip_to_scaled(data_t *data, uint32_t index,
data->big_fb.height);
}
+ if (modetoset)
+ igt_output_override_mode(output, modetoset);
+ /*
+ * Setting a pipe invalidates the modetoset pointer.
+ * So, mode is overriden first and then pipe is set.
+ * Don't change this sequence.
+ */
igt_output_set_pipe(output, pipe);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
- if (!igt_plane_has_format_mod(primary, data->small_fb.drm_format,
- data->small_fb.modifier) ||
- !igt_plane_has_format_mod(primary, data->big_fb.drm_format,
- data->big_fb.modifier))
- return NOREQUESTEDFORMATONPIPE;
+ igt_skip_on_f(!igt_plane_has_format_mod(primary, data->small_fb.drm_format, data->small_fb.modifier) ||
+ !igt_plane_has_format_mod(primary, data->big_fb.drm_format,
+ data->big_fb.modifier), "No requested format/modifier on pipe %s\n", kmstest_pipe_name(pipe));
set_lut(data, pipe);
- igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET,
- NULL);
+ igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
if (data->pipe_crc) {
igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
@@ -273,42 +276,15 @@ static enum subrval test_flip_to_scaled(data_t *data, uint32_t index,
data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
- for (int i = 0; i < output->config.connector->count_modes; i++) {
- if (output->config.connector->modes[i].hdisplay == data->attemptmodewidth &&
- output->config.connector->modes[i].vdisplay == data->attemptmodeheight) {
- if (modetoset &&
- modetoset->vrefresh < output->config.connector->modes[i].vrefresh)
- continue;
-
- modetoset = &output->config.connector->modes[i];
- }
- }
-
- if (!modetoset)
- igt_debug("%dp mode was not found from connector, will try with default. This may cause cdclk to fail this test on this connector.\n",
- data->attemptmodeheight);
- else
- igt_output_override_mode(output, modetoset);
-
igt_plane_set_position(primary, 0, 0);
igt_plane_set_fb(primary, &data->small_fb);
igt_plane_set_size(primary, data->attemptmodewidth,
data->attemptmodeheight);
ret = igt_display_try_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
- switch (ret) {
- case -ERANGE:
- igt_debug("Platform scaling limits exceeded, skipping.\n");
- return TESTSKIP;
- case -EINVAL:
- if (!modetoset) {
- igt_debug("No %dp and default mode too big, cdclk limits exceeded. Check next connector\n",
- data->attemptmodeheight);
- return CONNECTORFAIL;
- }
- /* fallthrough */
- default:
- igt_assert_eq(ret, 0);
- }
+
+ igt_skip_on_f(ret == -ERANGE, "Platform scaling limits exceeded, skipping.\n");
+ igt_skip_on_f((ret == -EINVAL) && (!modetoset || modetoset->vrefresh > 90), "Valid/default mode too big, cdclk limits exceeded. Check next connector\n");
+ igt_assert_eq(ret, 0);
igt_pipe_crc_start(data->pipe_crc);
igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &small_crc);
@@ -320,20 +296,9 @@ static enum subrval test_flip_to_scaled(data_t *data, uint32_t index,
DRM_MODE_ATOMIC_ALLOW_MODESET |
DRM_MODE_PAGE_FLIP_EVENT, NULL);
- switch (ret) {
- case -ERANGE:
- igt_debug("Platform scaling limits exceeded, skipping.\n");
- return TESTSKIP;
- case -EINVAL:
- if (!modetoset) {
- igt_debug("No %dp and default mode too big, cdclk limits exceeded. Check next connector\n",
- data->attemptmodeheight);
- return CONNECTORFAIL;
- }
- /* fallthrough */
- default:
- igt_assert_eq(ret, 0);
- }
+ igt_skip_on_f(ret == -ERANGE, "Platform scaling limits exceeded, skipping.\n");
+ igt_skip_on_f((ret == -EINVAL) && (!modetoset || modetoset->vrefresh > 90), "Valid/default mode too big, cdclk limits exceeded. Check next connector\n");
+ igt_assert_eq(ret, 0);
igt_assert(read(data->drm_fd, &ev, sizeof(ev)) == sizeof(ev));
@@ -346,11 +311,28 @@ static enum subrval test_flip_to_scaled(data_t *data, uint32_t index,
clear_lut(data, pipe);
+ modetoset = NULL;
igt_output_set_pipe(output, PIPE_NONE);
igt_plane_set_fb(primary, NULL);
igt_display_commit2(&data->display, COMMIT_ATOMIC);
+}
+
+static drmModeModeInfoPtr find_mode(data_t *data, igt_output_t *output)
+{
+ drmModeModeInfoPtr modetoset = NULL;
+
+ for (int i = 0; i < output->config.connector->count_modes; i++) {
+ if (output->config.connector->modes[i].hdisplay == data->attemptmodewidth &&
+ output->config.connector->modes[i].vdisplay == data->attemptmodeheight) {
+ if (modetoset &&
+ modetoset->vrefresh < output->config.connector->modes[i].vrefresh)
+ continue;
- return CONNECTORSUCCESS;
+ modetoset = &output->config.connector->modes[i];
+ }
+ }
+
+ return modetoset;
}
igt_main
@@ -358,6 +340,7 @@ igt_main
enum pipe pipe;
data_t data = {};
igt_output_t *output;
+ drmModeModeInfoPtr modetoset = NULL;
igt_fixture {
data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
@@ -379,28 +362,30 @@ igt_main
for (int index = 0; index < ARRAY_SIZE(flip_scenario_test); index++) {
igt_describe(flip_scenario_test[index].describe);
- igt_subtest(flip_scenario_test[index].name) {
- int validtests = 0;
+ igt_subtest_with_dynamic(flip_scenario_test[index].name) {
free_fbs(&data);
- for_each_pipe_static(pipe) {
- enum subrval rval = CONNECTORSUCCESS;
+ for_each_pipe(&data.display, pipe) {
+ bool found = false;
for_each_valid_output_on_pipe(&data.display, pipe, output) {
- rval = test_flip_to_scaled(&data, index, pipe, output);
-
- igt_require(rval != TESTSKIP);
-
- // break out to test next pipe
- if (rval == CONNECTORSUCCESS) {
- validtests++;
+ modetoset = find_mode(&data, output);
+ if (modetoset) {
+ found = true;
+ igt_dynamic_f("pipe-%s-valid-mode", kmstest_pipe_name(pipe))
+ test_flip_to_scaled(&data, index, pipe, output, modetoset);
break;
}
}
- if (rval == NOREQUESTEDFORMATONPIPE)
- igt_debug("No requested format/modifier on pipe %s\n", kmstest_pipe_name(pipe));
+ if (!found) {
+ for_each_valid_output_on_pipe(&data.display, pipe, output) {
+ igt_dynamic_f("pipe-%s-default-mode", kmstest_pipe_name(pipe))
+ test_flip_to_scaled(&data, index, pipe, output, NULL);
+ }
+ }
+ break;
}
- igt_require_f(validtests > 0, "No valid pipe/connector/format/mod combination found\n");
}
}
+
igt_fixture {
free_fbs(&data);
if (data.pipe_crc) {
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] [v2 PATCH i-g-t 2/4] tests/i915/kms_flip_scaled_crc: Add new tests covering modifiers and pixel-formats
2022-06-28 18:51 [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 1/4] tests/i915/kms_flip_scaled_crc: Convert tests to dynamic Swati Sharma
@ 2022-06-28 18:51 ` Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property Swati Sharma
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Swati Sharma @ 2022-06-28 18:51 UTC (permalink / raw)
To: igt-dev
New test cases are added covering various modifiers and
pixel-formats.
v2: fixed typo
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/i915/kms_flip_scaled_crc.c | 258 ++++++++++++++++++++++++++++++-
1 file changed, 257 insertions(+), 1 deletion(-)
diff --git a/tests/i915/kms_flip_scaled_crc.c b/tests/i915/kms_flip_scaled_crc.c
index d6edb01c..88640da2 100644
--- a/tests/i915/kms_flip_scaled_crc.c
+++ b/tests/i915/kms_flip_scaled_crc.c
@@ -57,6 +57,38 @@ const struct {
1.0,
2.0,
},
+ {
+ "flip-32bpp-yftile-to-64bpp-yftile-downscaling",
+ "Flip from 32bpp non scaled fb to 64bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-32bpp-xtile-to-64bpp-xtile-downscaling",
+ "Flip from 32bpp non scaled fb to 64bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB16161616F,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-32bpp-4tile-to-64bpp-4tile-downscaling",
+ "Flip from 32bpp non scaled fb to 64bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-32bpp-linear-to-64bpp-linear-downscaling",
+ "Flip from 32bpp non scaled fb to 64bpp downscaled fb to stress CD clock programming",
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB16161616F,
+ 1.0,
+ 2.0,
+ },
{
"flip-64bpp-ytile-to-32bpp-ytile-downscaling",
"Flip from 64bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
@@ -65,6 +97,38 @@ const struct {
1.0,
2.0,
},
+ {
+ "flip-64bpp-yftile-to-32bpp-yftile-downscaling",
+ "Flip from 64bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB8888,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-64bpp-xtile-to-32bpp-xtile-downscaling",
+ "Flip from 64bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB8888,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-64bpp-4tile-to-32bpp-4tile-downscaling",
+ "Flip from 64bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB8888,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-64bpp-linear-to-32bpp-linear-downscaling",
+ "Flip from 64bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB16161616F,
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB8888,
+ 1.0,
+ 2.0,
+ },
{
"flip-64bpp-ytile-to-16bpp-ytile-downscaling",
"Flip from 64bpp non scaled fb to 16bpp downscaled fb to stress CD clock programming",
@@ -73,6 +137,38 @@ const struct {
1.0,
2.0,
},
+ {
+ "flip-64bpp-yftile-to-16bpp-yftile-downscaling",
+ "Flip from 64bpp non scaled fb to 16bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_RGB565,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-64bpp-xtile-to-16bpp-xtile-downscaling",
+ "Flip from 64bpp non scaled fb to 16bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_RGB565,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-64bpp-4tile-to-16bpp-4tile-downscaling",
+ "Flip from 64bpp non scaled fb to 16bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_RGB565,
+ 1.0,
+ 2.0,
+ },
+ {
+ "flip-64bpp-linear-to-16bpp-linear-downscaling",
+ "Flip from 64bpp non scaled fb to 16bpp downscaled fb to stress CD clock programming",
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB16161616F,
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_RGB565,
+ 1.0,
+ 2.0,
+ },
{
"flip-32bpp-ytileccs-to-64bpp-ytile-downscaling",
"Flip from 32bpp non scaled fb to 64bpp downscaled fb to stress CD clock programming",
@@ -81,6 +177,14 @@ const struct {
1.0,
2.0,
},
+ {
+ "flip-32bpp-yftileccs-to-64bpp-yftile-downscaling",
+ "Flip from 32bpp non scaled fb to 64bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED_CCS, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ 1.0,
+ 2.0,
+ },
{
"flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-downscaling",
"Flip from 32bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
@@ -89,6 +193,14 @@ const struct {
1.0,
2.0,
},
+ {
+ "flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling",
+ "Flip from 32bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_4_TILED_DG2_RC_CCS, DRM_FORMAT_XRGB8888,
+ 1.0,
+ 2.0,
+ },
{
"flip-32bpp-ytile-to-32bpp-ytileccs-downscaling",
"Flip from 32bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
@@ -97,6 +209,14 @@ const struct {
1.0,
2.0,
},
+ {
+ "flip-32bpp-yftile-to-32bpp-yftileccs-downscaling",
+ "Flip from 32bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_Yf_TILED_CCS, DRM_FORMAT_XRGB8888,
+ 1.0,
+ 2.0,
+ },
{
"flip-64bpp-ytile-to-32bpp-ytilercccs-downscaling",
"Flip from 64bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
@@ -105,6 +225,14 @@ const struct {
1.0,
2.0,
},
+ {
+ "flip-64bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling",
+ "Flip from 64bpp non scaled fb to 32bpp downscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_4_TILED_DG2_RC_CCS, DRM_FORMAT_XRGB8888,
+ 1.0,
+ 2.0,
+ },
{
"flip-32bpp-ytile-to-64bpp-ytile-upscaling",
"Flip from 32bpp non scaled fb to 64bpp upscaled fb to stress CD clock programming",
@@ -113,6 +241,38 @@ const struct {
0.5,
1.0,
},
+ {
+ "flip-32bpp-yftile-to-64bpp-yftile-upscaling",
+ "Flip from 32bpp non scaled fb to 64bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-32bpp-xtile-to-64bpp-xtile-upscaling",
+ "Flip from 32bpp non scaled fb to 64bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB16161616F,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-32bpp-4tile-to-64bpp-4tile-upscaling",
+ "Flip from 32bpp non scaled fb to 64bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-32bpp-linear-to-64bpp-linear-upscaling",
+ "Flip from 32bpp non scaled fb to 64bpp upscaled fb to stress CD clock programming",
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB16161616F,
+ 0.5,
+ 1.0,
+ },
{
"flip-64bpp-ytile-to-32bpp-ytile-upscaling",
"Flip from 64bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
@@ -121,6 +281,38 @@ const struct {
0.5,
1.0,
},
+ {
+ "flip-64bpp-yftile-to-32bpp-yftile-upscaling",
+ "Flip from 64bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB8888,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-64bpp-xtile-to-32bpp-xtile-upscaling",
+ "Flip from 64bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB8888,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-64bpp-4tile-to-32bpp-4tile-upscaling",
+ "Flip from 64bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB8888,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-64bpp-linear-to-32bpp-linear-upscaling",
+ "Flip from 64bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB16161616F,
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB8888,
+ 0.5,
+ 1.0,
+ },
{
"flip-64bpp-ytile-to-16bpp-ytile-upscaling",
"Flip from 64bpp non scaled fb to 16bpp upscaled fb to stress CD clock programming",
@@ -129,6 +321,38 @@ const struct {
0.5,
1.0,
},
+ {
+ "flip-64bpp-yftile-to-16bpp-yftile-upscaling",
+ "Flip from 64bpp non scaled fb to 16bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_RGB565,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-64bpp-xtile-to-16bpp-xtile-upscaling",
+ "Flip from 64bpp non scaled fb to 16bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_X_TILED, DRM_FORMAT_RGB565,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-64bpp-4tile-to-16bpp-4tile-upscaling",
+ "Flip from 64bpp non scaled fb to 16bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_RGB565,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-64bpp-linear-to-16bpp-linear-upscaling",
+ "Flip from 64bpp non scaled fb to 16bpp upscaled fb to stress CD clock programming",
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_XRGB16161616F,
+ DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_RGB565,
+ 0.5,
+ 1.0,
+ },
{
"flip-32bpp-ytileccs-to-64bpp-ytile-upscaling",
"Flip from 32bpp non scaled fb to 64bpp upscaled fb to stress CD clock programming",
@@ -137,6 +361,14 @@ const struct {
0.5,
1.0,
},
+ {
+ "flip-32bpp-yftileccs-to-64bpp-yftile-upscaling",
+ "Flip from 32bpp non scaled fb to 64bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED_CCS, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB16161616F,
+ 0.5,
+ 1.0,
+ },
{
"flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-upscaling",
"Flip from 32bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
@@ -145,6 +377,14 @@ const struct {
0.5,
1.0,
},
+ {
+ "flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-upscaling",
+ "Flip from 32bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_4_TILED_DG2_RC_CCS, DRM_FORMAT_XRGB8888,
+ 0.5,
+ 1.0,
+ },
{
"flip-32bpp-ytile-to-32bpp-ytileccs-upscaling",
"Flip from 32bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
@@ -154,13 +394,29 @@ const struct {
1.0,
},
{
- "flip-64bpp-ytile-to-32bpp-ytilercccs-upscaling",
+ "flip-32bpp-yftile-to-32bpp-yftileccs-upscaling",
+ "Flip from 32bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_Yf_TILED, DRM_FORMAT_XRGB8888,
+ I915_FORMAT_MOD_Yf_TILED_CCS, DRM_FORMAT_XRGB8888,
+ 0.5,
+ 1.0,
+ },
+ {
+ "flip-64bpp-ytile-to-32bpp-ytilegen12rcccs-upscaling",
"Flip from 64bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
I915_FORMAT_MOD_Y_TILED, DRM_FORMAT_XRGB16161616F,
I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, DRM_FORMAT_XRGB8888,
0.5,
1.0,
},
+ {
+ "flip-64bpp-4tile-to-32bpp-4tiledg2rcccs-upscaling",
+ "Flip from 64bpp non scaled fb to 32bpp upscaled fb to stress CD clock programming",
+ I915_FORMAT_MOD_4_TILED, DRM_FORMAT_XRGB16161616F,
+ I915_FORMAT_MOD_4_TILED_DG2_RC_CCS, DRM_FORMAT_XRGB8888,
+ 0.5,
+ 1.0,
+ },
};
static void setup_fb(data_t *data, struct igt_fb *newfb, uint32_t width,
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property
2022-06-28 18:51 [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 1/4] tests/i915/kms_flip_scaled_crc: Convert tests to dynamic Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 2/4] tests/i915/kms_flip_scaled_crc: Add new tests covering modifiers and pixel-formats Swati Sharma
@ 2022-06-28 18:51 ` Swati Sharma
2022-06-29 12:36 ` Juha-Pekka Heikkila
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: Validate NN scaling filter Swati Sharma
2022-06-28 20:04 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/kms_flip_scaled_crc: New tests (rev10) Patchwork
4 siblings, 1 reply; 8+ messages in thread
From: Swati Sharma @ 2022-06-28 18:51 UTC (permalink / raw)
To: igt-dev
Added "scaling filter" as pipe and plane property.
v2: -Moved lib changes from 4/4 to 3/4
-Renaming filter enum
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
lib/igt_kms.c | 30 ++++++++++++++++++++++++++++++
lib/igt_kms.h | 3 +++
2 files changed, 33 insertions(+)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index bd606548..fdb13177 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -581,6 +581,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
[IGT_PLANE_ALPHA] = "alpha",
[IGT_PLANE_ZPOS] = "zpos",
[IGT_PLANE_FB_DAMAGE_CLIPS] = "FB_DAMAGE_CLIPS",
+ [IGT_PLANE_SCALING_FILTER] = "SCALING_FILTER",
};
const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
@@ -593,6 +594,7 @@ const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
[IGT_CRTC_ACTIVE] = "ACTIVE",
[IGT_CRTC_OUT_FENCE_PTR] = "OUT_FENCE_PTR",
[IGT_CRTC_VRR_ENABLED] = "VRR_ENABLED",
+ [IGT_CRTC_SCALING_FILTER] = "SCALING_FILTER",
};
const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
@@ -910,6 +912,28 @@ const char *kmstest_connector_status_str(int status)
return find_type_name(connector_status_names, status);
}
+enum scaling_filter {
+ SCALING_FILTER_DEFAULT,
+ SCALING_FILTER_NEAREST_NEIGHBOR,
+};
+
+static const struct type_name scaling_filter_names[] = {
+ { SCALING_FILTER_DEFAULT, "Default" },
+ { SCALING_FILTER_NEAREST_NEIGHBOR, "Nearest Neighbor" },
+ {}
+};
+
+/**
+ * kmstest_scaling_filter_str:
+ * @filter: SCALING_FILTER_* filter value
+ *
+ * Returns: A string representing the scaling filter @filter.
+ */
+const char *kmstest_scaling_filter_str(int filter)
+{
+ return find_type_name(scaling_filter_names, filter);
+}
+
static const struct type_name connector_type_names[] = {
{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
{ DRM_MODE_CONNECTOR_VGA, "VGA" },
@@ -2122,6 +2146,9 @@ static void igt_plane_reset(igt_plane_t *plane)
if (igt_plane_has_prop(plane, IGT_PLANE_FB_DAMAGE_CLIPS))
igt_plane_set_prop_value(plane, IGT_PLANE_FB_DAMAGE_CLIPS, 0);
+ if (igt_plane_has_prop(plane, IGT_PLANE_SCALING_FILTER))
+ igt_plane_set_prop_enum(plane, IGT_PLANE_SCALING_FILTER, "Default");
+
igt_plane_clear_prop_changed(plane, IGT_PLANE_IN_FENCE_FD);
plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
plane->gem_handle = 0;
@@ -2142,6 +2169,9 @@ static void igt_pipe_reset(igt_pipe_t *pipe)
if (igt_pipe_obj_has_prop(pipe, IGT_CRTC_DEGAMMA_LUT))
igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_DEGAMMA_LUT, 0);
+ if (igt_pipe_obj_has_prop(pipe, IGT_CRTC_SCALING_FILTER))
+ igt_pipe_obj_set_prop_enum(pipe, IGT_CRTC_SCALING_FILTER, "Default");
+
pipe->out_fence_fd = -1;
}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 3e674e74..4b67708d 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -107,6 +107,7 @@ enum igt_custom_edid_type {
const char *kmstest_encoder_type_str(int type);
const char *kmstest_connector_status_str(int status);
const char *kmstest_connector_type_str(int type);
+const char *kmstest_scaling_filter_str(int filter);
void kmstest_dump_mode(drmModeModeInfo *mode);
#define MAX_HDISPLAY_PER_PIPE 5120
@@ -126,6 +127,7 @@ enum igt_atomic_crtc_properties {
IGT_CRTC_ACTIVE,
IGT_CRTC_OUT_FENCE_PTR,
IGT_CRTC_VRR_ENABLED,
+ IGT_CRTC_SCALING_FILTER,
IGT_NUM_CRTC_PROPS
};
@@ -302,6 +304,7 @@ enum igt_atomic_plane_properties {
IGT_PLANE_ALPHA,
IGT_PLANE_ZPOS,
IGT_PLANE_FB_DAMAGE_CLIPS,
+ IGT_PLANE_SCALING_FILTER,
IGT_NUM_PLANE_PROPS
};
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] [v5 PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: Validate NN scaling filter
2022-06-28 18:51 [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests Swati Sharma
` (2 preceding siblings ...)
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property Swati Sharma
@ 2022-06-28 18:51 ` Swati Sharma
2022-06-29 12:37 ` Juha-Pekka Heikkila
2022-06-28 20:04 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/kms_flip_scaled_crc: New tests (rev10) Patchwork
4 siblings, 1 reply; 8+ messages in thread
From: Swati Sharma @ 2022-06-28 18:51 UTC (permalink / raw)
To: igt-dev; +Cc: Petri Latvala
SCALING_FILTER can be used either as plane scaler property
or CRTC scaler property.
The value of this property can be one of the following:
Default:
Driver's default scaling filter
Nearest Neighbor:
Nearest Neighbor scaling filter
If NN is used for scaling, sharpness is preserved
whereas if we use default scaling we can see blurriness
at edges.
v2: -no need to set pipe scaler filter property
v3: -addition of new lines to improve readability
-use of SPDX licence placeholder
-close(data.drm_fd)
v4: -instead of creating new i-g-t, tweaked kms_flip_scaled_crc
to validate both default and nn scaling filters
v5: -removed duplicate block
-added platform check for nn
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/i915/kms_flip_scaled_crc.c | 48 ++++++++++++++++++--------------
1 file changed, 27 insertions(+), 21 deletions(-)
diff --git a/tests/i915/kms_flip_scaled_crc.c b/tests/i915/kms_flip_scaled_crc.c
index 88640da2..f241806d 100644
--- a/tests/i915/kms_flip_scaled_crc.c
+++ b/tests/i915/kms_flip_scaled_crc.c
@@ -476,7 +476,7 @@ static void clear_lut(data_t *data, enum pipe pipe)
static void test_flip_to_scaled(data_t *data, uint32_t index,
enum pipe pipe, igt_output_t *output,
- drmModeModeInfoPtr modetoset)
+ drmModeModeInfoPtr modetoset, int flags)
{
igt_plane_t *primary;
igt_crc_t small_crc, big_crc;
@@ -518,6 +518,7 @@ static void test_flip_to_scaled(data_t *data, uint32_t index,
igt_output_set_pipe(output, pipe);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+ igt_skip_on_f(!igt_plane_has_prop(primary, IGT_PLANE_SCALING_FILTER), "Plane scaling filter prop not supported");
igt_skip_on_f(!igt_plane_has_format_mod(primary, data->small_fb.drm_format, data->small_fb.modifier) ||
!igt_plane_has_format_mod(primary, data->big_fb.drm_format,
data->big_fb.modifier), "No requested format/modifier on pipe %s\n", kmstest_pipe_name(pipe));
@@ -532,6 +533,8 @@ static void test_flip_to_scaled(data_t *data, uint32_t index,
data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
+ igt_plane_set_prop_enum(primary, IGT_PLANE_SCALING_FILTER, kmstest_scaling_filter_str(flags));
+
igt_plane_set_position(primary, 0, 0);
igt_plane_set_fb(primary, &data->small_fb);
igt_plane_set_size(primary, data->attemptmodewidth,
@@ -601,7 +604,6 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
data.gen = intel_display_ver(intel_get_drm_devid(data.drm_fd));
- igt_require(data.gen >= 9);
igt_display_require(&data.display, data.drm_fd);
igt_require(data.display.is_atomic);
igt_require_pipe_crc(data.drm_fd);
@@ -616,28 +618,32 @@ igt_main
}
}
- for (int index = 0; index < ARRAY_SIZE(flip_scenario_test); index++) {
- igt_describe(flip_scenario_test[index].describe);
- igt_subtest_with_dynamic(flip_scenario_test[index].name) {
- free_fbs(&data);
- for_each_pipe(&data.display, pipe) {
- bool found = false;
- for_each_valid_output_on_pipe(&data.display, pipe, output) {
- modetoset = find_mode(&data, output);
- if (modetoset) {
- found = true;
- igt_dynamic_f("pipe-%s-valid-mode", kmstest_pipe_name(pipe))
- test_flip_to_scaled(&data, index, pipe, output, modetoset);
- break;
- }
- }
- if (!found) {
+ igt_describe("Tests scaler using default and nearest neighbor plane scaling filters");
+ for (int filter = 0; filter < 2; filter++) {
+ for (int index = 0; index < ARRAY_SIZE(flip_scenario_test); index++) {
+ igt_describe(flip_scenario_test[index].describe);
+ igt_require(filter ? data.gen >= 10 : data.gen >= 9);
+ igt_subtest_with_dynamic_f("%s-%s", filter ? "nn" : "default", flip_scenario_test[index].name) {
+ free_fbs(&data);
+ for_each_pipe(&data.display, pipe) {
+ bool found = false;
for_each_valid_output_on_pipe(&data.display, pipe, output) {
- igt_dynamic_f("pipe-%s-default-mode", kmstest_pipe_name(pipe))
- test_flip_to_scaled(&data, index, pipe, output, NULL);
+ modetoset = find_mode(&data, output);
+ if (modetoset) {
+ found = true;
+ igt_dynamic_f("pipe-%s-valid-mode", kmstest_pipe_name(pipe))
+ test_flip_to_scaled(&data, index, pipe, output, modetoset, filter);
+ break;
+ }
+ }
+ if (!found) {
+ for_each_valid_output_on_pipe(&data.display, pipe, output) {
+ igt_dynamic_f("pipe-%s-default-mode", kmstest_pipe_name(pipe))
+ test_flip_to_scaled(&data, index, pipe, output, NULL, filter);
+ }
}
+ break;
}
- break;
}
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/kms_flip_scaled_crc: New tests (rev10)
2022-06-28 18:51 [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests Swati Sharma
` (3 preceding siblings ...)
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: Validate NN scaling filter Swati Sharma
@ 2022-06-28 20:04 ` Patchwork
4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2022-06-28 20:04 UTC (permalink / raw)
To: Swati Sharma; +Cc: igt-dev
== Series Details ==
Series: tests/i915/kms_flip_scaled_crc: New tests (rev10)
URL : https://patchwork.freedesktop.org/series/105148/
State : failure
== Summary ==
IGT patchset build failed on latest successful build
9b9371c8da32533022ad700a7c023b4c3a085fbc tests/i915: adapt __copy_ccs for discrete
297/329 testcase check amdgpu/amd_basic OK 0.18s
298/329 testcase check amdgpu/amd_bypass OK 0.17s
299/329 testcase check amdgpu/amd_cs_nop OK 0.17s
300/329 testcase check amdgpu/amd_hotplug OK 0.16s
301/329 testcase check amdgpu/amd_color OK 0.17s
302/329 testcase check amdgpu/amd_info OK 0.15s
303/329 testcase check amdgpu/amd_prime OK 0.15s
304/329 testcase check amdgpu/amd_max_bpc OK 0.14s
305/329 testcase check amdgpu/amd_module_load OK 0.14s
306/329 testcase check amdgpu/amd_mem_leak OK 0.13s
307/329 testcase check amdgpu/amd_link_settings OK 0.13s
308/329 testcase check amdgpu/amd_vrr_range OK 0.13s
309/329 testcase check amdgpu/amd_mode_switch OK 0.12s
310/329 testcase check amdgpu/amd_dp_dsc OK 0.11s
311/329 testcase check amdgpu/amd_psr OK 0.11s
312/329 testcase check amdgpu/amd_plane OK 0.11s
313/329 testcase check amdgpu/amd_ilr OK 0.10s
314/329 runner_json OK 0.08s
315/329 assembler test/mov OK 0.08s
316/329 assembler test/frc OK 0.07s
317/329 assembler test/regtype OK 0.07s
318/329 assembler test/rndd OK 0.07s
319/329 assembler test/rndu OK 0.05s
320/329 assembler test/rnde OK 0.05s
321/329 assembler test/rnde-intsrc OK 0.05s
322/329 assembler test/rndz OK 0.04s
323/329 assembler test/lzd OK 0.04s
324/329 assembler test/not OK 0.04s
325/329 assembler test/immediate OK 0.03s
326/329 lib igt_nesting OK 2.21s
327/329 lib igt_fork OK 2.64s
328/329 runner OK 4.73s
329/329 testcase check gem_concurrent_all OK 5.51s
Summary of Failures:
282/329 testcase check kms_flip_scaled_crc FAIL 0.38s exit status 1
Ok: 325
Expected Fail: 3
Fail: 1
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /home/cidrm/igt-gpu-tools/build/meson-logs/testlog.txt
FAILED: meson-test
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property Swati Sharma
@ 2022-06-29 12:36 ` Juha-Pekka Heikkila
0 siblings, 0 replies; 8+ messages in thread
From: Juha-Pekka Heikkila @ 2022-06-29 12:36 UTC (permalink / raw)
To: Swati Sharma, igt-dev
On 28.6.2022 21.51, Swati Sharma wrote:
> Added "scaling filter" as pipe and plane property.
>
> v2: -Moved lib changes from 4/4 to 3/4
> -Renaming filter enum
>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
> lib/igt_kms.c | 30 ++++++++++++++++++++++++++++++
> lib/igt_kms.h | 3 +++
> 2 files changed, 33 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index bd606548..fdb13177 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -581,6 +581,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
> [IGT_PLANE_ALPHA] = "alpha",
> [IGT_PLANE_ZPOS] = "zpos",
> [IGT_PLANE_FB_DAMAGE_CLIPS] = "FB_DAMAGE_CLIPS",
> + [IGT_PLANE_SCALING_FILTER] = "SCALING_FILTER",
> };
>
> const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
> @@ -593,6 +594,7 @@ const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
> [IGT_CRTC_ACTIVE] = "ACTIVE",
> [IGT_CRTC_OUT_FENCE_PTR] = "OUT_FENCE_PTR",
> [IGT_CRTC_VRR_ENABLED] = "VRR_ENABLED",
> + [IGT_CRTC_SCALING_FILTER] = "SCALING_FILTER",
> };
>
> const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
> @@ -910,6 +912,28 @@ const char *kmstest_connector_status_str(int status)
> return find_type_name(connector_status_names, status);
> }
>
> +enum scaling_filter {
> + SCALING_FILTER_DEFAULT,
> + SCALING_FILTER_NEAREST_NEIGHBOR,
^^
nit, misalignment with spaces.
> +};
> +
> +static const struct type_name scaling_filter_names[] = {
> + { SCALING_FILTER_DEFAULT, "Default" },
> + { SCALING_FILTER_NEAREST_NEIGHBOR, "Nearest Neighbor" },
> + {}
> +};
> +
> +/**
> + * kmstest_scaling_filter_str:
> + * @filter: SCALING_FILTER_* filter value
> + *
> + * Returns: A string representing the scaling filter @filter.
> + */
> +const char *kmstest_scaling_filter_str(int filter)
> +{
> + return find_type_name(scaling_filter_names, filter);
> +}
> +
> static const struct type_name connector_type_names[] = {
> { DRM_MODE_CONNECTOR_Unknown, "Unknown" },
> { DRM_MODE_CONNECTOR_VGA, "VGA" },
> @@ -2122,6 +2146,9 @@ static void igt_plane_reset(igt_plane_t *plane)
> if (igt_plane_has_prop(plane, IGT_PLANE_FB_DAMAGE_CLIPS))
> igt_plane_set_prop_value(plane, IGT_PLANE_FB_DAMAGE_CLIPS, 0);
>
> + if (igt_plane_has_prop(plane, IGT_PLANE_SCALING_FILTER))
> + igt_plane_set_prop_enum(plane, IGT_PLANE_SCALING_FILTER, "Default");
> +
> igt_plane_clear_prop_changed(plane, IGT_PLANE_IN_FENCE_FD);
> plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
> plane->gem_handle = 0;
> @@ -2142,6 +2169,9 @@ static void igt_pipe_reset(igt_pipe_t *pipe)
> if (igt_pipe_obj_has_prop(pipe, IGT_CRTC_DEGAMMA_LUT))
> igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_DEGAMMA_LUT, 0);
>
> + if (igt_pipe_obj_has_prop(pipe, IGT_CRTC_SCALING_FILTER))
> + igt_pipe_obj_set_prop_enum(pipe, IGT_CRTC_SCALING_FILTER, "Default");
> +
> pipe->out_fence_fd = -1;
> }
>
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 3e674e74..4b67708d 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -107,6 +107,7 @@ enum igt_custom_edid_type {
> const char *kmstest_encoder_type_str(int type);
> const char *kmstest_connector_status_str(int status);
> const char *kmstest_connector_type_str(int type);
> +const char *kmstest_scaling_filter_str(int filter);
>
> void kmstest_dump_mode(drmModeModeInfo *mode);
> #define MAX_HDISPLAY_PER_PIPE 5120
> @@ -126,6 +127,7 @@ enum igt_atomic_crtc_properties {
> IGT_CRTC_ACTIVE,
> IGT_CRTC_OUT_FENCE_PTR,
> IGT_CRTC_VRR_ENABLED,
> + IGT_CRTC_SCALING_FILTER,
> IGT_NUM_CRTC_PROPS
> };
>
> @@ -302,6 +304,7 @@ enum igt_atomic_plane_properties {
> IGT_PLANE_ALPHA,
> IGT_PLANE_ZPOS,
> IGT_PLANE_FB_DAMAGE_CLIPS,
> + IGT_PLANE_SCALING_FILTER,
> IGT_NUM_PLANE_PROPS
> };
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [v5 PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: Validate NN scaling filter
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: Validate NN scaling filter Swati Sharma
@ 2022-06-29 12:37 ` Juha-Pekka Heikkila
0 siblings, 0 replies; 8+ messages in thread
From: Juha-Pekka Heikkila @ 2022-06-29 12:37 UTC (permalink / raw)
To: Swati Sharma, igt-dev; +Cc: Petri Latvala
On 28.6.2022 21.51, Swati Sharma wrote:
> SCALING_FILTER can be used either as plane scaler property
> or CRTC scaler property.
> The value of this property can be one of the following:
> Default:
> Driver's default scaling filter
> Nearest Neighbor:
> Nearest Neighbor scaling filter
> If NN is used for scaling, sharpness is preserved
> whereas if we use default scaling we can see blurriness
> at edges.
>
> v2: -no need to set pipe scaler filter property
> v3: -addition of new lines to improve readability
> -use of SPDX licence placeholder
> -close(data.drm_fd)
> v4: -instead of creating new i-g-t, tweaked kms_flip_scaled_crc
> to validate both default and nn scaling filters
> v5: -removed duplicate block
> -added platform check for nn
>
> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> Cc: Petri Latvala <petri.latvala@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
> tests/i915/kms_flip_scaled_crc.c | 48 ++++++++++++++++++--------------
> 1 file changed, 27 insertions(+), 21 deletions(-)
>
> diff --git a/tests/i915/kms_flip_scaled_crc.c b/tests/i915/kms_flip_scaled_crc.c
> index 88640da2..f241806d 100644
> --- a/tests/i915/kms_flip_scaled_crc.c
> +++ b/tests/i915/kms_flip_scaled_crc.c
> @@ -476,7 +476,7 @@ static void clear_lut(data_t *data, enum pipe pipe)
>
> static void test_flip_to_scaled(data_t *data, uint32_t index,
> enum pipe pipe, igt_output_t *output,
> - drmModeModeInfoPtr modetoset)
> + drmModeModeInfoPtr modetoset, int flags)
> {
> igt_plane_t *primary;
> igt_crc_t small_crc, big_crc;
> @@ -518,6 +518,7 @@ static void test_flip_to_scaled(data_t *data, uint32_t index,
> igt_output_set_pipe(output, pipe);
>
> primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> + igt_skip_on_f(!igt_plane_has_prop(primary, IGT_PLANE_SCALING_FILTER), "Plane scaling filter prop not supported");
> igt_skip_on_f(!igt_plane_has_format_mod(primary, data->small_fb.drm_format, data->small_fb.modifier) ||
> !igt_plane_has_format_mod(primary, data->big_fb.drm_format,
> data->big_fb.modifier), "No requested format/modifier on pipe %s\n", kmstest_pipe_name(pipe));
> @@ -532,6 +533,8 @@ static void test_flip_to_scaled(data_t *data, uint32_t index,
> data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
> INTEL_PIPE_CRC_SOURCE_AUTO);
>
> + igt_plane_set_prop_enum(primary, IGT_PLANE_SCALING_FILTER, kmstest_scaling_filter_str(flags));
> +
> igt_plane_set_position(primary, 0, 0);
> igt_plane_set_fb(primary, &data->small_fb);
> igt_plane_set_size(primary, data->attemptmodewidth,
> @@ -601,7 +604,6 @@ igt_main
> igt_fixture {
> data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> data.gen = intel_display_ver(intel_get_drm_devid(data.drm_fd));
> - igt_require(data.gen >= 9);
> igt_display_require(&data.display, data.drm_fd);
> igt_require(data.display.is_atomic);
> igt_require_pipe_crc(data.drm_fd);
> @@ -616,28 +618,32 @@ igt_main
> }
> }
>
> - for (int index = 0; index < ARRAY_SIZE(flip_scenario_test); index++) {
> - igt_describe(flip_scenario_test[index].describe);
> - igt_subtest_with_dynamic(flip_scenario_test[index].name) {
> - free_fbs(&data);
> - for_each_pipe(&data.display, pipe) {
> - bool found = false;
> - for_each_valid_output_on_pipe(&data.display, pipe, output) {
> - modetoset = find_mode(&data, output);
> - if (modetoset) {
> - found = true;
> - igt_dynamic_f("pipe-%s-valid-mode", kmstest_pipe_name(pipe))
> - test_flip_to_scaled(&data, index, pipe, output, modetoset);
> - break;
> - }
> - }
> - if (!found) {
> + igt_describe("Tests scaler using default and nearest neighbor plane scaling filters");
> + for (int filter = 0; filter < 2; filter++)
I'd still bake these filters into single (dynamic sub-)test if that is
easily workable.
> + for (int index = 0; index < ARRAY_SIZE(flip_scenario_test); index++) {
> + igt_describe(flip_scenario_test[index].describe);
> + igt_require(filter ? data.gen >= 10 : data.gen >= 9);
Above igt_require need to be moved one line below, inside
igt_subtest_with_dynamic_f to fix that "ninja -C build test"
Other than these things patch did look ok to me.
> + igt_subtest_with_dynamic_f("%s-%s", filter ? "nn" : "default", flip_scenario_test[index].name) {
> + free_fbs(&data);
> + for_each_pipe(&data.display, pipe) {
> + bool found = false;
> for_each_valid_output_on_pipe(&data.display, pipe, output) {
> - igt_dynamic_f("pipe-%s-default-mode", kmstest_pipe_name(pipe))
> - test_flip_to_scaled(&data, index, pipe, output, NULL);
> + modetoset = find_mode(&data, output);
> + if (modetoset) {
> + found = true;
> + igt_dynamic_f("pipe-%s-valid-mode", kmstest_pipe_name(pipe))
> + test_flip_to_scaled(&data, index, pipe, output, modetoset, filter);
> + break;
> + }
> + }
> + if (!found) {
> + for_each_valid_output_on_pipe(&data.display, pipe, output) {
> + igt_dynamic_f("pipe-%s-default-mode", kmstest_pipe_name(pipe))
> + test_flip_to_scaled(&data, index, pipe, output, NULL, filter);
> + }
> }
> + break;
> }
> - break;
> }
> }
> }
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-06-29 12:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 18:51 [igt-dev] [v6 PATCH i-g-t 0/4] tests/i915/kms_flip_scaled_crc: New tests Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 1/4] tests/i915/kms_flip_scaled_crc: Convert tests to dynamic Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 2/4] tests/i915/kms_flip_scaled_crc: Add new tests covering modifiers and pixel-formats Swati Sharma
2022-06-28 18:51 ` [igt-dev] [v2 PATCH i-g-t 3/4] lib/igt_kms: Add scaling filter property Swati Sharma
2022-06-29 12:36 ` Juha-Pekka Heikkila
2022-06-28 18:51 ` [igt-dev] [v5 PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: Validate NN scaling filter Swati Sharma
2022-06-29 12:37 ` Juha-Pekka Heikkila
2022-06-28 20:04 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/kms_flip_scaled_crc: New tests (rev10) Patchwork
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.