This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Frame buffer double buffer?



Hi Tis,

I am using DM8168 and DVRRDK v4.1. Does frame buffer support double buffer feature?

Here is some codes to use frame buffer ioctl for getting fixed screen info and variable screen info...

    // open fb device
    fb->fd = open("/dev/fb0", O_RDWR);
    if (fb->fd < 0)
    {
        LOG_ERR("[bootfb] Can't open frame buffer device!\n");
        return -1;
    }

    // get screen's fixed info
    if (ioctl(fb->fd, FBIOGET_FSCREENINFO, &fb->finfo) < 0)
    {
        LOG_ERR("[bootfb] Read fixed screen info failed!\n");
        return -1;
    }

    // get screen's var info
    if (ioctl(fb->fd, FBIOGET_VSCREENINFO, &fb->vinfo) < 0)
    {
        LOG_ERR("[bootfb] Read variable screen information failed!\n");
        return -1;
    }

...

I print resolution of VSCREENINFO as below:

fb->vinfo.xres = 1920, fb->vinfo.yres = 1080, fb->vinfo.xres_virtual = 1920, fb->vinfo.yres_virtual = 1080

But after I modify the fb->vinfo.yres_virtual = 2160 and use FBIOPUT_VSCREENINFO ioctl to apply the new parameter...

There is no error after set FBIOPUT_VSCREENINFO but the vinfo.yres_virtual is still the same 1080...not 2160.

Why?

BR,

Steven

  • It really depends on the buffer allocated and output resolution. If you have allocated/provided enough buffer size at the time of insertion of fbdev driver, you should be able to do double buffering.
    Rgds,Brijesh
  • Hi Brijesh,
    thanks for your quickly reply.

    I want display 1920x1080 frame buffer. RGBA raw data 1920x1080x4 = 8294400.
    I have modified the following vram parameter of fb0 to 16MB:
    insmod ./kermod/ti81xxfb.ko vram=0:16M,1:8M,2:8M
    But the result is the same. Am I missing something?
    Thanks!
    BR,
    Steven

  • i dont see anywhere it getting reset.
    The only place where it will be reset, is in below code.
    if (line_size * var->yres_virtual > tfbi->mreg.size) {
    TFBDBG("can't fit fb memory, reducing y\n");
    var->yres_virtual = tfbi->mreg.size / line_size;
    If the line size and vertual height is more than allocated memory, then it will get reset to size/line size. can you again check the memory size.
    Rgds,Brijesh
  • Hi Brijesh,

    Sorry for late reply.

    There are some hard code in DVRRDK ti81xxfb driver. So the vrams parameter is useless when insmod the module.

    if (def_vram && ti81xxfb_parse_vram_param(def_vram, TI81XX_FB_NUM,
             vrams)) {
            dev_err(fbdev->dev,
            "failed to parse vram parameters: %s\n", def_vram);

            memset(vrams, 0, sizeof(vrams));
        }
        /*#if defined(CONFIG_MACH_UD8168_DVR)
        else {    //# phoong : fixed vram size of fb (default)
            vrams[0] = 0x7E9000;    //# 8M (1920x1080x4, 0x7E9000)
            vrams[1] = 0x7E9000;    //# 8M (1920x1080x4, 0x7E9000)
            vrams[2] = 0x400000;    //# 4M (720x480(1080)x4, 0x151800(0x2F7600))
        }

    Thanks for your help!

    BR,

    Steven