mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: create class unit
Created class unit under hal and moved all valid class check related functionality to this unit. Moved all class defs from gr to a new header include/nvgpu/class.h. Moved following hals from gr to newly created class unit: bool (*is_valid_class)(struct gk20a *g, u32 class_num); --> bool (*is_valid)(u32 class_num); bool (*is_valid_gfx_class)(struct gk20a *g, u32 class_num); --> bool (*is_valid_gfx)(u32 class_num); bool (*is_valid_compute_class)(struct gk20a *g, u32 class_num); --> bool (*is_valid_compute)(u32 class_num); JIRA NVGPU-3109 Change-Id: I01123e9b984613d4bddb2d8cf23d63410e212408 Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2095542 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> 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
c4facdc058
commit
4faeea63aa
@@ -71,7 +71,7 @@ static int nvgpu_gr_obj_ctx_init_ctxsw_preemption_mode(struct gk20a *g,
|
||||
nvgpu_log_fn(g, " ");
|
||||
|
||||
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_PREEMPTION_GFXP)) {
|
||||
if (g->ops.gr.is_valid_compute_class(g, class)) {
|
||||
if (g->ops.class.is_valid_compute(class)) {
|
||||
nvgpu_gr_ctx_init_compute_preemption_mode(gr_ctx,
|
||||
NVGPU_PREEMPTION_MODE_COMPUTE_CTA);
|
||||
}
|
||||
@@ -110,12 +110,12 @@ int nvgpu_gr_obj_ctx_set_ctxsw_preemption_mode(struct gk20a *g,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (g->ops.gr.is_valid_gfx_class(g, class) &&
|
||||
if (g->ops.class.is_valid_gfx(class) &&
|
||||
g->gr.ctx_vars.force_preemption_gfxp) {
|
||||
graphics_preempt_mode = NVGPU_PREEMPTION_MODE_GRAPHICS_GFXP;
|
||||
}
|
||||
|
||||
if (g->ops.gr.is_valid_compute_class(g, class) &&
|
||||
if (g->ops.class.is_valid_compute(class) &&
|
||||
g->gr.ctx_vars.force_preemption_cilp) {
|
||||
compute_preempt_mode = NVGPU_PREEMPTION_MODE_COMPUTE_CILP;
|
||||
}
|
||||
@@ -181,8 +181,8 @@ int nvgpu_gr_obj_ctx_set_ctxsw_preemption_mode(struct gk20a *g,
|
||||
break;
|
||||
}
|
||||
|
||||
if (g->ops.gr.is_valid_compute_class(g, class) ||
|
||||
g->ops.gr.is_valid_gfx_class(g, class)) {
|
||||
if (g->ops.class.is_valid_compute(class) ||
|
||||
g->ops.class.is_valid_gfx(class)) {
|
||||
switch (compute_preempt_mode) {
|
||||
case NVGPU_PREEMPTION_MODE_COMPUTE_WFI:
|
||||
case NVGPU_PREEMPTION_MODE_COMPUTE_CTA:
|
||||
|
||||
Reference in New Issue
Block a user