size = 64*256;
if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA)) {
- fprintf(stderr, "sizeof(drm_r300_cmd_header_t)=%ld\n",
+ fprintf(stderr, "sizeof(drm_r300_cmd_header_t)=%u\n",
sizeof(drm_r300_cmd_header_t));
- fprintf(stderr, "sizeof(drm_radeon_cmd_buffer_t)=%ld\n",
+ fprintf(stderr, "sizeof(drm_radeon_cmd_buffer_t)=%u\n",
sizeof(drm_radeon_cmd_buffer_t));
fprintf(stderr,
"Allocating %d bytes command buffer (max state is %d bytes)\n",
cmd[0].header.cmd_type = R300_CMD_PACKET3;
cmd[0].header.pad0 = R300_CMD_PACKET3_RAW;
- cmd[1].u = R200_CP_CMD_BITBLT_MULTI | (5 << 16);
+ cmd[1].u = R300_CP_CMD_BITBLT_MULTI | (5 << 16);
cmd[2].u = (RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
RADEON_GMC_DST_PITCH_OFFSET_CNTL |
RADEON_GMC_BRUSH_NONE |
GLenum envMode;
};
+
+/* The blit width for texture uploads
+ */
+#define R300_BLIT_WIDTH_BYTES 1024
#define R300_MAX_TEXTURE_UNITS 8
struct r300_texture_state {
#define R300_TX_PITCH_0 0x4500 /* obvious missing in gap */
#define R300_TX_OFFSET_0 0x4540
-
-/* BEGIN: Guess from R200 */
+ /* BEGIN: Guess from R200 */
# define R300_TXO_ENDIAN_NO_SWAP (0 << 0)
# define R300_TXO_ENDIAN_BYTE_SWAP (1 << 0)
# define R300_TXO_ENDIAN_WORD_SWAP (2 << 0)
# define R300_TXO_MICRO_TILE (1 << 3)
# define R300_TXO_OFFSET_MASK 0xffffffe0
# define R300_TXO_OFFSET_SHIFT 5
-/* END: Guess from R200 */
+ /* END: Guess from R200 */
/* 32 bit chroma key */
#define R300_TX_CHROMA_KEY_0 0x4580
# define R300_BLEND_ENABLE (1 << 0)
# define R300_BLEND_UNKNOWN (3 << 1)
# define R300_BLEND_NO_SEPARATE (1 << 3)
- /* the following are shared between CBLEND and ABLEND */
+/* the following are shared between CBLEND and ABLEND */
# define R300_FCN_MASK (3 << 12)
# define R300_COMB_FCN_ADD_CLAMP (0 << 12)
# define R300_COMB_FCN_ADD_NOCLAMP (1 << 12)
# define R300_COMB_FCN_SUB_CLAMP (2 << 12)
# define R300_COMB_FCN_SUB_NOCLAMP (3 << 12)
-# define R300_SRC_BLEND_GL_ZERO (32 << 16)
-# define R300_SRC_BLEND_GL_ONE (33 << 16)
-# define R300_SRC_BLEND_GL_SRC_COLOR (34 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16)
-# define R300_SRC_BLEND_GL_DST_COLOR (36 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16)
-# define R300_SRC_BLEND_GL_SRC_ALPHA (38 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16)
-# define R300_SRC_BLEND_GL_DST_ALPHA (40 << 16)
-# define R300_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16)
-# define R300_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16)
-# define R300_SRC_BLEND_MASK (63 << 16)
-# define R300_DST_BLEND_GL_ZERO (32 << 24)
-# define R300_DST_BLEND_GL_ONE (33 << 24)
-# define R300_DST_BLEND_GL_SRC_COLOR (34 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24)
-# define R300_DST_BLEND_GL_DST_COLOR (36 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24)
-# define R300_DST_BLEND_GL_SRC_ALPHA (38 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24)
-# define R300_DST_BLEND_GL_DST_ALPHA (40 << 24)
-# define R300_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24)
-# define R300_DST_BLEND_MASK (63 << 24)
+# define R300_COMB_FCN_MIN (4 << 12)
+# define R300_COMB_FCN_MAX (5 << 12)
+# define R300_COMB_FCN_RSUB_CLAMP (6 << 12)
+# define R300_COMB_FCN_RSUB_NOCLAMP (7 << 12)
+# define R300_BLEND_GL_ZERO (32)
+# define R300_BLEND_GL_ONE (33)
+# define R300_BLEND_GL_SRC_COLOR (34)
+# define R300_BLEND_GL_ONE_MINUS_SRC_COLOR (35)
+# define R300_BLEND_GL_DST_COLOR (36)
+# define R300_BLEND_GL_ONE_MINUS_DST_COLOR (37)
+# define R300_BLEND_GL_SRC_ALPHA (38)
+# define R300_BLEND_GL_ONE_MINUS_SRC_ALPHA (39)
+# define R300_BLEND_GL_DST_ALPHA (40)
+# define R300_BLEND_GL_ONE_MINUS_DST_ALPHA (41)
+# define R300_BLEND_GL_SRC_ALPHA_SATURATE (42)
+# define R300_BLEND_GL_CONST_COLOR (43)
+# define R300_BLEND_GL_ONE_MINUS_CONST_COLOR (44)
+# define R300_BLEND_GL_CONST_ALPHA (45)
+# define R300_BLEND_GL_ONE_MINUS_CONST_ALPHA (46)
+# define R300_BLEND_MASK (63)
+# define R300_SRC_BLEND_SHIFT (16)
+# define R300_DST_BLEND_SHIFT (24)
#define R300_RB3D_COLORMASK 0x4E0C
# define R300_COLORMASK0_B (1<<0)
# define R300_COLORMASK0_G (1<<1)
/* END: Packet 3 commands */
+
+/* Color formats for 2d packets
+ */
+#define R300_CP_COLOR_FORMAT_CI8 2
+#define R300_CP_COLOR_FORMAT_ARGB1555 3
+#define R300_CP_COLOR_FORMAT_RGB565 4
+#define R300_CP_COLOR_FORMAT_ARGB8888 6
+#define R300_CP_COLOR_FORMAT_RGB332 7
+#define R300_CP_COLOR_FORMAT_RGB8 9
+#define R300_CP_COLOR_FORMAT_ARGB4444 15
+
+/*
+ * CP type-3 packets
+ */
+#define R300_CP_CMD_BITBLT_MULTI 0xC0009B00
+
+
#endif /* _R300_REG_H */
switch (factor) {
case GL_ZERO:
- func = R200_BLEND_GL_ZERO;
+ func = R300_BLEND_GL_ZERO;
break;
case GL_ONE:
- func = R200_BLEND_GL_ONE;
+ func = R300_BLEND_GL_ONE;
break;
case GL_DST_COLOR:
- func = R200_BLEND_GL_DST_COLOR;
+ func = R300_BLEND_GL_DST_COLOR;
break;
case GL_ONE_MINUS_DST_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_DST_COLOR;
+ func = R300_BLEND_GL_ONE_MINUS_DST_COLOR;
break;
case GL_SRC_COLOR:
- func = R200_BLEND_GL_SRC_COLOR;
+ func = R300_BLEND_GL_SRC_COLOR;
break;
case GL_ONE_MINUS_SRC_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_SRC_COLOR;
+ func = R300_BLEND_GL_ONE_MINUS_SRC_COLOR;
break;
case GL_SRC_ALPHA:
- func = R200_BLEND_GL_SRC_ALPHA;
+ func = R300_BLEND_GL_SRC_ALPHA;
break;
case GL_ONE_MINUS_SRC_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_SRC_ALPHA;
+ func = R300_BLEND_GL_ONE_MINUS_SRC_ALPHA;
break;
case GL_DST_ALPHA:
- func = R200_BLEND_GL_DST_ALPHA;
+ func = R300_BLEND_GL_DST_ALPHA;
break;
case GL_ONE_MINUS_DST_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_DST_ALPHA;
+ func = R300_BLEND_GL_ONE_MINUS_DST_ALPHA;
break;
case GL_SRC_ALPHA_SATURATE:
- func =
- (is_src) ? R200_BLEND_GL_SRC_ALPHA_SATURATE :
- R200_BLEND_GL_ZERO;
+ func = (is_src) ? R300_BLEND_GL_SRC_ALPHA_SATURATE :
+ R300_BLEND_GL_ZERO;
break;
case GL_CONSTANT_COLOR:
- func = R200_BLEND_GL_CONST_COLOR;
+ func = R300_BLEND_GL_CONST_COLOR;
break;
case GL_ONE_MINUS_CONSTANT_COLOR:
- func = R200_BLEND_GL_ONE_MINUS_CONST_COLOR;
+ func = R300_BLEND_GL_ONE_MINUS_CONST_COLOR;
break;
case GL_CONSTANT_ALPHA:
- func = R200_BLEND_GL_CONST_ALPHA;
+ func = R300_BLEND_GL_CONST_ALPHA;
break;
case GL_ONE_MINUS_CONSTANT_ALPHA:
- func = R200_BLEND_GL_ONE_MINUS_CONST_ALPHA;
+ func = R300_BLEND_GL_ONE_MINUS_CONST_ALPHA;
break;
default:
fprintf(stderr, "unknown blend factor %x\n", factor);
- func = (is_src) ? R200_BLEND_GL_ONE : R200_BLEND_GL_ZERO;
+ func = (is_src) ? R300_BLEND_GL_ONE : R300_BLEND_GL_ZERO;
}
return func;
}
* This is done in a single
* function because some blend equations (i.e., \c GL_MIN and \c GL_MAX)
* change the interpretation of the blend function.
- * Also, make sure that blend function and blend equation are set to their default
- * value if color blending is not enabled, since at least blend equations GL_MIN
- * and GL_FUNC_REVERSE_SUBTRACT will cause wrong results otherwise for
- * unknown reasons.
+ * Also, make sure that blend function and blend equation are set to their
+ * default value if color blending is not enabled, since at least blend
+ * equations GL_MIN and GL_FUNC_REVERSE_SUBTRACT will cause wrong results
+ * otherwise for unknown reasons.
*/
/* helper function */
static void r300_set_blend_state(GLcontext * ctx)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
- int func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT);
- int eqn = R200_COMB_FCN_ADD_CLAMP;
- int funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ZERO << R200_DST_BLEND_SHIFT);
- int eqnA = R200_COMB_FCN_ADD_CLAMP;
+ int func = (R300_BLEND_GL_ONE << R300_SRC_BLEND_SHIFT) |
+ (R300_BLEND_GL_ZERO << R300_DST_BLEND_SHIFT);
+ int eqn = R300_COMB_FCN_ADD_CLAMP;
+ int funcA = (R300_BLEND_GL_ONE << R300_SRC_BLEND_SHIFT) |
+ (R300_BLEND_GL_ZERO << R300_DST_BLEND_SHIFT);
+ int eqnA = R300_COMB_FCN_ADD_CLAMP;
if (ctx->Color._LogicOpEnabled || !ctx->Color.BlendEnabled) {
r300_set_blend_cntl(r300,
return;
}
- func = (blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE) << R200_SRC_BLEND_SHIFT) |
- (blend_factor(ctx->Color.BlendDstRGB, GL_FALSE) << R200_DST_BLEND_SHIFT);
+ func = (blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE) << R300_SRC_BLEND_SHIFT) |
+ (blend_factor(ctx->Color.BlendDstRGB, GL_FALSE) << R300_DST_BLEND_SHIFT);
switch (ctx->Color.BlendEquationRGB) {
case GL_FUNC_ADD:
break;
case GL_FUNC_REVERSE_SUBTRACT:
- eqn = R200_COMB_FCN_RSUB_CLAMP;
+ eqn = R300_COMB_FCN_RSUB_CLAMP;
break;
case GL_MIN:
- eqn = R200_COMB_FCN_MIN;
- func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
+ eqn = R300_COMB_FCN_MIN;
+ func = (R300_BLEND_GL_ONE << R300_SRC_BLEND_SHIFT) |
+ (R300_BLEND_GL_ONE << R300_DST_BLEND_SHIFT);
break;
case GL_MAX:
- eqn = R200_COMB_FCN_MAX;
- func = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
+ eqn = R300_COMB_FCN_MAX;
+ func = (R300_BLEND_GL_ONE << R300_SRC_BLEND_SHIFT) |
+ (R300_BLEND_GL_ONE << R300_DST_BLEND_SHIFT);
break;
default:
}
- funcA = (blend_factor(ctx->Color.BlendSrcA, GL_TRUE) << R200_SRC_BLEND_SHIFT) |
- (blend_factor(ctx->Color.BlendDstA, GL_FALSE) << R200_DST_BLEND_SHIFT);
+ funcA = (blend_factor(ctx->Color.BlendSrcA, GL_TRUE) << R300_SRC_BLEND_SHIFT) |
+ (blend_factor(ctx->Color.BlendDstA, GL_FALSE) << R300_DST_BLEND_SHIFT);
switch (ctx->Color.BlendEquationA) {
case GL_FUNC_ADD:
break;
case GL_FUNC_REVERSE_SUBTRACT:
- eqnA = R200_COMB_FCN_RSUB_CLAMP;
+ eqnA = R300_COMB_FCN_RSUB_CLAMP;
break;
case GL_MIN:
- eqnA = R200_COMB_FCN_MIN;
- funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
+ eqnA = R300_COMB_FCN_MIN;
+ funcA = (R300_BLEND_GL_ONE << R300_SRC_BLEND_SHIFT) |
+ (R300_BLEND_GL_ONE << R300_DST_BLEND_SHIFT);
break;
case GL_MAX:
- eqnA = R200_COMB_FCN_MAX;
- funcA = (R200_BLEND_GL_ONE << R200_SRC_BLEND_SHIFT) |
- (R200_BLEND_GL_ONE << R200_DST_BLEND_SHIFT);
+ eqnA = R300_COMB_FCN_MAX;
+ funcA = (R300_BLEND_GL_ONE << R300_SRC_BLEND_SHIFT) |
+ (R300_BLEND_GL_ONE << R300_DST_BLEND_SHIFT);
break;
default:
GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
GLfloat ty = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y;
- if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != r300PackFloat32(tx) ||
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != r300PackFloat32(ty))
+ if ( rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] != r300PackFloat32(tx) ||
+ rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] != r300PackFloat32(ty))
{
/* Note: this should also modify whatever data the context reset
* code uses...
*/
R300_STATECHANGE( rmesa, vpt );
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] = r300PackFloat32(tx);
- rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] = r300PackFloat32(ty);
+ rmesa->hw.vpt.cmd[R300_VPT_XOFFSET] = r300PackFloat32(tx);
+ rmesa->hw.vpt.cmd[R300_VPT_YOFFSET] = r300PackFloat32(ty);
}
switch (ctx->Visual.depthBits) {
case 16:
r300->state.depth.scale = 1.0 / (GLfloat) 0xffff;
- depth_fmt = R200_DEPTH_FORMAT_16BIT_INT_Z;
+ depth_fmt = R300_DEPTH_FORMAT_16BIT_INT_Z;
r300->state.stencil.clear = 0x00000000;
break;
case 24:
r300->state.depth.scale = 1.0 / (GLfloat) 0xffffff;
- depth_fmt = R200_DEPTH_FORMAT_24BIT_INT_Z;
+ depth_fmt = R300_DEPTH_FORMAT_24BIT_INT_Z;
r300->state.stencil.clear = 0x00ff0000;
break;
default:
*/
switch (texFormat->TexelBytes) {
case 1:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
+ blit_format = R300_CP_COLOR_FORMAT_CI8;
srcPitch = t->image[0][0].width * texFormat->TexelBytes;
dstPitch = t->image[0][0].width * texFormat->TexelBytes;
break;
case 2:
- blit_format = R200_CP_COLOR_FORMAT_RGB565;
+ blit_format = R300_CP_COLOR_FORMAT_RGB565;
srcPitch = t->image[0][0].width * texFormat->TexelBytes;
dstPitch = t->image[0][0].width * texFormat->TexelBytes;
break;
case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
+ blit_format = R300_CP_COLOR_FORMAT_ARGB8888;
srcPitch = t->image[0][0].width * texFormat->TexelBytes;
dstPitch = t->image[0][0].width * texFormat->TexelBytes;
break;
case 8:
case 16:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
+ blit_format = R300_CP_COLOR_FORMAT_CI8;
srcPitch = t->image[0][0].width * texFormat->TexelBytes;
dstPitch = t->image[0][0].width * texFormat->TexelBytes;
break;
switch (texFormat->TexelBytes) {
case 1:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
+ blit_format = R300_CP_COLOR_FORMAT_CI8;
break;
case 2:
- blit_format = R200_CP_COLOR_FORMAT_RGB565;
+ blit_format = R300_CP_COLOR_FORMAT_RGB565;
break;
case 4:
- blit_format = R200_CP_COLOR_FORMAT_ARGB8888;
+ blit_format = R300_CP_COLOR_FORMAT_ARGB8888;
break;
case 8:
case 16:
- blit_format = R200_CP_COLOR_FORMAT_CI8;
+ blit_format = R300_CP_COLOR_FORMAT_CI8;
break;
default:
return;
needed (only with dxt1 since 2 dxt3/dxt5 blocks already use 32 Byte). */
/* set tex.height to 1/4 since 1 "macropixel" (dxt-block) has 4 real pixels. Needed
so the kernel module reads the right amount of data. */
- tex.format = R200_TXFORMAT_I8; /* any 1-byte texel format */
- tex.pitch = (BLIT_WIDTH_BYTES / 64);
+ tex.format = RADEON_TXFORMAT_I8; /* any 1-byte texel format */
+ tex.pitch = (R300_BLIT_WIDTH_BYTES / 64);
tex.height = (imageHeight + 3) / 4;
tex.width = (imageWidth + 3) / 4;
if ((t->format & R300_TX_FORMAT_DXT1) == R300_TX_FORMAT_DXT1)
#include "r300_tex.h"
#include "r300_reg.h"
-#define R200_TXFORMAT_A8 R200_TXFORMAT_I8
-#define R200_TXFORMAT_L8 R200_TXFORMAT_I8
-#define R200_TXFORMAT_AL88 R200_TXFORMAT_AI88
-#define R200_TXFORMAT_YCBCR R200_TXFORMAT_YVYU422
-#define R200_TXFORMAT_YCBCR_REV R200_TXFORMAT_VYUY422
-#define R200_TXFORMAT_RGB_DXT1 R200_TXFORMAT_DXT1
-#define R200_TXFORMAT_RGBA_DXT1 R200_TXFORMAT_DXT1
-#define R200_TXFORMAT_RGBA_DXT3 R200_TXFORMAT_DXT23
-#define R200_TXFORMAT_RGBA_DXT5 R200_TXFORMAT_DXT45
-
-#define _COLOR(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, 0 }
-#define _COLOR_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { R200_TXFORMAT_ ## f, 0 }
-#define _ALPHA(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f | R200_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _ALPHA_REV(f) \
- [ MESA_FORMAT_ ## f ## _REV ] = { R200_TXFORMAT_ ## f | R200_TXFORMAT_ALPHA_IN_MAP, 0 }
-#define _YUV(f) \
- [ MESA_FORMAT_ ## f ] = { R200_TXFORMAT_ ## f, R200_YUV_TO_RGB }
-#define _INVALID(f) \
- [ MESA_FORMAT_ ## f ] = { 0xffffffff, 0 }
-#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \
- || ((f) >= MESA_FORMAT_RGBA_FLOAT32 && (f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \
- && tx_table[f].flag )
-
-#define _ASSIGN(entry, format) \
- [ MESA_FORMAT_ ## entry ] = { format, 0, 1}
-static const struct {
- GLuint format, filter;
-} tx_table0[] = {
- _ALPHA(RGBA8888),
- _ALPHA_REV(RGBA8888),
- _ALPHA(ARGB8888),
- _ALPHA_REV(ARGB8888),
- _INVALID(RGB888),
- _COLOR(RGB565),
- _COLOR_REV(RGB565),
- _ALPHA(ARGB4444),
- _ALPHA_REV(ARGB4444),
- _ALPHA(ARGB1555),
- _ALPHA_REV(ARGB1555),
- _ALPHA(AL88),
- _ALPHA_REV(AL88),
- _ALPHA(A8),
- _COLOR(L8),
- _ALPHA(I8),
- _INVALID(CI8),
- _YUV(YCBCR),
- _YUV(YCBCR_REV),
- _INVALID(RGB_FXT1),
- _INVALID(RGBA_FXT1),
- _COLOR(RGB_DXT1),
- _ALPHA(RGBA_DXT1),
- _ALPHA(RGBA_DXT3),
- _ALPHA(RGBA_DXT5),
- };
+#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \
+ || ((f) >= MESA_FORMAT_RGBA_FLOAT32 && \
+ (f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \
+ && tx_table[f].flag )
+
+#define _ASSIGN(entry, format) \
+ [ MESA_FORMAT_ ## entry ] = { format, 0, 1}
static const struct {
GLuint format, filter, flag;
_ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)),
};
-#undef _COLOR
-#undef _ALPHA
-#undef _INVALID
#undef _ASSIGN
/* Set the hardware texture format
*/
-
- t->format &= ~(R200_TXFORMAT_FORMAT_MASK |
- R200_TXFORMAT_ALPHA_IN_MAP);
-
if (VALID_FORMAT(baseImage->TexFormat->MesaFormat) &&
tx_table[baseImage->TexFormat->MesaFormat].flag) {
t->format =
tx_table[baseImage->TexFormat->MesaFormat].format;
-#if 1
t->filter |=
tx_table[baseImage->TexFormat->MesaFormat].filter;
-#endif
} else {
_mesa_problem(NULL, "unexpected texture format in %s",
__FUNCTION__);
/* Compute which mipmap levels we really want to send to the hardware.
*/
-
driCalculateTextureFirstLastLevel((driTextureObject *) t);
log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
* memory organized as a rectangle of width BLIT_WIDTH_BYTES.
*/
curOffset = 0;
- blitWidth = BLIT_WIDTH_BYTES;
+ blitWidth = R300_BLIT_WIDTH_BYTES;
t->tile_bits = 0;
/* figure out if this texture is suitable for tiling. */
t->image[0][i].width = MIN2(size / texelBytes, blitWidth);
t->image[0][i].height = (size / texelBytes) / t->image[0][i].width;
} else {
- t->image[0][i].x = curOffset % BLIT_WIDTH_BYTES;
- t->image[0][i].y = curOffset / BLIT_WIDTH_BYTES;
- t->image[0][i].width = MIN2(size, BLIT_WIDTH_BYTES);
+ t->image[0][i].x = curOffset % R300_BLIT_WIDTH_BYTES;
+ t->image[0][i].y = curOffset / R300_BLIT_WIDTH_BYTES;
+ t->image[0][i].width = MIN2(size, R300_BLIT_WIDTH_BYTES);
t->image[0][i].height = size / t->image[0][i].width;
}
#if 0
/* for debugging only and only applicable to non-rectangle targets */
assert(size % t->image[0][i].width == 0);
assert(t->image[0][i].x == 0
- || (size < BLIT_WIDTH_BYTES
+ || (size < R300_BLIT_WIDTH_BYTES
&& t->image[0][i].height == 1));
#endif
t->format |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) |
(log2Height << R200_TXFORMAT_HEIGHT_SHIFT));
#endif
-
+#if 0
t->format_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK);
if (tObj->Target == GL_TEXTURE_3D) {
t->format_x |= (log2Depth << R200_DEPTH_LOG2_SHIFT);
(log2Width << R200_FACE_WIDTH_4_SHIFT) |
(log2Height << R200_FACE_HEIGHT_4_SHIFT));
}
+#endif
+ if (tObj->Target == GL_TEXTURE_CUBE_MAP) {
+ ASSERT(log2Width == log2Height);
+ t->format |= R300_TX_FORMAT_CUBIC_MAP;
+ }
t->size = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << R300_TX_WIDTHMASK_SHIFT)
|((tObj->Image[0][t->base.firstLevel]->Height - 1) << R300_TX_HEIGHTMASK_SHIFT))
/* Need to load the 3d images associated with this unit.
*/
+#if 0
if (t->format & R200_TXFORMAT_NON_POWER2) {
t->format &= ~R200_TXFORMAT_NON_POWER2;
t->base.dirty_images[0] = ~0;
}
-
+#endif
ASSERT(tObj->Target == GL_TEXTURE_3D);
/* R100 & R200 do not support mipmaps for 3D textures.
/* Need to load the 2d images associated with this unit.
*/
+#if 0
if (t->format & R200_TXFORMAT_NON_POWER2) {
t->format &= ~R200_TXFORMAT_NON_POWER2;
for (face = 0; face < 6; face++)
t->base.dirty_images[face] = ~0;
}
-
+#endif
ASSERT(tObj->Target == GL_TEXTURE_CUBE_MAP);
if (t->base.dirty_images[0] || t->base.dirty_images[1] ||
driUpdateTextureLRU((driTextureObject *) t); /* XXX: should be locked! */
}
-#if R200_MERGED
- FALLBACK(&rmesa->radeon, RADEON_FALLBACK_BORDER_MODE, t->border_fallback);
-#endif
-
return !t->border_fallback;
}
r300UpdateTextureUnit(ctx, 6) &&
r300UpdateTextureUnit(ctx, 7)
);
-
-#if R200_MERGED
- FALLBACK(&rmesa->radeon, RADEON_FALLBACK_TEXTURE, !ok);
-#endif
}
#include "radeon_screen.h"
#include "drm.h"
#include "dri_util.h"
+#include "colormac.h"
struct radeon_context;
typedef struct radeon_context radeonContextRec;
(void *)radeon->glCtx);
}
- if (IS_R200_CLASS(radeon->radeonScreen))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(radeon->glCtx);
+ r300Flush(radeon->glCtx);
LOCK_HARDWARE(radeon);
radeon->sarea->pfCurrentPage);
}
- if (IS_R200_CLASS(radeon->radeonScreen))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(radeon->glCtx);
+ r300Flush(radeon->glCtx);
LOCK_HARDWARE(radeon);
if (!dPriv->numClipRects) {
#include "xf86drm.h"
#include "drm.h"
+#if 0
#include "r200_context.h"
+#endif
#include "radeon_drm.h"
extern void radeonCopyBuffer(const __DRIdrawablePrivate * drawable,
#ifndef __RADEON_LOCK_H__
#define __RADEON_LOCK_H__
+#if 0
#include "r200_ioctl.h"
+#endif
+#include "radeon_context.h"
extern void radeonGetLock(radeonContextPtr radeon, GLuint flags);
if (ctx->Scissor.Enabled) {
/* We don't pipeline cliprect changes */
- if (IS_R200_CLASS(radeon->radeonScreen))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(ctx);
+ r300Flush(ctx);
radeonUpdateScissor(ctx);
}
switch(cap) {
case GL_SCISSOR_TEST:
/* We don't pipeline cliprect & scissor changes */
- if (IS_R200_CLASS(radeon->radeonScreen))
- R200_FIREVERTICES((r200ContextPtr)radeon);
- else
- r300Flush(ctx);
+ r300Flush(ctx);
radeon->state.scissor.enabled = state;
radeonUpdateScissor(ctx);