From dc5f6bcee0281c5fa63c977519d732218f519ea0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 7 Nov 2017 09:19:53 -0800 Subject: gpu: nvgpu: Return GPU classes in get_litter_value Return GPU classes in HAL get_litter_value() instead of assigning them to GPU characteristics at HAL initialization time. JIRA NVGPU-259 Change-Id: Ife7a5cb38df3d33ce98a1caa43d3873fb1431234 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1593683 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/ce2.c | 5 +++-- drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux') diff --git a/drivers/gpu/nvgpu/common/linux/ce2.c b/drivers/gpu/nvgpu/common/linux/ce2.c index 5127a32b..5f89ef7b 100644 --- a/drivers/gpu/nvgpu/common/linux/ce2.c +++ b/drivers/gpu/nvgpu/common/linux/ce2.c @@ -54,10 +54,10 @@ int gk20a_ce_execute_ops(struct gk20a *g, u32 methodSize; u32 cmd_buf_read_offset; u32 fence_index; + u32 dma_copy_class; struct nvgpu_gpfifo gpfifo; struct nvgpu_fence fence = {0,0}; struct gk20a_fence *ce_cmd_buf_fence_out = NULL; - struct nvgpu_gpu_characteristics *gpu_capability = &g->gpu_characteristics; if (!ce_app->initialised ||ce_app->app_state != NVGPU_CE_ACTIVE) goto end; @@ -124,6 +124,7 @@ int gk20a_ce_execute_ops(struct gk20a *g, cmd_buf_gpu_va = (ce_ctx->cmd_buf_mem.gpu_va + (u64)(cmd_buf_read_offset *sizeof(u32))); + dma_copy_class = g->ops.get_litter_value(g, GPU_LIT_DMA_COPY_CLASS); methodSize = gk20a_ce_prepare_submit(src_buf, dst_buf, size, @@ -132,7 +133,7 @@ int gk20a_ce_execute_ops(struct gk20a *g, payload, gk20a_get_valid_launch_flags(g, launch_flags), request_operation, - gpu_capability->dma_copy_class, + dma_copy_class, gk20a_fence_in); if (methodSize) { diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 83282b87..0481eacf 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -209,6 +209,14 @@ gk20a_ctrl_ioctl_gpu_characteristics( pgpu->impl = g->params.gpu_impl; pgpu->rev = g->params.gpu_rev; pgpu->reg_ops_limit = NVGPU_IOCTL_DBG_REG_OPS_LIMIT; + pgpu->twod_class = g->ops.get_litter_value(g, GPU_LIT_TWOD_CLASS); + pgpu->threed_class = g->ops.get_litter_value(g, GPU_LIT_THREED_CLASS); + pgpu->compute_class = g->ops.get_litter_value(g, GPU_LIT_COMPUTE_CLASS); + pgpu->gpfifo_class = g->ops.get_litter_value(g, GPU_LIT_GPFIFO_CLASS); + pgpu->inline_to_memory_class = + g->ops.get_litter_value(g, GPU_LIT_I2M_CLASS); + pgpu->dma_copy_class = + g->ops.get_litter_value(g, GPU_LIT_DMA_COPY_CLASS); pgpu->vbios_version = g->bios.vbios_version; pgpu->vbios_oem_version = g->bios.vbios_oem_version; -- cgit v1.2.2