gpu: nvgpu: Add abstraction layer for NVHost fence

In preparation for adding support for the upstream Host1x driver,
add a layer of abstraction for calling the NVHost fence APIs. This
provides a clean interface for calling the appropriate APIs for either
the downstream NVHost fence APIs or the upstream DMA fence and Host1x
APIs, depending on which is being used.

Change-Id: I055aee3fe5d3af83ebb11126c0a862e17b21f94c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2450244
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2020-11-24 10:21:44 +00:00
committed by Alex Waterman
parent d16259ccc9
commit 18d1b1b536
3 changed files with 66 additions and 13 deletions

View File

@@ -17,8 +17,23 @@
#ifndef __NVGPU_NVHOST_PRIV_H__
#define __NVGPU_NVHOST_PRIV_H__
#include <nvgpu/os_fence_syncpts.h>
struct nvhost_fence;
struct nvgpu_nvhost_dev {
struct platform_device *host1x_pdev;
};
int nvgpu_nvhost_fence_install(struct nvhost_fence *f, int fd);
struct nvhost_fence *nvgpu_nvhost_fence_get(int fd);
void nvgpu_nvhost_fence_put(struct nvhost_fence *f);
void nvgpu_nvhost_fence_dup(struct nvhost_fence *f);
struct nvhost_fence *nvgpu_nvhost_fence_create(struct platform_device *pdev,
struct nvhost_ctrl_sync_fence_info *pts,
u32 num_pts, const char *name);
u32 nvgpu_nvhost_fence_num_pts(struct nvhost_fence *fence);
int nvgpu_nvhost_fence_foreach_pt(struct nvhost_fence *fence,
int (*iter)(struct nvhost_ctrl_sync_fence_info, void *),
void *data);
#endif /* __NVGPU_NVHOST_PRIV_H__ */