diff --git a/drivers/gpu/nvgpu/os/linux/nvhost.c b/drivers/gpu/nvgpu/os/linux/nvhost.c index 853bf8cef..ac56fd6b6 100644 --- a/drivers/gpu/nvgpu/os/linux/nvhost.c +++ b/drivers/gpu/nvgpu/os/linux/nvhost.c @@ -183,3 +183,42 @@ u32 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(struct gk20a *g, { return nvhost_syncpt_unit_interface_get_byte_offset(syncpt_id); } + +int nvgpu_nvhost_fence_install(struct nvhost_fence *fence, int fd) +{ + return nvhost_fence_install(fence, fd); +} + +struct nvhost_fence *nvgpu_nvhost_fence_get(int fd) +{ + return nvhost_fence_get(fd); +} + +void nvgpu_nvhost_fence_put(struct nvhost_fence *fence) +{ + nvhost_fence_put(fence); +} + +void nvgpu_nvhost_fence_dup(struct nvhost_fence *fence) +{ + nvhost_fence_dup(fence); +} + +struct nvhost_fence *nvgpu_nvhost_fence_create(struct platform_device *pdev, + struct nvhost_ctrl_sync_fence_info *pts, + u32 num_pts, const char *name) +{ + return nvhost_fence_create(pdev, pts, num_pts, name); +} + +u32 nvgpu_nvhost_fence_num_pts(struct nvhost_fence *fence) +{ + return nvhost_fence_num_pts(fence); +} + +int nvgpu_nvhost_fence_foreach_pt(struct nvhost_fence *fence, + int (*iter)(struct nvhost_ctrl_sync_fence_info, void *), + void *data) +{ + return nvhost_fence_foreach_pt(fence, iter, data); +} diff --git a/drivers/gpu/nvgpu/os/linux/nvhost_priv.h b/drivers/gpu/nvgpu/os/linux/nvhost_priv.h index c03390a7d..2a470758b 100644 --- a/drivers/gpu/nvgpu/os/linux/nvhost_priv.h +++ b/drivers/gpu/nvgpu/os/linux/nvhost_priv.h @@ -17,8 +17,23 @@ #ifndef __NVGPU_NVHOST_PRIV_H__ #define __NVGPU_NVHOST_PRIV_H__ +#include + +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__ */ diff --git a/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c b/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c index 10e5544aa..fc04704c6 100644 --- a/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c +++ b/drivers/gpu/nvgpu/os/linux/os_fence_syncpt.c @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -35,18 +34,18 @@ static int nvgpu_os_fence_syncpt_install_fd(struct nvgpu_os_fence *s, int fd) { - return nvhost_fence_install(s->priv, fd); + return nvgpu_nvhost_fence_install(s->priv, fd); } static void nvgpu_os_fence_syncpt_drop_ref(struct nvgpu_os_fence *s) { - nvhost_fence_put(s->priv); + nvgpu_nvhost_fence_put(s->priv); nvgpu_os_fence_clear(s); } static void nvgpu_os_fence_syncpt_dup(struct nvgpu_os_fence *s) { - nvhost_fence_dup(s->priv); + nvgpu_nvhost_fence_dup(s->priv); } static const struct nvgpu_os_fence_ops syncpt_ops = { @@ -63,9 +62,10 @@ int nvgpu_os_fence_syncpt_create(struct nvgpu_os_fence *fence_out, .id = id, .thresh = thresh, }; - struct nvhost_fence *fence = nvhost_fence_create( - nvhost_device->host1x_pdev, &pt, 1, "fence"); + struct nvhost_fence *fence; + fence = nvgpu_nvhost_fence_create(nvhost_device->host1x_pdev, &pt, 1, + "fence"); if (IS_ERR(fence)) { nvgpu_err(c->g, "error %d during construction of fence.", (int)PTR_ERR(fence)); @@ -80,7 +80,7 @@ int nvgpu_os_fence_syncpt_create(struct nvgpu_os_fence *fence_out, int nvgpu_os_fence_syncpt_fdget(struct nvgpu_os_fence *fence_out, struct nvgpu_channel *c, int fd) { - struct nvhost_fence *fence = nvhost_fence_get(fd); + struct nvhost_fence *fence = nvgpu_nvhost_fence_get(fd); if (fence == NULL) { return -ENOMEM; @@ -107,13 +107,12 @@ int nvgpu_os_fence_get_syncpts( u32 nvgpu_os_fence_syncpt_get_num_syncpoints( struct nvgpu_os_fence_syncpt *fence) { - return nvhost_fence_num_pts(fence->fence->priv); + return nvgpu_nvhost_fence_num_pts(fence->fence->priv); } -int nvgpu_os_fence_syncpt_foreach_pt( - struct nvgpu_os_fence_syncpt *fence, - int (*iter)(struct nvhost_ctrl_sync_fence_info, void *), - void *data) +int nvgpu_os_fence_syncpt_foreach_pt(struct nvgpu_os_fence_syncpt *fence, + int (*iter)(struct nvhost_ctrl_sync_fence_info, void *), + void *data) { - return nvhost_fence_foreach_pt(fence->fence->priv, iter, data); + return nvgpu_nvhost_fence_foreach_pt(fence->fence->priv, iter, data); }