copybit hw module

135 views
Skip to first unread message

Jim Huang

unread,
Aug 31, 2009, 6:34:03 AM8/31/09
to 0xlab...@googlegroups.com
Hello list,

Android HAL consists of several hardware accelerated modules, and
copybit 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 is
available -- but that's an oversight.

Michael Trimarchi starts to implement copybit hw module for GTA02/Glamo:
http://panicking.kicks-ass.org/blog/index.php?m=08&y=09&entry=entry090810-231610

source repository:
http://feanor.sssup.it/~fabio/git/?p=libglamo-drm.git;a=summary
http://feanor.sssup.it/~fabio/git/?p=libglamo.git;a=summary

It is based on some basic work done by olv at Openmoko. At least,
blit is functioned. OMAP3 comes with some hardware
accelerations, and it is possible for 0xdroid to provide a dedicated one.

cheers,
Jim Huang (jserv)
http://0xlab.org/

Reference:
* http://groups.google.com/group/android-porting/browse_thread/thread/c464c97849d2b98e/b58736f412178d1d

Jim Huang

unread,
Aug 31, 2009, 6:45:08 AM8/31/09
to 0xlab...@googlegroups.com
2009/8/31 Jim Huang <js...@0xlab.org>:

> 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.
>

To quote the words from pixelflinger: (from
http://groups.google.com/group/android-porting/browse_thread/thread/c464c97849d2b98e/b58736f412178d1d
)

[[ Functions ]]
copybit is just an abstraction for a basic 2D blitter with support for
rotation, scaling and
color/pixelformat conversions. These features can be supported in full
or partially.

If the copybit module is present, then SurfaceFlinger will try to use
it instead of using
OpenGL ES.

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


[[ Donut Changes ]]
HOWEVER, on the release after Donut, the copybit module won't be used
by SurfaceFlinger
directly, instead it will be used as a back-end for our software
OpenGL ES 1.x and
SurfaceFlinger will only use the OpenGL ES API. Eventually, the
copybit module will be
phased out, instead, we will ask the ISV/OEMs to implement these
features on their
OpenGL ES drivers, if they think it is necessary.


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


[[ Limitations ]]
There are no mechanism to accelerate applications at the moment. Skia
is a purely
software renderer. It can greatly benefit from newer CPUs though,
which have SIMD
instructions, often, it'll be able to operate at bus speed in that
case. We're working on
optimization in that area.

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

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

Reply all
Reply to author
Forward
0 new messages