Commit 0a732870 authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter

drm/i915: BUG_ON bad PPGTT offset

Because PPGTT PDEs within the GTT are calculated in cachelines
(HW guys consistency ftw) we do a divide which will wreak havoc if this
is wrong, and I know that from experience).

If/when we move to multiple PPGTTs this will have to become a WARN, and
return an error. For now however it should always be considered fatal,
and only a developer could hit it.
Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
[danvet: s/BUG/WARN]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 186507e9
...@@ -110,6 +110,8 @@ static int gen6_ppgtt_enable(struct drm_device *dev) ...@@ -110,6 +110,8 @@ static int gen6_ppgtt_enable(struct drm_device *dev)
uint32_t pd_entry; uint32_t pd_entry;
int i; int i;
WARN_ON(ppgtt->pd_offset & 0x3f);
pd_addr = (gen6_gtt_pte_t __iomem*)dev_priv->gtt.gsm + pd_addr = (gen6_gtt_pte_t __iomem*)dev_priv->gtt.gsm +
ppgtt->pd_offset / sizeof(gen6_gtt_pte_t); ppgtt->pd_offset / sizeof(gen6_gtt_pte_t);
for (i = 0; i < ppgtt->num_pd_entries; i++) { for (i = 0; i < ppgtt->num_pd_entries; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment