From 9751fb0b5405bb283f5bd884115465443f5f8608 Mon Sep 17 00:00:00 2001 From: Antony Clince Alex Date: Tue, 29 May 2018 15:29:06 +0530 Subject: gpu: nvgpu: vgpu: Unified CSS VGPU HAL - defined platform agnostic wrapper for mempool mapping and unmapping. - used platform agnositc wrapper for device tree parsing. - modified css_gr_gk20a to include special handling incase of rm-server JIRA: VQRM:3699 Change-Id: I08fd26052edfa1edf45a67be57f7d27c38ad106a Signed-off-by: Antony Clince Alex Reviewed-on: https://git-master.nvidia.com/r/1733576 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c index 764ffe1a..6fd0d330 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c @@ -453,15 +453,24 @@ static int css_gr_create_client_data(struct gk20a *g, u32 perfmon_count, struct gk20a_cs_snapshot_client *cur) { - memset(cur->snapshot, 0, sizeof(*cur->snapshot)); - cur->snapshot->start = sizeof(*cur->snapshot); - /* we should be ensure that can fit all fifo entries here */ - cur->snapshot->end = - CSS_FIFO_ENTRY_CAPACITY(cur->snapshot_size) - * sizeof(struct gk20a_cs_snapshot_fifo_entry) - + sizeof(struct gk20a_cs_snapshot_fifo); - cur->snapshot->get = cur->snapshot->start; - cur->snapshot->put = cur->snapshot->start; + /* + * Special handling in-case of rm-server + * + * client snapshot buffer will not be mapped + * in-case of rm-server its only mapped in + * guest side + */ + if (cur->snapshot) { + memset(cur->snapshot, 0, sizeof(*cur->snapshot)); + cur->snapshot->start = sizeof(*cur->snapshot); + /* we should be ensure that can fit all fifo entries here */ + cur->snapshot->end = + CSS_FIFO_ENTRY_CAPACITY(cur->snapshot_size) + * sizeof(struct gk20a_cs_snapshot_fifo_entry) + + sizeof(struct gk20a_cs_snapshot_fifo); + cur->snapshot->get = cur->snapshot->start; + cur->snapshot->put = cur->snapshot->start; + } cur->perfmon_count = perfmon_count; -- cgit v1.2.2