copybit hw module

Android HAL consists of several hardware accelerated modules, andcopybit is one of them implemented in G1 phone.

While OpenGL ES cannot be used or it's in software implementation,copybit is used. Actually in cupcake branch,SurfaceFlinger always uses copybit instead of GL if copybit isavailable -- but that's an oversight.

> While OpenGL ES cannot be used or it's in software implementation,> copybit is used. Actually in cupcake branch,> SurfaceFlinger always uses copybit instead of GL if copybit is> available -- but that's an oversight.>

[[ Functions ]]copybit is just an abstraction for a basic 2D blitter with support forrotation, scaling andcolor/pixelformat conversions. These features can be supported in fullor partially.

If the copybit module is present, then SurfaceFlinger will try to useit instead of usingOpenGL ES.

On the G1 copybit is used for all window compositions and video playback (CC andscaling), on this h/w copybit is very fast and provide very good upand down scaling.

[[ Donut Changes ]]HOWEVER, on the release after Donut, the copybit module won't be usedby SurfaceFlingerdirectly, instead it will be used as a back-end for our softwareOpenGL ES 1.x andSurfaceFlinger will only use the OpenGL ES API. Eventually, thecopybit module will bephased out, instead, we will ask the ISV/OEMs to implement thesefeatures on theirOpenGL ES drivers, if they think it is necessary.

[[ Usability ]]If your h/w doesn't have accelerated GL, but has some sort of decent2D blitter, you canwrite a copybit HAL module for it, and it will be used automaticallyby SurfaceFlinger --at least under cupcake and donut.

[[ Limitations ]]There are no mechanism to accelerate applications at the moment. Skiais a purelysoftware renderer. It can greatly benefit from newer CPUs though,which have SIMDinstructions, often, it'll be able to operate at bus speed in thatcase. We're working onoptimization in that area.

If a device has a GPU, it makes no sense to implement copybit, because (1) it won't be used by appsand (2) SurfaceFlinger already uses the GPU for its work.

Now, if the device has an additional 2D part (like the G1), it isuseful to implement copybit,this way application won't have to share the GPU with SurfaceFlinger.