diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-08 14:18:58 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-23 15:19:10 -0500 |
commit | 05394f3975dceb107a5e1393e2244946e5b43660 (patch) | |
tree | 2af73b6efec503ed4cd9c932018619bd28a1fe60 /drivers/gpu/drm/i915/i915_debugfs.c | |
parent | 185cbcb304ba4dee55e39593fd86dcd7813f62ec (diff) |
drm/i915: Use drm_i915_gem_object as the preferred type
A glorified s/obj_priv/obj/ with a net reduction of over a 100 lines and
many characters!
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.c | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 4fe49e0228ef..1e8cd74d18d5 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -87,19 +87,19 @@ static int i915_capabilities(struct seq_file *m, void *data) | |||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
89 | 89 | ||
90 | static const char *get_pin_flag(struct drm_i915_gem_object *obj_priv) | 90 | static const char *get_pin_flag(struct drm_i915_gem_object *obj) |
91 | { | 91 | { |
92 | if (obj_priv->user_pin_count > 0) | 92 | if (obj->user_pin_count > 0) |
93 | return "P"; | 93 | return "P"; |
94 | else if (obj_priv->pin_count > 0) | 94 | else if (obj->pin_count > 0) |
95 | return "p"; | 95 | return "p"; |
96 | else | 96 | else |
97 | return " "; | 97 | return " "; |
98 | } | 98 | } |
99 | 99 | ||
100 | static const char *get_tiling_flag(struct drm_i915_gem_object *obj_priv) | 100 | static const char *get_tiling_flag(struct drm_i915_gem_object *obj) |
101 | { | 101 | { |
102 | switch (obj_priv->tiling_mode) { | 102 | switch (obj->tiling_mode) { |
103 | default: | 103 | default: |
104 | case I915_TILING_NONE: return " "; | 104 | case I915_TILING_NONE: return " "; |
105 | case I915_TILING_X: return "X"; | 105 | case I915_TILING_X: return "X"; |
@@ -140,7 +140,7 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
140 | struct list_head *head; | 140 | struct list_head *head; |
141 | struct drm_device *dev = node->minor->dev; | 141 | struct drm_device *dev = node->minor->dev; |
142 | drm_i915_private_t *dev_priv = dev->dev_private; | 142 | drm_i915_private_t *dev_priv = dev->dev_private; |
143 | struct drm_i915_gem_object *obj_priv; | 143 | struct drm_i915_gem_object *obj; |
144 | size_t total_obj_size, total_gtt_size; | 144 | size_t total_obj_size, total_gtt_size; |
145 | int count, ret; | 145 | int count, ret; |
146 | 146 | ||
@@ -175,12 +175,12 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
175 | } | 175 | } |
176 | 176 | ||
177 | total_obj_size = total_gtt_size = count = 0; | 177 | total_obj_size = total_gtt_size = count = 0; |
178 | list_for_each_entry(obj_priv, head, mm_list) { | 178 | list_for_each_entry(obj, head, mm_list) { |
179 | seq_printf(m, " "); | 179 | seq_printf(m, " "); |
180 | describe_obj(m, obj_priv); | 180 | describe_obj(m, obj); |
181 | seq_printf(m, "\n"); | 181 | seq_printf(m, "\n"); |
182 | total_obj_size += obj_priv->base.size; | 182 | total_obj_size += obj->base.size; |
183 | total_gtt_size += obj_priv->gtt_space->size; | 183 | total_gtt_size += obj->gtt_space->size; |
184 | count++; | 184 | count++; |
185 | } | 185 | } |
186 | mutex_unlock(&dev->struct_mutex); | 186 | mutex_unlock(&dev->struct_mutex); |
@@ -251,14 +251,14 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data) | |||
251 | seq_printf(m, "%d prepares\n", work->pending); | 251 | seq_printf(m, "%d prepares\n", work->pending); |
252 | 252 | ||
253 | if (work->old_fb_obj) { | 253 | if (work->old_fb_obj) { |
254 | struct drm_i915_gem_object *obj_priv = to_intel_bo(work->old_fb_obj); | 254 | struct drm_i915_gem_object *obj = work->old_fb_obj; |
255 | if(obj_priv) | 255 | if (obj) |
256 | seq_printf(m, "Old framebuffer gtt_offset 0x%08x\n", obj_priv->gtt_offset ); | 256 | seq_printf(m, "Old framebuffer gtt_offset 0x%08x\n", obj->gtt_offset); |
257 | } | 257 | } |
258 | if (work->pending_flip_obj) { | 258 | if (work->pending_flip_obj) { |
259 | struct drm_i915_gem_object *obj_priv = to_intel_bo(work->pending_flip_obj); | 259 | struct drm_i915_gem_object *obj = work->pending_flip_obj; |
260 | if(obj_priv) | 260 | if (obj) |
261 | seq_printf(m, "New framebuffer gtt_offset 0x%08x\n", obj_priv->gtt_offset ); | 261 | seq_printf(m, "New framebuffer gtt_offset 0x%08x\n", obj->gtt_offset); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | spin_unlock_irqrestore(&dev->event_lock, flags); | 264 | spin_unlock_irqrestore(&dev->event_lock, flags); |
@@ -421,17 +421,17 @@ static int i915_gem_fence_regs_info(struct seq_file *m, void *data) | |||
421 | seq_printf(m, "Reserved fences = %d\n", dev_priv->fence_reg_start); | 421 | seq_printf(m, "Reserved fences = %d\n", dev_priv->fence_reg_start); |
422 | seq_printf(m, "Total fences = %d\n", dev_priv->num_fence_regs); | 422 | seq_printf(m, "Total fences = %d\n", dev_priv->num_fence_regs); |
423 | for (i = 0; i < dev_priv->num_fence_regs; i++) { | 423 | for (i = 0; i < dev_priv->num_fence_regs; i++) { |
424 | struct drm_gem_object *obj = dev_priv->fence_regs[i].obj; | 424 | struct drm_i915_gem_object *obj = dev_priv->fence_regs[i].obj; |
425 | 425 | ||
426 | seq_printf(m, "Fenced object[%2d] = ", i); | 426 | seq_printf(m, "Fenced object[%2d] = ", i); |
427 | if (obj == NULL) | 427 | if (obj == NULL) |
428 | seq_printf(m, "unused"); | 428 | seq_printf(m, "unused"); |
429 | else | 429 | else |
430 | describe_obj(m, to_intel_bo(obj)); | 430 | describe_obj(m, obj); |
431 | seq_printf(m, "\n"); | 431 | seq_printf(m, "\n"); |
432 | } | 432 | } |
433 | mutex_unlock(&dev->struct_mutex); | ||
434 | 433 | ||
434 | mutex_unlock(&dev->struct_mutex); | ||
435 | return 0; | 435 | return 0; |
436 | } | 436 | } |
437 | 437 | ||
@@ -465,14 +465,14 @@ static int i915_hws_info(struct seq_file *m, void *data) | |||
465 | 465 | ||
466 | static void i915_dump_object(struct seq_file *m, | 466 | static void i915_dump_object(struct seq_file *m, |
467 | struct io_mapping *mapping, | 467 | struct io_mapping *mapping, |
468 | struct drm_i915_gem_object *obj_priv) | 468 | struct drm_i915_gem_object *obj) |
469 | { | 469 | { |
470 | int page, page_count, i; | 470 | int page, page_count, i; |
471 | 471 | ||
472 | page_count = obj_priv->base.size / PAGE_SIZE; | 472 | page_count = obj->base.size / PAGE_SIZE; |
473 | for (page = 0; page < page_count; page++) { | 473 | for (page = 0; page < page_count; page++) { |
474 | u32 *mem = io_mapping_map_wc(mapping, | 474 | u32 *mem = io_mapping_map_wc(mapping, |
475 | obj_priv->gtt_offset + page * PAGE_SIZE); | 475 | obj->gtt_offset + page * PAGE_SIZE); |
476 | for (i = 0; i < PAGE_SIZE; i += 4) | 476 | for (i = 0; i < PAGE_SIZE; i += 4) |
477 | seq_printf(m, "%08x : %08x\n", i, mem[i / 4]); | 477 | seq_printf(m, "%08x : %08x\n", i, mem[i / 4]); |
478 | io_mapping_unmap(mem); | 478 | io_mapping_unmap(mem); |
@@ -484,25 +484,21 @@ static int i915_batchbuffer_info(struct seq_file *m, void *data) | |||
484 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 484 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
485 | struct drm_device *dev = node->minor->dev; | 485 | struct drm_device *dev = node->minor->dev; |
486 | drm_i915_private_t *dev_priv = dev->dev_private; | 486 | drm_i915_private_t *dev_priv = dev->dev_private; |
487 | struct drm_gem_object *obj; | 487 | struct drm_i915_gem_object *obj; |
488 | struct drm_i915_gem_object *obj_priv; | ||
489 | int ret; | 488 | int ret; |
490 | 489 | ||
491 | ret = mutex_lock_interruptible(&dev->struct_mutex); | 490 | ret = mutex_lock_interruptible(&dev->struct_mutex); |
492 | if (ret) | 491 | if (ret) |
493 | return ret; | 492 | return ret; |
494 | 493 | ||
495 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, mm_list) { | 494 | list_for_each_entry(obj, &dev_priv->mm.active_list, mm_list) { |
496 | obj = &obj_priv->base; | 495 | if (obj->base.read_domains & I915_GEM_DOMAIN_COMMAND) { |
497 | if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) { | 496 | seq_printf(m, "--- gtt_offset = 0x%08x\n", obj->gtt_offset); |
498 | seq_printf(m, "--- gtt_offset = 0x%08x\n", | 497 | i915_dump_object(m, dev_priv->mm.gtt_mapping, obj); |
499 | obj_priv->gtt_offset); | ||
500 | i915_dump_object(m, dev_priv->mm.gtt_mapping, obj_priv); | ||
501 | } | 498 | } |
502 | } | 499 | } |
503 | 500 | ||
504 | mutex_unlock(&dev->struct_mutex); | 501 | mutex_unlock(&dev->struct_mutex); |
505 | |||
506 | return 0; | 502 | return 0; |
507 | } | 503 | } |
508 | 504 | ||
@@ -525,7 +521,7 @@ static int i915_ringbuffer_data(struct seq_file *m, void *data) | |||
525 | if (ret) | 521 | if (ret) |
526 | return ret; | 522 | return ret; |
527 | 523 | ||
528 | if (!ring->gem_object) { | 524 | if (!ring->obj) { |
529 | seq_printf(m, "No ringbuffer setup\n"); | 525 | seq_printf(m, "No ringbuffer setup\n"); |
530 | } else { | 526 | } else { |
531 | u8 *virt = ring->virtual_start; | 527 | u8 *virt = ring->virtual_start; |
@@ -983,7 +979,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data) | |||
983 | fb->base.height, | 979 | fb->base.height, |
984 | fb->base.depth, | 980 | fb->base.depth, |
985 | fb->base.bits_per_pixel); | 981 | fb->base.bits_per_pixel); |
986 | describe_obj(m, to_intel_bo(fb->obj)); | 982 | describe_obj(m, fb->obj); |
987 | seq_printf(m, "\n"); | 983 | seq_printf(m, "\n"); |
988 | 984 | ||
989 | list_for_each_entry(fb, &dev->mode_config.fb_list, base.head) { | 985 | list_for_each_entry(fb, &dev->mode_config.fb_list, base.head) { |
@@ -995,7 +991,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data) | |||
995 | fb->base.height, | 991 | fb->base.height, |
996 | fb->base.depth, | 992 | fb->base.depth, |
997 | fb->base.bits_per_pixel); | 993 | fb->base.bits_per_pixel); |
998 | describe_obj(m, to_intel_bo(fb->obj)); | 994 | describe_obj(m, fb->obj); |
999 | seq_printf(m, "\n"); | 995 | seq_printf(m, "\n"); |
1000 | } | 996 | } |
1001 | 997 | ||