tests/kms_content_protection: Test Refactoring
v6 cover tests/kms_content_protection: Test Refactoring
Series includes patches to:
-Bug Fix in MST subtests
-Cleanup the test
-Convert the test to dynamic
Karthik B S (3):
tests/kms_content_protection: Fix MST subtests tests/kms_content_protection: Test Cleanup tests/kms_content_protection: Convert test to dynamic
tests/kms_content_protection.c | 390 ++++++++++++++++++--------------- 1 file changed, 213 insertions(+), 177 deletions(-)
Signature · 1 line
2.22.0
PATCH v6 1/3 tests/kms_content_protection: Fix MST subtests
Add a modeset before checking output is HDCP capable.
Test currently skips on multidisplay MST config telling no HDCP capable output is found because we're checking if output is HDCP capable before doing a modeset on that output.
Try other pipe/output combo for MST if failure is seen on one, as the test is not dependent on the combination as long as each output has a valid pipe.
--- tests/kms_content_protection.c | 154 ++++++++++++++++----------------- 1 file changed, 77 insertions(+), 77 deletions(-)
tests/kms_content_protection.c +77 -77
@@ -317,91 +317,70 @@ static bool write_srm_as_fw(const __u8 *srm, int len) }static void test_content_protection_on_output (igt_output_t *output, +enum pipe pipe,enum igt_commit_style s,int content_type) {igt_display_t *display = &data.display;igt_plane_t *primary; -enum pipe pipe;bool ret; -for_each_pipe (display, pipe) { -if (!igt_pipe_connector_valid (pipe, output)) -continue ; - -/* -* If previous subtest of connector failed, pipe -* attached to that connector is not released. -* Because of that we have to choose the non -* attached pipe for this subtest. -*/ -if (!igt_pipe_is_free (display, pipe)) -continue ; +test_cp_enable_with_retry (output, s,3 , content_type, false, + false); + +if (data.cp_tests &CP_TYPE_CHANGE ) { +/* Type 1 -> Type 0 */ +test_cp_enable_with_retry (output, s,3 , +HDCP_CONTENT_TYPE_0 , false, + true); +/* Type 0 -> Type 1 */ +test_cp_enable_with_retry (output, s,3 , + content_type, false, + true); + } -modeset_with_fb (pipe, output, s); -test_cp_enable_with_retry (output, s,3 , content_type, false, - false); - -if (data.cp_tests &CP_TYPE_CHANGE ) { -/* Type 1 -> Type 0 */ -test_cp_enable_with_retry (output, s,3 , -HDCP_CONTENT_TYPE_0 , false, - true); -/* Type 0 -> Type 1 */ -test_cp_enable_with_retry (output, s,3 , - content_type, false, - true); - } +if (data.cp_tests &CP_MEI_RELOAD ) { +igt_assert_f (!igt_kmod_unload ("mei_hdcp" ,0 ), +"mei_hdcp unload failed" ); -if (data.cp_tests &CP_MEI_RELOAD ) { -igt_assert_f (!igt_kmod_unload ("mei_hdcp" ,0 ), -"mei_hdcp unload failed" ); +/* Expected to fail */ +test_cp_enable_with_retry (output, s,3 , + content_type, true, false); -/* Expected to fail */ -test_cp_enable_with_retry (output, s,3 , - content_type, true, false); +igt_assert_f (!igt_kmod_load ("mei_hdcp" ,NULL ), +"mei_hdcp load failed" ); -igt_assert_f (!igt_kmod_load ("mei_hdcp" ,NULL ), -"mei_hdcp load failed" ); +/* Expected to pass */ +test_cp_enable_with_retry (output, s,3 , + content_type, false, false); + } -/* Expected to pass */ -test_cp_enable_with_retry (output, s,3 , - content_type, false, false); - } +if (data.cp_tests &CP_LIC ) +test_cp_lic (output); -if (data.cp_tests &CP_LIC ) -test_cp_lic (output); +if (data.cp_tests &CP_DPMS ) { +igt_pipe_set_prop_value (display, pipe, +IGT_CRTC_ACTIVE ,0 ); +igt_display_commit2 (display, s); -if (data.cp_tests &CP_DPMS ) { -igt_pipe_set_prop_value (display, pipe, -IGT_CRTC_ACTIVE ,0 ); -igt_display_commit2 (display, s); +igt_pipe_set_prop_value (display, pipe, +IGT_CRTC_ACTIVE ,1 ); +igt_display_commit2 (display, s); -igt_pipe_set_prop_value (display, pipe, -IGT_CRTC_ACTIVE ,1 ); -igt_display_commit2 (display, s); + ret =wait_for_prop_value (output,CP_ENABLED , +KERNEL_AUTH_TIME_ALLOWED_MSEC ); +if (!ret) +test_cp_enable_with_retry (output, s,2 , + content_type, false, + false); + } - ret =wait_for_prop_value (output,CP_ENABLED , -KERNEL_AUTH_TIME_ALLOWED_MSEC ); -if (!ret) -test_cp_enable_with_retry (output, s,2 , - content_type, false, - false); - } +test_cp_disable (output, s); + primary =igt_output_get_plane_type (output, +DRM_PLANE_TYPE_PRIMARY ); +igt_plane_set_fb (primary,NULL ); +igt_output_set_pipe (output,PIPE_NONE ); -test_cp_disable (output, s); - primary =igt_output_get_plane_type (output, -DRM_PLANE_TYPE_PRIMARY ); -igt_plane_set_fb (primary,NULL ); -igt_output_set_pipe (output,PIPE_NONE ); - -/* -* Testing a output with a pipe is enough for HDCP -* testing. No ROI in testing the connector with other -* pipes. So Break the loop on pipe. -*/ -break ; - } }static void __debugfs_read (int fd,const char *param,char *buf,int len)
@@ -505,16 +484,32 @@ test_content_protection(enum igt_commit_style s, int content_type)igt_display_t *display = &data.display;igt_output_t *output;int valid_tests =0 ; +enum pipe pipe;if (data.cp_tests &CP_MEI_RELOAD )igt_require_f (igt_kmod_is_loaded ("mei_hdcp" ),"mei_hdcp module is not loaded\n" );for_each_connected_output (display, output) { -if (!output_hdcp_capable (output, content_type)) -continue ; +for_each_pipe (display, pipe) { +if (!igt_pipe_connector_valid (pipe, output)) +continue ; + +modeset_with_fb (pipe, output, s); + +if (!output_hdcp_capable (output, content_type)) +continue ; + +test_content_protection_on_output (output, pipe, s, content_type); + +/* +* Testing a output with a pipe is enough for HDCP +* testing. No ROI in testing the connector with other +* pipes. So Break the loop on pipe. +*/ +break ; + } -test_content_protection_on_output (output, s, content_type); valid_tests++; }
@@ -596,6 +591,7 @@ test_content_protection_mst(int content_type)igt_output_t *output;int valid_outputs =0 , dp_mst_outputs =0 , ret, count, max_pipe =0 , i;enum pipe pipe; +bool pipe_found;igt_output_t *mst_output[IGT_MAX_PIPES ], *hdcp_mst_output[IGT_MAX_PIPES ];for_each_pipe (display, pipe)
@@ -607,16 +603,20 @@ test_content_protection_mst(int content_type)if (!output_is_dp_mst (output, dp_mst_outputs))continue ; -igt_assert_f (igt_pipe_connector_valid (pipe, output),"Output-pipe combination invalid\n" ); + pipe_found = false; +for_each_pipe (display, pipe) { +if (igt_pipe_is_free (display, pipe) && +igt_pipe_connector_valid (pipe, output)) { + pipe_found = true; +break ; + } + } + +igt_assert_f (pipe_found,"No valid pipe found for %s\n" , output->name);igt_output_set_pipe (output, pipe);prepare_modeset_on_mst_output (output); mst_output[dp_mst_outputs++] = output; - - pipe++; - -if (pipe > max_pipe) -break ; }igt_require_f (dp_mst_outputs >1 ,"No DP MST set up with >= 2 outputs found in a single topology\n" );
Signature · 1 line
2.22.0
Re: [igt-dev] [PATCH i-g-t v6 1/3] tests/kms_content_protection: Fix MST subtests
Hi Karthik,
Quoted 161 lines · Karthik B S
Add a modeset before checking output is HDCP capable.
Test currently skips on multidisplay MST config telling no HDCP capable output is found because we're checking if output is HDCP capable before doing a modeset on that output.Try other pipe/output combo for MST if failure is seen on one, as the test is not dependent on the combination as long as each output has a valid pipe.
Signed-off-by Karthik B S <[email protected]>Reviewed-by Bhanuprakash Modem <[email protected]>--- tests/kms_content_protection.c | 154 ++++++++++++++++----------------- 1 file changed, 77 insertions(+), 77 deletions(-)tests/kms_content_protection.c +47
-68@@ -317,91 +317,70 @@ static bool write_srm_as_fw(const __u8 *srm, int len) }static void test_content_protection_on_output (igt_output_t *output, +enum pipe pipe,enum igt_commit_style s,int content_type) {igt_display_t *display = &data.display;igt_plane_t *primary; -enum pipe pipe;bool ret; -for_each_pipe (display, pipe) { -if (!igt_pipe_connector_valid (pipe, output)) -continue ; - -/* -* If previous subtest of connector failed, pipe -* attached to that connector is not released. -* Because of that we have to choose the non -* attached pipe for this subtest. -*/ -if (!igt_pipe_is_free (display, pipe)) -continue ; +test_cp_enable_with_retry (output, s,3 , content_type, false, + false); + +if (data.cp_tests &CP_TYPE_CHANGE ) { +/* Type 1 -> Type 0 */ +test_cp_enable_with_retry (output, s,3 , +HDCP_CONTENT_TYPE_0 , false, + true); +/* Type 0 -> Type 1 */ +test_cp_enable_with_retry (output, s,3 , + content_type, false, + true); + } -modeset_with_fb (pipe, output, s); -test_cp_enable_with_retry (output, s,3 , content_type, false, - false); - -if (data.cp_tests &CP_TYPE_CHANGE ) { -/* Type 1 -> Type 0 */ -test_cp_enable_with_retry (output, s,3 , -HDCP_CONTENT_TYPE_0 , false, - true); -/* Type 0 -> Type 1 */ -test_cp_enable_with_retry (output, s,3 , - content_type, false, - true); - } +if (data.cp_tests &CP_MEI_RELOAD ) { +igt_assert_f (!igt_kmod_unload ("mei_hdcp" ,0 ), +"mei_hdcp unload failed" ); -if (data.cp_tests &CP_MEI_RELOAD ) { -igt_assert_f (!igt_kmod_unload ("mei_hdcp" ,0 ), -"mei_hdcp unload failed" ); +/* Expected to fail */ +test_cp_enable_with_retry (output, s,3 , + content_type, true, false); -/* Expected to fail */ -test_cp_enable_with_retry (output, s,3 , - content_type, true, false); +igt_assert_f (!igt_kmod_load ("mei_hdcp" ,NULL ), +"mei_hdcp load failed" ); -igt_assert_f (!igt_kmod_load ("mei_hdcp" ,NULL ), -"mei_hdcp load failed" ); +/* Expected to pass */ +test_cp_enable_with_retry (output, s,3 , + content_type, false, false); + } -/* Expected to pass */ -test_cp_enable_with_retry (output, s,3 , - content_type, false, false); - } +if (data.cp_tests &CP_LIC ) +test_cp_lic (output); -if (data.cp_tests &CP_LIC ) -test_cp_lic (output); +if (data.cp_tests &CP_DPMS ) { +igt_pipe_set_prop_value (display, pipe, +IGT_CRTC_ACTIVE ,0 ); +igt_display_commit2 (display, s); -if (data.cp_tests &CP_DPMS ) { -igt_pipe_set_prop_value (display, pipe, -IGT_CRTC_ACTIVE ,0 ); -igt_display_commit2 (display, s); +igt_pipe_set_prop_value (display, pipe, +IGT_CRTC_ACTIVE ,1 ); +igt_display_commit2 (display, s); -igt_pipe_set_prop_value (display, pipe, -IGT_CRTC_ACTIVE ,1 ); -igt_display_commit2 (display, s); + ret =wait_for_prop_value (output,CP_ENABLED , +KERNEL_AUTH_TIME_ALLOWED_MSEC ); +if (!ret) +test_cp_enable_with_retry (output, s,2 , + content_type, false, + false); + } - ret =wait_for_prop_value (output,CP_ENABLED , -KERNEL_AUTH_TIME_ALLOWED_MSEC ); -if (!ret) -test_cp_enable_with_retry (output, s,2 , - content_type, false, - false); - } +test_cp_disable (output, s); + primary =igt_output_get_plane_type (output, +DRM_PLANE_TYPE_PRIMARY ); +igt_plane_set_fb (primary,NULL ); +igt_output_set_pipe (output,PIPE_NONE ); -test_cp_disable (output, s); - primary =igt_output_get_plane_type (output, -DRM_PLANE_TYPE_PRIMARY ); -igt_plane_set_fb (primary,NULL ); -igt_output_set_pipe (output,PIPE_NONE ); - -/* -* Testing a output with a pipe is enough for HDCP -* testing. No ROI in testing the connector with other -* pipes. So Break the loop on pipe. -*/ -break ; - } }static void __debugfs_read (int fd,const char *param,char *buf,int len)@@ -505,16 +484,32 @@ test_content_protection(enum igt_commit_style s, int content_type)igt_display_t *display = &data.display;igt_output_t *output;
tests/kms_content_protection.c test_content_protection(enum igt_commit_style s, int content_type) · line 515
Quoted 10 lines
tests/kms_content_protection.c +1
-2int valid_tests =0 ; +enum pipe pipe;if (data.cp_tests &CP_MEI_RELOAD )igt_require_f (igt_kmod_is_loaded ("mei_hdcp" ),"mei_hdcp module is not loaded\n" );for_each_connected_output (display, output) { -if (!output_hdcp_capable (output, content_type)) -continue ;
Consider if this check can stay here before for_each_pipe loop, unless modeset_with_fb changes output ?
imho someone from KMS should look into it.
Quoted 11 lines
tests/kms_content_protection.c +11
-0+for_each_pipe (display, pipe) { +if (!igt_pipe_connector_valid (pipe, output)) +continue ; + +modeset_with_fb (pipe, output, s); + +if (!output_hdcp_capable (output, content_type)) +continue ; + +test_content_protection_on_output (output, pipe, s, content_type); +
tests/kms_content_protection.c test_content_protection(enum igt_commit_style s, int content_type) · line 513
Quoted 10 lines
tests/kms_content_protection.c +7
-1+/* +* Testing a output with a pipe is enough for HDCP +* testing. No ROI in testing the connector with other +* pipes. So Break the loop on pipe. +*/ +break ; + } -test_content_protection_on_output (output, s, content_type); valid_tests++;
--------------- ^
This should be moved in this patch, please make all changes correct in the first go.
Regards,
Kamil
Quoted 40 lines
tests/kms_content_protection.c +11
-6}@@ -596,6 +591,7 @@ test_content_protection_mst(int content_type)igt_output_t *output;int valid_outputs =0 , dp_mst_outputs =0 , ret, count, max_pipe =0 , i;enum pipe pipe; +bool pipe_found;igt_output_t *mst_output[IGT_MAX_PIPES ], *hdcp_mst_output[IGT_MAX_PIPES ];for_each_pipe (display, pipe)@@ -607,16 +603,20 @@ test_content_protection_mst(int content_type)if (!output_is_dp_mst (output, dp_mst_outputs))continue ; -igt_assert_f (igt_pipe_connector_valid (pipe, output),"Output-pipe combination invalid\n" ); + pipe_found = false; +for_each_pipe (display, pipe) { +if (igt_pipe_is_free (display, pipe) && +igt_pipe_connector_valid (pipe, output)) { + pipe_found = true; +break ; + } + } + +igt_assert_f (pipe_found,"No valid pipe found for %s\n" , output->name);igt_output_set_pipe (output, pipe);prepare_modeset_on_mst_output (output); mst_output[dp_mst_outputs++] = output; - - pipe++; - -if (pipe > max_pipe) -break ; }igt_require_f (dp_mst_outputs >1 ,"No DP MST set up with >= 2 outputs found in a single topology\n" );Signature · 1 line
2.22.0
Re: [igt-dev] [PATCH i-g-t v6 1/3] tests/kms_content_protection: Fix MST subtests
Quoted 1 line · Kamil Konieczny
Hi Karthik,
Hi Kamil,
Quoted 170 lines · Karthik B S
Quoted 168 lines
Add a modeset before checking output is HDCP capable.
Test currently skips on multidisplay MST config telling no HDCP capable output is found because we're checking if output is HDCP capable before doing a modeset on that output.Try other pipe/output combo for MST if failure is seen on one, as the test is not dependent on the combination as long as each output has a valid pipe.
Signed-off-by Karthik B S <[email protected]>Reviewed-by Bhanuprakash Modem <[email protected]>--- tests/kms_content_protection.c | 154 ++++++++++++++++----------------- 1 file changed, 77 insertions(+), 77 deletions(-)tests/kms_content_protection.c +48
-68@@ -317,91 +317,70 @@ static bool write_srm_as_fw(const __u8 *srm, int len) }static void test_content_protection_on_output (igt_output_t *output, +enum pipe pipe,enum igt_commit_style s,int content_type) {igt_display_t *display = &data.display;igt_plane_t *primary; -enum pipe pipe;bool ret; -for_each_pipe (display, pipe) { -if (!igt_pipe_connector_valid (pipe, output)) -continue ; - -/* -* If previous subtest of connector failed, pipe -* attached to that connector is not released. -* Because of that we have to choose the non -* attached pipe for this subtest. -*/ -if (!igt_pipe_is_free (display, pipe)) -continue ; +test_cp_enable_with_retry (output, s,3 , content_type, false, + false); + +if (data.cp_tests &CP_TYPE_CHANGE ) { +/* Type 1 -> Type 0 */ +test_cp_enable_with_retry (output, s,3 , +HDCP_CONTENT_TYPE_0 , false, + true); +/* Type 0 -> Type 1 */ +test_cp_enable_with_retry (output, s,3 , + content_type, false, + true); + } -modeset_with_fb (pipe, output, s); -test_cp_enable_with_retry (output, s,3 , content_type, false, - false); - -if (data.cp_tests &CP_TYPE_CHANGE ) { -/* Type 1 -> Type 0 */ -test_cp_enable_with_retry (output, s,3 , -HDCP_CONTENT_TYPE_0 , false, - true); -/* Type 0 -> Type 1 */ -test_cp_enable_with_retry (output, s,3 , - content_type, false, - true); - } +if (data.cp_tests &CP_MEI_RELOAD ) { +igt_assert_f (!igt_kmod_unload ("mei_hdcp" ,0 ), +"mei_hdcp unload failed" ); -if (data.cp_tests &CP_MEI_RELOAD ) { -igt_assert_f (!igt_kmod_unload ("mei_hdcp" ,0 ), -"mei_hdcp unload failed" ); +/* Expected to fail */ +test_cp_enable_with_retry (output, s,3 , + content_type, true, false); -/* Expected to fail */ -test_cp_enable_with_retry (output, s,3 , - content_type, true, false); +igt_assert_f (!igt_kmod_load ("mei_hdcp" ,NULL ), +"mei_hdcp load failed" ); -igt_assert_f (!igt_kmod_load ("mei_hdcp" ,NULL ), -"mei_hdcp load failed" ); +/* Expected to pass */ +test_cp_enable_with_retry (output, s,3 , + content_type, false, false); + } -/* Expected to pass */ -test_cp_enable_with_retry (output, s,3 , - content_type, false, false); - } +if (data.cp_tests &CP_LIC ) +test_cp_lic (output); -if (data.cp_tests &CP_LIC ) -test_cp_lic (output); +if (data.cp_tests &CP_DPMS ) { +igt_pipe_set_prop_value (display, pipe, +IGT_CRTC_ACTIVE ,0 ); +igt_display_commit2 (display, s); -if (data.cp_tests &CP_DPMS ) { -igt_pipe_set_prop_value (display, pipe, -IGT_CRTC_ACTIVE ,0 ); -igt_display_commit2 (display, s); +igt_pipe_set_prop_value (display, pipe, +IGT_CRTC_ACTIVE ,1 ); +igt_display_commit2 (display, s); -igt_pipe_set_prop_value (display, pipe, -IGT_CRTC_ACTIVE ,1 ); -igt_display_commit2 (display, s); + ret =wait_for_prop_value (output,CP_ENABLED , +KERNEL_AUTH_TIME_ALLOWED_MSEC ); +if (!ret) +test_cp_enable_with_retry (output, s,2 , + content_type, false, + false); + } - ret =wait_for_prop_value (output,CP_ENABLED , -KERNEL_AUTH_TIME_ALLOWED_MSEC ); -if (!ret) -test_cp_enable_with_retry (output, s,2 , - content_type, false, - false); - } +test_cp_disable (output, s); + primary =igt_output_get_plane_type (output, +DRM_PLANE_TYPE_PRIMARY ); +igt_plane_set_fb (primary,NULL ); +igt_output_set_pipe (output,PIPE_NONE ); -test_cp_disable (output, s); - primary =igt_output_get_plane_type (output, -DRM_PLANE_TYPE_PRIMARY ); -igt_plane_set_fb (primary,NULL ); -igt_output_set_pipe (output,PIPE_NONE ); - -/* -* Testing a output with a pipe is enough for HDCP -* testing. No ROI in testing the connector with other -* pipes. So Break the loop on pipe. -*/ -break ; - } }static void __debugfs_read (int fd,const char *param,char *buf,int len)@@ -505,16 +484,32 @@ test_content_protection(enum igt_commit_style s, int content_type)igt_display_t *display = &data.display;igt_output_t *output;int valid_tests =0 ; +enum pipe pipe;if (data.cp_tests &CP_MEI_RELOAD )igt_require_f (igt_kmod_is_loaded ("mei_hdcp" ),"mei_hdcp module is not loaded\n" );
Quoted 6 lines
tests/kms_content_protection.c test_content_protection(enum igt_commit_style s, int content_type) · line 515
Quoted 3 lines
tests/kms_content_protection.c +0
-2for_each_connected_output (display, output) { -if (!output_hdcp_capable (output, content_type)) -continue ;Consider if this check can stay here before
for_each_pipeloop, unlessmodeset_with_fbchanges output ?
imho someone from KMS should look into it.
Thank you for the review.
modeset_with_fb doesn't change the output, but the issue is we need modeset before checking if output is hdcp capable. Thats why moved this check after modeset_with_fb.
Quoted 20 lines
Quoted 20 lines
tests/kms_content_protection.c +18
-0+for_each_pipe (display, pipe) { +if (!igt_pipe_connector_valid (pipe, output)) +continue ; + +modeset_with_fb (pipe, output, s); + +if (!output_hdcp_capable (output, content_type)) +continue ; + +test_content_protection_on_output (output, pipe, s, content_type); + +/* +* Testing a output with a pipe is enough for HDCP +* testing. No ROI in testing the connector with other +* pipes. So Break the loop on pipe. +*/ +break ; + }
Quoted 5 lines
tests/kms_content_protection.c test_content_protection(enum igt_commit_style s, int content_type) · line 513
Quoted 2 lines
tests/kms_content_protection.c +0
-1-test_content_protection_on_output (output, s, content_type); valid_tests++;--------------- ^
This should be moved in this patch, please make all changes correct in the first go.
Sure, will fix this.
Thanks,Karthik.B.S
Quoted 44 lines
Regards,
KamilQuoted 40 lines
tests/kms_content_protection.c +11
-6}@@ -596,6 +591,7 @@ test_content_protection_mst(int content_type)igt_output_t *output;int valid_outputs =0 , dp_mst_outputs =0 , ret, count, max_pipe =0 , i;enum pipe pipe; +bool pipe_found;igt_output_t *mst_output[IGT_MAX_PIPES ], *hdcp_mst_output[IGT_MAX_PIPES ];for_each_pipe (display, pipe)@@ -607,16 +603,20 @@ test_content_protection_mst(int content_type)if (!output_is_dp_mst (output, dp_mst_outputs))continue ; -igt_assert_f (igt_pipe_connector_valid (pipe, output),"Output-pipe combination invalid\n" ); + pipe_found = false; +for_each_pipe (display, pipe) { +if (igt_pipe_is_free (display, pipe) && +igt_pipe_connector_valid (pipe, output)) { + pipe_found = true; +break ; + } + } + +igt_assert_f (pipe_found,"No valid pipe found for %s\n" , output->name);igt_output_set_pipe (output, pipe);prepare_modeset_on_mst_output (output); mst_output[dp_mst_outputs++] = output; - - pipe++; - -if (pipe > max_pipe) -break ; }igt_require_f (dp_mst_outputs >1 ,"No DP MST set up with >= 2 outputs found in a single topology\n" );Signature · 1 line
2.22.0
PATCH v6 2/3 tests/kms_content_protection: Test Cleanup
In reply to Karthik B SReset display to clean the state before starting the subtest.
Move the clean up part to a separate function so that cleanup code is run even if there is a failure in the subtest. This prepares the test for conversion to dynamic subtests.
Remove redundant mode override as we're anyway overriding with the default mode.
Check if platform is capable of atomic commit before choosing commit style in cleanup function.
--- tests/kms_content_protection.c | 38 +++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 17 deletions(-)
tests/kms_content_protection.c +21 -17
@@ -170,18 +170,15 @@ static void modeset_with_fb(const enum pipe pipe, igt_output_t *output, enum igt_commit_style s) {igt_display_t *display = &data.display; -drmModeModeInfo mode; +drmModeModeInfo *mode;igt_plane_t *primary; -igt_assert (kmstest_get_connector_default_mode ( - display->drm_fd, output->config.connector, &mode)); - -igt_output_override_mode (output, &mode); + mode =igt_output_get_mode (output);igt_output_set_pipe (output, pipe); primary =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY );igt_plane_set_fb (primary, &data.red); -igt_fb_set_size (&data.red, primary, mode.hdisplay, mode.vdisplay); +igt_fb_set_size (&data.red, primary, mode->hdisplay, mode->vdisplay);igt_display_commit2 (display, s);
@@ -322,7 +319,6 @@ static void test_content_protection_on_output(igt_output_t *output, int content_type) {igt_display_t *display = &data.display; -igt_plane_t *primary;bool ret; test_cp_enable_with_retry(output, s, 3, content_type, false,
@@ -374,13 +370,6 @@ static void test_content_protection_on_output(igt_output_t *output, content_type, false, false); } - -test_cp_disable (output, s); - primary =igt_output_get_plane_type (output, -DRM_PLANE_TYPE_PRIMARY ); -igt_plane_set_fb (primary,NULL ); -igt_output_set_pipe (output,PIPE_NONE ); - }static void __debugfs_read (int fd,const char *param,char *buf,int len)
@@ -478,6 +467,19 @@ static bool output_hdcp_capable(igt_output_t *output, int content_type)return true; } +static void +test_fini (igt_output_t *output,enum igt_commit_style s) +{ +igt_plane_t *primary; + +test_cp_disable (output, s); + primary =igt_output_get_plane_type (output, +DRM_PLANE_TYPE_PRIMARY ); +igt_plane_set_fb (primary,NULL ); +igt_output_set_pipe (output,PIPE_NONE ); +igt_display_commit2 (&data.display, s); +} +static void test_content_protection (enum igt_commit_style s,int content_type) {
@@ -495,12 +497,16 @@ test_content_protection(enum igt_commit_style s, int content_type)if (!igt_pipe_connector_valid (pipe, output))continue ; +igt_display_reset (display);modeset_with_fb (pipe, output, s);if (!output_hdcp_capable (output, content_type))continue ;test_content_protection_on_output (output, pipe, s, content_type); +test_fini (output, s); + + valid_tests++;/* * Testing a output with a pipe is enough for HDCP
@@ -509,8 +515,6 @@ test_content_protection(enum igt_commit_style s, int content_type)*/ break ; } - - valid_tests++; }igt_require_f (valid_tests,"No connector found with HDCP capability\n" );
@@ -694,7 +698,7 @@ static void test_content_protection_cleanup(void)continue ;igt_info ("CP Prop being UNDESIRED on %s\n" , output->name); -test_cp_disable (output,COMMIT_ATOMIC ); +test_cp_disable (output, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); }igt_remove_fb (data.drm_fd, &data.red);
Signature · 1 line
2.22.0
PATCH v6 3/3 tests/kms_content_protection: Convert test to dynamic
In reply to Karthik B SCovert the existing subtests to dynamic subtests at pipe/output level.
--- tests/kms_content_protection.c | 218 +++++++++++++++++++-------------- 1 file changed, 125 insertions(+), 93 deletions(-)
tests/kms_content_protection.c +125 -93
@@ -485,13 +485,17 @@ test_content_protection(enum igt_commit_style s, int content_type) {igt_display_t *display = &data.display;igt_output_t *output; -int valid_tests =0 ;enum pipe pipe;if (data.cp_tests &CP_MEI_RELOAD )igt_require_f (igt_kmod_is_loaded ("mei_hdcp" ),"mei_hdcp module is not loaded\n" ); +if (data.cp_tests &CP_UEVENT ) { + data.uevent_monitor =igt_watch_uevents (); +igt_flush_uevents (data.uevent_monitor); + } +for_each_connected_output (display, output) {for_each_pipe (display, pipe) {if (!igt_pipe_connector_valid (pipe, output))
@@ -503,10 +507,10 @@ test_content_protection(enum igt_commit_style s, int content_type)if (!output_hdcp_capable (output, content_type))continue ; -test_content_protection_on_output (output, pipe, s, content_type); -test_fini (output, s); + igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) +test_content_protection_on_output (output, pipe, s, content_type); - valid_tests++; +test_fini (output, s);/* * Testing a output with a pipe is enough for HDCP
@@ -517,7 +521,8 @@ test_content_protection(enum igt_commit_style s, int content_type) } } -igt_require_f (valid_tests,"No connector found with HDCP capability\n" ); +if (data.cp_tests &CP_UEVENT ) +igt_cleanup_uevents (data.uevent_monitor); }static int parse_path_blob (char *blob_data)
@@ -727,6 +732,94 @@ static void create_fbs(void) 0.f, 1.f, 0.f, &data.green); } +static const struct { +const char *desc; +const char *name; +unsigned int cp_tests; +bool content_type; +} subtests[] = { + { .desc ="Test content protection with atomic modesetting" , + .name ="atomic" , + .cp_tests =0 , + .content_type =HDCP_CONTENT_TYPE_0 + }, + { .desc ="Test content protection with DPMS ON/OFF during atomic modesetting." , + .name ="atomic-dpms" , + .cp_tests =CP_DPMS , + .content_type =HDCP_CONTENT_TYPE_0 + }, + { .desc ="Test for the integrity of link." , + .name ="LIC" , + .cp_tests =CP_LIC , + .content_type =HDCP_CONTENT_TYPE_0 , + }, + { .desc ="Test content protection with content type 1 " +"that can be handled only through HDCP2.2." , + .name ="type1" , + .cp_tests =0 , + .content_type =HDCP_CONTENT_TYPE_1 , + }, + { .desc ="Test the teardown and rebuild of the interface between " +"I915 and mei hdcp." , + .name ="mei_interface" , + .cp_tests =CP_MEI_RELOAD , + .content_type =HDCP_CONTENT_TYPE_1 , + }, + { .desc ="Test the content type change when the content protection already enabled" , + .name ="content_type_change" , + .cp_tests =CP_TYPE_CHANGE , + .content_type =HDCP_CONTENT_TYPE_1 , + }, + { .desc ="Test to detect the HDCP status change when we are reading the uevent " +"sent with the corresponding connector id and property id." , + .name ="uevent" , + .cp_tests =CP_UEVENT , + .content_type =HDCP_CONTENT_TYPE_0 , + }, +/* +* Testing the revocation check through SRM needs a HDCP sink with +* programmable Ksvs or we need a uAPI from kernel to read the +* connected HDCP sink's Ksv. With that we would be able to add that +* Ksv into a SRM and send in for revocation check. Since we dont have +* either of these options, we test SRM writing from userspace and +* validation of the same at kernel. Something is better than nothing. +*/ + { .desc ="This test writes the facsimile SRM into the /lib/firmware/ " +"and check the kernel parsing of it by invoking the hdcp authentication." , + .name ="srm" , + .cp_tests =0 , + .content_type =HDCP_CONTENT_TYPE_0 , + }, +}; + +static const struct { +const char *desc; +const char *name; +unsigned int cp_tests; +bool content_type; +} mst_subtests[] = { + { .desc ="Test Content protection(Type 0) over DP MST." , + .name ="dp-mst-type-0" , + .cp_tests =0 , + .content_type =HDCP_CONTENT_TYPE_0 + }, + { .desc ="Test Content protection(Type 0) over DP MST with LIC." , + .name ="dp-mst-lic-type-0" , + .cp_tests =CP_LIC , + .content_type =HDCP_CONTENT_TYPE_0 + }, + { .desc ="Test Content protection(Type 1) over DP MST." , + .name ="dp-mst-type-1" , + .cp_tests =0 , + .content_type =HDCP_CONTENT_TYPE_1 , + }, + { .desc ="Test Content protection(Type 1) over DP MST with LIC." , + .name ="dp-mst-lic-type-1" , + .cp_tests =CP_LIC , + .content_type =HDCP_CONTENT_TYPE_1 , + }, +}; +igt_main { igt_fixture {
@@ -737,107 +830,46 @@ igt_main }igt_describe ("Test content protection with legacy style commit." ); - igt_subtest("legacy") { + igt_subtest_with_dynamic("legacy") { data.cp_tests =0 ;test_content_protection (COMMIT_LEGACY ,HDCP_CONTENT_TYPE_0 ); } -igt_describe ("Test content protection with atomic modesetting" ); - igt_subtest("atomic") { -igt_require (data.display.is_atomic); - data.cp_tests =0 ; -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_0 ); - } + igt_subtest_group { +igt_fixture + igt_require(data.display.is_atomic); -igt_describe ("Test content protection with DPMS ON/OFF during atomic modesetting." ); - igt_subtest("atomic-dpms") { -igt_require (data.display.is_atomic); - data.cp_tests =CP_DPMS ; -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_0 ); - } +for (int i =0 ; i <ARRAY_SIZE (subtests); i++) { +igt_describe_f ("%s" , subtests[i].desc); -igt_describe ("Test for the integrity of link." ); - igt_subtest("LIC") { -igt_require (data.display.is_atomic); - data.cp_tests =CP_LIC ; -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_0 ); - } + igt_subtest_with_dynamic(subtests[i].name) { + data.cp_tests = subtests[i].cp_tests; -igt_describe ("Test content protection with content type 1 that " -"can be handled only through HDCP2.2." ); - igt_subtest("type1") { -igt_require (data.display.is_atomic); -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_1 ); - } +if (!strcmp (subtests[i].name,"srm" )) { +bool ret; -igt_describe ("Test the teardown and rebuild of the interface between " -"I915 and mei hdcp." ); - igt_subtest("mei_interface") { -igt_require (data.display.is_atomic); - data.cp_tests =CP_MEI_RELOAD ; -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_1 ); - } + ret =write_srm_as_fw ((const __u8 *)facsimile_srm, +sizeof (facsimile_srm)); +igt_assert_f (ret,"SRM update failed" ); + } -igt_describe ("Test the content type change when the content protection already " -"enabled." ); - igt_subtest("content_type_change") { -igt_require (data.display.is_atomic); - data.cp_tests =CP_TYPE_CHANGE ; -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_1 ); - } - -igt_describe ("Test to detect the HDCP status change when we are reading the uevent " -"sent with the corresponding connector id and property id." ); - igt_subtest("uevent") { -igt_require (data.display.is_atomic); - data.cp_tests =CP_UEVENT ; - data.uevent_monitor =igt_watch_uevents (); -igt_flush_uevents (data.uevent_monitor); -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_0 ); -igt_cleanup_uevents (data.uevent_monitor); - } - -/* -* Testing the revocation check through SRM needs a HDCP sink with -* programmable Ksvs or we need a uAPI from kernel to read the -* connected HDCP sink's Ksv. With that we would be able to add that -* Ksv into a SRM and send in for revocation check. Since we dont have -* either of these options, we test SRM writing from userspace and -* validation of the same at kernel. Something is better than nothing. -*/ -igt_describe ("This test writes the facsimile SRM into the /lib/firmware/ " -"and check the kernel parsing of it by invoking the hdcp authentication." ); - igt_subtest("srm") { -bool ret; - -igt_require (data.display.is_atomic); - data.cp_tests =0 ; - ret =write_srm_as_fw ((const __u8 *)facsimile_srm, -sizeof (facsimile_srm)); -igt_assert_f (ret,"SRM update failed" ); -test_content_protection (COMMIT_ATOMIC ,HDCP_CONTENT_TYPE_0 ); - } - -igt_describe ("Test Content protection over DP MST" ); - igt_subtest("dp-mst-type-0") { -test_content_protection_mst (HDCP_CONTENT_TYPE_0 ); +test_content_protection (COMMIT_ATOMIC , subtests[i].content_type); + } + } } -igt_describe ("Test Content protection over DP MST with LIC" ); - igt_subtest("dp-mst-lic-type-0") { - data.cp_tests =CP_LIC ; -test_content_protection_mst (HDCP_CONTENT_TYPE_0 ); - } + igt_subtest_group { +igt_fixture + igt_require(data.display.is_atomic); -igt_describe ("Test Content protection over DP MST" ); - igt_subtest("dp-mst-type-1") { -test_content_protection_mst (HDCP_CONTENT_TYPE_1 ); - } +for (int i =0 ; i <ARRAY_SIZE (mst_subtests); i++) { +igt_describe_f ("%s" , mst_subtests[i].desc); -igt_describe ("Test Content protection over DP MST with LIC" ); - igt_subtest("dp-mst-lic-type-1") { - data.cp_tests =CP_LIC ; -test_content_protection_mst (HDCP_CONTENT_TYPE_1 ); + igt_subtest(mst_subtests[i].name) { + data.cp_tests = mst_subtests[i].cp_tests; +test_content_protection_mst (mst_subtests[i].content_type); + } + } } igt_fixture {
Signature · 1 line
2.22.0
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_content_protection: Test Refactoring (rev4)
In reply to Karthik B S== Series Details ==
== Series Details ==
Series: tests/kms_content_protection: Test Refactoring (rev4)
URL : https://patchwork.freedesktop.org/series/108484/
State : failure
== Summary ==
CI Bug Log - changes from IGT_6668 -> IGTPW_7869
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_7869 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_7869, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/index.html
Participating hosts (45 -> 45)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_7869:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@hangcheck:
- fi-snb-2600: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/fi-snb-2600/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-snb-2600/igt@i915_selftest@[email protected]
Known issues
------------
Here are the changes found in IGTPW_7869 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@migrate:
- fi-icl-u2: [PASS][3] -> [INCOMPLETE][4] ([i915#4890])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/fi-icl-u2/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-icl-u2/igt@i915_selftest@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-kefka: [PASS][5] -> [FAIL][6] ([i915#6298])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
* igt@runner@aborted:
- fi-icl-u2: NOTRUN -> [FAIL][7] ([i915#4312])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-icl-u2/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s0@smem:
- {bat-rplp-1}: [DMESG-WARN][8] ([i915#2867]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/bat-rplp-1/igt@gem_exec_suspend@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/bat-rplp-1/igt@gem_exec_suspend@[email protected]
* igt@gem_exec_suspend@basic-s3@smem:
- {bat-adlm-1}: [DMESG-WARN][10] ([i915#2867]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/bat-adlm-1/igt@gem_exec_suspend@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/bat-adlm-1/igt@gem_exec_suspend@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-cfl-8109u: [DMESG-FAIL][12] ([i915#62]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/fi-cfl-8109u/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-cfl-8109u/igt@[email protected]
* igt@i915_selftest@live@late_gt_pm:
- fi-cfl-8109u: [DMESG-WARN][14] ([i915#5904]) -> [PASS][15] +30 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
* igt@i915_suspend@basic-s2idle-without-i915:
- fi-cfl-8109u: [DMESG-WARN][16] ([i915#5904] / [i915#62]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/fi-cfl-8109u/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-cfl-8109u/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-cfl-8109u: [DMESG-WARN][18] ([i915#62]) -> [PASS][19] +11 similar issues
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6668/fi-cfl-8109u/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/fi-cfl-8109u/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4890]: https://gitlab.freedesktop.org/drm/intel/issues/4890
[i915#5904]: https://gitlab.freedesktop.org/drm/intel/issues/5904
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#6503]: https://gitlab.freedesktop.org/drm/intel/issues/6503
[i915#6818]: https://gitlab.freedesktop.org/drm/intel/issues/6818
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6668 -> IGTPW_7869
CI-20190529: 20190529
CI_DRM_12193: 0f0716dcfd8446cde4391475c9c3656ca670b55f @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_7869: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/index.html
IGT_6668: 5f29c9369550164b35b65baaaeba4b370f434cf1 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7869/index.html