From 4dfd6e43cfe303c8b23421ef32738db2ee52e291 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Wed, 18 Apr 2018 11:03:02 +0530 Subject: gpu: nvgpu: create a wrapper over sync_fences This patch constructs an abstraction to hide the sync_fence functionality from the common code. struct nvgpu_os_fence acts as an abstraction for struct sync_fence. struct nvgpu_os_fence consists of an ops structure named nvgpu_os_fence_ops which contains an API to do pushbuffer programming to generate wait commands for the fence. The current implementation of nvgpu only allows for wait method on a sync_fence which was generated using a similar backend(i.e. either Nvhost Syncpoints or Semaphores). In this patch, a generic API is introduced which will decide the type of the underlying implementation of the struct nvgpu_os_fence at runtime and run the corresponding wait implementation on it. This patch changes the channel_sync_gk20a's semaphore specific implementation to use the abstract API. A subsequent patch will make the changes for the nvhost_syncpoint based implementations as well. JIRA NVGPU-66 Change-Id: If6675bfde5885c3d15d2ca380bb6c7c0e240e734 Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/1667218 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/Makefile') diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 32166f31..9a46f12c 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -160,7 +160,9 @@ nvgpu-$(CONFIG_TEGRA_GK20A) += \ common/linux/platform_gp10b_tegra.o \ common/linux/platform_gv11b_tegra.o -nvgpu-$(CONFIG_SYNC) += gk20a/sync_gk20a.o +nvgpu-$(CONFIG_SYNC) += gk20a/sync_gk20a.o \ + common/linux/os_fence_android.o \ + common/linux/os_fence_android_sema.o nvgpu-$(CONFIG_GK20A_PCI) += common/linux/pci.o \ common/linux/pci_usermode.o \ -- cgit v1.2.2