summaryrefslogtreecommitdiff
path: root/driver/xf86-video-intel/src/i915_3d.h
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-05-21 20:19:53 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-05-21 20:19:53 +0000
commit441d3c52cab6805717c92f85d08ace52c97c5881 (patch)
tree7a49a4b910dc3eaee3457a63d901b48684f9bc7d /driver/xf86-video-intel/src/i915_3d.h
parent913928db385e6d08f0141674758a36e9f4978c33 (diff)
Update to xf86-video-intel 2.3.1. Tested by many.
Diffstat (limited to 'driver/xf86-video-intel/src/i915_3d.h')
-rw-r--r--driver/xf86-video-intel/src/i915_3d.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/driver/xf86-video-intel/src/i915_3d.h b/driver/xf86-video-intel/src/i915_3d.h
index fc4ca6038..1a0bd45b1 100644
--- a/driver/xf86-video-intel/src/i915_3d.h
+++ b/driver/xf86-video-intel/src/i915_3d.h
@@ -33,7 +33,7 @@
#define MASK_Y 0x2
#define MASK_Z 0x4
#define MASK_W 0x8
-#define MASK_XYZ (MASK_X | MASK_Y | MASK_W)
+#define MASK_XYZ (MASK_X | MASK_Y | MASK_Z)
#define MASK_XYZW (MASK_XYZ | MASK_W)
#define MASK_SATURATE 0x10
@@ -61,6 +61,10 @@
#define FS_C1 ((REG_TYPE_CONST << 8) | 1)
#define FS_C2 ((REG_TYPE_CONST << 8) | 2)
#define FS_C3 ((REG_TYPE_CONST << 8) | 3)
+#define FS_C4 ((REG_TYPE_CONST << 8) | 4)
+#define FS_C5 ((REG_TYPE_CONST << 8) | 5)
+#define FS_C6 ((REG_TYPE_CONST << 8) | 6)
+#define FS_C7 ((REG_TYPE_CONST << 8) | 7)
/* Sampler regs */
#define FS_S0 ((REG_TYPE_S << 8) | 0)
@@ -84,7 +88,7 @@
#define REG_NR(reg) ((reg) & 0xff)
struct i915_fs_op {
- CARD32 ui[3];
+ uint32_t ui[3];
};
#define X_CHANNEL_VAL 1
@@ -232,6 +236,11 @@ do { \
FS_OUT(_i915_fs_texld(T0_TEXLD, dest_reg, sampler_reg, address_reg)); \
} while (0)
+#define i915_fs_texldp(dest_reg, sampler_reg, address_reg) \
+do { \
+ FS_OUT(_i915_fs_texld(T0_TEXLDP, dest_reg, sampler_reg, address_reg)); \
+} while (0)
+
static inline struct i915_fs_op
_i915_fs_texld(int load_op, int dest_reg, int sampler_reg, int address_reg)
{
@@ -350,8 +359,16 @@ _i915_fs_arith(int cmd, int dest_reg,
return op;
}
+/** Move operand0 to dest_reg */
+#define i915_fs_mov(dest_reg, operand0) \
+do { \
+ FS_OUT(i915_fs_arith(MOV, dest_reg, operand0, \
+ i915_fs_operand_none(), \
+ i915_fs_operand_none())); \
+} while (0)
+
/**
- * Move the values in operand0 to the dest reg with the masking/saturation
+ * Move the value in operand0 to the dest reg with the masking/saturation
* specified.
*/
#define i915_fs_mov_masked(dest_reg, dest_mask, operand0) \
@@ -375,6 +392,13 @@ do { \
i915_fs_operand_none())); \
} while (0)
+/** Add operand0 and operand1 and put the result in dest_reg */
+#define i915_fs_mul(dest_reg, operand0, operand1) \
+do { \
+ FS_OUT(i915_fs_arith(MUL, dest_reg, operand0, operand1, \
+ i915_fs_operand_none())); \
+} while (0)
+
/**
* Perform a 3-component dot-product of operand0 and operand1 and put the
* resulting scalar in the channels of dest_reg specified by the dest_mask.
@@ -383,7 +407,7 @@ do { \
do { \
struct i915_fs_op op; \
\
- op = i915_fs_arith(DP3, dest_reg, operand0, i915_fs_operand_none(), \
+ op = i915_fs_arith(DP3, dest_reg, operand0, operand1, \
i915_fs_operand_none()); \
op.ui[0] &= ~A0_DEST_CHANNEL_ALL; \
op.ui[0] |= ((dest_mask) & ~MASK_SATURATE) << A0_DEST_CHANNEL_SHIFT; \
@@ -400,7 +424,7 @@ do { \
* a FS_START and FS_END
*/
#define FS_LOCALS(x) \
- CARD32 _shader_buf[(x) * 3]; \
+ uint32_t _shader_buf[(x) * 3]; \
int _max_shader_commands = x; \
int _cur_shader_commands
@@ -421,11 +445,13 @@ do { \
#define FS_END() \
do { \
- int _i; \
- BEGIN_LP_RING(_cur_shader_commands * 3 + 1); \
+ int _i, _pad = (_cur_shader_commands & 0x1) ? 0 : 1; \
+ BEGIN_LP_RING(_cur_shader_commands * 3 + 1 + _pad); \
OUT_RING(_3DSTATE_PIXEL_SHADER_PROGRAM | \
(_cur_shader_commands * 3 - 1)); \
for (_i = 0; _i < _cur_shader_commands * 3; _i++) \
OUT_RING(_shader_buf[_i]); \
+ if (_pad != 0) \
+ OUT_RING(MI_NOOP); \
ADVANCE_LP_RING(); \
} while (0);