mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +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
@@ -45,7 +45,6 @@
|
||||
/* Access gr_gk20a_suspend_context and gr_gk20a_resume_context functions */
|
||||
#include "hal/gr/gr/gr_gk20a.h"
|
||||
|
||||
#include "common/gr/gr_priv.h"
|
||||
#include "os_linux.h"
|
||||
#include "platform_gk20a.h"
|
||||
#include "ioctl_dbg.h"
|
||||
@@ -269,7 +268,6 @@ static int nvgpu_dbg_gpu_ioctl_read_single_sm_error_state(
|
||||
struct nvgpu_dbg_gpu_read_single_sm_error_state_args *args)
|
||||
{
|
||||
struct gk20a *g = dbg_s->g;
|
||||
struct nvgpu_gr *gr = g->gr;
|
||||
struct nvgpu_tsg_sm_error_state *sm_error_state;
|
||||
struct nvgpu_dbg_gpu_sm_error_state_record sm_error_state_record;
|
||||
struct channel_gk20a *ch;
|
||||
@@ -289,7 +287,7 @@ static int nvgpu_dbg_gpu_ioctl_read_single_sm_error_state(
|
||||
}
|
||||
|
||||
sm_id = args->sm_id;
|
||||
if (sm_id >= nvgpu_gr_config_get_no_of_sm(gr->config)) {
|
||||
if (sm_id >= g->ops.gr.init.get_no_of_sm(g)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1454,7 +1452,6 @@ static int nvgpu_dbg_gpu_ioctl_clear_single_sm_error_state(
|
||||
struct nvgpu_dbg_gpu_clear_single_sm_error_state_args *args)
|
||||
{
|
||||
struct gk20a *g = dbg_s->g;
|
||||
struct nvgpu_gr *gr = g->gr;
|
||||
u32 sm_id;
|
||||
struct channel_gk20a *ch;
|
||||
int err = 0;
|
||||
@@ -1465,8 +1462,9 @@ static int nvgpu_dbg_gpu_ioctl_clear_single_sm_error_state(
|
||||
}
|
||||
|
||||
sm_id = args->sm_id;
|
||||
if (sm_id >= nvgpu_gr_config_get_no_of_sm(gr->config))
|
||||
if (sm_id >= g->ops.gr.init.get_no_of_sm(g)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nvgpu_speculation_barrier();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user