diff options
author | Kenneth Graunke <[email protected]> | 2013-01-14 14:22:38 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-01-28 16:47:52 -0800 |
commit | 7b07808f741ea31831a953aad58749b75a12a108 (patch) | |
tree | dcd7c02f0a4d735e7be427d71d96b9cdb65a9f28 /src/mesa/drivers/dri | |
parent | 1b3ec16cc2c1190f0212fda26242f5e5206f5b1e (diff) |
intel: Un-hardcode lengths from blitter commands.
The packet length may change at some point in the future. Specifying it
explicitly (rather than hardcoding it in the command #define) allows us
to change it much more easily in the future.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_blit.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_reg.h | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 4b86f0eb0e1..0946972d4fa 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -194,7 +194,7 @@ intelEmitCopyBlit(struct intel_context *intel, assert(dst_y < dst_y2); BEGIN_BATCH_BLT(8); - OUT_BATCH(CMD); + OUT_BATCH(CMD | (8 - 2)); OUT_BATCH(BR13 | (uint16_t)dst_pitch); OUT_BATCH((dst_y << 16) | dst_x); OUT_BATCH((dst_y2 << 16) | dst_x2); @@ -368,7 +368,7 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) } BEGIN_BATCH_BLT(6); - OUT_BATCH(CMD); + OUT_BATCH(CMD | (6 - 2)); OUT_BATCH(BR13); OUT_BATCH((y1 << 16) | x1); OUT_BATCH((y2 << 16) | x2); @@ -445,7 +445,7 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, blit_cmd |= XY_DST_TILED; BEGIN_BATCH_BLT(8 + 3); - OUT_BATCH(opcode); + OUT_BATCH(opcode | (8 - 2)); OUT_BATCH(br13); OUT_BATCH((0 << 16) | 0); /* clip x1, y1 */ OUT_BATCH((100 << 16) | 100); /* clip x2, y2 */ @@ -587,7 +587,7 @@ intel_set_teximage_alpha_to_one(struct gl_context *ctx, } BEGIN_BATCH_BLT(6); - OUT_BATCH(CMD); + OUT_BATCH(CMD | (6 - 2)); OUT_BATCH(BR13); OUT_BATCH((y1 << 16) | x1); OUT_BATCH((y2 << 16) | x2); diff --git a/src/mesa/drivers/dri/intel/intel_reg.h b/src/mesa/drivers/dri/intel/intel_reg.h index 53b1cb93d98..e4871ebf9e7 100644 --- a/src/mesa/drivers/dri/intel/intel_reg.h +++ b/src/mesa/drivers/dri/intel/intel_reg.h @@ -240,11 +240,11 @@ #define PRIM3D_DIB (0x9<<18) #define PRIM3D_MASK (0x1f<<18) -#define XY_SETUP_BLT_CMD (CMD_2D | (0x01 << 22) | 6) +#define XY_SETUP_BLT_CMD (CMD_2D | (0x01 << 22)) -#define XY_COLOR_BLT_CMD (CMD_2D | (0x50 << 22) | 4) +#define XY_COLOR_BLT_CMD (CMD_2D | (0x50 << 22)) -#define XY_SRC_COPY_BLT_CMD (CMD_2D | (0x53 << 22) | 6) +#define XY_SRC_COPY_BLT_CMD (CMD_2D | (0x53 << 22)) #define XY_TEXT_IMMEDIATE_BLIT_CMD (CMD_2D | (0x31 << 22)) # define XY_TEXT_BYTE_PACKED (1 << 16) |