AMD LX 900@1.5W Computer Hardware User Manual


 
242 AMD Geode™ LX Processors Data Book
Graphics Processor
33234H
6.3.2.1 Rotating BLTs
This feature of the GP allows bitmaps to be rotated 90°,
180° or 270°. The 90° and 270° modes work by reading
vertical strips of the source bitmap that are one cache line
(32 bytes) wide starting at either the top right or bottom left
corner of the bitmap. The output is written as tiles that are
one cache line wide by either 8, 16 or 32 pixels tall,
depending on the color depth of the input data stream.
Because the data is not written out in scan line order, none
of the other channels can be correctly ROPed with the
data, so this operation should be treated as a source copy.
Also, because the entire buffer memory will be used for the
fetched data, the input data stream may not be indexed
color (it may be declared as 8-bpp, but it will not be con-
verted through LUT lookups. This may be done on a sec-
ond pass after the rotation).
To program a rotation BLT of 90° clockwise, the rotation bit
should be on in the GP_CH3_MODE_STR register (GP
Memory Offset 64h[23]), the X and Y bits for channel 3
should be clear and set respectively, the X and Y in the
GP_BLT_MODE register (GP Memory Offset 40h[9:8])
should both be clear, GP_CH3_OFFSET (GP Memory Off-
set 60h) should point to the bottom left corner of the source
and GP_DST_OFFSET (GP Memory Offset 00h) should
point to the top left corner of the destination.
To program a rotation BLT of 270° clockwise, the rotation
bit should be on in the GP_CH3_MODE_STR register, the
X and Y bits for channel 3 should be set and clear respec-
tively, the X and Y in the GP_BLT_MODE register should
both be clear, GP_CH3_OFFSET should point to the top
right corner of the source and GP_DEST_OFFSET should
point to the top left corner of the destination.
To program a rotation BLT of 180° clockwise, the rotation
bit should be off in the GP_CH3_MODE_STR register, the
X and Y bits for channel 3 should be opposite their counter-
parts in the GP_BLT_MODE register, and
GP_CH3_OFFSET should point to the opposite corner
from GP_DEST_OFFSET.
For all rotations, it is required that both the source stride
and the destination stride be aligned to a cache line bound-
ary (i.e., bottom 5 bits of stride are all 0s). Do not attempt to
rotate host source data. The fill algorithm would be too
complex and the likelihood of causing a FIFO underrun and
hanging the GP is too high.
Note that for rotation BLTs, the PL bit in the
GP_CH3_MODE_STR register (GP Memory Offset
64h[20]) may not be set. The entire buffer is needed for the
rotation so the LUT and pattern data may not be retained.
6.3.2.2 Rotating Video
The GP is primarily an RGB engine that does not natively
understand YUV data. However, it is possible to perform
video rotations using the GP hardware assuming the data
is formatted correctly. If the data is in 4:2:0 format with the
Y data separated from the UV data, the rotation can be
performed by passing each channel of the image sepa-
rately through the GP and setting the color depth appropri-
ately. For the Y data, the color depth should be set to 8-bpp
3:3:2. The same is true for the U and V data if they are in
separate channels. If the U and V data are combined in
one buffer then the color depth should be set to 16-bpp
5:6:5. Similarly, 4:4:4 format data can also be supported if
each channel is stored in its own buffer.
6.3.2.3 Color Depth Conversion
If the BPP/FMT bits in the GP_CH3_MODE_STR register
(GP Memory Offset 64h]27:24]) are set different than the
BPP/FMT bits in the GP_RASTER_MODE register (GP
Memory Offset 38h[31:28]), then the incoming data is con-
verted to match the output format. If the BGR bit (GP Mem-
ory Offset 64h[22]) is set, then the red and blue channels of
the data will be swapped prior to the depth conversion (if
any).
A 24-bpp source format is supported on channel 3 allowing
packed RGB pixels to be unpacked as they are written into
the frame buffer. For this format, the channel 3 width is
specified in DWORDs, not pixels. As a result, the channel 3
offset for 24-bpp data must therefore be aligned to a
DWORD boundary. BGR conversion is not possible in this
format since this operation is done before the depth con-
version. 24-bpp images may not be rotated, they would
need to be converted into another format first.