The video display size comes from the surface allocated by the
application that creates the MediaPlayer and is passed as an ISurface.
SurfaceFlinger is notified by the Window Manager of any changes in
position, size, or orientation.
SurfaceFlinger does the scaling and rotation. In the case of the G1,
this allows it to take full advantage of the display processor, which
also does color conversion.
pmem is the driver that allocates physically contiguous memory for
devices like the display processor, DSP, and camera. For security, we
don't pass around physical addresses in user space. Instead we pass
around a file descriptor that is backed by the physical memory and can
be mapped into the user process space as virtual memory. A kernel
driver can then map the file descriptor back to physical addresses
when needed.
When the video MIO gets a new frame to display, it passes the fd/
offset to SurfaceFlinger, which in turn programs up the display
processor to scale, position, rotatate, and color convert the frame.
If there is any logging in SurfaceFlinger, it can probably be turned
on by setting the preprocessor symbol LOG_NDEBUG to 0. I'm not sure
that it has any. If not, you can add your own logging using the LOGV
macro and using LOG_NDEBUG to enable or disable it.