drm_radeon_cmd_header_t *cmd = NULL;
cmd =
- (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1,
- __FUNCTION__);
+ (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__);
cmd[0].header.cmd_type = R300_CMD_END3D;
}
drm_radeon_cmd_header_t *cmd = NULL;
cmd =
- (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1,
- __FUNCTION__);
+ (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__);
cmd[0].i = cmdcpdelay(count);
}
drm_radeon_cmd_header_t *cmd = NULL;
cmd =
- (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1,
- __FUNCTION__);
+ (drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, 1, __FUNCTION__);
cmd[0].i = cmdwait(flags);
}
/**
* fire vertex buffer
*/
-static void inline
-fire_AOS(r300ContextPtr rmesa, int vertex_count, int type)
+static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type)
{
int cmd_reserved = 0;
int cmd_written = 0;
*/
gl_state_index tokens[STATE_LENGTH] = {
STATE_INTERNAL, STATE_R300_TEXRECT_FACTOR, 0, 0,
- 0
+ 0
};
int factor_index;
GLuint factorreg;
if (flags & CLEARBUFFER_DEPTH) {
t1 |= R300_RB3D_Z_WRITE_ONLY;
t2 |=
- (R300_ZS_ALWAYS <<
- R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
+ (R300_ZS_ALWAYS << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
} else {
t1 |= R300_RB3D_Z_DISABLED_1; // disable
}
e32(r300->state.stencil.clear);
}
- cmd2 =
- (drm_r300_cmd_header_t *) r300AllocCmdBuf(r300, 9,
- __FUNCTION__);
+ cmd2 = (drm_r300_cmd_header_t *) r300AllocCmdBuf(r300, 9, __FUNCTION__);
cmd2[0].packet3.cmd_type = R300_CMD_PACKET3;
cmd2[0].packet3.packet = R300_CMD_PACKET3_CLEAR;
cmd2[1].u = r300PackFloat32(dPriv->w / 2.0);
R300_STATECHANGE(r300, fpi[3]);
reg_start(R300_PFS_INSTR0_0, 0);
- e32(FP_INSTRC
- (MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO)));
+ e32(FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO)));
reg_start(R300_PFS_INSTR1_0, 0);
e32(FP_SELC(0, NO, XYZ, FP_TMP(0), 0, 0));
}
if (flags & BUFFER_BIT_BACK_LEFT) {
- r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR,
- swapped ^ 1);
+ r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, swapped ^ 1);
bits = 0;
}
}
if (rmesa->dma.current.buf)
- r300ReleaseDmaRegion(rmesa, &rmesa->dma.current,
- __FUNCTION__);
+ r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__);
if (rmesa->dma.nr_released_bufs > 4)
r300FlushCmdBuf(rmesa, __FUNCTION__);
}
void r300ReleaseDmaRegion(r300ContextPtr rmesa,
- struct r300_dma_region *region,
- const char *caller)
+ struct r300_dma_region *region, const char *caller)
{
if (RADEON_DEBUG & DEBUG_IOCTL)
fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
}
if (rmesa->dma.current.buf)
- r300ReleaseDmaRegion(rmesa, &rmesa->dma.current,
- __FUNCTION__);
+ r300ReleaseDmaRegion(rmesa, &rmesa->dma.current, __FUNCTION__);
if (rmesa->dma.nr_released_bufs > 4)
r300FlushCmdBuf(rmesa, __FUNCTION__);
}
void r300ReleaseDmaRegion(r300ContextPtr rmesa,
- struct r300_dma_region *region,
- const char *caller)
+ struct r300_dma_region *region, const char *caller)
{
if (RADEON_DEBUG & DEBUG_IOCTL)
fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
return valid;
}
-GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa,
- const GLvoid * pointer)
+GLuint r300GartOffsetFromVirtual(r300ContextPtr rmesa, const GLvoid * pointer)
{
int offset =
(char *)pointer -
|| offset > rmesa->radeon.radeonScreen->gartTextures.size)
return ~0;
else
- return rmesa->radeon.radeonScreen->gart_texture_offset +
- offset;
+ return rmesa->radeon.radeonScreen->gart_texture_offset + offset;
}
void r300InitIoctlFuncs(struct dd_function_table *functions)
if (RADEON_DEBUG & DEBUG_VERTS)
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
- __FUNCTION__, count, stride, (void *)out,
- (void *)data);
+ __FUNCTION__, count, stride, (void *)out, (void *)data);
if (stride == 12)
COPY_DWORDS(out, data, count * 3);
assert(elt_size == 2 || elt_size == 4);
if (r300IsGartMemory(rmesa, elts, n_elts * elt_size)) {
- rvb->address =
- rmesa->radeon.radeonScreen->gartTextures.map;
+ rvb->address = rmesa->radeon.radeonScreen->gartTextures.map;
rvb->start = ((char *)elts) - rvb->address;
rvb->aos_offset =
rmesa->radeon.radeonScreen->gart_texture_offset +
GLuint i;
for (i = 0; i + 1 < nr; i += 2) {
- dst[i >> 1] =
- t_swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE;
+ dst[i >> 1] = t_swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE;
dst[i >> 1] |=
(t_swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE)
<< 16;
CURRENT_VERTEX_SHADER(ctx);
inputs = prog->inputs;
InputsRead = CURRENT_VERTEX_SHADER(ctx)->key.InputsRead;
- OutputsWritten =
- CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
+ OutputsWritten = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
} else {
DECLARE_RENDERINPUTS(inputs_bitset);
inputs = r300->state.sw_tcl_inputs;
assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_NORMAL)
== 0);
- assert(RENDERINPUTS_TEST
- (inputs_bitset, _TNL_ATTRIB_COLOR0));
+ assert(RENDERINPUTS_TEST(inputs_bitset, _TNL_ATTRIB_COLOR0));
InputsRead |= 1 << VERT_ATTRIB_COLOR0;
OutputsWritten |= 1 << VERT_RESULT_COL0;
if (RENDERINPUTS_TEST
(inputs_bitset, _TNL_ATTRIB_TEX(i))) {
InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i);
- OutputsWritten |=
- 1 << (VERT_RESULT_TEX0 + i);
+ OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i);
}
for (i = 0, nr = 0; i < VERT_ATTRIB_MAX; i++)
if (InputsRead & (1 << VERT_ATTRIB_COLOR1))
inputs[VERT_ATTRIB_COLOR1] = 3;
- for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7;
- i++)
+ for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++)
if (InputsRead & (1 << i))
- inputs[i] =
- 6 + (i - VERT_ATTRIB_TEX0);
+ inputs[i] = 6 + (i - VERT_ATTRIB_TEX0);
}
RENDERINPUTS_COPY(rmesa->state.render_inputs_bitset,
}
#endif /* MESA_BIG_ENDIAN */
- if (r300IsGartMemory
- (rmesa, VB->AttribPtr[tab[i]].data,
- /*(count-1)*stride */ 4)) {
+ if (r300IsGartMemory(rmesa, VB->AttribPtr[tab[i]].data,
+ /*(count-1)*stride */ 4)) {
if (VB->AttribPtr[tab[i]].stride % 4)
return R300_FALLBACK_TCL;
rmesa->state.aos[i].aos_offset =
r300GartOffsetFromVirtual(rmesa,
VB->
- AttribPtr[tab[i]].
- data);
+ AttribPtr[tab[i]].data);
rmesa->state.aos[i].aos_stride =
VB->AttribPtr[tab[i]].stride / 4;
for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
if (OutputsWritten & (1 << (VERT_RESULT_TEX0 + i)))
- r300->hw.vof.cmd[R300_VOF_CNTL_1] |=
- (4 << (3 * i));
+ r300->hw.vof.cmd[R300_VOF_CNTL_1] |= (4 << (3 * i));
rmesa->state.aos_count = nr;
r300ReleaseDmaRegion(rmesa, &rmesa->state.elt_dma, __FUNCTION__);
for (i = 0; i < rmesa->state.aos_count; i++) {
- r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i],
- __FUNCTION__);
+ r300ReleaseDmaRegion(rmesa, &rmesa->state.aos[i], __FUNCTION__);
}
}
((arg1) << R300_FPI2_ARG1A_SHIFT) | \
((arg2) << R300_FPI2_ARG2A_SHIFT))
-extern void debug_vp(GLcontext *ctx, struct gl_vertex_program *vp);
-
-#endif /* __R300_PROGRAM_H__ */
+extern void debug_vp(GLcontext * ctx, struct gl_vertex_program *vp);
+
+#endif /* __R300_PROGRAM_H__ */
#include "r300_emit.h"
extern int future_hw_tcl_on;
-static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx,
- int prim)
+static int r300PrimitiveType(r300ContextPtr rmesa, GLcontext * ctx, int prim)
{
int type = -1;
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;
- r300RunRenderPrimitive(rmesa, ctx, start, start + length,
- prim);
+ r300RunRenderPrimitive(rmesa, ctx, start, start + length, prim);
}
reg_start(R300_RB3D_DSTCACHE_CTLSTAT, 0);
FALLBACK_IF(ctx->Color.ColorLogicOpEnabled);
- if (ctx->Extensions.NV_point_sprite
- || ctx->Extensions.ARB_point_sprite)
+ if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite)
FALLBACK_IF(ctx->Point.PointSprite);
if (!r300->disable_lowimpact_fallback) {
}
static void
-r300ProgramStringNotify(GLcontext * ctx, GLenum target,
- struct gl_program *prog)
+r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog)
{
struct r300_vertex_program_cont *vp = (void *)prog;
- struct r300_fragment_program *fp =
- (struct r300_fragment_program *)prog;
+ struct r300_fragment_program *fp = (struct r300_fragment_program *)prog;
switch (target) {
case GL_VERTEX_PROGRAM_ARB:
}
static GLboolean
-r300IsProgramNative(GLcontext * ctx, GLenum target,
- struct gl_program *prog)
+r300IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog)
{
return 1;
}
#if 1
if ((t->tile_bits & R300_TXO_MACRO_TILE) &&
(texImage->Width * texImage->TexFormat->TexelBytes >= 256)
- &&
- ((!(t->tile_bits & R300_TXO_MICRO_TILE)
- && (texImage->Height >= 8))
- || (texImage->Height >= 16))) {
+ && ((!(t->tile_bits & R300_TXO_MICRO_TILE)
+ && (texImage->Height >= 8))
+ || (texImage->Height >= 16))) {
/* weird: R200 disables macro tiling if mip width is smaller than 256 bytes,
OR if height is smaller than 8 automatically, but if micro tiling is active
the limit is height 16 instead ? */
}
static struct r300_vertex_program *build_program(struct r300_vertex_program_key
- *wanted_key,
- struct gl_vertex_program
+ *wanted_key, struct gl_vertex_program
*mesa_vp, GLint wpos_idx)
{
struct r300_vertex_program *vp;