Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

A question about Resolution of Framebuffer under uClinux

Altera_Forum
Honored Contributor II
1,405 Views

Hi all, 

I'm a newbie to uClinux and Nios II. Now I am able to use the UDP protocol to transfer an image from PC to DE2 board and show it in the VGA screen through the Framebuffer in a resolution of 640*480 under uClinux. 

 

My question is what should I do if I want to change the resolultion from 640*480 to 800*600 or higher?  

 

In the menuconfig, I have chosen the "Device Driver-->Graphics support-->Support for frame buffer devices-->Altera Framebuffer Support". 

 

Please reply if you have any advice and thank you all for reading my post.
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
738 Views

The vga controller supports higher resolution. You may edit the instance to change it. 

 

You will need to modify the defs in nios2-linux/linux-2.6/drivers/video/altfb.c 

# define VGABASE na_vga_controller_0 /* Altera VGA controller */# define XRES 640 ==> 800# define YRES 480 ==> 600# define BPX 16 

 

One thing to watch out is the memory bandwidth, which is tight on DE2. The higher resolution, the higher memory bandwidth consumed for display. 

 

- Hippo
0 Kudos
Altera_Forum
Honored Contributor II
738 Views

Do you really want to see the higher resolution on the screen or just watch the framebuffer via the network. If only network, you might want to deactivate the display hardware (supposedly doable by software in the driver), to reduce the memory usage.  

 

Moreover to watch the framebuffer via the network it might be a good idea to use the standard "VNC" protocol. With that you can use a standard VNC client on a PC (any Arch and OS) to connect to your device. Moreover the free VNC software already has compression functions and such nice stuff. 

 

Some time ago I did some tests implementing a VNC server on the NIOS (no-MMU). This did work fine, but I just tried to monitor a dedicated memory region and did not yet define that to be the framebuffer (should be no problem at all, though). Moreover I did not try to send mouse-moves and keystrokes towards the device (should be not too difficult). A more interesting task would be to decide if/when a modified picture needs to be transferred.  

 

-Michael
0 Kudos
Altera_Forum
Honored Contributor II
738 Views

 

--- Quote Start ---  

The vga controller supports higher resolution. You may edit the instance to change it. 

 

You will need to modify the defs in nios2-linux/linux-2.6/drivers/video/altfb.c 

# define VGABASE na_vga_controller_0 /* Altera VGA controller */# define XRES 640 ==> 800# define YRES 480 ==> 600# define BPX 16 

 

One thing to watch out is the memory bandwidth, which is tight on DE2. The higher resolution, the higher memory bandwidth consumed for display. 

 

- Hippo 

--- Quote End ---  

 

 

Hi,Hippo 

Thanks for your reply. 

I've changed the XRES and YRES as you said. Though I build it successfully, I can't get any normal color bars which I can get from resolution of 640*480. And I got nothing but blinking when I ran the UDP program to transfer the image. Is it caused by pixel clock? Or some reasons I don't know?  

 

By the way, I'm using the PTF file which is downloaded in http://www.nioswiki.com/operatingsystems/uclinux/framebuffer 

How could I fix it?Thanks.
0 Kudos
Altera_Forum
Honored Contributor II
738 Views

 

--- Quote Start ---  

Do you really want to see the higher resolution on the screen or just watch the framebuffer via the network. If only network, you might want to deactivate the display hardware (supposedly doable by software in the driver), to reduce the memory usage.  

 

Moreover to watch the framebuffer via the network it might be a good idea to use the standard "VNC" protocol. With that you can use a standard VNC client on a PC (any Arch and OS) to connect to your device. Moreover the free VNC software already has compression functions and such nice stuff. 

 

Some time ago I did some tests implementing a VNC server on the NIOS (no-MMU). This did work fine, but I just tried to monitor a dedicated memory region and did not yet define that to be the framebuffer (should be no problem at all, though). Moreover I did not try to send mouse-moves and keystrokes towards the device (should be not too difficult). A more interesting task would be to decide if/when a modified picture needs to be transferred.  

 

-Michael 

--- Quote End ---  

 

 

Hi Michael, 

Thanks for your reply. 

 

In fact I really want to see the higher resolution on the screen. :)  

 

So far I am able to display an image in resolultion of 640*480,16 bit per pixel. And I want to see if I could go further. So I'd like to display an image in a higher resolution(higher than 640*480 at least) in DE2. 

 

Apropos of the network, I've edited a program with UDP protocol to transfer data successfully. The PC and DE2 board are in the same LAN, so the UDP protocol is enough and I have no plan to change it to VNC for now. Since I am a beginner, I don't want to add too many new things to my project once and I hope you could understand that. 

 

If you have some good advises about higher resolution, please let me know. 

 

Thank you again for your kindness. :)
0 Kudos
Altera_Forum
Honored Contributor II
738 Views

Hi Z, 

 

I mean you need to edit the resolution of vga controller in sopc builder. Then regenerate the hardware and synthesis. 

 

- Hippo
0 Kudos
Altera_Forum
Honored Contributor II
738 Views

To prevent an overload of the external memory interface, for a real project (not just a demo) it might be a good idea to use a bigger Cyclone chip with enough internal memory to hold the framebuffer.  

 

-Michael
0 Kudos
Reply