summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_bo.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2023-01-25 17:14:37 +0100
committerChristian König <christian.koenig@amd.com>2023-01-25 17:27:51 +0100
commit2847a67d3aa518a29e8a8db01bbec630d3bd5011 (patch)
treee1c86de6ccd2059700240dc1443d0e3fce3d20dc /drivers/gpu/drm/ttm/ttm_bo.c
parentaccel/ivpu: Fix spelling mistake "tansition" -> "transition" (diff)
downloadlinux-2847a67d3aa518a29e8a8db01bbec630d3bd5011.tar.xz
linux-2847a67d3aa518a29e8a8db01bbec630d3bd5011.zip
drm/ttm: revert "prevent moving of pinned BOs"
This reverts commit b49323aa35d502b0d9a7950327f30a1a52eae534. This still seems to break i915. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Matthew Auld <matthew.william.auld@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230125155023.105584-1-christian.koenig@amd.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 33471e363ff4..bb0c21c8caac 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -894,18 +894,14 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
if (!placement->num_placement && !placement->num_busy_placement)
return ttm_bo_pipeline_gutting(bo);
- /* Check whether we need to move buffer. */
- if (bo->resource && ttm_resource_compat(bo->resource, placement))
- return 0;
-
- /* Moving of pinned BOs is forbidden */
- if (bo->pin_count)
- return -EINVAL;
-
- ret = ttm_bo_move_buffer(bo, placement, ctx);
- if (ret)
- return ret;
-
+ /*
+ * Check whether we need to move buffer.
+ */
+ if (!bo->resource || !ttm_resource_compat(bo->resource, placement)) {
+ ret = ttm_bo_move_buffer(bo, placement, ctx);
+ if (ret)
+ return ret;
+ }
/*
* We might need to add a TTM.
*/