diff options
author | Jonathan Gray <jsg@jsg.id.au> | 2013-02-15 03:04:17 +1100 |
---|---|---|
committer | Jonathan Gray <jsg@jsg.id.au> | 2013-02-15 03:04:17 +1100 |
commit | f7858ef0efb0b3265dec659653627c187ff1b0a0 (patch) | |
tree | c6759b0782c914d7ace7073670ed2683e22534b3 /sys/dev/pci/drm | |
parent | bb8f4e75d4e2f6b21b38f432e7ddc3c7dd5e05e4 (diff) |
fix some remaining casts between drm_obj and drm_i915_gem_object
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/i915_drv.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_gem_evict.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_gem_execbuffer.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_gem_tiling.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/intel_fb.c | 4 |
5 files changed, 12 insertions, 14 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index c310b0c825d..39c89e0353e 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -1064,7 +1064,7 @@ i915_gem_gtt_map_ioctl(struct drm_device *dev, void *data, /* Since we are doing purely uvm-related operations here we do * not need to hold the object, a reference alone is sufficient */ - obj_priv = (struct drm_i915_gem_object *)obj; + obj_priv = to_intel_bo(obj); /* Check size. Also ensure that the object is not purgeable */ if (args->size == 0 || args->offset > obj->size || args->size > @@ -1364,7 +1364,7 @@ again: if (reg->obj == NULL) break; - old_obj_priv = (struct drm_i915_gem_object *)reg->obj; + old_obj_priv = to_intel_bo(reg->obj); if (old_obj_priv->pin_count == 0) avail++; } @@ -1379,7 +1379,7 @@ again: TAILQ_FOREACH(reg, &dev_priv->mm.fence_list, list) { old_obj = reg->obj; - old_obj_priv = (struct drm_i915_gem_object *)old_obj; + old_obj_priv = to_intel_bo(old_obj); if (old_obj_priv->pin_count) continue; @@ -1517,7 +1517,7 @@ i915_gem_object_pin_and_relocate(struct drm_obj *obj, goto err; } - target_obj_priv = (struct drm_i915_gem_object *)target_obj; + target_obj_priv = to_intel_bo(target_obj); /* The target buffer should have appeared before us in the * exec_object list, so it should have a GTT space bound by now. @@ -2076,7 +2076,7 @@ inteldrm_verify_inactive(struct inteldrm_softc *dev_priv, char *file, struct drm_i915_gem_object *obj_priv; TAILQ_FOREACH(obj_priv, &dev_priv->mm.inactive_list, list) { - obj = (struct drm_obj *)obj_priv; + obj = &obj_priv->base; if (obj_priv->pin_count || obj_priv->active || obj->write_domain & I915_GEM_GPU_DOMAINS) DRM_ERROR("inactive %p (p $d a $d w $x) %s:%d\n", @@ -2236,7 +2236,7 @@ i915_gem_fence_regs_info(int kdev) } else { struct drm_i915_gem_object *obj_priv; - obj_priv = (struct drm_i915_gem_object *)obj; + obj_priv = to_intel_bo(obj); printf("Fenced object[%2d] = %p: %s " "%08x %08zx %08x %s %08x %08x %d", i, obj, get_pin_flag(obj_priv), diff --git a/sys/dev/pci/drm/i915_gem_evict.c b/sys/dev/pci/drm/i915_gem_evict.c index f25afda1ee8..b07e3a8e3c9 100644 --- a/sys/dev/pci/drm/i915_gem_evict.c +++ b/sys/dev/pci/drm/i915_gem_evict.c @@ -74,7 +74,7 @@ i915_gem_evict_something(struct inteldrm_softc *dev_priv, size_t min_size) */ obj = i915_gem_find_inactive_object(dev_priv, min_size); if (obj != NULL) { - obj_priv = (struct drm_i915_gem_object *)obj; + obj_priv = to_intel_bo(obj); /* find inactive object returns the object with a * reference for us, and held */ diff --git a/sys/dev/pci/drm/i915_gem_execbuffer.c b/sys/dev/pci/drm/i915_gem_execbuffer.c index 88081a0f5b1..c6d30701db8 100644 --- a/sys/dev/pci/drm/i915_gem_execbuffer.c +++ b/sys/dev/pci/drm/i915_gem_execbuffer.c @@ -443,7 +443,7 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, * command. */ batch_obj = object_list[args->buffer_count - 1]; - batch_obj_priv = (struct drm_i915_gem_object *)batch_obj; + batch_obj_priv = to_intel_bo(batch_obj); if (args->batch_start_offset + args->batch_len > batch_obj->size || batch_obj->pending_write_domain) { ret = EINVAL; @@ -482,7 +482,7 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, mtx_enter(&dev_priv->list_lock); for (i = 0; i < args->buffer_count; i++) { obj = object_list[i]; - obj_priv = (struct drm_i915_gem_object *)obj; + obj_priv = to_intel_bo(obj); drm_lock_obj(obj); obj->write_domain = obj->pending_write_domain; diff --git a/sys/dev/pci/drm/i915_gem_tiling.c b/sys/dev/pci/drm/i915_gem_tiling.c index 97617a5f73a..8f2f2e2afd7 100644 --- a/sys/dev/pci/drm/i915_gem_tiling.c +++ b/sys/dev/pci/drm/i915_gem_tiling.c @@ -315,7 +315,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, obj = drm_gem_object_lookup(dev, file_priv, args->handle); if (obj == NULL) return (EBADF); - obj_priv = (struct drm_i915_gem_object *)obj; + obj_priv = to_intel_bo(obj); drm_hold_object(obj); if (obj_priv->pin_count != 0) { @@ -383,7 +383,7 @@ i915_gem_get_tiling(struct drm_device *dev, void *data, if (obj == NULL) return (EBADF); drm_hold_object(obj); - obj_priv = (struct drm_i915_gem_object *)obj; + obj_priv = to_intel_bo(obj); args->tiling_mode = obj_priv->tiling_mode; switch (obj_priv->tiling_mode) { diff --git a/sys/dev/pci/drm/intel_fb.c b/sys/dev/pci/drm/intel_fb.c index 4a712f754a1..b0e9ad50ab6 100644 --- a/sys/dev/pci/drm/intel_fb.c +++ b/sys/dev/pci/drm/intel_fb.c @@ -220,7 +220,6 @@ intel_fbdev_destroy(struct drm_device *dev, struct intel_fbdev *ifbdev) struct fb_info *info; #endif struct intel_framebuffer *ifb = &ifbdev->ifb; - struct drm_obj *obj; #if 0 if (ifbdev->helper.fbdev) { @@ -237,8 +236,7 @@ intel_fbdev_destroy(struct drm_device *dev, struct intel_fbdev *ifbdev) drm_framebuffer_cleanup(&ifb->base); if (ifb->obj) { - obj = (struct drm_obj *)ifb->obj; - drm_gem_object_unreference(obj); + drm_gem_object_unreference(&ifb->obj->base); ifb->obj = NULL; } } |