test/kms_dp_dsc: Basic KMS test to validate VESA DSC on DP/eDP
PATCH v2 1/1 test/kms_dp_dsc: Basic KMS test to validate VESA DSC on DP/eDP
This patch adds a basic kms test to validate the display stream compression functionality if supported on DP/eDP connector. Currently this has only two subtests to force the DSC on all the eDP and DP connectors that support it with default parameters. This will be expanded to add more subtests to tweak DSC parameters.
This uses the debugfs nodes added in the patch:
https://patchwork.freedesktop.org/patch/261742/
v2:
* Use IGT wrappers for all (DK, Antonio)
* Split into two subtests for eDP and DP types (Petri)
--- tests/Makefile.sources | 1 + tests/kms_dp_dsc.c | 253 +++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 255 insertions(+) create mode 100644 tests/kms_dp_dsc.c
tests/Makefile.sources +1 -0
@@ -88,6 +88,7 @@ TESTS_progs = \ kms_universal_plane \ kms_vblank \ kms_sequence \ + kms_dp_dsc \ meta_test \ perf \ perf_pmu \
tests/kms_dp_dsc.c new file +253 -0
253 lines not on this page · raw message
tests/meson.build +1 -0
@@ -32,6 +32,7 @@ test_progs = [ 'kms_cursor_crc', 'kms_cursor_legacy', 'kms_draw_crc', + 'kms_dp_dsc', 'kms_fbcon_fbt', 'kms_fence_pin_leak', 'kms_flip',
Signature · 6 lines
2.19.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for test/kms_dp_dsc: Basic KMS test to validate VESA DSC on DP/eDP (rev2)
== Series Details ==
== Series Details ==
Series: test/kms_dp_dsc: Basic KMS test to validate VESA DSC on DP/eDP (rev2)
URL : https://patchwork.freedesktop.org/series/50652/
State : success
== Summary ==
= CI Bug Log - changes from IGT_4723 -> IGTPW_2081 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/50652/revisions/2/mbox/
== Known issues ==
Here are the changes found in IGTPW_2081 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_ctx_create@basic-files:
fi-icl-u2: PASS -> DMESG-WARN (fdo#107724)
==== Possible fixes ====
igt@gem_ctx_switch@basic-default:
fi-icl-u2: DMESG-WARN (fdo#107724) -> PASS
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
fi-byt-clapper: FAIL (fdo#103191, fdo#107362) -> PASS fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
== Participating hosts (52 -> 46) ==
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-icl-u3
== Build changes ==
* IGT: IGT_4723 -> IGTPW_2081
CI_DRM_5174: 0bfa7192170c039a271ebc27222b4b91516e73f6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2081: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2081/
IGT_4723: 53bb24ad410b53cdd96f15ced8fd5921c8ab0eac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Testlist changes ==
+igt@kms_dp_dsc@basic-dsc-enable-dp
+igt@kms_dp_dsc@basic-dsc-enable-edp
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2081/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 277 lines · Manasi Navare
This patch adds a basic kms test to validate the display stream compression functionality if supported on DP/eDP connector. Currently this has only two subtests to force the DSC on all the eDP and DP connectors that support it with default parameters. This will be expanded to add more subtests to tweak DSC parameters.
This uses the debugfs nodes added in the patch:
https://patchwork.freedesktop.org/patch/261742/v2:
* Use IGT wrappers for all (DK, Antonio)
* Split into two subtests for eDP and DP types (Petri)Cc Petri Latvala <[email protected]>Cc Antonio Argenziano <[email protected]>Cc Dhinakaran Pandiyan <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Anusha Srivatsa <[email protected]>Signed-off-by Manasi Navare <[email protected]>--- tests/Makefile.sources | 1 + tests/kms_dp_dsc.c | 253 +++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 255 insertions(+) create mode 100644 tests/kms_dp_dsc.ctests/Makefile.sources +1
-0@@ -88,6 +88,7 @@ TESTS_progs = \ kms_universal_plane \ kms_vblank \ kms_sequence \ + kms_dp_dsc \ meta_test \ perf \ perf_pmu \tests/kms_dp_dsc.c new file +233
-0@@ -0,0 +1,253 @@ +/* +* Copyright © 2018 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +* Displayport Display Stream Compression test +* Until the CRC support is added this needs to be invoked with --interactive +* to manually verify if the test pattern is seen without corruption for each +* subtest. +* +* Authors: +* Manasi Navare <[email protected]> +* +*/ +#include "igt.h" +#include "igt_sysfs.h" +#include <errno.h> +#include <getopt.h> +#include <math.h> +#include <stdint.h> +#include <stdbool.h> +#include <strings.h> +#include <unistd.h> +#include <stdlib.h> +#include <signal.h> +#include <time.h> +#include <fcntl.h> +#include <termios.h> + +enum dsc_test_type +{ + test_basic_dsc_enable +}; + +typedef struct { +int drm_fd; +int debugfs_fd; +uint32_t id; +igt_display_t display; +struct igt_fb fb_test_pattern; +igt_output_t *output; +int mode_valid; +drmModeModeInfo *mode; +drmModeConnector *connector; +drmModeEncoder *encoder; +int crtc; +enum pipe pipe; +int test_conn_cnt; +}data_t ; + +static inline void manual (const char *expected) +{ +igt_debug_manual_check ("all" , expected); +} + +static bool is_dp_dsc_supported (data_t *data,char *test_connector_name) +{ +char file_name[128 ] = {0 }; +char buf[512 ]; + +strcpy (file_name, test_connector_name); +strcat (file_name,"/i915_dsc_support" ); +igt_debugfs_read (data->drm_fd, file_name, buf); + +return strstr (buf,"Supported: yes" ); + +} + +static bool is_dp_dsc_enabled (data_t *data,char *test_connector_name) +{ +char file_name[128 ] = {0 }; +char buf[512 ]; + +strcpy (file_name, test_connector_name); +strcat (file_name,"/i915_dsc_support" ); +igt_debugfs_read (data->drm_fd, file_name, buf); + +return strstr (buf,"Enabled: yes" ); + +} + +static void force_dp_dsc_enable (data_t *data,char *test_connector_name) +{ +char file_name[128 ] = {0 }; +int ret; + +strcpy (file_name, test_connector_name); +strcat (file_name,"/i915_dsc_support" ); +igt_debug ("Forcing DSC enable on %s\n" , test_connector_name); + ret =igt_sysfs_write (data->debugfs_fd, file_name,"1" ,1 ); +igt_assert_f (ret >0 ,"debugfs_write failed" ); +} + +static void clear_dp_dsc_enable (data_t *data,char *test_connector_name) +{ +char file_name[128 ] = {0 }; +int ret; + +strcpy (file_name, test_connector_name); +strcat (file_name,"/i915_dsc_support" ); +igt_debug ("Clearing DSC enable on %s\n" , test_connector_name); + ret =igt_sysfs_write (data->debugfs_fd, file_name,"0" ,1 ); +igt_assert_f (ret >0 ,"debugfs_write failed" ); +} + +static void test_cleanup (data_t *data) { +igt_plane_t *primary; + + primary =igt_output_get_plane_type (data->output, +DRM_PLANE_TYPE_PRIMARY ); +igt_plane_set_fb (primary,NULL ); +igt_display_commit (&data->display); + +igt_remove_fb (data->drm_fd, &data->fb_test_pattern); +} + + +/* +* Re-probe connectors and do a modeset with DSC +* +*/ +static void update_display (data_t *data,enum dsc_test_type test_type) +{ +igt_plane_t *primary; +char conn_buf[128 ]; + data->mode =igt_output_get_mode (data->output); + data->connector = data->output->config.connector; + +sprintf (conn_buf,"%s-%d" , +kmstest_connector_type_str (data->connector->connector_type), + data->test_conn_cnt); +if (!is_dp_dsc_supported (data, conn_buf)) { +igt_debug ("DSC not supported on connector %s on %s\n" , + conn_buf, +kmstest_pipe_name (data->pipe)); +return ; + } + +if (test_type == test_basic_dsc_enable) { +igt_debug ("DSC is supported on %s\n" , + conn_buf); +force_dp_dsc_enable (data, conn_buf); +igt_create_pattern_fb (data->drm_fd, data->mode->hdisplay, + data->mode->vdisplay, +DRM_FORMAT_XRGB8888 , +LOCAL_DRM_FORMAT_MOD_NONE , + &data->fb_test_pattern); + primary =igt_output_get_plane_type (data->output, +DRM_PLANE_TYPE_PRIMARY ); +igt_plane_set_fb (primary, &data->fb_test_pattern); +igt_display_commit (&data->display); +/* Until we have CRC check support, manually check if RGB test pattern has no corruption */ +manual ("RGB test pattern without corruption" ); +igt_assert_f (is_dp_dsc_enabled (data, conn_buf), +"Default DSC enable failed on Connector: %s Pipe: %s" , + conn_buf, +kmstest_pipe_name (data->pipe)); +clear_dp_dsc_enable (data, conn_buf); + } + +} + +static void run_test (data_t *data,igt_output_t *output, +enum dsc_test_type test_type) +{ +enum pipe pipe; + +for_each_pipe_with_valid_output (&data->display, pipe, output) { +igt_output_set_pipe (output, pipe); + data->pipe = pipe; + data->output = output; +update_display (data, test_basic_dsc_enable); + } +} + +igt_main +{ +data_t data = {}; +igt_output_t *output; +drmModeRes *res; +drmModeConnector *connector; +int i, test_conn_cnt, devid; + + igt_fixture { +igt_skip_on_simulation (); + data.drm_fd =drm_open_driver_master (DRIVER_ANY ); + data.debugfs_fd =igt_debugfs_dir (data.drm_fd); + devid =intel_get_drm_devid (data.drm_fd); +igt_require (AT_LEAST_GEN (devid,10 )); +kmstest_set_vt_graphics_mode (); +igt_display_init (&data.display, data.drm_fd); +igt_display_require_output (&data.display); +igt_require (res =drmModeGetResources (data.drm_fd)); + } + + igt_subtest("basic-dsc-enable-eDP") { + test_conn_cnt =0 ; +for (i =0 ; i < res->count_connectors; i++) { + connector =drmModeGetConnectorCurrent (data.drm_fd, + res->connectors[i]); +if (connector->connection !=DRM_MODE_CONNECTED || + connector->connector_type != DRM_MODE_CONNECTOR_eDP) +continue ; + data.test_conn_cnt = ++test_conn_cnt; + output =igt_output_from_connector (&data.display, connector); +run_test (&data, output, test_basic_dsc_enable); + } +test_cleanup (&data); +igt_skip_on (test_conn_cnt ==0 ); + } + + igt_subtest("basic-dsc-enable-DP") { + test_conn_cnt =0 ; +for (i =0 ; i < res->count_connectors; i++) { + connector =drmModeGetConnectorCurrent (data.drm_fd, + res->connectors[i]);
tests/kms_dp_dsc.c line 243
Quoted 10 lines
tests/kms_dp_dsc.c new file +10
-0+if (connector->connection !=DRM_MODE_CONNECTED || + connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) +continue ; + data.test_conn_cnt = test_conn_cnt++; + output =igt_output_from_connector (&data.display, connector); +run_test (&data, output, test_basic_dsc_enable); + } +test_cleanup (&data); +igt_skip_on (test_conn_cnt ==0 ); + }
Refactor this duplication a bit.
A for loop over an array of (name, type) and
igt_subtest_f("basic-dsc-enable-%s", name) {
...
if (connector->connector_type != type)
...
}
The name and connector type are two out of the three differences in the subtest code that I can spot, and I can't see a reason for the third.
Signature · 5 lines
Petri Latvala _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for test/kms_dp_dsc: Basic KMS test to validate VESA DSC on DP/eDP (rev2)
In reply to Manasi Navare== Series Details ==
== Series Details ==
Series: test/kms_dp_dsc: Basic KMS test to validate VESA DSC on DP/eDP (rev2)
URL : https://patchwork.freedesktop.org/series/50652/
State : success
== Summary ==
= CI Bug Log - changes from IGT_4723_full -> IGTPW_2081_full =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/50652/revisions/2/mbox/
== Known issues ==
Here are the changes found in IGTPW_2081_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_available_modes_crc@available_mode_test_crc:
shard-apl: PASS -> FAIL (fdo#106641)
igt@kms_busy@extended-modeset-hang-newfb-render-a:
shard-hsw: PASS -> DMESG-WARN (fdo#107956)
igt@kms_color@pipe-b-legacy-gamma:
shard-apl: PASS -> FAIL (fdo#104782)
igt@kms_color@pipe-c-ctm-max:
shard-apl: PASS -> FAIL (fdo#108147)
igt@kms_cursor_crc@cursor-64x21-onscreen:
shard-kbl: PASS -> FAIL (fdo#103232) +2
igt@kms_cursor_crc@cursor-64x21-sliding:
shard-apl: PASS -> FAIL (fdo#103232) +4
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
shard-glk: PASS -> FAIL (fdo#103167) +1
shard-apl: PASS -> FAIL (fdo#103167) +2
shard-kbl: PASS -> FAIL (fdo#103167)
igt@kms_plane@plane-position-covered-pipe-c-planes:
shard-apl: PASS -> FAIL (fdo#103166) +1
igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
shard-kbl: PASS -> FAIL (fdo#103166)
igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
shard-glk: PASS -> FAIL (fdo#103166) +2
==== Possible fixes ====
igt@gem_exec_suspend@basic:
shard-snb: INCOMPLETE (fdo#105411, fdo#107469) -> PASS
igt@kms_cursor_crc@cursor-64x64-sliding:
shard-glk: FAIL (fdo#103232) -> PASS +2
shard-apl: FAIL (fdo#103232) -> PASS
shard-kbl: FAIL (fdo#103232) -> PASS
igt@kms_cursor_legacy@cursora-vs-flipa-toggle:
shard-glk: DMESG-WARN (fdo#105763, fdo#106538) -> PASS
igt@kms_draw_crc@draw-method-rgb565-blt-ytiled:
shard-glk: FAIL (fdo#103184) -> PASS
igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
shard-glk: FAIL (fdo#105363) -> PASS
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-apl: FAIL (fdo#102887, fdo#105363) -> PASS
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
shard-glk: FAIL (fdo#103167) -> PASS +5
igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
shard-glk: FAIL (fdo#103166) -> PASS +1
shard-apl: FAIL (fdo#103166) -> PASS +3
igt@kms_setmode@basic:
shard-apl: FAIL (fdo#99912) -> PASS
shard-kbl: FAIL (fdo#99912) -> PASS fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
fdo#107469 https://bugs.freedesktop.org/show_bug.cgi?id=107469
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (7 -> 5) ==
Missing (2): shard-skl shard-iclb
== Build changes ==
* IGT: IGT_4723 -> IGTPW_2081
CI_DRM_5174: 0bfa7192170c039a271ebc27222b4b91516e73f6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2081: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2081/
IGT_4723: 53bb24ad410b53cdd96f15ced8fd5921c8ab0eac @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2081/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev