gpu: nvgpu: allocate separate client managed syncpoint for User

We right now allocate a nvgpu managed syncpoint in c->sync and share
that with user space

But to avoid conflicts between user space and kernel space increments
allocate a separate "client managed" syncpoint for User space in c->user_sync

Add new API nvgpu_nvhost_get_syncpt_client_managed() to request a client managed
syncpoint from nvhost.
Note that nvhost/nvgpu do not keep track of MAX/threshold value of this syncpoint

Update gk20a_channel_syncpt_create() to receive a flag to indicate whether a
User space syncpoint is required or not

Unset NVGPU_SUPPORT_USER_SYNCPOINT for gp10b since we don't want to allocate
double syncpoints per channel on that platform

For gv11b, once we move to use user space submits, support for c->sync will be
dropped so we keep using only one syncpoint per channel

Bug 200326065
Jira NVGPU-179

Change-Id: I78d94de4276db1c897ea2a4fe4c2db8b2a179722
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1665828
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2018-02-28 03:56:36 -08:00
committed by mobile promotions
parent aa1da74a75
commit df2100018d
9 changed files with 41 additions and 17 deletions

View File

@@ -444,7 +444,7 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c,
if (g->aggressive_sync_destroy_thresh) {
nvgpu_mutex_acquire(&c->sync_lock);
if (!c->sync) {
c->sync = gk20a_channel_sync_create(c);
c->sync = gk20a_channel_sync_create(c, false);
if (!c->sync) {
err = -ENOMEM;
nvgpu_mutex_release(&c->sync_lock);

View File

@@ -972,11 +972,11 @@ static int nvgpu_ioctl_channel_get_user_syncpoint(struct channel_gk20a *ch,
}
nvgpu_mutex_acquire(&ch->sync_lock);
if (ch->sync) {
if (ch->user_sync) {
nvgpu_mutex_release(&ch->sync_lock);
} else {
ch->sync = gk20a_channel_sync_create(ch);
if (!ch->sync) {
ch->user_sync = gk20a_channel_sync_create(ch, true);
if (!ch->user_sync) {
nvgpu_mutex_release(&ch->sync_lock);
return -ENOMEM;
}
@@ -989,11 +989,11 @@ static int nvgpu_ioctl_channel_get_user_syncpoint(struct channel_gk20a *ch,
}
}
args->syncpoint_id = ch->sync->syncpt_id(ch->sync);
args->syncpoint_id = ch->user_sync->syncpt_id(ch->user_sync);
args->syncpoint_max = nvgpu_nvhost_syncpt_read_maxval(g->nvhost_dev,
args->syncpoint_id);
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_SYNCPOINT_ADDRESS))
args->gpu_va = ch->sync->syncpt_address(ch->sync);
args->gpu_va = ch->user_sync->syncpt_address(ch->user_sync);
else
args->gpu_va = 0;

View File

@@ -138,6 +138,14 @@ u32 nvgpu_nvhost_get_syncpt_host_managed(
param, syncpt_name);
}
u32 nvgpu_nvhost_get_syncpt_client_managed(
struct nvgpu_nvhost_dev *nvhost_dev,
const char *syncpt_name)
{
return nvhost_get_syncpt_client_managed(nvhost_dev->host1x_pdev,
syncpt_name);
}
int nvgpu_nvhost_syncpt_wait_timeout_ext(
struct nvgpu_nvhost_dev *nvhost_dev, u32 id,
u32 thresh, u32 timeout, u32 *value, struct timespec *ts)