Skip to content

Commit

Permalink
drm/gma500: Add debugging info to psb_gtt_restore()
Browse files Browse the repository at this point in the history
This makes it easier to see what's going on during resume/restore.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
  • Loading branch information
Patrik Jakobsson committed Apr 15, 2013
1 parent 4dd6a89 commit 1611f84
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/gpu/drm/gma500/gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,18 +563,25 @@ int psb_gtt_restore(struct drm_device *dev)
struct drm_psb_private *dev_priv = dev->dev_private;
struct resource *r = dev_priv->gtt_mem->child;
struct gtt_range *range;
unsigned int restored = 0, total = 0, size = 0;

/* On resume, the gtt_mutex is already initialized */
mutex_lock(&dev_priv->gtt_mutex);
psb_gtt_init(dev, 1);

while (r != NULL) {
range = container_of(r, struct gtt_range, resource);
if (range->pages)
if (range->pages) {
psb_gtt_insert(dev, range, 1);
size += range->resource.end - range->resource.start;
restored++;
}
r = r->sibling;
total++;
}
mutex_unlock(&dev_priv->gtt_mutex);
DRM_DEBUG_DRIVER("Restored %u of %u gtt ranges (%u KB)", restored,
total, (size / 1024));

return 0;
}

0 comments on commit 1611f84

Please sign in to comment.