From e4c9ab22f578ac6422299e6513028406485872a0 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 17 Jan 2020 17:37:11 +0530 Subject: [PATCH] gpu: nvgpu: unit: mark boundary value tests for common.gr Add "Boundary value" to test type for below tests: test_gr_setup_alloc_obj_ctx_error_injections test_gr_setup_preemption_mode_errors Also add a test to verify passing graphics class to alloc_obj_ctx HAL fails. Jira NVGPU-4843 Change-Id: I0c256c2fcff98e81bfdcf80c6e0edb66d3831c31 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2279973 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- userspace/units/gr/setup/nvgpu-gr-setup.c | 9 ++++++++- userspace/units/gr/setup/nvgpu-gr-setup.h | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/userspace/units/gr/setup/nvgpu-gr-setup.c b/userspace/units/gr/setup/nvgpu-gr-setup.c index ee9f2ccf2..c530b148e 100644 --- a/userspace/units/gr/setup/nvgpu-gr-setup.c +++ b/userspace/units/gr/setup/nvgpu-gr-setup.c @@ -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"), @@ -399,6 +399,13 @@ static int gr_setup_fail_alloc(struct unit_module *m, struct gk20a *g) goto obj_ctx_fail_end; } + /* SUBTEST-4 for graphics class num */ + err = g->ops.gr.setup.alloc_obj_ctx(gr_setup_ch, 0xC397U, 0); + if (err == 0) { + unit_err(m, "setup alloc SUBTEST-4 failed\n"); + goto obj_ctx_fail_end; + } + obj_ctx_fail_end: return (err != 0) ? UNIT_SUCCESS: UNIT_FAIL; } diff --git a/userspace/units/gr/setup/nvgpu-gr-setup.h b/userspace/units/gr/setup/nvgpu-gr-setup.h index a45dbb003..006177a2e 100644 --- a/userspace/units/gr/setup/nvgpu-gr-setup.h +++ b/userspace/units/gr/setup/nvgpu-gr-setup.h @@ -121,7 +121,7 @@ int test_gr_setup_free_obj_ctx(struct unit_module *m, * Description: Helps to verify error paths in * g->ops.gr.setup.set_preemption_mode call. * - * Test Type: Error injection + * Test Type: Error injection, Boundary values * * Targets: #nvgpu_gr_setup_set_preemption_mode, * #nvgpu_gr_obj_ctx_set_ctxsw_preemption_mode. @@ -147,7 +147,7 @@ int test_gr_setup_preemption_mode_errors(struct unit_module *m, * Description: Helps to verify error paths in * g->ops.gr.setup.alloc_obj_ctx call. * - * Test Type: Error injection + * Test Type: Error injection, Boundary values * * Targets: #nvgpu_gr_setup_alloc_obj_ctx, * #nvgpu_gr_subctx_alloc, #nvgpu_gr_obj_ctx_alloc,