From 28d0497909299b17d9aff12a869cf8f8ae819097 Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Sun, 14 Mar 2010 07:45:27 +0100 Subject: Import radeon, r200 and r300 drivers from mesa 7.4.0. --- configure.ac | 6 +++--- r300/r300_render.c | 16 ++++++++++------ r300/r300_state.c | 42 +++++++++++++----------------------------- r300/r300_swtcl.c | 4 ++-- radeon/radeon_chipset.h | 4 ++++ radeon/radeon_screen.c | 10 ++++++++-- 6 files changed, 40 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index 500a538..a1e1b6d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script AC_PREREQ(2.57) -AC_INIT([mesa-dri-radeon], 7.3.0, [], mesa-dri-radeon) +AC_INIT([mesa-dri-radeon], 7.4.0, [], mesa-dri-radeon) AM_INIT_AUTOMAKE([dist-bzip2]) @@ -16,8 +16,8 @@ AC_PROG_CC AC_HEADER_STDC PKG_CHECK_MODULES([DRM], [libdrm >= 2.3.0]) -PKG_CHECK_MODULES([DRI], [libmesadri >= 7.3.0 libmesadri < 7.4.0 - libmesadricommon >= 7.3.0 libmesadricommon < 7.4.0]) +PKG_CHECK_MODULES([DRI], [libmesadri >= 7.4.0 libmesadri < 7.5.0 + libmesadricommon >= 7.4.0 libmesadricommon < 7.5.0]) AC_OUTPUT([ Makefile diff --git a/r300/r300_render.c b/r300/r300_render.c index f9266e4..16ce4a1 100644 --- a/r300/r300_render.c +++ b/r300/r300_render.c @@ -347,6 +347,8 @@ static GLboolean r300RunRender(GLcontext * ctx, static int r300Fallback(GLcontext * ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); + const unsigned back = ctx->Stencil._BackFace; + /* Do we need to use new-style shaders? * Also is there a better way to do this? */ if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { @@ -371,12 +373,14 @@ static int r300Fallback(GLcontext * ctx) FALLBACK_IF(ctx->RenderMode != GL_RENDER); - FALLBACK_IF(ctx->Stencil._TestTwoSide - && (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] - || ctx->Stencil.ValueMask[0] != - ctx->Stencil.ValueMask[1] - || ctx->Stencil.WriteMask[0] != - ctx->Stencil.WriteMask[1])); + /* If GL_EXT_stencil_two_side is disabled, this fallback check can + * be removed. + */ + FALLBACK_IF(ctx->Stencil.Ref[0] != ctx->Stencil.Ref[back] + || ctx->Stencil.ValueMask[0] != + ctx->Stencil.ValueMask[back] + || ctx->Stencil.WriteMask[0] != + ctx->Stencil.WriteMask[back]); if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) FALLBACK_IF(ctx->Point.PointSprite); diff --git a/r300/r300_state.c b/r300/r300_state.c index a63dbac..b756d1c 100644 --- a/r300/r300_state.c +++ b/r300/r300_state.c @@ -974,15 +974,9 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, { r300ContextPtr rmesa = R300_CONTEXT(ctx); GLuint refmask = - (((ctx->Stencil. - Ref[0] & 0xff) << R300_STENCILREF_SHIFT) | ((ctx-> - Stencil. - ValueMask - [0] & - 0xff) - << - R300_STENCILMASK_SHIFT)); - + ((ctx->Stencil.Ref[0] & 0xff) << R300_STENCILREF_SHIFT) + | ((ctx->Stencil.ValueMask[0] & 0xff) << R300_STENCILMASK_SHIFT); + const unsigned back = ctx->Stencil._BackFace; GLuint flag; R300_STATECHANGE(rmesa, zs); @@ -1000,8 +994,7 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_S_FRONT_FUNC_SHIFT); - if (ctx->Stencil._TestTwoSide) - flag = translate_func(ctx->Stencil.Function[1]); + flag = translate_func(ctx->Stencil.Function[back]); rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_S_BACK_FUNC_SHIFT); @@ -1026,6 +1019,7 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { r300ContextPtr rmesa = R300_CONTEXT(ctx); + const unsigned back = ctx->Stencil._BackFace; R300_STATECHANGE(rmesa, zs); /* It is easier to mask what's left.. */ @@ -1042,23 +1036,13 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << R300_S_FRONT_ZPASS_OP_SHIFT); - if (ctx->Stencil._TestTwoSide) { - rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= - (translate_stencil_op(ctx->Stencil.FailFunc[1]) << - R300_S_BACK_SFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZFailFunc[1]) << - R300_S_BACK_ZFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZPassFunc[1]) << - R300_S_BACK_ZPASS_OP_SHIFT); - } else { - rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= - (translate_stencil_op(ctx->Stencil.FailFunc[0]) << - R300_S_BACK_SFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZFailFunc[0]) << - R300_S_BACK_ZFAIL_OP_SHIFT) - | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) << - R300_S_BACK_ZPASS_OP_SHIFT); - } + rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= + (translate_stencil_op(ctx->Stencil.FailFunc[back]) << + R300_S_BACK_SFAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZFailFunc[back]) << + R300_S_BACK_ZFAIL_OP_SHIFT) + | (translate_stencil_op(ctx->Stencil.ZPassFunc[back]) << + R300_S_BACK_ZPASS_OP_SHIFT); } /* ============================================================= @@ -1214,7 +1198,7 @@ r300FetchStateParameter(GLcontext * ctx, case STATE_R300_TEXRECT_FACTOR:{ struct gl_texture_object *t = - ctx->Texture.Unit[state[2]].CurrentRect; + ctx->Texture.Unit[state[2]].CurrentTex[TEXTURE_RECT_INDEX]; if (t && t->Image[0][t->BaseLevel]) { struct gl_texture_image *image = diff --git a/r300/r300_swtcl.c b/r300/r300_swtcl.c index b6e7ce1..f021e12 100644 --- a/r300/r300_swtcl.c +++ b/r300/r300_swtcl.c @@ -129,13 +129,13 @@ static void r300SetVertexFormat( GLcontext *ctx ) offset = 4; EMIT_PAD(4 * sizeof(float)); } - +/* if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_POINTSIZE )) { EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F ); vap_fmt_0 |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; offset += 1; } - +*/ if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_COLOR0)) { sz = VB->AttribPtr[VERT_ATTRIB_COLOR0]->size; rmesa->swtcl.coloroffset = offset; diff --git a/radeon/radeon_chipset.h b/radeon/radeon_chipset.h index 55a73ea..f6bd1eb 100644 --- a/radeon/radeon_chipset.h +++ b/radeon/radeon_chipset.h @@ -247,6 +247,9 @@ #define PCI_CHIP_RS350_7835 0x7835 #define PCI_CHIP_RS690_791E 0x791E #define PCI_CHIP_RS690_791F 0x791F +#define PCI_CHIP_RS600_793F 0x793F +#define PCI_CHIP_RS600_7941 0x7941 +#define PCI_CHIP_RS600_7942 0x7942 #define PCI_CHIP_RS740_796C 0x796C #define PCI_CHIP_RS740_796D 0x796D #define PCI_CHIP_RS740_796E 0x796E @@ -270,6 +273,7 @@ enum { CHIP_FAMILY_R420, CHIP_FAMILY_RV410, CHIP_FAMILY_RS400, + CHIP_FAMILY_RS600, CHIP_FAMILY_RS690, CHIP_FAMILY_RS740, CHIP_FAMILY_RV515, diff --git a/radeon/radeon_screen.c b/radeon/radeon_screen.c index 5f32dd5..81337da 100644 --- a/radeon/radeon_screen.c +++ b/radeon/radeon_screen.c @@ -680,6 +680,12 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) screen->chip_family = CHIP_FAMILY_RS400; break; + case PCI_CHIP_RS600_793F: + case PCI_CHIP_RS600_7941: + case PCI_CHIP_RS600_7942: + screen->chip_family = CHIP_FAMILY_RS600; + break; + case PCI_CHIP_RS690_791E: case PCI_CHIP_RS690_791F: screen->chip_family = CHIP_FAMILY_RS690; @@ -838,7 +844,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) ret = radeonGetParam( sPriv->fd, RADEON_PARAM_FB_LOCATION, &temp); if (ret) { - if (screen->chip_family < CHIP_FAMILY_RS690) + if (screen->chip_family < CHIP_FAMILY_RS600) screen->fbLocation = ( INREG( RADEON_MC_FB_LOCATION ) & 0xffff) << 16; else { FREE( screen ); @@ -849,7 +855,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) screen->fbLocation = (temp & 0xffff) << 16; } - if (screen->chip_family >= CHIP_FAMILY_RV515) { + if (screen->chip_family >= CHIP_FAMILY_R300) { ret = radeonGetParam( sPriv->fd, RADEON_PARAM_NUM_GB_PIPES, &temp); if (ret) { -- cgit v1.2.3