Files
linux-nvgpu/drivers/gpu/nvgpu/common/gr/gr_priv.h
Deepak Nibade f8b3d50360 gpu: nvgpu: remove gr_gk20a.ctx_vars struct
gr_gk20a.ctx_vars struct right now stores sizes for golden_image, zcull,
pm_ctxsw, and gfxp_preemption_buffer.
but these sizes should be really owned by respective units and should
be assigned to units as soon as they are queried from FECS

Add new structure to nvgpu_gr_falcon to hold sizes that will be queried
from FECS
struct nvgpu_gr_falcon_query_sizes {
        u32 golden_image_size;
        u32 pm_ctxsw_image_size;
        u32 preempt_image_size;
        u32 zcull_image_size;
};

gr.falcon unit now queries sizes from FECS and fills this structure.
gr.falcon unit also exposes below APIs to query above sizes

u32 nvgpu_gr_falcon_get_golden_image_size(struct nvgpu_gr_falcon *falcon);
u32 nvgpu_gr_falcon_get_pm_ctxsw_image_size(struct nvgpu_gr_falcon *falcon);
u32 nvgpu_gr_falcon_get_preempt_image_size(struct nvgpu_gr_falcon *falcon);
u32 nvgpu_gr_falcon_get_zcull_image_size(struct nvgpu_gr_falcon *falcon);

gr.gr unit now calls into gr.falcon unit to initailize sizes, and then
uses above exposed APIs to set sizes into respective units

vGPU will too fill up struct nvgpu_gr_falcon_query_sizes with all the sizes
and then above APIs will be used to set sizes into respective units

All of above means size variables in gr_gk20a.ctx_vars struct are no more
being referred. Delete them.

Jira NVGPU-3112

Change-Id: I8b8e64ee0840c3bdefabc8ee739e53a30791f2b3
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2103478
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-24 13:34:24 -07:00

97 lines
2.6 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_PRIV_H
#define NVGPU_GR_PRIV_H
#include <nvgpu/types.h>
#include <nvgpu/cond.h>
struct nvgpu_gr_ctx_desc;
struct nvgpu_gr_global_ctx_buffer_desc;
struct nvgpu_gr_obj_ctx_golden_image;
struct nvgpu_gr_config;
struct nvgpu_gr_zbc;
struct nvgpu_gr_hwpm_map;
struct nvgpu_gr_zcull;
struct gk20a_cs_snapshot;
struct gr_channel_map_tlb_entry {
u32 curr_ctx;
u32 chid;
u32 tsgid;
};
struct nvgpu_gr {
struct gk20a *g;
struct nvgpu_cond init_wq;
bool initialized;
u32 num_fbps;
u32 max_fbps_count;
struct nvgpu_gr_global_ctx_buffer_desc *global_ctx_buffer;
struct nvgpu_gr_obj_ctx_golden_image *golden_image;
struct nvgpu_gr_ctx_desc *gr_ctx_desc;
struct nvgpu_gr_config *config;
struct nvgpu_gr_hwpm_map *hwpm_map;
struct nvgpu_gr_zcull *zcull;
struct nvgpu_gr_zbc *zbc;
struct nvgpu_gr_falcon *falcon;
#define GR_CHANNEL_MAP_TLB_SIZE 2U /* must of power of 2 */
struct gr_channel_map_tlb_entry chid_tlb[GR_CHANNEL_MAP_TLB_SIZE];
u32 channel_tlb_flush_index;
struct nvgpu_spinlock ch_tlb_lock;
void (*remove_support)(struct gk20a *g);
bool sw_ready;
u32 fecs_feature_override_ecc_val;
u32 cilp_preempt_pending_chid;
u32 fbp_en_mask;
u32 *fbp_rop_l2_en_mask;
#if defined(CONFIG_GK20A_CYCLE_STATS)
struct nvgpu_mutex cs_lock;
struct gk20a_cs_snapshot *cs_data;
#endif
u32 max_css_buffer_size;
u32 max_ctxsw_ring_buffer_size;
struct nvgpu_mutex ctxsw_disable_mutex;
int ctxsw_disable_count;
};
#endif /* NVGPU_GR_PRIV_H */