aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-07-16 04:07:13 +1000
committerDave Airlie <airlied@redhat.com>2019-07-16 04:07:13 +1000
commit3729fe2bc2a01f4cc1aa88be8f64af06084c87d6 (patch)
tree462102b65a8cec402bc4726eef6946bdd9113111 /drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
parentRevert "mm: adjust apply_to_pfn_range interface for dropped token." (diff)
downloadlinux-dev-3729fe2bc2a01f4cc1aa88be8f64af06084c87d6.tar.xz
linux-dev-3729fe2bc2a01f4cc1aa88be8f64af06084c87d6.zip
Revert "Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux into drm-next"
This reverts commit 031e610a6a21448a63dff7a0416e5e206724caac, reversing changes made to 52d2d44eee8091e740d0d275df1311fb8373c9a9. The mm changes in there we premature and not fully ack or reviewed by core mm folks, I dropped the ball by merging them via this tree, so lets take em all back out. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_validation.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_validation.c74
1 files changed, 1 insertions, 73 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
index 9aaf807ed73c..f611b2290a1b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
@@ -33,8 +33,6 @@
* struct vmw_validation_bo_node - Buffer object validation metadata.
* @base: Metadata used for TTM reservation- and validation.
* @hash: A hash entry used for the duplicate detection hash table.
- * @coherent_count: If switching backup buffers, number of new coherent
- * resources that will have this buffer as a backup buffer.
* @as_mob: Validate as mob.
* @cpu_blit: Validate for cpu blit access.
*
@@ -44,7 +42,6 @@
struct vmw_validation_bo_node {
struct ttm_validate_buffer base;
struct drm_hash_item hash;
- unsigned int coherent_count;
u32 as_mob : 1;
u32 cpu_blit : 1;
};
@@ -462,19 +459,6 @@ int vmw_validation_res_reserve(struct vmw_validation_context *ctx,
if (ret)
goto out_unreserve;
}
-
- if (val->switching_backup && val->new_backup &&
- res->coherent) {
- struct vmw_validation_bo_node *bo_node =
- vmw_validation_find_bo_dup(ctx,
- val->new_backup);
-
- if (WARN_ON(!bo_node)) {
- ret = -EINVAL;
- goto out_unreserve;
- }
- bo_node->coherent_count++;
- }
}
return 0;
@@ -578,9 +562,6 @@ int vmw_validation_bo_validate(struct vmw_validation_context *ctx, bool intr)
int ret;
list_for_each_entry(entry, &ctx->bo_list, base.head) {
- struct vmw_buffer_object *vbo =
- container_of(entry->base.bo, typeof(*vbo), base);
-
if (entry->cpu_blit) {
struct ttm_operation_ctx ctx = {
.interruptible = intr,
@@ -595,27 +576,6 @@ int vmw_validation_bo_validate(struct vmw_validation_context *ctx, bool intr)
}
if (ret)
return ret;
-
- /*
- * Rather than having the resource code allocating the bo
- * dirty tracker in resource_unreserve() where we can't fail,
- * Do it here when validating the buffer object.
- */
- if (entry->coherent_count) {
- unsigned int coherent_count = entry->coherent_count;
-
- while (coherent_count) {
- ret = vmw_bo_dirty_add(vbo);
- if (ret)
- return ret;
-
- coherent_count--;
- }
- entry->coherent_count -= coherent_count;
- }
-
- if (vbo->dirty)
- vmw_bo_dirty_scan(vbo);
}
return 0;
}
@@ -641,8 +601,7 @@ int vmw_validation_res_validate(struct vmw_validation_context *ctx, bool intr)
struct vmw_resource *res = val->res;
struct vmw_buffer_object *backup = res->backup;
- ret = vmw_resource_validate(res, intr, val->dirty_set &&
- val->dirty);
+ ret = vmw_resource_validate(res, intr);
if (ret) {
if (ret != -ERESTARTSYS)
DRM_ERROR("Failed to validate resource.\n");
@@ -869,34 +828,3 @@ int vmw_validation_preload_res(struct vmw_validation_context *ctx,
ctx->mem_size_left += size;
return 0;
}
-
-/**
- * vmw_validation_bo_backoff - Unreserve buffer objects registered with a
- * validation context
- * @ctx: The validation context
- *
- * This function unreserves the buffer objects previously reserved using
- * vmw_validation_bo_reserve. It's typically used as part of an error path
- */
-void vmw_validation_bo_backoff(struct vmw_validation_context *ctx)
-{
- struct vmw_validation_bo_node *entry;
-
- /*
- * Switching coherent resource backup buffers failed.
- * Release corresponding buffer object dirty trackers.
- */
- list_for_each_entry(entry, &ctx->bo_list, base.head) {
- if (entry->coherent_count) {
- unsigned int coherent_count = entry->coherent_count;
- struct vmw_buffer_object *vbo =
- container_of(entry->base.bo, typeof(*vbo),
- base);
-
- while (coherent_count--)
- vmw_bo_dirty_release(vbo);
- }
- }
-
- ttm_eu_backoff_reservation(&ctx->ticket, &ctx->bo_list);
-}