aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_debugfs.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-27 10:51:07 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-30 04:30:13 -0400
commit5cdf58817433345157644140f2f509f00c06d479 (patch)
tree07ff068968ccf9694e21a1b32a2227d2eda64562 /drivers/gpu/drm/i915/i915_debugfs.c
parent8f2480fb05991f1a5522dd48332cd9db4f7745c6 (diff)
drm/i915: Make get/put pages static
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 47e3a8fdcc6..0d9bbd595ff 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -406,16 +406,19 @@ static int i915_hws_info(struct seq_file *m, void *data)
406 return 0; 406 return 0;
407} 407}
408 408
409static void i915_dump_pages(struct seq_file *m, struct page **pages, int page_count) 409static void i915_dump_object(struct seq_file *m,
410 struct io_mapping *mapping,
411 struct drm_i915_gem_object *obj_priv)
410{ 412{
411 int page, i; 413 int page, page_count, i;
412 uint32_t *mem;
413 414
415 page_count = obj_priv->base.size / PAGE_SIZE;
414 for (page = 0; page < page_count; page++) { 416 for (page = 0; page < page_count; page++) {
415 mem = kmap(pages[page]); 417 u32 *mem = io_mapping_map_wc(mapping,
418 obj_priv->gtt_offset + page * PAGE_SIZE);
416 for (i = 0; i < PAGE_SIZE; i += 4) 419 for (i = 0; i < PAGE_SIZE; i += 4)
417 seq_printf(m, "%08x : %08x\n", i, mem[i / 4]); 420 seq_printf(m, "%08x : %08x\n", i, mem[i / 4]);
418 kunmap(pages[page]); 421 io_mapping_unmap(mem);
419 } 422 }
420} 423}
421 424
@@ -436,16 +439,9 @@ static int i915_batchbuffer_info(struct seq_file *m, void *data)
436 list) { 439 list) {
437 obj = &obj_priv->base; 440 obj = &obj_priv->base;
438 if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) { 441 if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) {
439 ret = i915_gem_object_get_pages(obj, 0); 442 seq_printf(m, "--- gtt_offset = 0x%08x\n",
440 if (ret) { 443 obj_priv->gtt_offset);
441 mutex_unlock(&dev->struct_mutex); 444 i915_dump_object(m, dev_priv->mm.gtt_mapping, obj_priv);
442 return ret;
443 }
444
445 seq_printf(m, "--- gtt_offset = 0x%08x\n", obj_priv->gtt_offset);
446 i915_dump_pages(m, obj_priv->pages, obj->size / PAGE_SIZE);
447
448 i915_gem_object_put_pages(obj);
449 } 445 }
450 } 446 }
451 447