mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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:
committed by
mobile promotions
parent
aa1da74a75
commit
df2100018d
@@ -315,7 +315,7 @@ static void gk20a_channel_syncpt_destroy(struct gk20a_channel_sync *s)
|
||||
}
|
||||
|
||||
static struct gk20a_channel_sync *
|
||||
gk20a_channel_syncpt_create(struct channel_gk20a *c)
|
||||
gk20a_channel_syncpt_create(struct channel_gk20a *c, bool user_managed)
|
||||
{
|
||||
struct gk20a_channel_syncpt *sp;
|
||||
char syncpt_name[32];
|
||||
@@ -327,11 +327,19 @@ gk20a_channel_syncpt_create(struct channel_gk20a *c)
|
||||
sp->c = c;
|
||||
sp->nvhost_dev = c->g->nvhost_dev;
|
||||
|
||||
snprintf(syncpt_name, sizeof(syncpt_name),
|
||||
"%s_%d", c->g->name, c->chid);
|
||||
if (user_managed) {
|
||||
snprintf(syncpt_name, sizeof(syncpt_name),
|
||||
"%s_%d_user", c->g->name, c->chid);
|
||||
|
||||
sp->id = nvgpu_nvhost_get_syncpt_host_managed(sp->nvhost_dev,
|
||||
sp->id = nvgpu_nvhost_get_syncpt_client_managed(sp->nvhost_dev,
|
||||
syncpt_name);
|
||||
} else {
|
||||
snprintf(syncpt_name, sizeof(syncpt_name),
|
||||
"%s_%d", c->g->name, c->chid);
|
||||
|
||||
sp->id = nvgpu_nvhost_get_syncpt_host_managed(sp->nvhost_dev,
|
||||
c->chid, syncpt_name);
|
||||
}
|
||||
if (!sp->id) {
|
||||
nvgpu_kfree(c->g, sp);
|
||||
nvgpu_err(c->g, "failed to get free syncpt");
|
||||
@@ -892,7 +900,7 @@ static void gk20a_channel_semaphore_destroy(struct gk20a_channel_sync *s)
|
||||
}
|
||||
|
||||
static struct gk20a_channel_sync *
|
||||
gk20a_channel_semaphore_create(struct channel_gk20a *c)
|
||||
gk20a_channel_semaphore_create(struct channel_gk20a *c, bool user_managed)
|
||||
{
|
||||
int asid = -1;
|
||||
struct gk20a_channel_semaphore *sema;
|
||||
@@ -940,13 +948,14 @@ void gk20a_channel_sync_destroy(struct gk20a_channel_sync *sync)
|
||||
sync->destroy(sync);
|
||||
}
|
||||
|
||||
struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c)
|
||||
struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c,
|
||||
bool user_managed)
|
||||
{
|
||||
#ifdef CONFIG_TEGRA_GK20A_NVHOST
|
||||
if (gk20a_platform_has_syncpoints(c->g))
|
||||
return gk20a_channel_syncpt_create(c);
|
||||
return gk20a_channel_syncpt_create(c, user_managed);
|
||||
#endif
|
||||
return gk20a_channel_semaphore_create(c);
|
||||
return gk20a_channel_semaphore_create(c, user_managed);
|
||||
}
|
||||
|
||||
bool gk20a_channel_sync_needs_sync_framework(struct gk20a *g)
|
||||
|
||||
Reference in New Issue
Block a user