| From 966d71594a2af88410b915e4b6bfa40bef86140c Mon Sep 17 00:00:00 2001 |
| From: Lepton Wu <ytht.net@gmail.com> |
| Date: Wed, 4 Sep 2019 13:08:27 -0700 |
| Subject: [PATCH] BACKPORT: FROMLIST: drm/ttm: let ttm_bo_wait timeout be |
| configurable |
| |
| When running dEQP against virgl driver, it turns out the default |
| 15 seconds timeout for ttm_bo_wait is not big enough for |
| GLES31.functional.ssbo.layout.random.nested_structs_arrays_instance_arrays.22 |
| Change it to a configurable value so we can tune it before virgl |
| performance gets improved. |
| |
| Signed-off-by: Lepton Wu <ytht.net@gmail.com> |
| |
| BUG=b:138755978 |
| TEST=Compile kernel |
| (am from https://patchwork.kernel.org/patch/11132281/) |
| |
| Change-Id: I4fb34cdd0848c7f0c20434ad932b9e0151911321 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1788167 |
| Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> |
| Tested-by: Lepton Wu <lepton@chromium.org> |
| Commit-Queue: Lepton Wu <lepton@chromium.org> |
| [rebase510(groeck): Context conflicts (drivers/gpu/drm/Kconfig)] |
| Signed-off-by: Guenter Roeck <groeck@chromium.org> |
| --- |
| drivers/gpu/drm/Kconfig | 2 ++ |
| drivers/gpu/drm/ttm/Kconfig | 7 +++++++ |
| drivers/gpu/drm/ttm/ttm_bo.c | 2 +- |
| 3 files changed, 10 insertions(+), 1 deletion(-) |
| create mode 100644 drivers/gpu/drm/ttm/Kconfig |
| |
| diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig |
| index 34f5a092c99e72f3a3b8744fa5b71f80de96e9b6..f9a472bfd18a45459f40fcb8e8aff1728375caa6 100644 |
| --- a/drivers/gpu/drm/Kconfig |
| +++ b/drivers/gpu/drm/Kconfig |
| @@ -213,6 +213,8 @@ config DRM_TTM_HELPER |
| help |
| Helpers for ttm-based gem objects |
| |
| +source "drivers/gpu/drm/ttm/Kconfig" |
| + |
| config DRM_GEM_DMA_HELPER |
| tristate |
| depends on DRM |
| diff --git a/drivers/gpu/drm/ttm/Kconfig b/drivers/gpu/drm/ttm/Kconfig |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c7953271c59b0c59c64aa8fc400862d57b8880d3 |
| --- /dev/null |
| +++ b/drivers/gpu/drm/ttm/Kconfig |
| @@ -0,0 +1,7 @@ |
| +config DRM_TTM_BO_WAIT_TIMEOUT |
| + int "Default timeout for ttm bo wait (in seconds)" |
| + depends on DRM_TTM |
| + default 15 |
| + help |
| + This option controls the default timeout (in seconds) used in |
| + ttm_bo_wait |
| diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c |
| index 7c8e8be774f1d493d6efd7524ca97595672cbfbe..e135348e29ef4f4b5c03579a376879bb5604eced 100644 |
| --- a/drivers/gpu/drm/ttm/ttm_bo.c |
| +++ b/drivers/gpu/drm/ttm/ttm_bo.c |
| @@ -1091,7 +1091,7 @@ EXPORT_SYMBOL(ttm_bo_unmap_virtual); |
| int ttm_bo_wait(struct ttm_buffer_object *bo, |
| bool interruptible, bool no_wait) |
| { |
| - long timeout = 15 * HZ; |
| + long timeout = CONFIG_DRM_TTM_BO_WAIT_TIMEOUT * HZ; |
| |
| if (no_wait) { |
| if (dma_resv_test_signaled(bo->base.resv, DMA_RESV_USAGE_BOOKKEEP)) |
| -- |
| 2.38.1.584.g0f3c55d4c2-goog |
| |