mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
Add doxygen documentation for private GR structures defined in: gr/gr_config_priv.h gr/gr_falcon_priv.h gr/gr_intr_priv.h gr/gr_priv.h Remove "p_va" field from struct nvgpu_ctxsw_ucode_info since it is unused. Compile out "pm_ctxsw_image_size" with flag CONFIG_NVGPU_DEBUGGER. Compile out "preempt_image_size" with flag CONFIG_NVGPU_GRAPHICS. Replace eUcodeHandshakeInitComplete enum value by macro FALCON_UCODE_HANDSHAKE_INIT_COMPLETE. And remove enum value eUcodeHandshakeMethodFinished since it is unused. Compile "ctxsw_disable_mutex" and "ctxsw_disable_count" in struct nvgpu_gr only if CONFIG_NVGPU_RECOVERY or CONFIG_NVGPU_DEBUGGER is defined Jira NVGPU-4028 Change-Id: Ie8769c1f3f8d313b479b182d3858a6715d49cd4c Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2201373 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
203 lines
4.9 KiB
C
203 lines
4.9 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_INTR_PRIV_H
|
|
#define NVGPU_GR_INTR_PRIV_H
|
|
|
|
#include <nvgpu/types.h>
|
|
#include <nvgpu/lock.h>
|
|
|
|
struct nvgpu_channel;
|
|
|
|
/**
|
|
* Size of lookup buffer used for context translation to GPU channel
|
|
* and TSG identifiers.
|
|
* This value must be a power of 2.
|
|
*/
|
|
#define GR_CHANNEL_MAP_TLB_SIZE 2U
|
|
|
|
/**
|
|
* GR interrupt information struct.
|
|
*
|
|
* This structure maintains information on pending GR engine interrupts.
|
|
*/
|
|
struct nvgpu_gr_intr_info {
|
|
/**
|
|
* This value is set in case notification interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 notify;
|
|
/**
|
|
* This value is set in case semaphore interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 semaphore;
|
|
/**
|
|
* This value is set in case illegal notify interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 illegal_notify;
|
|
/**
|
|
* This value is set in case illegal method interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 illegal_method;
|
|
/**
|
|
* This value is set in case illegal class interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 illegal_class;
|
|
/**
|
|
* This value is set in case FECS error interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 fecs_error;
|
|
/**
|
|
* This value is set in case illegal class interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 class_error;
|
|
/**
|
|
* This value is set in case firmware method interrupt is pending.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 fw_method;
|
|
/**
|
|
* This value is set in case exception is pending in graphics pipe.
|
|
* Same value is used to clear the interrupt.
|
|
*/
|
|
u32 exception;
|
|
};
|
|
|
|
/**
|
|
* TPC exception data structure.
|
|
*
|
|
* TPC exceptions can be decomposed into exceptions triggered by its
|
|
* subunits. This structure keeps track of which subunits have
|
|
* triggered exception.
|
|
*/
|
|
struct nvgpu_gr_tpc_exception {
|
|
/**
|
|
* This flag is set in case TEX exception is pending.
|
|
*/
|
|
bool tex_exception;
|
|
/**
|
|
* This flag is set in case SM exception is pending.
|
|
*/
|
|
bool sm_exception;
|
|
/**
|
|
* This flag is set in case MPC exception is pending.
|
|
*/
|
|
bool mpc_exception;
|
|
/**
|
|
* This flag is set in case PE exception is pending.
|
|
*/
|
|
bool pe_exception;
|
|
};
|
|
|
|
/**
|
|
* GR ISR data structure.
|
|
*
|
|
* This structure holds all necessary information to handle all GR engine
|
|
* error/exception interrupts.
|
|
*/
|
|
struct nvgpu_gr_isr_data {
|
|
/**
|
|
* Contents of TRAPPED_ADDR register used to decode below
|
|
* fields.
|
|
*/
|
|
u32 addr;
|
|
/**
|
|
* Low word of the trapped method data.
|
|
*/
|
|
u32 data_lo;
|
|
/**
|
|
* High word of the trapped method data.
|
|
*/
|
|
u32 data_hi;
|
|
/**
|
|
* Information of current context.
|
|
*/
|
|
u32 curr_ctx;
|
|
/**
|
|
* Pointer to faulted GPU channel.
|
|
*/
|
|
struct nvgpu_channel *ch;
|
|
/**
|
|
* Address of the trapped method.
|
|
*/
|
|
u32 offset;
|
|
/**
|
|
* Subchannel ID of the trapped method.
|
|
*/
|
|
u32 sub_chan;
|
|
/**
|
|
* Class ID corresponding to above subchannel.
|
|
*/
|
|
u32 class_num;
|
|
};
|
|
|
|
/**
|
|
* Details of lookup buffer used to translate context to GPU
|
|
* channel/TSG identifiers.
|
|
*/
|
|
struct gr_channel_map_tlb_entry {
|
|
/**
|
|
* Information of context.
|
|
*/
|
|
u32 curr_ctx;
|
|
/**
|
|
* GPU channel ID.
|
|
*/
|
|
u32 chid;
|
|
/**
|
|
* GPU Time Slice Group ID.
|
|
*/
|
|
u32 tsgid;
|
|
};
|
|
|
|
/**
|
|
* GR interrupt management data structure.
|
|
*
|
|
* This structure holds various fields to manage GR engine interrupt
|
|
* handling.
|
|
*/
|
|
struct nvgpu_gr_intr {
|
|
/**
|
|
* Lookup buffer structure used to translate context to GPU
|
|
* channel and TSG identifiers.
|
|
*/
|
|
struct gr_channel_map_tlb_entry chid_tlb[GR_CHANNEL_MAP_TLB_SIZE];
|
|
/**
|
|
* Entry in lookup buffer that should be overwritten if there is
|
|
* no remaining free entry.
|
|
*/
|
|
u32 channel_tlb_flush_index;
|
|
/**
|
|
* Spinlock for all lookup buffer accesses.
|
|
*/
|
|
struct nvgpu_spinlock ch_tlb_lock;
|
|
};
|
|
|
|
#endif /* NVGPU_GR_INTR_PRIV_H */
|
|
|