summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-07-26 17:47:59 -0700
committerEric Anholt <eric@anholt.net>2010-07-26 17:53:27 -0700
commitafe125e0a18ac3886c45c7e6b02b122fb2d327b5 (patch)
tree78621707e71154c0b388b0baacffc26432b7e992 /src/mesa/drivers/dri/radeon
parentd64343f1ae84979bd154475badf11af8a9bfc2eb (diff)
parent5403ca79b225605c79f49866a6497c97da53be3b (diff)
Merge remote branch 'origin/master' into glsl2
This pulls in multiple i965 driver fixes which will help ensure better testing coverage during development, and also gets past the conflicts of the src/mesa/shader -> src/mesa/program move. Conflicts: src/mesa/Makefile src/mesa/main/shaderapi.c src/mesa/main/shaderobj.h
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common_context.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c10
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c16
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_tex_getimage.c9
4 files changed, 16 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c
index 94f476617b..5a7d52c4d2 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c
@@ -300,10 +300,10 @@ void radeonDestroyContext(__DRIcontext *driContextPriv )
_mesa_meta_free(radeon->glCtx);
if (radeon == current) {
- radeon_firevertices(radeon);
_mesa_make_current(NULL, NULL, NULL);
}
+ radeon_firevertices(radeon);
if (!is_empty_list(&radeon->dma.reserved)) {
rcommonFlushCmdBuf( radeon, __FUNCTION__ );
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
index 6cd1d87de2..c877e6c176 100644
--- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
+++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
@@ -602,17 +602,17 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t
__FUNCTION__, texObj ,t->minLod, t->maxLod);
radeon_mipmap_tree *dst_miptree;
- dst_miptree = get_biggest_matching_miptree(t, t->minLod, t->maxLod);
+ dst_miptree = get_biggest_matching_miptree(t, t->base.BaseLevel, t->base.MaxLevel);
+ radeon_miptree_unreference(&t->mt);
if (!dst_miptree) {
- radeon_miptree_unreference(&t->mt);
radeon_try_alloc_miptree(rmesa, t);
- dst_miptree = t->mt;
radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
"%s: No matching miptree found, allocated new one %p\n",
__FUNCTION__, t->mt);
} else {
+ radeon_miptree_reference(dst_miptree, &t->mt);
radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
"%s: Using miptree %p\n", __FUNCTION__, t->mt);
}
@@ -629,7 +629,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t
"Checking image level %d, face %d, mt %p ... ",
level, face, img->mt);
- if (img->mt != dst_miptree) {
+ if (img->mt != t->mt) {
radeon_print(RADEON_TEXTURE, RADEON_TRACE,
"MIGRATING\n");
@@ -637,7 +637,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t
if (src_bo && radeon_bo_is_referenced_by_cs(src_bo, rmesa->cmdbuf.cs)) {
radeon_firevertices(rmesa);
}
- migrate_image_to_miptree(dst_miptree, img, face, level);
+ migrate_image_to_miptree(t->mt, img, face, level);
} else
radeon_print(RADEON_TEXTURE, RADEON_TRACE, "OK\n");
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 4f59511a52..82107cc6ae 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -52,7 +52,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_tex.h"
#elif defined(RADEON_R200)
#include "r200_context.h"
-#include "r200_ioctl.h"
#include "r200_tex.h"
#elif defined(RADEON_R300)
#include "r300_context.h"
@@ -338,12 +337,6 @@ static const __DRItexBufferExtension radeonTexBufferExtension = {
#endif
#if defined(RADEON_R200)
-static const __DRIallocateExtension r200AllocateExtension = {
- { __DRI_ALLOCATE, __DRI_ALLOCATE_VERSION },
- r200AllocateMemoryMESA,
- r200FreeMemoryMESA,
- r200GetMemoryOffsetMESA
-};
static const __DRItexOffsetExtension r200texOffsetExtension = {
{ __DRI_TEX_OFFSET, __DRI_TEX_OFFSET_VERSION },
@@ -1209,7 +1202,6 @@ radeonCreateScreen( __DRIscreen *sPriv )
i = 0;
screen->extensions[i++] = &driCopySubBufferExtension.base;
- screen->extensions[i++] = &driFrameTrackingExtension.base;
screen->extensions[i++] = &driReadDrawableExtension;
if ( screen->irq != 0 ) {
@@ -1222,9 +1214,6 @@ radeonCreateScreen( __DRIscreen *sPriv )
#endif
#if defined(RADEON_R200)
- if (IS_R200_CLASS(screen))
- screen->extensions[i++] = &r200AllocateExtension.base;
-
screen->extensions[i++] = &r200texOffsetExtension.base;
#endif
@@ -1366,8 +1355,8 @@ radeonCreateScreen2(__DRIscreen *sPriv)
i = 0;
screen->extensions[i++] = &driCopySubBufferExtension.base;
- screen->extensions[i++] = &driFrameTrackingExtension.base;
screen->extensions[i++] = &driReadDrawableExtension;
+ screen->extensions[i++] = &dri2ConfigQueryExtension.base;
if ( screen->irq != 0 ) {
screen->extensions[i++] = &driSwapControlExtension.base;
@@ -1379,9 +1368,6 @@ radeonCreateScreen2(__DRIscreen *sPriv)
#endif
#if defined(RADEON_R200)
- if (IS_R200_CLASS(screen))
- screen->extensions[i++] = &r200AllocateExtension.base;
-
screen->extensions[i++] = &r200TexBufferExtension.base;
#endif
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c b/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c
index 3ababb1ef5..f878b48e5f 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c
@@ -31,6 +31,7 @@
#include "radeon_common_context.h"
#include "radeon_texture.h"
+#include "radeon_mipmap_tree.h"
#include "main/texgetimage.h"
@@ -51,7 +52,15 @@ radeon_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
__func__, ctx, texObj, image, compressed);
if (image->mt) {
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
/* Map the texture image read-only */
+ if (radeon_bo_is_referenced_by_cs(image->mt->bo, rmesa->cmdbuf.cs)) {
+ radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+ "%s: called for texture that is queued for GPU processing\n",
+ __func__);
+ radeon_firevertices(rmesa);
+ }
+
radeon_teximage_map(image, GL_FALSE);
} else {
/* Image hasn't been uploaded to a miptree yet */