From 9d04e970937657d11620d812c29a5d10828440fc Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 9 Nov 2017 15:12:41 -0800 Subject: gpu: nvgpu: Remove separation of t18x code Remove separation of t18x specific code and fields and the associated ifdefs. We can build T18x code in always. Change-Id: I4e8eae9c30335632a2da48b418c6138193831b4f Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1595431 Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c | 37 +++++++++++----------- .../nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c | 1 + 2 files changed, 20 insertions(+), 18 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/vgpu/gp10b') diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c index efc9c595..fe85e113 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c @@ -21,6 +21,7 @@ #include "common/linux/vgpu/vgpu.h" #include "common/linux/vgpu/gm20b/vgpu_gr_gm20b.h" +#include "gp10b/gr_gp10b.h" #include "vgpu_gr_gp10b.h" #include @@ -45,10 +46,10 @@ void vgpu_gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, __nvgpu_vm_free_va(vm, gr_ctx->mem.gpu_va, gmmu_page_size_kernel); - nvgpu_dma_unmap_free(vm, &gr_ctx->t18x.pagepool_ctxsw_buffer); - nvgpu_dma_unmap_free(vm, &gr_ctx->t18x.betacb_ctxsw_buffer); - nvgpu_dma_unmap_free(vm, &gr_ctx->t18x.spill_ctxsw_buffer); - nvgpu_dma_unmap_free(vm, &gr_ctx->t18x.preempt_ctxsw_buffer); + nvgpu_dma_unmap_free(vm, &gr_ctx->pagepool_ctxsw_buffer); + nvgpu_dma_unmap_free(vm, &gr_ctx->betacb_ctxsw_buffer); + nvgpu_dma_unmap_free(vm, &gr_ctx->spill_ctxsw_buffer); + nvgpu_dma_unmap_free(vm, &gr_ctx->preempt_ctxsw_buffer); nvgpu_kfree(g, gr_ctx); } @@ -122,11 +123,11 @@ int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, int err = 0; if (g->ops.gr.is_valid_gfx_class(g, class) && - g->gr.t18x.ctx_vars.force_preemption_gfxp) + 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) && - g->gr.t18x.ctx_vars.force_preemption_cilp) + g->gr.ctx_vars.force_preemption_cilp) compute_preempt_mode = NVGPU_PREEMPTION_MODE_COMPUTE_CILP; /* check for invalid combinations */ @@ -157,54 +158,54 @@ int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, attrib_cb_size = ALIGN(attrib_cb_size, 128); gk20a_dbg_info("gfxp context preempt size=%d", - g->gr.t18x.ctx_vars.preempt_image_size); + g->gr.ctx_vars.preempt_image_size); gk20a_dbg_info("gfxp context spill size=%d", spill_size); gk20a_dbg_info("gfxp context pagepool size=%d", pagepool_size); gk20a_dbg_info("gfxp context attrib cb size=%d", attrib_cb_size); err = gr_gp10b_alloc_buffer(vm, - g->gr.t18x.ctx_vars.preempt_image_size, - &gr_ctx->t18x.preempt_ctxsw_buffer); + g->gr.ctx_vars.preempt_image_size, + &gr_ctx->preempt_ctxsw_buffer); if (err) { err = -ENOMEM; goto fail; } - desc = &gr_ctx->t18x.preempt_ctxsw_buffer; + desc = &gr_ctx->preempt_ctxsw_buffer; p->gpu_va[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_MAIN] = desc->gpu_va; p->size[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_MAIN] = desc->size; err = gr_gp10b_alloc_buffer(vm, spill_size, - &gr_ctx->t18x.spill_ctxsw_buffer); + &gr_ctx->spill_ctxsw_buffer); if (err) { err = -ENOMEM; goto fail; } - desc = &gr_ctx->t18x.spill_ctxsw_buffer; + desc = &gr_ctx->spill_ctxsw_buffer; p->gpu_va[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_SPILL] = desc->gpu_va; p->size[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_SPILL] = desc->size; err = gr_gp10b_alloc_buffer(vm, pagepool_size, - &gr_ctx->t18x.pagepool_ctxsw_buffer); + &gr_ctx->pagepool_ctxsw_buffer); if (err) { err = -ENOMEM; goto fail; } - desc = &gr_ctx->t18x.pagepool_ctxsw_buffer; + desc = &gr_ctx->pagepool_ctxsw_buffer; p->gpu_va[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_PAGEPOOL] = desc->gpu_va; p->size[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_PAGEPOOL] = desc->size; err = gr_gp10b_alloc_buffer(vm, attrib_cb_size, - &gr_ctx->t18x.betacb_ctxsw_buffer); + &gr_ctx->betacb_ctxsw_buffer); if (err) { err = -ENOMEM; goto fail; } - desc = &gr_ctx->t18x.betacb_ctxsw_buffer; + desc = &gr_ctx->betacb_ctxsw_buffer; p->gpu_va[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_BETACB] = desc->gpu_va; p->size[TEGRA_VGPU_GR_BIND_CTXSW_BUFFER_BETACB] = desc->size; @@ -323,9 +324,9 @@ int vgpu_gr_gp10b_init_ctx_state(struct gk20a *g) if (err) return err; - g->gr.t18x.ctx_vars.preempt_image_size = + g->gr.ctx_vars.preempt_image_size = priv->constants.preempt_ctx_size; - if (!g->gr.t18x.ctx_vars.preempt_image_size) + if (!g->gr.ctx_vars.preempt_image_size) return -EINVAL; return 0; diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c index da4ca10c..6806b318 100644 --- a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c @@ -40,6 +40,7 @@ #include "gp10b/ce_gp10b.h" #include "gp10b/fb_gp10b.h" #include "gp10b/pmu_gp10b.h" +#include "gp10b/gr_gp10b.h" #include "gp10b/gr_ctx_gp10b.h" #include "gp10b/fifo_gp10b.h" #include "gp10b/gp10b_gating_reglist.h" -- cgit v1.2.2