From 79de983b6f260415e1f952cefbc3a593ed861171 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 27 Jan 2006 11:58:00 +0000 Subject: [PATCH] initial copytexsubimage code, untested --- src/mesa/drivers/dri/i915/Makefile | 1 + src/mesa/drivers/dri/i915/i915_tex_layout.c | 11 + src/mesa/drivers/dri/i915/i915_texstate.c | 15 +- src/mesa/drivers/dri/i915/intel_context.c | 9 +- src/mesa/drivers/dri/i915/intel_context.h | 15 +- src/mesa/drivers/dri/i915/intel_pixel.c | 27 +- src/mesa/drivers/dri/i915/intel_tex.h | 19 ++ src/mesa/drivers/dri/i915/intel_tex_copy.c | 283 ++++++++++++++++++ src/mesa/drivers/dri/i915/intel_tex_format.c | 9 +- src/mesa/drivers/dri/i915/intel_tex_image.c | 37 ++- .../drivers/dri/i915/intel_tex_subimage.c | 26 ++ 11 files changed, 416 insertions(+), 36 deletions(-) create mode 100644 src/mesa/drivers/dri/i915/intel_tex_copy.c diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index fecb41e3d83..132794d798c 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -11,6 +11,7 @@ DRIVER_SOURCES = \ i915_tex_layout.c \ intel_tex_image.c \ intel_tex_subimage.c \ + intel_tex_copy.c \ intel_tex_validate.c \ intel_tex_format.c \ intel_tex.c \ diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c index bf0d551bf5f..5c480c3d9e6 100644 --- a/src/mesa/drivers/dri/i915/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c @@ -150,6 +150,11 @@ GLboolean i915_miptree_layout( struct intel_mipmap_tree *mt ) break; } } + _mesa_printf("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__, + mt->pitch, + mt->total_height, + mt->cpp, + mt->pitch * mt->total_height * mt->cpp ); return GL_TRUE; } @@ -324,6 +329,12 @@ GLboolean i945_miptree_layout( struct intel_mipmap_tree *mt ) break; } } + _mesa_printf("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__, + mt->pitch, + mt->total_height, + mt->cpp, + mt->pitch * mt->total_height * mt->cpp ); + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 0eed85c201d..19833660983 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -259,13 +259,14 @@ static GLboolean i915_update_tex_unit( GLcontext *ctx, memcpy(i915->state.Tex[unit], state, sizeof(state)); } - _mesa_printf("state[I915_TEXREG_SS2] = 0x%x\n", state[I915_TEXREG_SS2]); - _mesa_printf("state[I915_TEXREG_SS3] = 0x%x\n", state[I915_TEXREG_SS3]); - _mesa_printf("state[I915_TEXREG_SS4] = 0x%x\n", state[I915_TEXREG_SS4]); - - _mesa_printf("state[I915_TEXREG_MS2] = 0x%x\n", state[I915_TEXREG_MS2]); - _mesa_printf("state[I915_TEXREG_MS3] = 0x%x\n", state[I915_TEXREG_MS3]); - _mesa_printf("state[I915_TEXREG_MS4] = 0x%x\n", state[I915_TEXREG_MS4]); + if (INTEL_DEBUG & DEBUG_TEXTURE) { + _mesa_printf("state[I915_TEXREG_SS2] = 0x%x\n", state[I915_TEXREG_SS2]); + _mesa_printf("state[I915_TEXREG_SS3] = 0x%x\n", state[I915_TEXREG_SS3]); + _mesa_printf("state[I915_TEXREG_SS4] = 0x%x\n", state[I915_TEXREG_SS4]); + _mesa_printf("state[I915_TEXREG_MS2] = 0x%x\n", state[I915_TEXREG_MS2]); + _mesa_printf("state[I915_TEXREG_MS3] = 0x%x\n", state[I915_TEXREG_MS3]); + _mesa_printf("state[I915_TEXREG_MS4] = 0x%x\n", state[I915_TEXREG_MS4]); + } return GL_TRUE; } diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index 699824f012c..b9a7b8622d6 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -197,7 +197,7 @@ const struct dri_extension card_extensions[] = { "GL_NV_blend_square", NULL }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_vertex_program1_1", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, +/* { "GL_SGIS_generate_mipmap", NULL }, */ { NULL, NULL } }; @@ -368,7 +368,12 @@ GLboolean intelInitContext( intelContextPtr intel, _math_matrix_ctr (&intel->ViewportMatrix); - driInitExtensions( ctx, card_extensions, GL_TRUE ); + /* Disable imaging extension until convolution is working in + * teximage paths: + */ + driInitExtensions( ctx, card_extensions, +/* GL_TRUE, */ + GL_FALSE); if (intel->ctx.Mesa_DXTn) { _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" ); diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index 63749461727..7f7f0f39088 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -533,8 +533,21 @@ extern void intel_dump_batchbuffer( long offset, */ extern void intelInitPixelFuncs( struct dd_function_table *functions ); +GLboolean intel_check_color_per_fragment_ops( const GLcontext *ctx ); -/* Inline conversion functions. These are better-typed than the macros used previously: +GLboolean intel_clip_to_framebuffer( GLcontext *ctx, + const GLframebuffer *buffer, + GLint *x, GLint *y, + GLsizei *width, GLsizei *height ); + +struct intel_region *intel_readbuf_region( struct intel_context *intel ); +struct intel_region *intel_drawbuf_region( struct intel_context *intel ); + + + +/*====================================================================== + * Inline conversion functions. + * These are better-typed than the macros used previously: */ static inline struct intel_context *intel_context( GLcontext *ctx ) { diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c index 3e9ac06d8f2..f629b1fbb45 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel.c +++ b/src/mesa/drivers/dri/i915/intel_pixel.c @@ -72,8 +72,7 @@ check_color( GLcontext *ctx, GLenum type, GLenum format, return GL_FALSE; } -static GLboolean -check_color_per_fragment_ops( const GLcontext *ctx ) +GLboolean intel_check_color_per_fragment_ops( const GLcontext *ctx ) { return !(ctx->Color.AlphaEnabled || ctx->Depth.Test || @@ -90,11 +89,10 @@ check_color_per_fragment_ops( const GLcontext *ctx ) -static GLboolean -clip_pixelrect( GLcontext *ctx, - const GLframebuffer *buffer, - GLint *x, GLint *y, - GLsizei *width, GLsizei *height ) +GLboolean intel_clip_to_framebuffer( GLcontext *ctx, + const GLframebuffer *buffer, + GLint *x, GLint *y, + GLsizei *width, GLsizei *height ) { /* left clipping */ if (*x < buffer->_Xmin) { @@ -122,9 +120,6 @@ clip_pixelrect( GLcontext *ctx, if (*height <= 0) return GL_FALSE; -/* *size = ((*y + *height - 1) * intel->intelScreen->front.pitch + */ -/* (*x + *width - 1) * intel->intelScreen->cpp); */ - return GL_TRUE; } @@ -189,7 +184,7 @@ intelTryReadPixels( GLcontext *ctx, drm_clip_rect_t *box = dPriv->pClipRects; int i; - if (!clip_pixelrect(ctx, ctx->ReadBuffer, &x, &y, &width, &height)) { + if (!intel_clip_to_framebuffer(ctx, ctx->ReadBuffer, &x, &y, &width, &height)) { UNLOCK_HARDWARE( intel ); if (INTEL_DEBUG & DEBUG_PIXEL) fprintf(stderr, "%s totally clipped -- nothing to do\n", @@ -278,7 +273,7 @@ static void do_draw_pix( GLcontext *ctx, { y -= height; /* cope with pixel zoom */ - if (!clip_pixelrect(ctx, ctx->DrawBuffer, + if (!intel_clip_to_framebuffer(ctx, ctx->DrawBuffer, &x, &y, &width, &height)) { UNLOCK_HARDWARE( intel ); return; @@ -414,7 +409,7 @@ intelDrawPixels( GLcontext *ctx, } -static struct intel_region *intel_drawbuf_region( struct intel_context *intel ) +struct intel_region *intel_drawbuf_region( struct intel_context *intel ) { switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) { case BUFFER_BIT_FRONT_LEFT: @@ -429,7 +424,7 @@ static struct intel_region *intel_drawbuf_region( struct intel_context *intel ) } } -static struct intel_region *intel_readbuf_region( struct intel_context *intel ) +struct intel_region *intel_readbuf_region( struct intel_context *intel ) { GLcontext *ctx = &intel->ctx; @@ -527,7 +522,7 @@ static GLboolean intelTryCopyPixels( GLcontext *ctx, if (!ctx->DrawBuffer) goto out; - if (!clip_pixelrect(ctx, ctx->DrawBuffer, &dstx, &dsty, &width, &height)) + if (!intel_clip_to_framebuffer(ctx, ctx->DrawBuffer, &dstx, &dsty, &width, &height)) goto out; /* Update source for clipped dest. Need to also clip the source rect. @@ -535,7 +530,7 @@ static GLboolean intelTryCopyPixels( GLcontext *ctx, srcx = dstx + delta_x; srcy = dsty + delta_y; - if (!clip_pixelrect(ctx, ctx->DrawBuffer, &srcx, &srcy, &width, &height)) + if (!intel_clip_to_framebuffer(ctx, ctx->DrawBuffer, &srcx, &srcy, &width, &height)) goto out; /* Update dest for clipped source: diff --git a/src/mesa/drivers/dri/i915/intel_tex.h b/src/mesa/drivers/dri/i915/intel_tex.h index c3f3cdd0531..33d2e279c95 100644 --- a/src/mesa/drivers/dri/i915/intel_tex.h +++ b/src/mesa/drivers/dri/i915/intel_tex.h @@ -79,6 +79,25 @@ void intelTexSubImage1D(GLcontext *ctx, struct gl_texture_object *texObj, struct gl_texture_image *texImage); +void intelCopyTexImage1D( GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, + GLint border ); + +void intelCopyTexImage2D( GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border ); + +void intelCopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, + GLint x, GLint y, GLsizei width ); + +void intelCopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height ); + + GLuint intel_validate_mipmap_tree( struct intel_context *intel, struct intel_texture_object *intelObj ); diff --git a/src/mesa/drivers/dri/i915/intel_tex_copy.c b/src/mesa/drivers/dri/i915/intel_tex_copy.c new file mode 100644 index 00000000000..6696e9ad9dc --- /dev/null +++ b/src/mesa/drivers/dri/i915/intel_tex_copy.c @@ -0,0 +1,283 @@ +/************************************************************************** + * + * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include "mtypes.h" +#include "enums.h" +#include "teximage.h" +#include "swrast/swrast.h" + +#include "intel_screen.h" +#include "intel_context.h" +#include "intel_batchbuffer.h" +#include "intel_mipmap_tree.h" +#include "intel_regions.h" +#include "intel_tex.h" +#include "bufmgr.h" + +/* Do the best we can using the blitter. A future project is to use + * the texture engine and fragment programs for these copies. + */ + +static struct intel_region *get_teximage_source( struct intel_context *intel, + GLenum internalFormat ) +{ + switch (internalFormat) { + case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT16_ARB: + if (intel->intelScreen->cpp == 2) + return intel->depth_region; + return NULL; + case GL_DEPTH24_STENCIL8_EXT: + case GL_DEPTH_STENCIL_EXT: + if (intel->intelScreen->cpp == 4) + return intel->depth_region; + return NULL; + case GL_RGBA: + return intel_readbuf_region( intel ); + case GL_RGB: + if (intel->intelScreen->cpp == 2) + return intel_readbuf_region( intel ); + return NULL; + default: + return NULL; + } +} + + +static GLboolean do_copy_texsubimage( struct intel_context *intel, + struct intel_texture_image *intelImage, + GLenum internalFormat, + GLint dstx, GLint dsty, + GLint x, GLint y, + GLsizei width, GLsizei height ) +{ + GLcontext *ctx = &intel->ctx; + struct intel_region *src = get_teximage_source(intel, internalFormat); + GLuint ret = GL_TRUE; + + if (!intelImage->mt) + return GL_FALSE; + + if (!intel_check_color_per_fragment_ops( ctx )) + return GL_FALSE; + + + LOCK_HARDWARE(intel); + { + __DRIdrawablePrivate *dPriv = intel->driDrawable; + struct bm_buffer_list *list = bmNewBufferList(); + GLuint image_offset = intel_miptree_image_offset(intelImage->mt, + intelImage->face, + intelImage->level); + GLuint dst_offset = 0; + GLuint src_offset = 0; + GLint orig_x = x; + GLint orig_y = y; + + if (!intel_clip_to_framebuffer(ctx, ctx->DrawBuffer, &x, &y, &width, &height)) { + ret = GL_TRUE; + goto out; + } + + /* Update dst for clipped src. Need to also clip the source rect. + */ + dstx = x - orig_x; + dsty = y - orig_y; + + y = dPriv->h - y - height; /* convert from gl to hardware coords */ + x += dPriv->x; + y += dPriv->y; + + + bmAddBuffer(list, intelImage->mt->region->buffer, BM_WRITE, NULL, &dst_offset); + bmAddBuffer(list, src->buffer, BM_READ, NULL, &src_offset); + if (!bmValidateBufferList(intel->bm, list, BM_MEM_AGP)) { + ret = GL_FALSE; + goto out; + } + + intelEmitCopyBlitLocked( intel, + intelImage->mt->cpp, + src->pitch, src_offset, + intelImage->mt->pitch, + dst_offset + image_offset, + x, y, + dstx, dsty, + width, height ); + + intelFlushBatchLocked( intel, GL_TRUE, GL_FALSE, GL_FALSE); + bmFenceBufferList(intel->bm, list); + + out: + bmFreeBufferList(list); + } + + + UNLOCK_HARDWARE(intel); + if (!ret) + return GL_FALSE; + +#if 0 + /* GL_SGIS_generate_mipmap -- this can be accelerated now. + */ + if (level == texObj->BaseLevel && + texObj->GenerateMipmap) { + intel_generate_mipmap(ctx, target, + &ctx->Texture.Unit[ctx->Texture.CurrentUnit], + texObj); + } +#endif + + return GL_TRUE; +} + + + + + +void intelCopyTexImage1D( GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, + GLint border ) +{ + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + + if (border) + goto fail; + + /* Setup or redefine the texture object, mipmap tree and texture + * image. Don't populate yet. + */ + ctx->Driver.TexImage1D(ctx, target, level, internalFormat, + width, border, + GL_RGBA, CHAN_TYPE, NULL, + &ctx->DefaultPacking, texObj, texImage); + + + + if (!texImage) + goto fail; + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, + 0, 0, + x, y, + width, 1)) + goto fail; + + return; + + fail: + _swrast_copy_teximage1d( ctx, target, level, internalFormat, x, y, + width, border ); +} + +void intelCopyTexImage2D( GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border ) +{ + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + + if (border) + goto fail; + + /* Setup or redefine the texture object, mipmap tree and texture + * image. Don't populate yet. + */ + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, + GL_RGBA, CHAN_TYPE, NULL, + &ctx->DefaultPacking, texObj, texImage); + + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, + 0, 0, + x, y, + width, height)) + goto fail; + + return; + + fail: + _swrast_copy_teximage2d( ctx, target, level, internalFormat, x, y, + width, height, border ); +} + + +void intelCopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, + GLint x, GLint y, GLsizei width ) +{ + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + GLenum internalFormat = texImage->InternalFormat; + + /* Need to check texture is compatible with source format. + */ + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, + xoffset, 0, + x, y, width, 1)) { + _swrast_copy_texsubimage1d( ctx, target, level, + xoffset, x, y, width ); + } +} + + + +void intelCopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height ) +{ + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texUnit, target, level); + GLenum internalFormat = texImage->InternalFormat; + + + /* Need to check texture is compatible with source format. + */ + + if (!do_copy_texsubimage(intel_context(ctx), + intel_texture_image(texImage), + internalFormat, + xoffset, yoffset, + x, y, width, height)) { + _swrast_copy_texsubimage2d( ctx, target, level, + xoffset, yoffset, + x, y, width, height ); + } +} diff --git a/src/mesa/drivers/dri/i915/intel_tex_format.c b/src/mesa/drivers/dri/i915/intel_tex_format.c index 30da8419870..a645165fb27 100644 --- a/src/mesa/drivers/dri/i915/intel_tex_format.c +++ b/src/mesa/drivers/dri/i915/intel_tex_format.c @@ -7,13 +7,16 @@ * hardware. However, there is still a need to map the formats onto * hardware descriptors. */ +/* Note that the i915 can actually support many more formats than + * these if we take the step of simply swizzling the colors + * immediately after sampling... + */ const struct gl_texture_format * intelChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { intelContextPtr intel = INTEL_CONTEXT( ctx ); - const GLboolean do32bpt = ( intel->intelScreen->cpp == 4 && - intel->intelScreen->tex.size > 4*1024*1024); + const GLboolean do32bpt = (intel->intelScreen->cpp == 4); switch ( internalFormat ) { case 4: @@ -57,7 +60,7 @@ intelChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + return &_mesa_texformat_argb8888; case GL_RGB5: case GL_RGB4: diff --git a/src/mesa/drivers/dri/i915/intel_tex_image.c b/src/mesa/drivers/dri/i915/intel_tex_image.c index d307e507b54..ab5e33466c0 100644 --- a/src/mesa/drivers/dri/i915/intel_tex_image.c +++ b/src/mesa/drivers/dri/i915/intel_tex_image.c @@ -215,17 +215,24 @@ static void intelTexImage(GLcontext *ctx, free(texImage->Data); } - pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1, - format, type, - pixels, packing, "glTexImage"); - if (!pixels) - return; + /* XXX: If this is the only texture image in the tree, could call + * bmBufferData with NULL data to free the old block and avoid + * waiting on any outstanding fences. + * + * XXX: Better to do this internally to intel_mipmap_tree.c, + * somehow? + */ + if (intelObj->mt && + intelObj->mt->first_level == level && + intelObj->mt->last_level == level && + intelObj->mt->target != GL_TEXTURE_CUBE_MAP_ARB) { + } + if (!intelObj->mt) { guess_and_alloc_mipmap_tree(intel, intelObj, intelImage); } - - LOCK_HARDWARE(intel); + if (intelObj->mt && intelObj->mt != intelImage->mt && @@ -237,6 +244,22 @@ static void intelTexImage(GLcontext *ctx, intelImage->mt = intel_miptree_reference(intelObj->mt); } + + + /* intelCopyTexImage calls this function with pixels == NULL, with + * the expectation that the mipmap tree will be set up but nothing + * more will be done. This is where those calls return: + */ + pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, 1, + format, type, + pixels, packing, "glTexImage"); + if (!pixels) + return; + + + + + LOCK_HARDWARE(intel); if (intelImage->mt) { texImage->Data = intel_miptree_image_map(intel, diff --git a/src/mesa/drivers/dri/i915/intel_tex_subimage.c b/src/mesa/drivers/dri/i915/intel_tex_subimage.c index 4c7910ffa8f..9ee208e5985 100644 --- a/src/mesa/drivers/dri/i915/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/i915/intel_tex_subimage.c @@ -1,4 +1,30 @@ +/************************************************************************** + * + * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ #include "mtypes.h" #include "texobj.h"