summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-18 09:04:02 (GMT)
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-20 12:23:11 (GMT)
commit41783eea1a7f7d033ace4fd78218dd5f37b2db5f (patch)
tree01814367fdd89ce0258901d13b108913253bb1aa
parent3cce574f0190dd149472059fb69267cf83d290f9 (diff)
downloadlinux-fsl-qoriq-41783eea1a7f7d033ace4fd78218dd5f37b2db5f.tar.xz
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: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 8186f63..6a2f3e5 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -44,6 +44,7 @@ eb_create(int size)
{
struct eb_objects *eb;
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)
count >>= 1;
eb = kzalloc(count*sizeof(struct hlist_head) +