summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
diff options
context:
space:
mode:
authorSourab Gupta <sourabg@nvidia.com>2018-04-10 05:28:09 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-11 13:16:16 -0400
commit6c6aab952e91c9f15265af04be78c5a49934a823 (patch)
tree5f4eb2bd858e02a0ab1f53cde6237173db8284f2 /drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
parentf8578c92741425ec4630bc9fe52d8537fa8a5c16 (diff)
gpu: nvgpu: Add conversion function for uapi submit gpfifo flags
The submit gpfifo flags are splattered everywhere inside the nvgpu code. Though the usage is inside nvgpu Linux code only, still it needs to be gotten rid of and replaced with the defines present in common code. VQRM-3465 Change-Id: I901b33565b01fa3e1f9ba6698a323c16547a8d3e Signed-off-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1691979 Reviewed-by: Konsta Holtta <kholtta@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>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
index 3392b6fa..e4b66460 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c
@@ -43,6 +43,7 @@
43#include "platform_gk20a.h" 43#include "platform_gk20a.h"
44#include "os_linux.h" 44#include "os_linux.h"
45#include "dmabuf.h" 45#include "dmabuf.h"
46#include "channel.h"
46 47
47#define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ 48#define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \
48 (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) 49 (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ))
@@ -341,7 +342,8 @@ static int gk20a_ctrl_prepare_compressible_read(
341 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); 342 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
342 struct nvgpu_channel_fence fence; 343 struct nvgpu_channel_fence fence;
343 struct gk20a_fence *fence_out = NULL; 344 struct gk20a_fence *fence_out = NULL;
344 int flags = args->submit_flags; 345 int submit_flags = nvgpu_submit_gpfifo_user_flags_to_common_flags(
346 args->submit_flags);
345 347
346 fence.id = args->fence.syncpt_id; 348 fence.id = args->fence.syncpt_id;
347 fence.value = args->fence.syncpt_value; 349 fence.value = args->fence.syncpt_value;
@@ -351,15 +353,15 @@ static int gk20a_ctrl_prepare_compressible_read(
351 args->compbits_hoffset, args->compbits_voffset, 353 args->compbits_hoffset, args->compbits_voffset,
352 args->scatterbuffer_offset, 354 args->scatterbuffer_offset,
353 args->width, args->height, args->block_height_log2, 355 args->width, args->height, args->block_height_log2,
354 flags, &fence, &args->valid_compbits, 356 submit_flags, &fence, &args->valid_compbits,
355 &args->zbc_color, &fence_out); 357 &args->zbc_color, &fence_out);
356 358
357 if (ret) 359 if (ret)
358 return ret; 360 return ret;
359 361
360 /* Convert fence_out to something we can pass back to user space. */ 362 /* Convert fence_out to something we can pass back to user space. */
361 if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET) { 363 if (submit_flags & NVGPU_SUBMIT_FLAGS_FENCE_GET) {
362 if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_SYNC_FENCE) { 364 if (submit_flags & NVGPU_SUBMIT_FLAGS_SYNC_FENCE) {
363 if (fence_out) { 365 if (fence_out) {
364 int fd = gk20a_fence_install_fd(fence_out); 366 int fd = gk20a_fence_install_fd(fence_out);
365 if (fd < 0) 367 if (fd < 0)