static void psb_gem_free_object(struct drm_gem_object *obj)
{
- struct gtt_range *gtt = container_of(obj, struct gtt_range, gem);
+ struct gtt_range *gtt = to_gtt_range(obj);
/* Remove the list map if one is present */
drm_gem_free_mmap_offset(obj);
dev = obj->dev;
dev_priv = to_drm_psb_private(dev);
- r = container_of(obj, struct gtt_range, gem); /* Get the gtt range */
+ r = to_gtt_range(obj);
/* Make sure we don't parallel update on a fault, nor move or remove
something from beneath our feet */
/* Unpin the old GEM object */
if (gma_crtc->cursor_obj) {
- gt = container_of(gma_crtc->cursor_obj,
- struct gtt_range, gem);
+ gt = to_gtt_range(gma_crtc->cursor_obj);
psb_gtt_unpin(gt);
drm_gem_object_put(gma_crtc->cursor_obj);
gma_crtc->cursor_obj = NULL;
goto unref_cursor;
}
- gt = container_of(obj, struct gtt_range, gem);
+ gt = to_gtt_range(obj);
/* Pin the memory into the GTT */
ret = psb_gtt_pin(gt);
/* unpin the old bo */
if (gma_crtc->cursor_obj) {
- gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem);
+ gt = to_gtt_range(gma_crtc->cursor_obj);
psb_gtt_unpin(gt);
drm_gem_object_put(gma_crtc->cursor_obj);
}