From 520ff00e870eadc98a50f58ecd514ced53a8612f Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Thu, 19 Mar 2015 21:28:34 +0200 Subject: gpu: nvgpu: Implement compbits mapping Implement NVGPU_AS_IOCTL_GET_BUFFER_COMPBITS_INFO for requesting info on compbits-mappable buffers; and NVGPU_AS_IOCTL_MAP_BUFFER_COMPBITS, which enables mapping compbits to the GPU address space of said buffers. This, subsequently, enables moving comptag swizzling from GPU to CDEH/CDEV formats to userspace. Compbits mapping is conservative and it may map more than what is strictly needed. This is because two reasons: 1) mapping must be done on small page alignment (4kB), and 2) GPU comptags are swizzled all around the aggregate cache line, which means that the whole cache line must be visible even if only some comptag lines are required from it. Cache line size is not necessarily a multiple of the small page size. Bug 200077571 Change-Id: I5ae88fe6b616e5ea37d3bff0dff46c07e9c9267e Signed-off-by: Sami Kiminki Reviewed-on: http://git-master/r/719710 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 470729b7..d3114ecd 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -2016,8 +2016,13 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->max_ltc_per_fbp = g->ops.gr.get_max_ltc_per_fbp(g); gpu->max_lts_per_ltc = g->ops.gr.get_max_lts_per_ltc(g); g->ops.gr.get_rop_l2_en_mask(g); - - gpu->reserved = 0; + gpu->gr_compbit_store_base_hw = g->gr.compbit_store.base_hw; + gpu->gr_gobs_per_comptagline_per_slice = + g->gr.gobs_per_comptagline_per_slice; + gpu->num_ltc = g->ltc_count; + gpu->lts_per_ltc = g->gr.slices_per_ltc; + gpu->cbc_cache_line_size = g->gr.cacheline_size; + gpu->cbc_comptags_per_line = g->gr.comptags_per_cacheline; return 0; } -- cgit v1.2.2