diff options
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 4 |
3 files changed, 28 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index 781a803e..0c8bff43 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |||
@@ -455,12 +455,27 @@ clean_up: | |||
455 | return err; | 455 | return err; |
456 | } | 456 | } |
457 | 457 | ||
458 | int nvgpu_channel_ioctl_alloc_gpfifo(struct channel_gk20a *c, | 458 | static u32 nvgpu_gpfifo_user_flags_to_common_flags(u32 user_flags) |
459 | struct nvgpu_alloc_gpfifo_ex_args *args) | ||
460 | { | 459 | { |
461 | return gk20a_channel_alloc_gpfifo(c, args->num_entries, | 460 | u32 flags = 0; |
462 | args->num_inflight_jobs, | 461 | |
463 | args->flags); | 462 | if (user_flags & NVGPU_ALLOC_GPFIFO_EX_FLAGS_VPR_ENABLED) |
463 | flags |= NVGPU_GPFIFO_FLAGS_SUPPORT_VPR; | ||
464 | |||
465 | if (user_flags & NVGPU_ALLOC_GPFIFO_EX_FLAGS_DETERMINISTIC) | ||
466 | flags |= NVGPU_GPFIFO_FLAGS_SUPPORT_DETERMINISTIC; | ||
467 | |||
468 | return flags; | ||
469 | } | ||
470 | |||
471 | static int nvgpu_channel_ioctl_alloc_gpfifo(struct channel_gk20a *c, | ||
472 | unsigned int num_entries, | ||
473 | unsigned int num_inflight_jobs, | ||
474 | u32 user_flags) | ||
475 | { | ||
476 | return gk20a_channel_alloc_gpfifo(c, num_entries, | ||
477 | num_inflight_jobs, | ||
478 | nvgpu_gpfifo_user_flags_to_common_flags(user_flags)); | ||
464 | } | 479 | } |
465 | 480 | ||
466 | 481 | ||
@@ -1031,7 +1046,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
1031 | gk20a_idle(ch->g); | 1046 | gk20a_idle(ch->g); |
1032 | break; | 1047 | break; |
1033 | } | 1048 | } |
1034 | err = gk20a_channel_alloc_gpfifo(ch, | 1049 | err = nvgpu_channel_ioctl_alloc_gpfifo(ch, |
1035 | alloc_gpfifo_ex_args->num_entries, | 1050 | alloc_gpfifo_ex_args->num_entries, |
1036 | alloc_gpfifo_ex_args->num_inflight_jobs, | 1051 | alloc_gpfifo_ex_args->num_inflight_jobs, |
1037 | alloc_gpfifo_ex_args->flags); | 1052 | alloc_gpfifo_ex_args->flags); |
@@ -1056,7 +1071,7 @@ long gk20a_channel_ioctl(struct file *filp, | |||
1056 | * submitted gpfifos and another one after, for internal usage. | 1071 | * submitted gpfifos and another one after, for internal usage. |
1057 | * Triple the requested size. | 1072 | * Triple the requested size. |
1058 | */ | 1073 | */ |
1059 | err = gk20a_channel_alloc_gpfifo(ch, | 1074 | err = nvgpu_channel_ioctl_alloc_gpfifo(ch, |
1060 | alloc_gpfifo_args->num_entries * 3, | 1075 | alloc_gpfifo_args->num_entries * 3, |
1061 | 0, | 1076 | 0, |
1062 | alloc_gpfifo_args->flags); | 1077 | alloc_gpfifo_args->flags); |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 229e3782..9a8130ba 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1242,10 +1242,10 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1242 | gpfifo_size = num_entries; | 1242 | gpfifo_size = num_entries; |
1243 | gpfifo_entry_size = nvgpu_get_gpfifo_entry_size(); | 1243 | gpfifo_entry_size = nvgpu_get_gpfifo_entry_size(); |
1244 | 1244 | ||
1245 | if (flags & NVGPU_ALLOC_GPFIFO_EX_FLAGS_VPR_ENABLED) | 1245 | if (flags & NVGPU_GPFIFO_FLAGS_SUPPORT_VPR) |
1246 | c->vpr = true; | 1246 | c->vpr = true; |
1247 | 1247 | ||
1248 | if (flags & NVGPU_ALLOC_GPFIFO_EX_FLAGS_DETERMINISTIC) { | 1248 | if (flags & NVGPU_GPFIFO_FLAGS_SUPPORT_DETERMINISTIC) { |
1249 | nvgpu_rwsem_down_read(&g->deterministic_busy); | 1249 | nvgpu_rwsem_down_read(&g->deterministic_busy); |
1250 | /* | 1250 | /* |
1251 | * Railgating isn't deterministic; instead of disallowing | 1251 | * Railgating isn't deterministic; instead of disallowing |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index 0cb60200..58a8aa97 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h | |||
@@ -48,6 +48,10 @@ struct fifo_profile_gk20a; | |||
48 | #include "channel_t19x.h" | 48 | #include "channel_t19x.h" |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* Flags to be passed to gk20a_channel_alloc_gpfifo() */ | ||
52 | #define NVGPU_GPFIFO_FLAGS_SUPPORT_VPR (1 << 0) | ||
53 | #define NVGPU_GPFIFO_FLAGS_SUPPORT_DETERMINISTIC (1 << 1) | ||
54 | |||
51 | struct notification { | 55 | struct notification { |
52 | struct { | 56 | struct { |
53 | u32 nanoseconds[2]; | 57 | u32 nanoseconds[2]; |