summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAapo Tahkola <[email protected]>2005-06-16 10:40:39 +0000
committerAapo Tahkola <[email protected]>2005-06-16 10:40:39 +0000
commitaf02907b4cbe212f0d87de25d85118b05303415c (patch)
tree1497c1bb6c3e6592803bf2f6bf2fbf806da10fa0 /src
parent463c1d6c57a3df87b57a74f9bdbd365eb99f2a42 (diff)
Support 16-bit modes.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c14
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h3
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c11
3 files changed, 21 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index 6f8a7129e06..8d752f90b75 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -125,9 +125,14 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
r300->hw.bld.cmd[R300_BLD_CBLEND] = 0;
r300->hw.bld.cmd[R300_BLD_ABLEND] = 0;
+ if (r300->radeon.radeonScreen->cpp == 4)
+ cbpitch |= R300_COLOR_FORMAT_ARGB8888;
+ else
+ cbpitch |= R300_COLOR_FORMAT_RGB565;
+
R300_STATECHANGE(r300, cb);
r300->hw.cb.cmd[R300_CB_OFFSET] = cboffset;
- r300->hw.cb.cmd[R300_CB_PITCH] = cbpitch | R300_COLOR_UNKNOWN_22_23;
+ r300->hw.cb.cmd[R300_CB_PITCH] = cbpitch;
R300_STATECHANGE(r300, unk221C);
r300->hw.unk221C.cmd[1] = R300_221C_CLEAR;
@@ -257,8 +262,13 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
reg_start(R300_RB3D_COLOROFFSET0, 0);
e32(cboffset);
+ if (r300->radeon.radeonScreen->cpp == 4)
+ cbpitch |= R300_COLOR_FORMAT_ARGB8888;
+ else
+ cbpitch |= R300_COLOR_FORMAT_RGB565;
+
reg_start(R300_RB3D_COLORPITCH0, 0);
- e32(cbpitch | R300_COLOR_UNKNOWN_22_23);
+ e32(cbpitch);
R300_STATECHANGE(r300, cmk);
reg_start(R300_RB3D_COLORMASK, 0);
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index 5b979dbe81a..3321954ca89 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -1147,7 +1147,8 @@ I am fairly certain that they are correct unless stated otherwise in comments.
# define R300_COLOR_ENDIAN_NO_SWAP (0 << 18) /* GUESS */
# define R300_COLOR_ENDIAN_WORD_SWAP (1 << 18) /* GUESS */
# define R300_COLOR_ENDIAN_DWORD_SWAP (2 << 18) /* GUESS */
-# define R300_COLOR_UNKNOWN_22_23 (3 << 22) /* GUESS: Format? - (6<<21) for RGBA? */
+# define R300_COLOR_FORMAT_RGB565 (2 << 22)
+# define R300_COLOR_FORMAT_ARGB8888 (3 << 22)
#define R300_RB3D_COLORPITCH1 0x4E3C /* GUESS */
#define R300_RB3D_COLORPITCH2 0x4E40 /* GUESS */
#define R300_RB3D_COLORPITCH3 0x4E44 /* GUESS */
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 72418154c46..1c0ccc19860 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -2146,17 +2146,20 @@ void r300ResetHwState(r300ContextPtr r300)
r300->hw.cb.cmd[R300_CB_OFFSET] =
r300->radeon.radeonScreen->backOffset +
r300->radeon.radeonScreen->fbLocation;
- r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.radeonScreen->backPitch
- | R300_COLOR_UNKNOWN_22_23;
+ r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.radeonScreen->backPitch;
} else {
r300->hw.cb.cmd[R300_CB_OFFSET] =
r300->radeon.radeonScreen->frontOffset +
r300->radeon.radeonScreen->fbLocation;
- r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.radeonScreen->frontPitch
- | R300_COLOR_UNKNOWN_22_23;
+ r300->hw.cb.cmd[R300_CB_PITCH] = r300->radeon.radeonScreen->frontPitch;
}
+ if (r300->radeon.radeonScreen->cpp == 4)
+ r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_ARGB8888;
+ else
+ r300->hw.cb.cmd[R300_CB_PITCH] |= R300_COLOR_FORMAT_RGB565;
+
r300->hw.unk4E50.cmd[1] = 0;
r300->hw.unk4E50.cmd[2] = 0;
r300->hw.unk4E50.cmd[3] = 0;