Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41783eea authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter
Browse files

drm/i915: Assert that the exec object lookup table is a power-of-two



As we make the simplification of using a power-of-two size for the
execbuffer handle-to-object TLB, we should validate that this is actually
true and so clarify that premise.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 3cce574f
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ eb_create(int size)
{
{
	struct eb_objects *eb;
	struct eb_objects *eb;
	int count = PAGE_SIZE / sizeof(struct hlist_head) / 2;
	int count = PAGE_SIZE / sizeof(struct hlist_head) / 2;
	BUILD_BUG_ON(!is_power_of_2(PAGE_SIZE / sizeof(struct hlist_head)));
	while (count > size)
	while (count > size)
		count >>= 1;
		count >>= 1;
	eb = kzalloc(count*sizeof(struct hlist_head) +
	eb = kzalloc(count*sizeof(struct hlist_head) +