[Arm-netbook] Dissecting the SD Card Image

cnxsoft cnxsoft at cnx-software.com
Sat Apr 21 05:26:41 BST 2012


On 21/04/2012 03:11, Alejandro Martínez wrote:
> 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;
> }
>
Thanks Alejandr, I can switch to VGA.
I can select any resolution specified in drv_display_sun4i.h, just  you 
need to turn off VGA first.

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,0x201,(unsigned long)args); //turn VGA off*

     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;
}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.phcomp.co.uk/pipermail/arm-netbook/attachments/20120421/82b0f33e/attachment.html 


More information about the arm-netbook mailing list