diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index e965a329..9649c573 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -315,7 +315,7 @@ static void gk20a_channel_syncpt_destroy(struct gk20a_channel_sync *s) | |||
315 | } | 315 | } |
316 | 316 | ||
317 | static struct gk20a_channel_sync * | 317 | static struct gk20a_channel_sync * |
318 | gk20a_channel_syncpt_create(struct channel_gk20a *c) | 318 | gk20a_channel_syncpt_create(struct channel_gk20a *c, bool user_managed) |
319 | { | 319 | { |
320 | struct gk20a_channel_syncpt *sp; | 320 | struct gk20a_channel_syncpt *sp; |
321 | char syncpt_name[32]; | 321 | char syncpt_name[32]; |
@@ -327,11 +327,19 @@ gk20a_channel_syncpt_create(struct channel_gk20a *c) | |||
327 | sp->c = c; | 327 | sp->c = c; |
328 | sp->nvhost_dev = c->g->nvhost_dev; | 328 | sp->nvhost_dev = c->g->nvhost_dev; |
329 | 329 | ||
330 | snprintf(syncpt_name, sizeof(syncpt_name), | 330 | if (user_managed) { |
331 | "%s_%d", c->g->name, c->chid); | 331 | snprintf(syncpt_name, sizeof(syncpt_name), |
332 | "%s_%d_user", c->g->name, c->chid); | ||
332 | 333 | ||
333 | sp->id = nvgpu_nvhost_get_syncpt_host_managed(sp->nvhost_dev, | 334 | sp->id = nvgpu_nvhost_get_syncpt_client_managed(sp->nvhost_dev, |
335 | syncpt_name); | ||
336 | } else { | ||
337 | snprintf(syncpt_name, sizeof(syncpt_name), | ||
338 | "%s_%d", c->g->name, c->chid); | ||
339 | |||
340 | sp->id = nvgpu_nvhost_get_syncpt_host_managed(sp->nvhost_dev, | ||
334 | c->chid, syncpt_name); | 341 | c->chid, syncpt_name); |
342 | } | ||
335 | if (!sp->id) { | 343 | if (!sp->id) { |
336 | nvgpu_kfree(c->g, sp); | 344 | nvgpu_kfree(c->g, sp); |
337 | nvgpu_err(c->g, "failed to get free syncpt"); | 345 | nvgpu_err(c->g, "failed to get free syncpt"); |
@@ -892,7 +900,7 @@ static void gk20a_channel_semaphore_destroy(struct gk20a_channel_sync *s) | |||
892 | } | 900 | } |
893 | 901 | ||
894 | static struct gk20a_channel_sync * | 902 | static struct gk20a_channel_sync * |
895 | gk20a_channel_semaphore_create(struct channel_gk20a *c) | 903 | gk20a_channel_semaphore_create(struct channel_gk20a *c, bool user_managed) |
896 | { | 904 | { |
897 | int asid = -1; | 905 | int asid = -1; |
898 | struct gk20a_channel_semaphore *sema; | 906 | struct gk20a_channel_semaphore *sema; |
@@ -940,13 +948,14 @@ void gk20a_channel_sync_destroy(struct gk20a_channel_sync *sync) | |||
940 | sync->destroy(sync); | 948 | sync->destroy(sync); |
941 | } | 949 | } |
942 | 950 | ||
943 | struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c) | 951 | struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c, |
952 | bool user_managed) | ||
944 | { | 953 | { |
945 | #ifdef CONFIG_TEGRA_GK20A_NVHOST | 954 | #ifdef CONFIG_TEGRA_GK20A_NVHOST |
946 | if (gk20a_platform_has_syncpoints(c->g)) | 955 | if (gk20a_platform_has_syncpoints(c->g)) |
947 | return gk20a_channel_syncpt_create(c); | 956 | return gk20a_channel_syncpt_create(c, user_managed); |
948 | #endif | 957 | #endif |
949 | return gk20a_channel_semaphore_create(c); | 958 | return gk20a_channel_semaphore_create(c, user_managed); |
950 | } | 959 | } |
951 | 960 | ||
952 | bool gk20a_channel_sync_needs_sync_framework(struct gk20a *g) | 961 | bool gk20a_channel_sync_needs_sync_framework(struct gk20a *g) |