intel: Remove support for the DRI1 TFP extension.

This commit is contained in:
Eric Anholt 2010-03-05 13:48:41 -08:00
parent 20952f0378
commit a232cc59e3
7 changed files with 39 additions and 144 deletions

View File

@ -122,6 +122,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
GLuint *state = i830->state.Tex[unit], format, pitch;
GLint lodbias;
GLubyte border[4];
GLuint dst_x, dst_y;
memset(state, 0, sizeof(state));
@ -132,7 +133,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
i830->state.tex_buffer[unit] = NULL;
}
if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit))
if (!intel_finalize_mipmap_tree(intel, unit))
return GL_FALSE;
/* Get first image here, since intelObj->firstLevel will get set in
@ -140,42 +141,20 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
*/
firstImage = tObj->Image[0][intelObj->firstLevel];
if (intelObj->imageOverride) {
i830->state.tex_buffer[unit] = NULL;
i830->state.tex_offset[unit] = intelObj->textureOffset;
intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0,
&dst_x, &dst_y);
switch (intelObj->depthOverride) {
case 32:
format = MAPSURF_32BIT | MT_32BIT_ARGB8888;
break;
case 24:
default:
format = MAPSURF_32BIT | MT_32BIT_XRGB8888;
break;
case 16:
format = MAPSURF_16BIT | MT_16BIT_RGB565;
break;
}
dri_bo_reference(intelObj->mt->region->buffer);
i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
/* XXX: This calculation is probably broken for tiled images with
* a non-page-aligned offset.
*/
i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) *
intelObj->mt->cpp;
pitch = intelObj->pitchOverride;
} else {
GLuint dst_x, dst_y;
intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0,
&dst_x, &dst_y);
dri_bo_reference(intelObj->mt->region->buffer);
i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
/* XXX: This calculation is probably broken for tiled images with
* a non-page-aligned offset.
*/
i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) *
intelObj->mt->cpp;
format = translate_texture_format(firstImage->TexFormat,
firstImage->InternalFormat);
pitch = intelObj->mt->pitch * intelObj->mt->cpp;
}
format = translate_texture_format(firstImage->TexFormat,
firstImage->InternalFormat);
pitch = intelObj->mt->pitch * intelObj->mt->cpp;
state[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 |
(LOAD_TEXTURE_MAP0 << unit) | 4);

View File

@ -150,7 +150,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
i915->state.tex_buffer[unit] = NULL;
}
if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit))
if (!intel_finalize_mipmap_tree(intel, unit))
return GL_FALSE;
/* Get first image here, since intelObj->firstLevel will get set in
@ -158,34 +158,14 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
*/
firstImage = tObj->Image[0][intelObj->firstLevel];
if (intelObj->imageOverride) {
i915->state.tex_buffer[unit] = NULL;
i915->state.tex_offset[unit] = intelObj->textureOffset;
dri_bo_reference(intelObj->mt->region->buffer);
i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */
switch (intelObj->depthOverride) {
case 32:
format = MAPSURF_32BIT | MT_32BIT_ARGB8888;
break;
case 24:
default:
format = MAPSURF_32BIT | MT_32BIT_XRGB8888;
break;
case 16:
format = MAPSURF_16BIT | MT_16BIT_RGB565;
break;
}
pitch = intelObj->pitchOverride;
} else {
dri_bo_reference(intelObj->mt->region->buffer);
i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */
format = translate_texture_format(firstImage->TexFormat,
firstImage->InternalFormat,
tObj->DepthMode);
pitch = intelObj->mt->pitch * intelObj->mt->cpp;
}
format = translate_texture_format(firstImage->TexFormat,
firstImage->InternalFormat,
tObj->DepthMode);
pitch = intelObj->mt->pitch * intelObj->mt->cpp;
state[I915_TEXREG_MS3] =
(((firstImage->Height - 1) << MS3_HEIGHT_SHIFT) |

View File

@ -207,33 +207,14 @@ brw_create_texture_surface( struct brw_context *brw,
surf.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW;
surf.ss0.surface_type = translate_tex_target(key->target);
if (key->bo) {
surf.ss0.surface_format = translate_tex_format(key->format,
key->internal_format,
key->depthmode);
}
else {
switch (key->depth) {
case 32:
surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
break;
default:
case 24:
surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8X8_UNORM;
break;
case 16:
surf.ss0.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM;
break;
}
}
surf.ss0.surface_format = translate_tex_format(key->format,
key->internal_format,
key->depthmode);
/* This is ok for all textures with channel width 8bit or less:
*/
/* surf.ss0.data_return_format = BRW_SURFACERETURNFORMAT_S1; */
if (key->bo)
surf.ss1.base_addr = key->bo->offset; /* reloc */
else
surf.ss1.base_addr = key->offset;
surf.ss1.base_addr = key->bo->offset; /* reloc */
surf.ss2.mip_count = key->last_level - key->first_level;
surf.ss2.width = key->width - 1;
@ -255,17 +236,14 @@ brw_create_texture_surface( struct brw_context *brw,
bo = brw_upload_cache(&brw->surface_cache, BRW_SS_SURFACE,
key, sizeof(*key),
&key->bo, key->bo ? 1 : 0,
&key->bo, 1,
&surf, sizeof(surf));
if (key->bo) {
/* Emit relocation to surface contents */
dri_bo_emit_reloc(bo,
I915_GEM_DOMAIN_SAMPLER, 0,
0,
offsetof(struct brw_surface_state, ss1),
key->bo);
}
/* Emit relocation to surface contents */
drm_intel_bo_emit_reloc(bo, offsetof(struct brw_surface_state, ss1),
key->bo, 0,
I915_GEM_DOMAIN_SAMPLER, 0);
return bo;
}
@ -281,19 +259,12 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit )
memset(&key, 0, sizeof(key));
if (intelObj->imageOverride) {
key.pitch = intelObj->pitchOverride / intelObj->mt->cpp;
key.depth = intelObj->depthOverride;
key.bo = NULL;
key.offset = intelObj->textureOffset;
} else {
key.format = firstImage->TexFormat;
key.internal_format = firstImage->InternalFormat;
key.pitch = intelObj->mt->pitch;
key.depth = firstImage->Depth;
key.bo = intelObj->mt->region->buffer;
key.offset = 0;
}
key.format = firstImage->TexFormat;
key.internal_format = firstImage->InternalFormat;
key.pitch = intelObj->mt->pitch;
key.depth = firstImage->Depth;
key.bo = intelObj->mt->region->buffer;
key.offset = 0;
key.target = tObj->Target;
key.depthmode = tObj->DepthMode;
@ -308,7 +279,7 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit )
brw->wm.surf_bo[surf] = brw_search_cache(&brw->surface_cache,
BRW_SS_SURFACE,
&key, sizeof(key),
&key.bo, key.bo ? 1 : 0,
&key.bo, 1,
NULL);
if (brw->wm.surf_bo[surf] == NULL) {
brw->wm.surf_bo[surf] = brw_create_texture_surface(brw, &key);

View File

@ -96,11 +96,6 @@ const GLuint __driNConfigOptions = 11;
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /*USE_NEW_INTERFACE */
static const __DRItexOffsetExtension intelTexOffsetExtension = {
{ __DRI_TEX_OFFSET },
intelSetTexOffset,
};
static const __DRItexBufferExtension intelTexBufferExtension = {
{ __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
intelSetTexBuffer,
@ -227,7 +222,6 @@ static struct __DRIimageExtensionRec intelImageExtension = {
static const __DRIextension *intelScreenExtensions[] = {
&driReadDrawableExtension,
&intelTexOffsetExtension.base,
&intelTexBufferExtension.base,
&intelFlushExtension.base,
&intelImageExtension.base,

View File

@ -45,8 +45,6 @@ void intelInitTextureCopyImageFuncs(struct dd_function_table *functions);
gl_format intelChooseTextureFormat(GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type);
void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
void intelSetTexBuffer(__DRIcontext *pDRICtx,
GLint target, __DRIdrawable *pDraw);
void intelSetTexBuffer2(__DRIcontext *pDRICtx,

View File

@ -706,29 +706,6 @@ intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
texObj, texImage, GL_TRUE);
}
void
intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch)
{
struct intel_context *intel = pDRICtx->driverPrivate;
struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
struct intel_texture_object *intelObj = intel_texture_object(tObj);
if (!intelObj)
return;
if (intelObj->mt)
intel_miptree_release(intel, &intelObj->mt);
intelObj->imageOverride = GL_TRUE;
intelObj->depthOverride = depth;
intelObj->pitchOverride = pitch;
if (offset)
intelObj->textureOffset = offset;
}
void
intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
GLint texture_format,

View File

@ -46,10 +46,6 @@ struct intel_texture_object
* regions will be copied to this region and the old storage freed.
*/
struct intel_mipmap_tree *mt;
GLboolean imageOverride;
GLint depthOverride;
GLuint pitchOverride;
};
struct intel_texture_image