diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2010-04-09 15:05:09 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-19 23:23:14 -0400 |
commit | a8089e849a32c5b6bfd6c88dbd09c0ea4a779b71 (patch) | |
tree | 50eda22881d24af5668d87e3ee90669c2272082e /drivers/gpu | |
parent | 62b8b21515065235bd363ad07094d301532e14ce (diff) |
drm/i915: drop pointer to drm_gem_object
Luckily the change is quite a little bit less invasive than I've
feared.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_debug.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 6 |
6 files changed, 23 insertions, 26 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index a0b8447b06e7..213aa3f67314 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -96,19 +96,18 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
96 | spin_lock(lock); | 96 | spin_lock(lock); |
97 | list_for_each_entry(obj_priv, head, list) | 97 | list_for_each_entry(obj_priv, head, list) |
98 | { | 98 | { |
99 | struct drm_gem_object *obj = obj_priv->obj; | ||
100 | |||
101 | seq_printf(m, " %p: %s %8zd %08x %08x %d%s%s", | 99 | seq_printf(m, " %p: %s %8zd %08x %08x %d%s%s", |
102 | obj, | 100 | &obj_priv->base, |
103 | get_pin_flag(obj_priv), | 101 | get_pin_flag(obj_priv), |
104 | obj->size, | 102 | obj_priv->base.size, |
105 | obj->read_domains, obj->write_domain, | 103 | obj_priv->base.read_domains, |
104 | obj_priv->base.write_domain, | ||
106 | obj_priv->last_rendering_seqno, | 105 | obj_priv->last_rendering_seqno, |
107 | obj_priv->dirty ? " dirty" : "", | 106 | obj_priv->dirty ? " dirty" : "", |
108 | obj_priv->madv == I915_MADV_DONTNEED ? " purgeable" : ""); | 107 | obj_priv->madv == I915_MADV_DONTNEED ? " purgeable" : ""); |
109 | 108 | ||
110 | if (obj->name) | 109 | if (obj_priv->base.name) |
111 | seq_printf(m, " (name: %d)", obj->name); | 110 | seq_printf(m, " (name: %d)", obj_priv->base.name); |
112 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) | 111 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) |
113 | seq_printf(m, " (fence: %d)", obj_priv->fence_reg); | 112 | seq_printf(m, " (fence: %d)", obj_priv->fence_reg); |
114 | if (obj_priv->gtt_space != NULL) | 113 | if (obj_priv->gtt_space != NULL) |
@@ -289,7 +288,7 @@ static int i915_batchbuffer_info(struct seq_file *m, void *data) | |||
289 | spin_lock(&dev_priv->mm.active_list_lock); | 288 | spin_lock(&dev_priv->mm.active_list_lock); |
290 | 289 | ||
291 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { | 290 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { |
292 | obj = obj_priv->obj; | 291 | obj = &obj_priv->base; |
293 | if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) { | 292 | if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) { |
294 | ret = i915_gem_object_get_pages(obj, 0); | 293 | ret = i915_gem_object_get_pages(obj, 0); |
295 | if (ret) { | 294 | if (ret) { |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 354b00f92d45..242993bedab3 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -648,7 +648,6 @@ typedef struct drm_i915_private { | |||
648 | /** driver private structure attached to each drm_gem_object */ | 648 | /** driver private structure attached to each drm_gem_object */ |
649 | struct drm_i915_gem_object { | 649 | struct drm_i915_gem_object { |
650 | struct drm_gem_object base; | 650 | struct drm_gem_object base; |
651 | struct drm_gem_object *obj; | ||
652 | 651 | ||
653 | /** Current space allocated to this object in the GTT, if any. */ | 652 | /** Current space allocated to this object in the GTT, if any. */ |
654 | struct drm_mm_node *gtt_space; | 653 | struct drm_mm_node *gtt_space; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 7c8c01b49d63..47c46ed384f1 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1566,7 +1566,7 @@ i915_gem_process_flushing_list(struct drm_device *dev, | |||
1566 | list_for_each_entry_safe(obj_priv, next, | 1566 | list_for_each_entry_safe(obj_priv, next, |
1567 | &dev_priv->mm.gpu_write_list, | 1567 | &dev_priv->mm.gpu_write_list, |
1568 | gpu_write_list) { | 1568 | gpu_write_list) { |
1569 | struct drm_gem_object *obj = obj_priv->obj; | 1569 | struct drm_gem_object *obj = &obj_priv->base; |
1570 | 1570 | ||
1571 | if ((obj->write_domain & flush_domains) == | 1571 | if ((obj->write_domain & flush_domains) == |
1572 | obj->write_domain) { | 1572 | obj->write_domain) { |
@@ -1704,7 +1704,7 @@ i915_gem_retire_request(struct drm_device *dev, | |||
1704 | obj_priv = list_first_entry(&dev_priv->mm.active_list, | 1704 | obj_priv = list_first_entry(&dev_priv->mm.active_list, |
1705 | struct drm_i915_gem_object, | 1705 | struct drm_i915_gem_object, |
1706 | list); | 1706 | list); |
1707 | obj = obj_priv->obj; | 1707 | obj = &obj_priv->base; |
1708 | 1708 | ||
1709 | /* If the seqno being retired doesn't match the oldest in the | 1709 | /* If the seqno being retired doesn't match the oldest in the |
1710 | * list, then the oldest in the list must still be newer than | 1710 | * list, then the oldest in the list must still be newer than |
@@ -2075,7 +2075,7 @@ i915_gem_find_inactive_object(struct drm_device *dev, int min_size) | |||
2075 | 2075 | ||
2076 | /* Try to find the smallest clean object */ | 2076 | /* Try to find the smallest clean object */ |
2077 | list_for_each_entry(obj_priv, &dev_priv->mm.inactive_list, list) { | 2077 | list_for_each_entry(obj_priv, &dev_priv->mm.inactive_list, list) { |
2078 | struct drm_gem_object *obj = obj_priv->obj; | 2078 | struct drm_gem_object *obj = &obj_priv->base; |
2079 | if (obj->size >= min_size) { | 2079 | if (obj->size >= min_size) { |
2080 | if ((!obj_priv->dirty || | 2080 | if ((!obj_priv->dirty || |
2081 | i915_gem_object_is_purgeable(obj_priv)) && | 2081 | i915_gem_object_is_purgeable(obj_priv)) && |
@@ -2209,7 +2209,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size) | |||
2209 | 2209 | ||
2210 | /* Find an object that we can immediately reuse */ | 2210 | /* Find an object that we can immediately reuse */ |
2211 | list_for_each_entry(obj_priv, &dev_priv->mm.flushing_list, list) { | 2211 | list_for_each_entry(obj_priv, &dev_priv->mm.flushing_list, list) { |
2212 | obj = obj_priv->obj; | 2212 | obj = &obj_priv->base; |
2213 | if (obj->size >= min_size) | 2213 | if (obj->size >= min_size) |
2214 | break; | 2214 | break; |
2215 | 2215 | ||
@@ -2437,7 +2437,7 @@ static int i915_find_fence_reg(struct drm_device *dev) | |||
2437 | i = I915_FENCE_REG_NONE; | 2437 | i = I915_FENCE_REG_NONE; |
2438 | list_for_each_entry(obj_priv, &dev_priv->mm.fence_list, | 2438 | list_for_each_entry(obj_priv, &dev_priv->mm.fence_list, |
2439 | fence_list) { | 2439 | fence_list) { |
2440 | obj = obj_priv->obj; | 2440 | obj = &obj_priv->base; |
2441 | 2441 | ||
2442 | if (obj_priv->pin_count) | 2442 | if (obj_priv->pin_count) |
2443 | continue; | 2443 | continue; |
@@ -4441,7 +4441,6 @@ struct drm_gem_object * i915_gem_alloc_object(struct drm_device *dev, | |||
4441 | obj->agp_type = AGP_USER_MEMORY; | 4441 | obj->agp_type = AGP_USER_MEMORY; |
4442 | 4442 | ||
4443 | obj->base.driver_private = NULL; | 4443 | obj->base.driver_private = NULL; |
4444 | obj->obj = &obj->base; | ||
4445 | obj->fence_reg = I915_FENCE_REG_NONE; | 4444 | obj->fence_reg = I915_FENCE_REG_NONE; |
4446 | INIT_LIST_HEAD(&obj->list); | 4445 | INIT_LIST_HEAD(&obj->list); |
4447 | INIT_LIST_HEAD(&obj->gpu_write_list); | 4446 | INIT_LIST_HEAD(&obj->gpu_write_list); |
@@ -4495,9 +4494,9 @@ i915_gem_evict_from_inactive_list(struct drm_device *dev) | |||
4495 | struct drm_gem_object *obj; | 4494 | struct drm_gem_object *obj; |
4496 | int ret; | 4495 | int ret; |
4497 | 4496 | ||
4498 | obj = list_first_entry(&dev_priv->mm.inactive_list, | 4497 | obj = &list_first_entry(&dev_priv->mm.inactive_list, |
4499 | struct drm_i915_gem_object, | 4498 | struct drm_i915_gem_object, |
4500 | list)->obj; | 4499 | list)->base; |
4501 | 4500 | ||
4502 | ret = i915_gem_object_unbind(obj); | 4501 | ret = i915_gem_object_unbind(obj); |
4503 | if (ret != 0) { | 4502 | if (ret != 0) { |
@@ -5111,7 +5110,7 @@ i915_gem_shrink(int nr_to_scan, gfp_t gfp_mask) | |||
5111 | &dev_priv->mm.inactive_list, | 5110 | &dev_priv->mm.inactive_list, |
5112 | list) { | 5111 | list) { |
5113 | if (i915_gem_object_is_purgeable(obj_priv)) { | 5112 | if (i915_gem_object_is_purgeable(obj_priv)) { |
5114 | i915_gem_object_unbind(obj_priv->obj); | 5113 | i915_gem_object_unbind(&obj_priv->base); |
5115 | if (--nr_to_scan <= 0) | 5114 | if (--nr_to_scan <= 0) |
5116 | break; | 5115 | break; |
5117 | } | 5116 | } |
@@ -5140,7 +5139,7 @@ i915_gem_shrink(int nr_to_scan, gfp_t gfp_mask) | |||
5140 | &dev_priv->mm.inactive_list, | 5139 | &dev_priv->mm.inactive_list, |
5141 | list) { | 5140 | list) { |
5142 | if (nr_to_scan > 0) { | 5141 | if (nr_to_scan > 0) { |
5143 | i915_gem_object_unbind(obj_priv->obj); | 5142 | i915_gem_object_unbind(&obj_priv->base); |
5144 | nr_to_scan--; | 5143 | nr_to_scan--; |
5145 | } else | 5144 | } else |
5146 | cnt++; | 5145 | cnt++; |
diff --git a/drivers/gpu/drm/i915/i915_gem_debug.c b/drivers/gpu/drm/i915/i915_gem_debug.c index 35507cf53fa3..80f380b1d951 100644 --- a/drivers/gpu/drm/i915/i915_gem_debug.c +++ b/drivers/gpu/drm/i915/i915_gem_debug.c | |||
@@ -39,7 +39,7 @@ i915_verify_inactive(struct drm_device *dev, char *file, int line) | |||
39 | struct drm_i915_gem_object *obj_priv; | 39 | struct drm_i915_gem_object *obj_priv; |
40 | 40 | ||
41 | list_for_each_entry(obj_priv, &dev_priv->mm.inactive_list, list) { | 41 | list_for_each_entry(obj_priv, &dev_priv->mm.inactive_list, list) { |
42 | obj = obj_priv->obj; | 42 | obj = &obj_priv->base; |
43 | if (obj_priv->pin_count || obj_priv->active || | 43 | if (obj_priv->pin_count || obj_priv->active || |
44 | (obj->write_domain & ~(I915_GEM_DOMAIN_CPU | | 44 | (obj->write_domain & ~(I915_GEM_DOMAIN_CPU | |
45 | I915_GEM_DOMAIN_GTT))) | 45 | I915_GEM_DOMAIN_GTT))) |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index e357ccd1ce53..ed26b7b7376a 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -613,7 +613,7 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
613 | batchbuffer[1] = NULL; | 613 | batchbuffer[1] = NULL; |
614 | count = 0; | 614 | count = 0; |
615 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { | 615 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { |
616 | struct drm_gem_object *obj = obj_priv->obj; | 616 | struct drm_gem_object *obj = &obj_priv->base; |
617 | 617 | ||
618 | if (batchbuffer[0] == NULL && | 618 | if (batchbuffer[0] == NULL && |
619 | bbaddr >= obj_priv->gtt_offset && | 619 | bbaddr >= obj_priv->gtt_offset && |
@@ -649,7 +649,7 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
649 | if (error->active_bo) { | 649 | if (error->active_bo) { |
650 | int i = 0; | 650 | int i = 0; |
651 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { | 651 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { |
652 | struct drm_gem_object *obj = obj_priv->obj; | 652 | struct drm_gem_object *obj = &obj_priv->base; |
653 | 653 | ||
654 | error->active_bo[i].size = obj->size; | 654 | error->active_bo[i].size = obj->size; |
655 | error->active_bo[i].name = obj->name; | 655 | error->active_bo[i].name = obj->name; |
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index bc3721af855c..b0e17b06eb6e 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -373,7 +373,7 @@ static void intel_overlay_off_tail(struct intel_overlay *overlay) | |||
373 | 373 | ||
374 | /* never have the overlay hw on without showing a frame */ | 374 | /* never have the overlay hw on without showing a frame */ |
375 | BUG_ON(!overlay->vid_bo); | 375 | BUG_ON(!overlay->vid_bo); |
376 | obj = overlay->vid_bo->obj; | 376 | obj = &overlay->vid_bo->base; |
377 | 377 | ||
378 | i915_gem_object_unpin(obj); | 378 | i915_gem_object_unpin(obj); |
379 | drm_gem_object_unreference(obj); | 379 | drm_gem_object_unreference(obj); |
@@ -411,7 +411,7 @@ int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay, | |||
411 | 411 | ||
412 | switch (overlay->hw_wedged) { | 412 | switch (overlay->hw_wedged) { |
413 | case RELEASE_OLD_VID: | 413 | case RELEASE_OLD_VID: |
414 | obj = overlay->old_vid_bo->obj; | 414 | obj = &overlay->old_vid_bo->base; |
415 | i915_gem_object_unpin(obj); | 415 | i915_gem_object_unpin(obj); |
416 | drm_gem_object_unreference(obj); | 416 | drm_gem_object_unreference(obj); |
417 | overlay->old_vid_bo = NULL; | 417 | overlay->old_vid_bo = NULL; |
@@ -467,7 +467,7 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay) | |||
467 | if (ret != 0) | 467 | if (ret != 0) |
468 | return ret; | 468 | return ret; |
469 | 469 | ||
470 | obj = overlay->old_vid_bo->obj; | 470 | obj = &overlay->old_vid_bo->base; |
471 | i915_gem_object_unpin(obj); | 471 | i915_gem_object_unpin(obj); |
472 | drm_gem_object_unreference(obj); | 472 | drm_gem_object_unreference(obj); |
473 | overlay->old_vid_bo = NULL; | 473 | overlay->old_vid_bo = NULL; |