gpu: nvgpu: add syncpoint read map

For sync-point read map:
 1. Added nvgpu_mem memory allocator in gk20a struct and
    allocated memory for this in gk20a_finalize_poweron()
    and freed this memory in gk20a_remove().
 2. Added "u64 syncpt_ro_map_gpu_va" in vm_gk20a struct
    for read map in vm.

Added nvgpu_quiesce() in nvgpu_remove() before freeing
syncpoint read map to ensure that nvgpu is idle.

JIRA GPUT19X-2

Change-Id: I7cbfec57f0992682dd833a1b0d92d694bcaf1eb3
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514338
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
seshendra Gadagottu
2017-07-05 22:47:20 -07:00
committed by mobile promotions
parent 017a9f5775
commit a9ce91f910
6 changed files with 36 additions and 4 deletions

View File

@@ -25,6 +25,7 @@
#include <linux/reset.h>
#include <linux/platform/tegra/common.h>
#include <nvgpu/dma.h>
#include <nvgpu/kmem.h>
#include <nvgpu/nvgpu_common.h>
#include <nvgpu/soc.h>
@@ -1026,9 +1027,16 @@ int nvgpu_remove(struct device *dev, struct class *class)
struct gk20a *g = get_gk20a(dev);
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct gk20a_platform *platform = gk20a_get_platform(dev);
int err;
gk20a_dbg_fn("");
err = nvgpu_quiesce(g);
WARN(err, "gpu failed to idle during driver removal");
if (nvgpu_mem_is_valid(&g->syncpt_mem))
nvgpu_dma_free(g, &g->syncpt_mem);
if (platform->has_cde)
gk20a_cde_destroy(l);
@@ -1061,7 +1069,7 @@ int nvgpu_remove(struct device *dev, struct class *class)
gk20a_dbg_fn("removed");
return 0;
return err;
}
static int __exit gk20a_remove(struct platform_device *pdev)