<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 21/04/2012 03:11, Alejandro Martínez wrote:
<blockquote
cite="mid:CAOx6PCK2go+Fqbz_B3iWrfDEFMBHjNFwfuNxob1Zubc=H28Ddg@mail.gmail.com"
type="cite">
<pre wrap="">I got to enable VGA, basing on files:
novo7_android2.3.4/android2.3.4/device/softwinner/crane-common/hardware/libhardware/display/display.cpp
and
novo7_android2.3.4/android2.3.4/device/softwinner/crane-common/hardware/include/drv_display_sun4i.h
from the android image source drop. The driver is easily controllable
through ioctl's.
The framebuffer keeps being 720p no matter what resolution you set VGA
to. It seems another command is needed to change the framebuffer size.
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/mman.h>
int main(int argc, char const *argv[])
{
        unsigned long args[4];
int ret = -1;
        int disp = open("/dev/disp", O_RDWR, 0);
        args[0] = displayno;
args[1] = 0;
args[2] = 0;
args[3] = 0;
ret = ioctl(disp,0x200,(unsigned long)args); //turn VGA on
args[1] = 0xb; //set mode to 720p
ret = ioctl(disp,0x202,(unsigned long)args); //set the mode
ret = ioctl(disp,0x200,(unsigned long)args); //turn VGA on again
        return 0;
}
</pre>
</blockquote>
Thanks Alejandr, I can switch to VGA.<br>
I can select any resolution specified in drv_display_sun4i.h, just
you need to turn off VGA first.<br>
<pre wrap="">int main(int argc, char const *argv[])
{
        unsigned long args[4];
int ret = -1;
        int disp = open("/dev/disp", O_RDWR, 0);
        args[0] = displayno;
args[1] = 0;
args[2] = 0;
args[3] = 0;
<b> ret = ioctl(disp,0x201,(unsigned long)args); //turn VGA off</b>
args[1] = 0x4; //set mode to 1024x768
ret = ioctl(disp,0x202,(unsigned long)args); //set the mode
ret = ioctl(disp,0x200,(unsigned long)args); //turn VGA on again
        return 0;
}
</pre>
<br>
</body>
</html>