From 0130c7ba43253790ef7e6e79c86c14223715f572 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Thu, 17 Aug 2017 10:32:17 -0700 Subject: gpu: nvgpu: vgpu: add num_pce to constants Implement hal gops->ce2.get_num_pce. Jira VFND-3797 Change-Id: Ie4fd3f170f2961ab5ebd1867b83bfda40e57aa2b Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1543020 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/ce2_vgpu.c | 14 +++++++++++++- drivers/gpu/nvgpu/vgpu/vgpu.c | 1 + drivers/gpu/nvgpu/vgpu/vgpu.h | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/vgpu') diff --git a/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c b/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c index f7b06f3b..81035d71 100644 --- a/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c @@ -1,7 +1,7 @@ /* * Virtualized GPU CE2 * - * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -33,3 +33,15 @@ int vgpu_ce2_nonstall_isr(struct gk20a *g, return 0; } + +static u32 vgpu_ce_get_num_pce(struct gk20a *g) +{ + struct vgpu_priv_data *priv = vgpu_get_priv_data(g); + + return priv->constants.num_pce; +} + +void vgpu_init_ce2_ops(struct gpu_ops *gops) +{ + gops->ce2.get_num_pce = vgpu_ce_get_num_pce; +} diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index 8f401ec6..06971bb0 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -440,6 +440,7 @@ void vgpu_init_hal_common(struct gk20a *g) #if defined(CONFIG_GK20A_CYCLE_STATS) vgpu_init_css_ops(gops); #endif + vgpu_init_ce2_ops(gops); gops->chip_init_gpu_characteristics = vgpu_init_gpu_characteristics; gops->bus.read_ptimer = vgpu_read_ptimer; gops->bus.get_timestamps_zipper = vgpu_get_timestamps_zipper; diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h index cee81bb1..c5e57efa 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.h +++ b/drivers/gpu/nvgpu/vgpu/vgpu.h @@ -94,6 +94,7 @@ void vgpu_init_tsg_ops(struct gpu_ops *gops); #if defined(CONFIG_GK20A_CYCLE_STATS) void vgpu_init_css_ops(struct gpu_ops *gops); #endif +void vgpu_init_ce2_ops(struct gpu_ops *gops); int vgpu_init_mm_support(struct gk20a *g); int vgpu_init_gr_support(struct gk20a *g); int vgpu_init_fifo_support(struct gk20a *g); @@ -178,6 +179,9 @@ static inline void vgpu_init_css_ops(struct gpu_ops *gops) { } #endif +static inline void vgpu_init_ce2_ops(struct gpu_ops *gops) +{ +} static inline int vgpu_init_mm_support(struct gk20a *g) { return -ENOSYS; -- cgit v1.2.2