Commit 9da30cdd authored by Maaz Mombasawala's avatar Maaz Mombasawala Committed by Zack Rusin
Browse files

drm/vmwgfx: Remove vmwgfx_hashtab



The vmwgfx driver has migrated from using the hashtable in vmwgfx_hashtab
to the linux/hashtable implementation. Remove the vmwgfx_hashtab from the
driver.

Signed-off-by: default avatarMaaz Mombasawala <mombasawalam@vmware.com>
Reviewed-by: default avatarMartin Krastev <krastevm@vmware.com>
Reviewed-by: default avatarZack Rusin <zackr@vmware.com>
Signed-off-by: default avatarZack Rusin <zackr@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221022040236.616490-12-zack@kde.org
parent 76a9e07f
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -651,17 +651,6 @@ See drivers/gpu/drm/amd/display/TODO for tasks.

Contact: Harry Wentland, Alex Deucher

vmwgfx: Replace hashtable with Linux' implementation
----------------------------------------------------

The vmwgfx driver uses its own hashtable implementation. Replace the
code with Linux' implementation and update the callers. It's mostly a
refactoring task, but the interfaces are different.

Contact: Zack Rusin, Thomas Zimmermann <tzimmermann@suse.de>

Level: Intermediate

Bootsplash
==========

+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_hashtab.o vmwgfx_kms.o vmwgfx_drv.o \
vmwgfx-y := vmwgfx_execbuf.o vmwgfx_gmr.o vmwgfx_kms.o vmwgfx_drv.o \
	    vmwgfx_ioctl.o vmwgfx_resource.o vmwgfx_ttm_buffer.o \
	    vmwgfx_cmd.o vmwgfx_irq.o vmwgfx_ldu.o vmwgfx_ttm_glue.o \
	    vmwgfx_overlay.o vmwgfx_gmrid_manager.o vmwgfx_fence.o \
+4 −4
Original line number Diff line number Diff line
@@ -284,7 +284,7 @@ ttm_base_object_noref_lookup(struct ttm_object_file *tfile, uint64_t key)
	}

	__release(RCU);
	return drm_hash_entry(hash, struct ttm_ref_object, hash)->obj;
	return hlist_entry(hash, struct ttm_ref_object, hash)->obj;
}
EXPORT_SYMBOL(ttm_base_object_noref_lookup);

@@ -299,7 +299,7 @@ struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file *tfile,
	ret = ttm_tfile_find_ref_rcu(tfile, key, &hash);

	if (likely(ret == 0)) {
		base = drm_hash_entry(hash, struct ttm_ref_object, hash)->obj;
		base = hlist_entry(hash, struct ttm_ref_object, hash)->obj;
		if (!kref_get_unless_zero(&base->refcount))
			base = NULL;
	}
@@ -343,7 +343,7 @@ int ttm_ref_object_add(struct ttm_object_file *tfile,
		ret = ttm_tfile_find_ref_rcu(tfile, base->handle, &hash);

		if (ret == 0) {
			ref = drm_hash_entry(hash, struct ttm_ref_object, hash);
			ref = hlist_entry(hash, struct ttm_ref_object, hash);
			if (kref_get_unless_zero(&ref->kref)) {
				rcu_read_unlock();
				break;
@@ -407,7 +407,7 @@ int ttm_ref_object_base_unref(struct ttm_object_file *tfile,
		spin_unlock(&tfile->lock);
		return -EINVAL;
	}
	ref = drm_hash_entry(hash, struct ttm_ref_object, hash);
	ref = hlist_entry(hash, struct ttm_ref_object, hash);
	kref_put(&ref->kref, ttm_ref_object_release);
	spin_unlock(&tfile->lock);
	return 0;
+0 −2
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@
#include <linux/list.h>
#include <linux/rcupdate.h>

#include "vmwgfx_hashtab.h"

/**
 * enum ttm_object_type
 *
+2 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ vmw_cmdbuf_res_lookup(struct vmw_cmdbuf_res_manager *man,

	hash_for_each_possible_rcu(man->resources, hash, head, key) {
		if (hash->key == key)
			return drm_hash_entry(hash, struct vmw_cmdbuf_res, hash)->res;
			return hlist_entry(hash, struct vmw_cmdbuf_res, hash)->res;
	}
	return ERR_PTR(-EINVAL);
}
@@ -243,7 +243,7 @@ int vmw_cmdbuf_res_remove(struct vmw_cmdbuf_res_manager *man,

	hash_for_each_possible_rcu(man->resources, hash, head, key) {
		if (hash->key == key) {
			entry = drm_hash_entry(hash, struct vmw_cmdbuf_res, hash);
			entry = hlist_entry(hash, struct vmw_cmdbuf_res, hash);
			break;
		}
	}
Loading