Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

A question about Resolution of Framebuffer under uClinux

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.

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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. :)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Z,

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

    - Hippo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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