gpu: nvgpu: create sync_fence only if needed
authorDeepak Nibade <dnibade@nvidia.com>
Wed, 7 Oct 2015 10:50:07 +0000 (15:50 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Mon, 7 Dec 2015 21:50:40 +0000 (13:50 -0800)
commit11f492af602ffad048773f1b62fa3d02c8b161e7
tree78dc5acacd9944e4ca0aca814294c017d6841c94
parent7479378ed84ee9e9b4980a44537be994b6baf809
gpu: nvgpu: create sync_fence only if needed

Currently, we create sync_fence (from nvhost_sync_create_fence())
for every submit
But not all submits request for a sync_fence.

Also, nvhost_sync_create_fence() API takes about 1/3rd of the total
submit path.

Hence to optimize, we can allocate sync_fence
only when user explicitly asks for it using
(NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET &&
NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE)

Also, in CDE path from gk20a_prepare_compressible_read(),
we reuse existing fence stored in "state" and that can
result into not returning sync_fence_fd when user asked
for it
Hence, force allocation of sync_fence when job submission
comes from CDE path

Bug 200141116

Change-Id: Ia921701bf0e2432d6b8a5e8b7d91160e7f52db1e
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/818190
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/cde_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_gk20a.h
drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
drivers/gpu/nvgpu/gk20a/fence_gk20a.c
drivers/gpu/nvgpu/gk20a/fence_gk20a.h