summaryrefslogtreecommitdiff
path: root/lib/intel_batchbuffer.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2021-04-21 13:14:28 -0500
committerJason Ekstrand <jason@jlekstrand.net>2021-07-08 12:45:33 -0500
commitff89500e6e93aa2f41a9e9ef01ee70c8bf133cca (patch)
treed179e03b9de97b3b9266cb5840b566ba5c05c7b3 /lib/intel_batchbuffer.c
parent3eae7848c89161d1cc66c88c90bc558e56df691b (diff)
lib/intel_bb: Remove intel_bb_assign_vm and tests (v2)
It's not used by anything other than the tests for that functionality and it relies on setting the VM via SET_CONTEXT_PARAM which is deprecated. Delete it for now. We can add it back in later if it's actually useful and do it properly then. v2 (Zbigniew Kempczyński): - Also remove intel_bb_detach_intel_buf() Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'lib/intel_batchbuffer.c')
-rw-r--r--lib/intel_batchbuffer.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index cc976a62..2b8b903e 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1513,14 +1513,6 @@ static void __intel_bb_destroy_cache(struct intel_bb *ibb)
ibb->root = NULL;
}
-static void __intel_bb_detach_intel_bufs(struct intel_bb *ibb)
-{
- struct intel_buf *entry, *tmp;
-
- igt_list_for_each_entry_safe(entry, tmp, &ibb->intel_bufs, link)
- intel_bb_detach_intel_buf(ibb, entry);
-}
-
static void __intel_bb_remove_intel_bufs(struct intel_bb *ibb)
{
struct intel_buf *entry, *tmp;
@@ -1649,50 +1641,6 @@ int intel_bb_sync(struct intel_bb *ibb)
return ret;
}
-uint64_t intel_bb_assign_vm(struct intel_bb *ibb, uint64_t allocator,
- uint32_t vm_id)
-{
- struct drm_i915_gem_context_param arg = {
- .param = I915_CONTEXT_PARAM_VM,
- };
- uint64_t prev_allocator = ibb->allocator_handle;
- bool closed = false;
-
- if (ibb->vm_id == vm_id) {
- igt_debug("Skipping to assign same vm_id: %u\n", vm_id);
- return 0;
- }
-
- /* Cannot switch if someone keeps bb refcount */
- igt_assert(ibb->refcount == 1);
-
- /* Detach intel_bufs and remove bb handle */
- __intel_bb_detach_intel_bufs(ibb);
- intel_bb_remove_object(ibb, ibb->handle, ibb->batch_offset, ibb->size);
-
- /* Cache + objects are not valid after change anymore */
- __intel_bb_destroy_objects(ibb);
- __intel_bb_destroy_cache(ibb);
-
- /* Attach new allocator */
- ibb->allocator_handle = allocator;
-
- /* Setparam */
- ibb->vm_id = vm_id;
-
- /* Skip set param, we likely return to default vm */
- if (vm_id) {
- arg.ctx_id = ibb->ctx;
- arg.value = vm_id;
- gem_context_set_param(ibb->i915, &arg);
- }
-
- /* Recreate bb */
- intel_bb_reset(ibb, false);
-
- return closed ? 0 : prev_allocator;
-}
-
/*
* intel_bb_print:
* @ibb: pointer to intel_bb
@@ -2040,19 +1988,6 @@ intel_bb_add_intel_buf_with_alignment(struct intel_bb *ibb, struct intel_buf *bu
return __intel_bb_add_intel_buf(ibb, buf, alignment, write);
}
-void intel_bb_detach_intel_buf(struct intel_bb *ibb, struct intel_buf *buf)
-{
- igt_assert(ibb);
- igt_assert(buf);
- igt_assert(!buf->ibb || buf->ibb == ibb);
-
- if (!igt_list_empty(&buf->link)) {
- buf->addr.offset = INTEL_BUF_INVALID_ADDRESS;
- buf->ibb = NULL;
- igt_list_del_init(&buf->link);
- }
-}
-
bool intel_bb_remove_intel_buf(struct intel_bb *ibb, struct intel_buf *buf)
{
bool removed;