diff options
author | Owain G. Ainsworth <oga@openbsd.org> | 2010-05-31 18:40:48 +0100 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2010-05-31 18:40:48 +0100 |
commit | 94b208d9e7d85e58d0a4c7803ba2c2a72ed73dd3 (patch) | |
tree | ad1f45ef8c54f8e5fc14279dce8e99e0ec60d9c3 /src/i830_memory.c | |
parent | 1f0f41c3d4170ff28c6b88395abda7039bbddd8a (diff) |
Remove all code that pretends to work if we lack drm and gem.
It doesn't work, and just adds extra complexity for no real gain by this
point.
Diffstat (limited to 'src/i830_memory.c')
-rw-r--r-- | src/i830_memory.c | 58 |
1 files changed, 7 insertions, 51 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c index de0c1cde..f26ec6dd 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -198,7 +198,7 @@ static Bool i830_bind_memory(ScrnInfoPtr scrn, i830_memory *mem) if (mem == NULL || mem->bound || intel->use_drm_mode) return TRUE; - if (intel->have_gem && mem->bo != NULL) { + if (mem->bo != NULL) { if (dri_bo_pin(mem->bo, mem->alignment) != 0) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, @@ -332,8 +332,6 @@ void i830_reset_allocations(ScrnInfoPtr scrn) intel->front_buffer = NULL; intel->overlay_regs = NULL; intel->power_context = NULL; - intel->ring.mem = NULL; - intel->fake_bufmgr_mem = NULL; } /** @@ -442,15 +440,14 @@ Bool i830_allocator_init(ScrnInfoPtr scrn, unsigned long size) /* Tell the kernel to manage it */ ret = ioctl(intel->drmSubFD, DRM_IOCTL_I915_GEM_INIT, &init); - if (ret == 0) { - intel->have_gem = TRUE; - i830_init_bufmgr(scrn); - } else { + if (ret != 0) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to initialize kernel memory manager\n"); i830_free_memory(scrn, intel->memory_manager); intel->memory_manager = NULL; + return FALSE; } + i830_init_bufmgr(scrn); } else { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to allocate space for kernel memory manager\n"); @@ -464,8 +461,8 @@ void i830_allocator_fini(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); - /* The memory manager is more special */ if - (intel->memory_manager) { + /* The memory manager is more special */ + if (intel->memory_manager) { i830_free_memory(scrn, intel->memory_manager); intel->memory_manager = NULL; } @@ -829,7 +826,7 @@ i830_memory *i830_allocate_memory(ScrnInfoPtr scrn, const char *name, * kernel. Under UMS, we separately reserve space for * a few objects (overlays, power context, cursors, etc). */ - if (intel->have_gem && (intel->use_drm_mode || + if ((intel->use_drm_mode || !(flags & (NEED_PHYSICAL_ADDR|NEED_LIFETIME_FIXED)))) { return i830_allocate_memory_bo(scrn, name, size, pitch, alignment, flags, tile_format); @@ -934,31 +931,6 @@ i830_describe_allocations(ScrnInfoPtr scrn, int verbosity, const char *prefix) } } -static Bool i830_allocate_ringbuffer(ScrnInfoPtr scrn) -{ - intel_screen_private *intel = intel_get_screen_private(scrn); - - if (intel->have_gem || intel->ring.mem != NULL) - return TRUE; - - /* We don't have any mechanism in the DRM yet to alert it that we've - * moved the ringbuffer since init time, so allocate it fixed for its - * lifetime. - */ - intel->ring.mem = i830_allocate_memory(scrn, "ring buffer", - PRIMARY_RINGBUFFER_SIZE, PITCH_NONE, GTT_PAGE_SIZE, - NEED_LIFETIME_FIXED, TILE_NONE); - if (intel->ring.mem == NULL) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to allocate Ring Buffer space\n"); - return FALSE; - } - - intel->ring.tail_mask = intel->ring.mem->size - 1; - intel->ring.virtual_start = intel->FbBase + intel->ring.mem->offset; - return TRUE; -} - /** * Allocate space for overlay registers. */ @@ -1238,10 +1210,6 @@ Bool i830_allocate_2d_memory(ScrnInfoPtr scrn) "\tthe agpgart module loaded.\n"); return FALSE; } - - /* Allocate the ring buffer first, so it ends up in stolen mem. */ - if (!i830_allocate_ringbuffer(scrn)) - return FALSE; } if (intel->fb_compression) @@ -1254,18 +1222,6 @@ Bool i830_allocate_2d_memory(ScrnInfoPtr scrn) return FALSE; } - if (!intel->have_gem) { - intel->fake_bufmgr_mem = i830_allocate_memory(scrn, - "fake bufmgr", MB(8), PITCH_NONE, GTT_PAGE_SIZE, 0, - TILE_NONE); - if (intel->fake_bufmgr_mem == NULL) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Failed to allocate fake bufmgr space.\n"); - return FALSE; - } - i830_init_bufmgr(scrn); - } - if (!intel->use_drm_mode) i830_allocate_overlay(scrn); |