gpu: nvgpu: unit: update dummy pes_tpc_mask for better coverage

Update gr_test_config_get_pes_tpc_mask() to return 0x2F when called
for third time.

There are 2 PES in a GPC. So essentially we want to cover below two
cases
1. pes_tpc_count[pes0][gpc0] > pes_tpc_count[pes1][gpc0]
2. pes_tpc_count[pes0][gpc0] < pes_tpc_count[pes1][gpc0]

Also, run gr_test_diff_gpc_skip_mask() before gr_test_diff_pes_tpc_mask()
so that gpc_skip_mask calculation can generate above two cases first.

Jira NVGPU-4778

Change-Id: I1c34bbc36b0e126d34529725b6c45b59b7e66b67
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2277156
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2020-01-09 16:07:15 +05:30
committed by Alex Waterman
parent 7444372237
commit 12bc49a078

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -86,7 +86,7 @@ static u32 gr_test_config_get_pes_tpc_mask(struct gk20a *g,
if (gr_test_config_lits.pes_tpc_mask == 2) {
return 0x1F;
}else if (gr_test_config_lits.pes_tpc_mask == 3) {
return 0;
return 0x2F;
}else if (gr_test_config_lits.pes_tpc_mask > 3) {
return 0xF;
}else {
@@ -483,15 +483,20 @@ int test_gr_config_error_injection(struct unit_module *m,
"gr_test_invalid_gpc_count test failed\n");
}
/* Pass with diff pes_tpc_mask */
err = gr_test_diff_pes_tpc_mask(g);
/* Pass with diff gpc_skip_mask */
err = gr_test_diff_gpc_skip_mask(g);
if (err != 0) {
unit_return_fail(m,
"gr_test_invalid_pes_tpc_mask test failed\n");
}
/* Pass with diff gpc_skip_mask */
err = gr_test_diff_gpc_skip_mask(g);
/*
* Pass with diff pes_tpc_mask.
* Run this after gr_test_diff_gpc_skip_mask() so that this
* test receives appropriate pes_tpc_mask from
* gr_test_config_get_pes_tpc_mask().
*/
err = gr_test_diff_pes_tpc_mask(g);
if (err != 0) {
unit_return_fail(m,
"gr_test_invalid_pes_tpc_mask test failed\n");