diff options
author | Aapo Tahkola <aet@rasterburn.org> | 2005-06-16 10:40:39 +0000 |
---|---|---|
committer | Aapo Tahkola <aet@rasterburn.org> | 2005-06-16 10:40:39 +0000 |
commit | af02907b4cbe212f0d87de25d85118b05303415c (patch) | |
tree | 1497c1bb6c3e6592803bf2f6bf2fbf806da10fa0 /src | |
parent | 463c1d6c57a3df87b57a74f9bdbd365eb99f2a42 (diff) | |
download | external_mesa3d-af02907b4cbe212f0d87de25d85118b05303415c.zip external_mesa3d-af02907b4cbe212f0d87de25d85118b05303415c.tar.gz external_mesa3d-af02907b4cbe212f0d87de25d85118b05303415c.tar.bz2 |
Support 16-bit modes.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_ioctl.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_reg.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_state.c | 11 |
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 6f8a712..8d752f9 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 5b979db..3321954 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 7241815..1c0ccc1 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; |