if (is_r500) {
ALLOC_STATE(r500fp, variable, R300_FPI_CMDSIZE, 0);
- r300->hw.r500fp.cmd[R300_FPI_CMD_0] = cmdr500fp(0, 0);
+ r300->hw.r500fp.cmd[R300_FPI_CMD_0] = cmdr500fp(0, 0, 0, 0);
+ ALLOC_STATE(r500fp_const, variable, R300_FPI_CMDSIZE, 0);
+ r300->hw.r500fp_const.cmd[R300_FPI_CMD_0] = cmdr500fp(0, 0, 1, 0);
} else {
ALLOC_STATE(fp, always, R300_FP_CMDSIZE, 0);
r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(R300_PFS_CNTL_0, 3);
struct r300_state_atom fpt; /* texi - (4620) */
struct r300_state_atom us_out_fmt; /* (46A4) */
struct r300_state_atom r500fp; /* r500 fp instructions */
+ struct r300_state_atom r500fp_const; /* r500 fp constants */
struct r300_state_atom fpi[4]; /* fp instructions (46C0/47C0/48C0/49C0) */
struct r300_state_atom fogs; /* fog state (4BC0) */
struct r300_state_atom fogc; /* fog color (4BC8) */
return cmd.u;
}
-static inline uint32_t cmdr500fp(int addr, int count)
+static inline uint32_t cmdr500fp(int addr, int count, int type, int clamp)
{
drm_r300_cmd_header_t cmd;
- cmd.vpu.cmd_type = R300_CMD_R500FP;
- cmd.vpu.count = count;
- cmd.vpu.adrhi = ((unsigned int)addr & 0xFF00) >> 8;
- cmd.vpu.adrlo = ((unsigned int)addr & 0x00FF);
+ cmd.r500fp.cmd_type = R300_CMD_R500FP;
+ cmd.r500fp.count = count;
+ cmd.r500fp.adrhi_flags = ((unsigned int)addr & 0x100) >> 8;
+ cmd.r500fp.adrhi_flags |= type ? R500FP_CONSTANT_TYPE : 0;
+ cmd.r500fp.adrhi_flags |= clamp ? R500FP_CONSTANT_CLAMP : 0;
+ cmd.r500fp.adrlo = ((unsigned int)addr & 0x00FF);
return cmd.u;
}
__FUNCTION__); \
cmd_reserved = _n+1; \
cmd_written =1; \
- cmd[0].i = cmdr500fp((dest), _n/6); \
+ cmd[0].i = cmdr500fp((dest), _n/6, 0, 0); \
} while (0);
#define start_packet3(packet, count) \