Files
linux-nvgpu/drivers/gpu/nvgpu/common/gr/obj_ctx_priv.h
Deepak Nibade 9f55801a15 gpu: nvgpu: move local golden context memory allocation to poweorn
- Separate out local golden context memory allocation from
  nvgpu_gr_global_ctx_init_local_golden_image() into a new function
  nvgpu_gr_global_ctx_alloc_local_golden_image().
- Add a new member local_golden_image_copy to struct
  nvgpu_gr_obj_ctx_golden_image to store copy used for context
  verification.
- Allocate local golden context memory from nvgpu_gr_obj_ctx_init()
  which is called during poweron path.
- Remove memory allocation from nvgpu_gr_obj_ctx_save_golden_ctx().
- Disable test test_gr_obj_ctx_error_injection since it needs rework
  to accomodate the new changes.
- Fix below tests to allocate local golden context memory :
  test_gr_global_ctx_local_ctx_error_injection
  test_gr_setup_alloc_obj_ctx

Bug 3307637

Change-Id: I2f760d524881fd328346838ea9ce0234358f8e51
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2633713
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-12-01 08:44:30 -08:00

67 lines
2.1 KiB
C

/*
* Copyright (c) 2019, 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"),
* 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 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.
*/
#ifndef NVGPU_GR_OBJ_CTX_PRIV_H
#define NVGPU_GR_OBJ_CTX_PRIV_H
#include <nvgpu/types.h>
#include <nvgpu/lock.h>
struct nvgpu_gr_global_ctx_local_golden_image;
/**
* Golden context image descriptor structure.
*
* This structure stores details of the Golden context image.
*/
struct nvgpu_gr_obj_ctx_golden_image {
/**
* Flag to indicate if Golden context image is ready or not.
*/
bool ready;
/**
* Mutex to hold for accesses to Golden context image.
*/
struct nvgpu_mutex ctx_mutex;
/**
* Size of Golden context image.
*/
size_t size;
/**
* Pointer to local Golden context image struct.
*/
struct nvgpu_gr_global_ctx_local_golden_image *local_golden_image;
#ifdef CONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION
/**
* Pointer to local Golden context image struct used for Golden
* context verification.
*/
struct nvgpu_gr_global_ctx_local_golden_image *local_golden_image_copy;
#endif
};
#endif /* NVGPU_GR_OBJ_CTX_PRIV_H */