From 394c25133e756e9d9580b65e0f1af7d67155e0f7 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 8 Apr 2010 22:09:11 -0400 Subject: glx: Fix config chooser logic for 'mask' matching When matching attributes using the 'mask' matching criteria, the spec says that "Only GLXFBConfigs for which the set bits of attribute include all the bits that are set in the requested value are considered. (Additional bits might be set in the attribute)." The current test returns true if the two bit masks have bits in common, specifically it matches even if the requested value has bits set that are not set in the fbconfig attribute. For example, an application asking for GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT | GLX_PBUFFER_BIT, as glxpbdemo does, will match fbconfigs that don't support pbuffer rendering, as long as they support pixmap rendering. Reviewed-by: Ian Romanick --- src/glx/glxcmds.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 51a75e352bb..e2c47812d7a 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -1110,6 +1110,13 @@ init_fbconfig_for_chooser(__GLcontextModes * config, } \ } while ( 0 ) +/* Test that all bits from a are contained in b */ +#define MATCH_MASK(param) \ + do { \ + if ((a->param & ~b->param) != 0) \ + return False; \ + } while (0); + /** * Determine if two GLXFBConfigs are compatible. * @@ -1148,11 +1155,8 @@ fbconfigs_compatible(const __GLcontextModes * const a, MATCH_DONT_CARE(stereoMode); MATCH_EXACT(level); - if (((a->drawableType & b->drawableType) == 0) - || ((a->renderType & b->renderType) == 0)) { - return False; - } - + MATCH_MASK(drawableType); + MATCH_MASK(renderType); /* There is a bug in a few of the XFree86 DDX drivers. They contain * visuals with a "transparent type" of 0 when they really mean GLX_NONE. -- cgit v1.2.3 From edff2e058571cfd8e1cb94e668c35f3d3cac4d80 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 9 Apr 2010 20:20:42 -0400 Subject: r600: add new r7xx pci ids --- src/mesa/drivers/dri/radeon/radeon_chipset.h | 3 +++ src/mesa/drivers/dri/radeon/radeon_screen.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/mesa/drivers/dri/radeon/radeon_chipset.h b/src/mesa/drivers/dri/radeon/radeon_chipset.h index f17a305bce8..98732c810c5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_chipset.h +++ b/src/mesa/drivers/dri/radeon/radeon_chipset.h @@ -357,6 +357,7 @@ #define PCI_CHIP_RV770_9456 0x9456 #define PCI_CHIP_RV770_945A 0x945A #define PCI_CHIP_RV770_945B 0x945B +#define PCI_CHIP_RV770_945E 0x945E #define PCI_CHIP_RV790_9460 0x9460 #define PCI_CHIP_RV790_9462 0x9462 #define PCI_CHIP_RV770_946A 0x946A @@ -368,6 +369,7 @@ #define PCI_CHIP_RV730_9487 0x9487 #define PCI_CHIP_RV730_9488 0x9488 #define PCI_CHIP_RV730_9489 0x9489 +#define PCI_CHIP_RV730_948A 0x948A #define PCI_CHIP_RV730_948F 0x948F #define PCI_CHIP_RV730_9490 0x9490 #define PCI_CHIP_RV730_9491 0x9491 @@ -386,6 +388,7 @@ #define PCI_CHIP_RV710_9553 0x9553 #define PCI_CHIP_RV710_9555 0x9555 #define PCI_CHIP_RV710_9557 0x9557 +#define PCI_CHIP_RV710_955F 0x955F #define PCI_CHIP_RV740_94A0 0x94A0 #define PCI_CHIP_RV740_94A1 0x94A1 diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 6415ec1239c..4d7255f47e7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -846,6 +846,7 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id) case PCI_CHIP_RV770_9456: case PCI_CHIP_RV770_945A: case PCI_CHIP_RV770_945B: + case PCI_CHIP_RV770_945E: case PCI_CHIP_RV790_9460: case PCI_CHIP_RV790_9462: case PCI_CHIP_RV770_946A: @@ -860,6 +861,7 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id) case PCI_CHIP_RV730_9487: case PCI_CHIP_RV730_9488: case PCI_CHIP_RV730_9489: + case PCI_CHIP_RV730_948A: case PCI_CHIP_RV730_948F: case PCI_CHIP_RV730_9490: case PCI_CHIP_RV730_9491: @@ -881,6 +883,7 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id) case PCI_CHIP_RV710_9553: case PCI_CHIP_RV710_9555: case PCI_CHIP_RV710_9557: + case PCI_CHIP_RV710_955F: screen->chip_family = CHIP_FAMILY_RV710; screen->chip_flags = RADEON_CHIPSET_TCL; break; -- cgit v1.2.3 From 6a5518861e541db76bae0fa69d1d025805d90f2c Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Fri, 9 Apr 2010 21:14:15 +0200 Subject: r300: set proper vertex index limits also in non indexed mode Fixes #27521, broken menus in UT2004 and broken water refraction in Sauerbraten. --- src/mesa/drivers/dri/r300/r300_render.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 95961314863..11eafd3aeea 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -386,6 +386,14 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim) WARN_ONCE("Fixme: can't handle spliting prim %d\n", prim); return; } + + if (rmesa->radeon.radeonScreen->kernel_mm) { + BEGIN_BATCH_NO_AUTOSTATE(2); + OUT_BATCH_REGSEQ(R300_VAP_VF_MAX_VTX_INDX, 1); + OUT_BATCH(rmesa->radeon.tcl.aos[0].count); + END_BATCH(); + } + r300_emit_scissor(rmesa->radeon.glCtx); while (num_verts > 0) { int nr; -- cgit v1.2.3 From 2657325c4a73a2bfa94888a936d06466000e7fbf Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 11 Apr 2010 12:39:54 +0200 Subject: r300: respect radeon common code fallbacks Fixes progs/demos/shadowtex under KMS --- src/mesa/drivers/dri/r300/r300_context.c | 3 +++ src/mesa/drivers/dri/r300/r300_render.c | 8 ++++++-- src/mesa/drivers/dri/r300/r300_render.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index ff35cd52753..689bb138133 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -61,6 +61,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_state.h" #include "r300_tex.h" #include "r300_emit.h" +#include "r300_render.h" #include "r300_swtcl.h" #include "radeon_bocs_wrapper.h" #include "radeon_buffer_objects.h" @@ -226,6 +227,8 @@ static void r300_fallback(GLcontext *ctx, GLuint bit, GLboolean mode) r300->radeon.Fallback |= bit; else r300->radeon.Fallback &= ~bit; + + r300SwitchFallback(ctx, R300_FALLBACK_RADEON_COMMON, mode); } static void r300_emit_query_finish(radeonContextPtr radeon) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 11eafd3aeea..bb8f91491f5 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -408,8 +408,9 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim) COMMIT_BATCH(); } -static const char *getFallbackString(uint32_t bit) +static const char *getFallbackString(r300ContextPtr rmesa, uint32_t bit) { + static char common_fallback_str[32]; switch (bit) { case R300_FALLBACK_VERTEX_PROGRAM : return "vertex program"; @@ -429,6 +430,9 @@ static const char *getFallbackString(uint32_t bit) return "render mode != GL_RENDER"; case R300_FALLBACK_FRAGMENT_PROGRAM: return "fragment program"; + case R300_FALLBACK_RADEON_COMMON: + snprintf(common_fallback_str, 32, "radeon common 0x%08x", rmesa->radeon.Fallback); + return common_fallback_str; case R300_FALLBACK_AOS_LIMIT: return "aos limit"; case R300_FALLBACK_INVALID_BUFFERS: @@ -448,7 +452,7 @@ void r300SwitchFallback(GLcontext *ctx, uint32_t bit, GLboolean mode) if (mode) { if ((fallback_warn & bit) == 0) { if (RADEON_DEBUG & RADEON_FALLBACKS) - fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit)); + fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(rmesa, bit)); fallback_warn |= bit; } rmesa->fallback |= bit; diff --git a/src/mesa/drivers/dri/r300/r300_render.h b/src/mesa/drivers/dri/r300/r300_render.h index ec785474a67..581e9fa0ccd 100644 --- a/src/mesa/drivers/dri/r300/r300_render.h +++ b/src/mesa/drivers/dri/r300/r300_render.h @@ -41,6 +41,7 @@ #define R300_FALLBACK_STENCIL_TWOSIDE (1 << 21) #define R300_FALLBACK_RENDER_MODE (1 << 22) #define R300_FALLBACK_FRAGMENT_PROGRAM (1 << 23) +#define R300_FALLBACK_RADEON_COMMON (1 << 29) #define R300_FALLBACK_AOS_LIMIT (1 << 30) #define R300_FALLBACK_INVALID_BUFFERS (1 << 31) #define R300_RASTER_FALLBACK_MASK 0xffff0000 -- cgit v1.2.3