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);