Remove ttm entrypoints. That memory manager interface isn't going to see the

light of day and has already been removed in mesa master (ages ago).

As a bonus, removes the annoying "falling back to classic" message on
launching a gl application.

ok matthieu@.
This commit is contained in:
oga 2009-01-10 15:56:13 +00:00
parent 64d859dd9e
commit 7efd4e6855
5 changed files with 17 additions and 105 deletions

View File

@ -59,7 +59,6 @@
#include "intel_buffer_objects.h"
#include "intel_fbo.h"
#include "intel_decode.h"
#include "intel_bufmgr_ttm.h"
#include "drirenderbuffer.h"
#include "vblank.h"
@ -271,12 +270,6 @@ static const struct dri_extension brw_extensions[] = {
{ NULL, NULL }
};
static const struct dri_extension ttm_extensions[] = {
{"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
{"GL_ARB_pixel_buffer_object", NULL},
{NULL, NULL}
};
/**
* Initializes potential list of extensions if ctx == NULL, or actually enables
* extensions for a context.
@ -291,9 +284,6 @@ void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging)
driInitExtensions(ctx, card_extensions, enable_imaging);
if (intel == NULL || intel->ttm)
driInitExtensions(ctx, ttm_extensions, GL_FALSE);
if (intel == NULL || IS_965(intel->intelScreen->deviceID))
driInitExtensions(ctx, brw_extensions, GL_FALSE);
}
@ -409,63 +399,24 @@ static GLboolean
intel_init_bufmgr(struct intel_context *intel)
{
intelScreenPrivate *intelScreen = intel->intelScreen;
GLboolean ttm_disable = getenv("INTEL_NO_TTM") != NULL;
GLboolean ttm_supported;
/* If we've got a new enough DDX that's initializing TTM and giving us
* object handles for the shared buffers, use that.
*/
intel->ttm = GL_FALSE;
if (intel->intelScreen->driScrnPriv->dri2.enabled)
ttm_supported = GL_TRUE;
else if (intel->intelScreen->driScrnPriv->ddx_version.minor >= 9 &&
intel->intelScreen->drmMinor >= 11 &&
intel->intelScreen->front.bo_handle != -1)
ttm_supported = GL_TRUE;
else
ttm_supported = GL_FALSE;
if (!ttm_disable && ttm_supported) {
int bo_reuse_mode;
intel->bufmgr = intel_bufmgr_ttm_init(intel->driFd,
DRM_FENCE_TYPE_EXE,
DRM_FENCE_TYPE_EXE |
DRM_I915_FENCE_TYPE_RW,
BATCH_SZ);
if (intel->bufmgr != NULL)
intel->ttm = GL_TRUE;
bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse");
switch (bo_reuse_mode) {
case DRI_CONF_BO_REUSE_DISABLED:
break;
case DRI_CONF_BO_REUSE_ALL:
intel_ttm_enable_bo_reuse(intel->bufmgr);
break;
}
if (intelScreen->tex.size == 0) {
fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n",
__func__, __LINE__);
return GL_FALSE;
}
/* Otherwise, use the classic buffer manager. */
if (intel->bufmgr == NULL) {
if (ttm_disable) {
fprintf(stderr, "TTM buffer manager disabled. Using classic.\n");
} else {
fprintf(stderr, "Failed to initialize TTM buffer manager. "
"Falling back to classic.\n");
}
if (intelScreen->tex.size == 0) {
fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n",
__func__, __LINE__);
return GL_FALSE;
}
intel->bufmgr = dri_bufmgr_fake_init(intelScreen->tex.offset,
intelScreen->tex.map,
intelScreen->tex.size,
intel_fence_emit,
intel_fence_wait,
intel);
}
intel->bufmgr = dri_bufmgr_fake_init(intelScreen->tex.offset,
intelScreen->tex.map,
intelScreen->tex.size,
intel_fence_emit,
intel_fence_wait,
intel);
return GL_TRUE;
}

View File

@ -43,8 +43,6 @@
#include "drm.h"
#include "i915_drm.h"
#include "intel_bufmgr_ttm.h"
#define FILE_DEBUG_FLAG DEBUG_IOCTL
int

View File

@ -44,7 +44,6 @@
#include "intel_blit.h"
#include "intel_buffer_objects.h"
#include "dri_bufmgr.h"
#include "intel_bufmgr_ttm.h"
#include "intel_batchbuffer.h"
#define FILE_DEBUG_FLAG DEBUG_REGION
@ -114,19 +113,6 @@ intel_region_alloc(struct intel_context *intel,
return intel_region_alloc_internal(intel, cpp, pitch, height, 0, buffer);
}
struct intel_region *
intel_region_alloc_for_handle(struct intel_context *intel,
GLuint cpp, GLuint pitch, GLuint height,
GLuint tiled, GLuint handle)
{
dri_bo *buffer;
buffer = intel_ttm_bo_create_from_handle(intel->bufmgr, "region", handle);
return intel_region_alloc_internal(intel,
cpp, pitch, height, tiled, buffer);
}
void
intel_region_reference(struct intel_region **dst, struct intel_region *src)
{
@ -437,20 +423,13 @@ intel_recreate_static(struct intel_context *intel,
region->height = intelScreen->height; /* needed? */
region->tiled = region_desc->tiled;
if (intel->ttm) {
assert(region_desc->bo_handle != -1);
region->buffer = intel_ttm_bo_create_from_handle(intel->bufmgr,
name,
region_desc->bo_handle);
} else {
region->buffer = dri_bo_alloc_static(intel->bufmgr,
name,
region_desc->offset,
intelScreen->pitch *
intelScreen->height,
region_desc->map,
DRM_BO_FLAG_MEM_TT);
}
region->buffer = dri_bo_alloc_static(intel->bufmgr,
name,
region_desc->offset,
intelScreen->pitch *
intelScreen->height,
region_desc->map,
DRM_BO_FLAG_MEM_TT);
assert(region->buffer != NULL);

View File

@ -66,11 +66,6 @@ struct intel_region *intel_region_alloc(struct intel_context *intel,
GLuint cpp,
GLuint pitch, GLuint height);
struct intel_region *
intel_region_alloc_for_handle(struct intel_context *intel,
GLuint cpp, GLuint pitch, GLuint height,
GLuint tiled, unsigned int handle);
void intel_region_reference(struct intel_region **dst,
struct intel_region *src);

View File

@ -49,7 +49,6 @@
#include "i830_dri.h"
#include "intel_regions.h"
#include "intel_batchbuffer.h"
#include "intel_bufmgr_ttm.h"
PUBLIC const char __driConfigOptions[] =
DRI_CONF_BEGIN
@ -243,16 +242,6 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
intelScreen->depth.size = sarea->depth_size;
intelScreen->depth.tiled = sarea->depth_tiled;
if (intelScreen->driScrnPriv->ddx_version.minor >= 9) {
intelScreen->front.bo_handle = sarea->front_bo_handle;
intelScreen->back.bo_handle = sarea->back_bo_handle;
intelScreen->depth.bo_handle = sarea->depth_bo_handle;
} else {
intelScreen->front.bo_handle = -1;
intelScreen->back.bo_handle = -1;
intelScreen->depth.bo_handle = -1;
}
intelScreen->tex.offset = sarea->tex_offset;
intelScreen->logTextureGranularity = sarea->log_tex_granularity;
intelScreen->tex.handle = sarea->tex_handle;