From e445d080220ed62dec74ef098e31647631b79807 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Sun, 9 Feb 2020 19:53:20 +0530 Subject: [PATCH] gpu :nvgpu : Add waiter index in syncpt_wait_ext Allocated the following two waiter objects for sync point waith path: Job tracking and CE threads. 2. QNX channel specific job tracking thread. The above implementation is only available for QNX. For Linux, waiter index is skipped. JIRA NVGPU-3009 Change-Id: If12ad1dc90a24a7b922b205829ca335805c02c3d Signed-off-by: Lakshmanan M Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2292080 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rajesh Devaraj Reviewed-by: Shashank Singh Reviewed-by: Vaibhav Kachore Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/fence/fence.c | 4 ++-- drivers/gpu/nvgpu/include/nvgpu/nvhost.h | 10 +++++++++- drivers/gpu/nvgpu/os/linux/nvhost.c | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/common/fence/fence.c b/drivers/gpu/nvgpu/common/fence/fence.c index 4a57886e9..e489de17d 100644 --- a/drivers/gpu/nvgpu/common/fence/fence.c +++ b/drivers/gpu/nvgpu/common/fence/fence.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -261,7 +261,7 @@ static int nvgpu_fence_syncpt_wait(struct nvgpu_fence_type *f, u32 timeout) { return nvgpu_nvhost_syncpt_wait_timeout_ext( f->nvhost_dev, f->syncpt_id, f->syncpt_value, - timeout); + timeout, NVGPU_NVHOST_DEFAULT_WAITER); } static bool nvgpu_fence_syncpt_is_expired(struct nvgpu_fence_type *f) diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h index d4678ef07..1b7df195d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h @@ -72,6 +72,14 @@ int nvgpu_get_nvhost_dev(struct gk20a *g); void nvgpu_free_nvhost_dev(struct gk20a *g); #ifdef CONFIG_NVGPU_KERNEL_MODE_SUBMIT +/** + * Available waiter index is used for sync point wait path. + * Maximum supported waiter count is 2U. + */ +#define NVGPU_NVHOST_DEFAULT_WAITER 0U +#define NVGPU_NVHOST_WAITER_1 1U +#define NVGPU_NVHOST_MAX_WAITER_COUNT 2U + int nvgpu_nvhost_module_busy_ext(struct nvgpu_nvhost_dev *nvgpu_syncpt_dev); void nvgpu_nvhost_module_idle_ext(struct nvgpu_nvhost_dev *nvgpu_syncpt_dev); @@ -84,7 +92,7 @@ int nvgpu_nvhost_intr_register_notifier(struct nvgpu_nvhost_dev *nvgpu_syncpt_de bool nvgpu_nvhost_syncpt_is_expired_ext(struct nvgpu_nvhost_dev *nvgpu_syncpt_dev, u32 id, u32 thresh); int nvgpu_nvhost_syncpt_wait_timeout_ext(struct nvgpu_nvhost_dev *nvgpu_syncpt_dev, - u32 id, u32 thresh, u32 timeout); + u32 id, u32 thresh, u32 timeout, u32 waiter_index); u32 nvgpu_nvhost_syncpt_incr_max_ext(struct nvgpu_nvhost_dev *nvgpu_syncpt_dev, u32 id, u32 incrs); diff --git a/drivers/gpu/nvgpu/os/linux/nvhost.c b/drivers/gpu/nvgpu/os/linux/nvhost.c index c4be10bb0..7ac1d3939 100644 --- a/drivers/gpu/nvgpu/os/linux/nvhost.c +++ b/drivers/gpu/nvgpu/os/linux/nvhost.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -149,7 +149,7 @@ u32 nvgpu_nvhost_get_syncpt_client_managed( int nvgpu_nvhost_syncpt_wait_timeout_ext( struct nvgpu_nvhost_dev *nvhost_dev, u32 id, - u32 thresh, u32 timeout) + u32 thresh, u32 timeout, u32 waiter_index) { return nvhost_syncpt_wait_timeout_ext(nvhost_dev->host1x_pdev, id, thresh, timeout, NULL, NULL);