mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
gpu: nvgpu: gr_priv header cleanup
Remove gr_priv.h from outside gr files. Add hal function in gr.init for get_no_of_sm. This helps to avoid dereferencing gr in couple of files for g->gr->config and avoid gr_priv.h include in those files. Replace nvgpu_gr_config_get_no_of_sm call with g->ops.gr.init.get_no_of_sm for files outside gr unit. Jira NVGPU-3218 Change-Id: I435bb233f70986e31fbfcb900ada3b3bda0bc787 Signed-off-by: Vinod G <vinodg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2109182 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
c272264f54
commit
7581601f80
@@ -704,12 +704,13 @@ static int nvgpu_gpu_ioctl_wait_for_pause(struct gk20a *g,
|
||||
struct nvgpu_warpstate *w_state = NULL;
|
||||
u32 ioctl_size, size, sm_id, no_of_sm;
|
||||
|
||||
no_of_sm = nvgpu_gr_config_get_no_of_sm(g->gr->config);
|
||||
no_of_sm = g->ops.gr.init.get_no_of_sm(g);
|
||||
|
||||
ioctl_size = no_of_sm * sizeof(struct warpstate);
|
||||
ioctl_w_state = nvgpu_kzalloc(g, ioctl_size);
|
||||
if (!ioctl_w_state)
|
||||
if (!ioctl_w_state) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
size = no_of_sm * sizeof(struct nvgpu_warpstate);
|
||||
w_state = nvgpu_kzalloc(g, size);
|
||||
@@ -719,8 +720,9 @@ static int nvgpu_gpu_ioctl_wait_for_pause(struct gk20a *g,
|
||||
}
|
||||
|
||||
err = gk20a_busy(g);
|
||||
if (err)
|
||||
if (err) {
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
nvgpu_mutex_acquire(&g->dbg_sessions_lock);
|
||||
g->ops.gr.wait_for_pause(g, w_state);
|
||||
@@ -807,8 +809,7 @@ static int nvgpu_gpu_ioctl_has_any_exception(
|
||||
static int gk20a_ctrl_get_num_vsms(struct gk20a *g,
|
||||
struct nvgpu_gpu_num_vsms *args)
|
||||
{
|
||||
struct nvgpu_gr *gr = g->gr;
|
||||
args->num_vsms = nvgpu_gr_config_get_no_of_sm(gr->config);
|
||||
args->num_vsms = g->ops.gr.init.get_no_of_sm(g);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -817,7 +818,7 @@ static int gk20a_ctrl_vsm_mapping(struct gk20a *g,
|
||||
{
|
||||
int err = 0;
|
||||
struct nvgpu_gr *gr = g->gr;
|
||||
u32 no_of_sm = nvgpu_gr_config_get_no_of_sm(gr->config);
|
||||
u32 no_of_sm = g->ops.gr.init.get_no_of_sm(g);
|
||||
size_t write_size = no_of_sm *
|
||||
sizeof(struct nvgpu_gpu_vsms_mapping_entry);
|
||||
struct nvgpu_gpu_vsms_mapping_entry *vsms_buf;
|
||||
|
||||
Reference in New Issue
Block a user