From ae34c0364995b1a554062067b391f6fd1c06cdf8 Mon Sep 17 00:00:00 2001 From: Anup Mahindre Date: Tue, 20 Apr 2021 15:39:18 +0530 Subject: [PATCH] video: tegra: host: nvdla: Align max buffers per task limit - Max buffers per task limit was reduced to 384 recently as per all usecases from UMD - Rename the macro to MAX_NVDLA_BUFFERS_PER_TASK to avoid conflict with another macro defined in nvdla_inf.h - Reflect this change in uapi Jira DLA-4376 Change-Id: I7d2f19901db5273ae2ae2ba7be504223c2f59e4e Signed-off-by: Anup Mahindre Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2517621 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/video/tegra/host/nvdla/nvdla.h | 4 ++-- drivers/video/tegra/host/nvdla/nvdla_ioctl.c | 4 ++-- include/uapi/linux/nvhost_nvdla_ioctl.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/tegra/host/nvdla/nvdla.h b/drivers/video/tegra/host/nvdla/nvdla.h index 630e5777..692c9050 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.h +++ b/drivers/video/tegra/host/nvdla/nvdla.h @@ -277,7 +277,7 @@ struct nvdla_task { struct nvdla_status_notify eof_task_status[MAX_NUM_NVDLA_OUT_TASK_STATUS]; struct nvdla_mem_handle sof_timestamps[MAX_NUM_NVDLA_OUT_TIMESTAMP]; struct nvdla_mem_handle eof_timestamps[MAX_NUM_NVDLA_OUT_TIMESTAMP]; - struct nvdla_mem_handle memory_handles[NVDLA_MAX_BUFFERS_PER_TASK]; + struct nvdla_mem_handle memory_handles[MAX_NVDLA_BUFFERS_PER_TASK]; u8 num_prefences; u8 num_postfences; u8 num_in_task_status; @@ -296,7 +296,7 @@ struct nvdla_task { int timeout; int pool_index; - struct dma_buf *memory_dmabuf[NVDLA_MAX_BUFFERS_PER_TASK]; + struct dma_buf *memory_dmabuf[MAX_NVDLA_BUFFERS_PER_TASK]; struct dma_buf *prefences_sem_dmabuf[MAX_NUM_NVDLA_PREFENCES]; struct dma_buf *in_task_status_dmabuf[MAX_NUM_NVDLA_IN_TASK_STATUS]; struct dma_buf *postfences_sem_dmabuf[MAX_NUM_NVDLA_POSTFENCES]; diff --git a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c index 862a95ac..cde3af73 100644 --- a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c +++ b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c @@ -697,10 +697,10 @@ static int nvdla_val_task_submit_input(struct nvdla_ioctl_submit_task *in_task) in_task->num_addresses); return -EINVAL; } - if (in_task->num_addresses > NVDLA_MAX_BUFFERS_PER_TASK) { + if (in_task->num_addresses > MAX_NVDLA_BUFFERS_PER_TASK) { pr_err("num addresses[%u] crossing expected[%d]\n", in_task->num_addresses, - NVDLA_MAX_BUFFERS_PER_TASK); + MAX_NVDLA_BUFFERS_PER_TASK); return -EINVAL; } diff --git a/include/uapi/linux/nvhost_nvdla_ioctl.h b/include/uapi/linux/nvhost_nvdla_ioctl.h index bd427e78..58d45c9d 100644 --- a/include/uapi/linux/nvhost_nvdla_ioctl.h +++ b/include/uapi/linux/nvhost_nvdla_ioctl.h @@ -174,7 +174,7 @@ struct nvdla_ioctl_submit_task { __u8 num_sof_timestamps; __u8 num_eof_timestamps; __u8 reserved0[1]; -#define NVDLA_MAX_BUFFERS_PER_TASK (6144) +#define MAX_NVDLA_BUFFERS_PER_TASK (384U) __u32 num_addresses; __u16 flags; __u16 reserved1;