diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/channel.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/nvhost.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 25 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gp10b.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/nvhost.h | 2 |
9 files changed, 41 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c index a725cd6b..8bfa4cfc 100644 --- a/drivers/gpu/nvgpu/common/linux/channel.c +++ b/drivers/gpu/nvgpu/common/linux/channel.c | |||
@@ -444,7 +444,7 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c, | |||
444 | if (g->aggressive_sync_destroy_thresh) { | 444 | if (g->aggressive_sync_destroy_thresh) { |
445 | nvgpu_mutex_acquire(&c->sync_lock); | 445 | nvgpu_mutex_acquire(&c->sync_lock); |
446 | if (!c->sync) { | 446 | if (!c->sync) { |
447 | c->sync = gk20a_channel_sync_create(c); | 447 | c->sync = gk20a_channel_sync_create(c, false); |
448 | if (!c->sync) { | 448 | if (!c->sync) { |
449 | err = -ENOMEM; | 449 | err = -ENOMEM; |
450 | nvgpu_mutex_release(&c->sync_lock); | 450 | nvgpu_mutex_release(&c->sync_lock); |
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index ab6ac9b9..0acaa61d 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |||
@@ -972,11 +972,11 @@ static int nvgpu_ioctl_channel_get_user_syncpoint(struct channel_gk20a *ch, | |||
972 | } | 972 | } |
973 | 973 | ||
974 | nvgpu_mutex_acquire(&ch->sync_lock); | 974 | nvgpu_mutex_acquire(&ch->sync_lock); |
975 | if (ch->sync) { | 975 | if (ch->user_sync) { |
976 | nvgpu_mutex_release(&ch->sync_lock); | 976 | nvgpu_mutex_release(&ch->sync_lock); |
977 | } else { | 977 | } else { |
978 | ch->sync = gk20a_channel_sync_create(ch); | 978 | ch->user_sync = gk20a_channel_sync_create(ch, true); |
979 | if (!ch->sync) { | 979 | if (!ch->user_sync) { |
980 | nvgpu_mutex_release(&ch->sync_lock); | 980 | nvgpu_mutex_release(&ch->sync_lock); |
981 | return -ENOMEM; | 981 | return -ENOMEM; |
982 | } | 982 | } |
@@ -989,11 +989,11 @@ static int nvgpu_ioctl_channel_get_user_syncpoint(struct channel_gk20a *ch, | |||
989 | } | 989 | } |
990 | } | 990 | } |
991 | 991 | ||
992 | args->syncpoint_id = ch->sync->syncpt_id(ch->sync); | 992 | args->syncpoint_id = ch->user_sync->syncpt_id(ch->user_sync); |
993 | args->syncpoint_max = nvgpu_nvhost_syncpt_read_maxval(g->nvhost_dev, | 993 | args->syncpoint_max = nvgpu_nvhost_syncpt_read_maxval(g->nvhost_dev, |
994 | args->syncpoint_id); | 994 | args->syncpoint_id); |
995 | if (nvgpu_is_enabled(g, NVGPU_SUPPORT_SYNCPOINT_ADDRESS)) | 995 | if (nvgpu_is_enabled(g, NVGPU_SUPPORT_SYNCPOINT_ADDRESS)) |
996 | args->gpu_va = ch->sync->syncpt_address(ch->sync); | 996 | args->gpu_va = ch->user_sync->syncpt_address(ch->user_sync); |
997 | else | 997 | else |
998 | args->gpu_va = 0; | 998 | args->gpu_va = 0; |
999 | 999 | ||
diff --git a/drivers/gpu/nvgpu/common/linux/nvhost.c b/drivers/gpu/nvgpu/common/linux/nvhost.c index 94bbfd70..a76953e3 100644 --- a/drivers/gpu/nvgpu/common/linux/nvhost.c +++ b/drivers/gpu/nvgpu/common/linux/nvhost.c | |||
@@ -138,6 +138,14 @@ u32 nvgpu_nvhost_get_syncpt_host_managed( | |||
138 | param, syncpt_name); | 138 | param, syncpt_name); |
139 | } | 139 | } |
140 | 140 | ||
141 | u32 nvgpu_nvhost_get_syncpt_client_managed( | ||
142 | struct nvgpu_nvhost_dev *nvhost_dev, | ||
143 | const char *syncpt_name) | ||
144 | { | ||
145 | return nvhost_get_syncpt_client_managed(nvhost_dev->host1x_pdev, | ||
146 | syncpt_name); | ||
147 | } | ||
148 | |||
141 | int nvgpu_nvhost_syncpt_wait_timeout_ext( | 149 | int nvgpu_nvhost_syncpt_wait_timeout_ext( |
142 | struct nvgpu_nvhost_dev *nvhost_dev, u32 id, | 150 | struct nvgpu_nvhost_dev *nvhost_dev, u32 id, |
143 | u32 thresh, u32 timeout, u32 *value, struct timespec *ts) | 151 | u32 thresh, u32 timeout, u32 *value, struct timespec *ts) |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 2f5ea301..2c98797d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -438,6 +438,10 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) | |||
438 | gk20a_channel_sync_destroy(ch->sync); | 438 | gk20a_channel_sync_destroy(ch->sync); |
439 | ch->sync = NULL; | 439 | ch->sync = NULL; |
440 | } | 440 | } |
441 | if (ch->user_sync) { | ||
442 | gk20a_channel_sync_destroy(ch->user_sync); | ||
443 | ch->user_sync = NULL; | ||
444 | } | ||
441 | nvgpu_mutex_release(&ch->sync_lock); | 445 | nvgpu_mutex_release(&ch->sync_lock); |
442 | 446 | ||
443 | /* | 447 | /* |
@@ -1147,7 +1151,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1147 | 1151 | ||
1148 | if (!g->aggressive_sync_destroy_thresh) { | 1152 | if (!g->aggressive_sync_destroy_thresh) { |
1149 | nvgpu_mutex_acquire(&c->sync_lock); | 1153 | nvgpu_mutex_acquire(&c->sync_lock); |
1150 | c->sync = gk20a_channel_sync_create(c); | 1154 | c->sync = gk20a_channel_sync_create(c, false); |
1151 | if (!c->sync) { | 1155 | if (!c->sync) { |
1152 | err = -ENOMEM; | 1156 | err = -ENOMEM; |
1153 | nvgpu_mutex_release(&c->sync_lock); | 1157 | nvgpu_mutex_release(&c->sync_lock); |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index db1404a3..edb645b5 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h | |||
@@ -226,6 +226,7 @@ struct channel_gk20a { | |||
226 | 226 | ||
227 | struct nvgpu_mutex sync_lock; | 227 | struct nvgpu_mutex sync_lock; |
228 | struct gk20a_channel_sync *sync; | 228 | struct gk20a_channel_sync *sync; |
229 | struct gk20a_channel_sync *user_sync; | ||
229 | 230 | ||
230 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION | 231 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION |
231 | u64 virt_ctx; | 232 | u64 virt_ctx; |
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) |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h index fe1d8526..f4f54145 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h | |||
@@ -110,7 +110,8 @@ struct gk20a_channel_sync { | |||
110 | }; | 110 | }; |
111 | 111 | ||
112 | void gk20a_channel_sync_destroy(struct gk20a_channel_sync *sync); | 112 | void gk20a_channel_sync_destroy(struct gk20a_channel_sync *sync); |
113 | struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c); | 113 | struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c, |
114 | bool user_managed); | ||
114 | bool gk20a_channel_sync_needs_sync_framework(struct gk20a *g); | 115 | bool gk20a_channel_sync_needs_sync_framework(struct gk20a *g); |
115 | 116 | ||
116 | #ifdef CONFIG_SYNC | 117 | #ifdef CONFIG_SYNC |
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b.c b/drivers/gpu/nvgpu/gp10b/gp10b.c index d0a21fe5..51dc4301 100644 --- a/drivers/gpu/nvgpu/gp10b/gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gp10b.c | |||
@@ -116,6 +116,5 @@ int gp10b_init_gpu_characteristics(struct gk20a *g) | |||
116 | gk20a_init_gpu_characteristics(g); | 116 | gk20a_init_gpu_characteristics(g); |
117 | gp10b_detect_ecc_enabled_units(g); | 117 | gp10b_detect_ecc_enabled_units(g); |
118 | __nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, true); | 118 | __nvgpu_set_enabled(g, NVGPU_SUPPORT_RESCHEDULE_RUNLIST, true); |
119 | __nvgpu_set_enabled(g, NVGPU_SUPPORT_USER_SYNCPOINT, true); | ||
120 | return 0; | 119 | return 0; |
121 | } | 120 | } |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h index cb70f436..d5b5831a 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h | |||
@@ -65,6 +65,8 @@ void nvgpu_nvhost_syncpt_put_ref_ext(struct nvgpu_nvhost_dev *nvhost_dev, | |||
65 | u32 nvgpu_nvhost_get_syncpt_host_managed(struct nvgpu_nvhost_dev *nvhost_dev, | 65 | u32 nvgpu_nvhost_get_syncpt_host_managed(struct nvgpu_nvhost_dev *nvhost_dev, |
66 | u32 param, | 66 | u32 param, |
67 | const char *syncpt_name); | 67 | const char *syncpt_name); |
68 | u32 nvgpu_nvhost_get_syncpt_client_managed(struct nvgpu_nvhost_dev *nvhost_dev, | ||
69 | const char *syncpt_name); | ||
68 | 70 | ||
69 | int nvgpu_nvhost_create_symlink(struct gk20a *g); | 71 | int nvgpu_nvhost_create_symlink(struct gk20a *g); |
70 | void nvgpu_nvhost_remove_symlink(struct gk20a *g); | 72 | void nvgpu_nvhost_remove_symlink(struct gk20a *g); |