Date:2010-08-30 23:33:33 (13 years 3 months ago)
Author:Maarten ter Huurne
Commit:8c2e1901900fe755990bdb9e153afacddf518c26
Message:MIPS: JZ4740: SLCD: Fix bytes per frame for TV-out.

To support double buffering, video memory is allocated for two frames, but only one frame should be uploaded to the LCD controller when using TV-out.

Note that this does not add support for double buffering when using TV-out, it only fixes single buffering.
Files: drivers/video/jz4740_slcd_fb.c (3 diffs)

Change Details

drivers/video/jz4740_slcd_fb.c
497497
498498static int jzfb_alloc_devmem(struct jzfb *jzfb)
499499{
500    int max_videosize = 0;
500    int max_framesize = 0;
501501    struct fb_videomode *mode = jzfb->pdata->modes;
502502    void *page;
503503    int i;
504504
505505    for (i = 0; i < jzfb->pdata->num_modes; ++mode, ++i) {
506        if (max_videosize < mode->xres * mode->yres)
507            max_videosize = mode->xres * mode->yres;
506        if (max_framesize < mode->xres * mode->yres)
507            max_framesize = mode->xres * mode->yres;
508508    }
509509
510    max_videosize *= jzfb_get_controller_bpp(jzfb) >> 3;
511    max_videosize *= 2; /* allow double buffering */
510    max_framesize *= jzfb_get_controller_bpp(jzfb) >> 3;
512511
513512    jzfb->framedesc = dma_alloc_coherent(&jzfb->pdev->dev,
514513                    sizeof(*jzfb->framedesc),
...... 
517516    if (!jzfb->framedesc)
518517        return -ENOMEM;
519518
520    jzfb->vidmem_size = PAGE_ALIGN(max_videosize);
519    /* reserve memory for two frames to allow double buffering */
520    jzfb->vidmem_size = PAGE_ALIGN(max_framesize * 2);
521521    jzfb->vidmem = dma_alloc_coherent(&jzfb->pdev->dev,
522522                        jzfb->vidmem_size,
523523                        &jzfb->vidmem_phys, GFP_KERNEL);
...... 
535535    jzfb->framedesc->addr = jzfb->vidmem_phys;
536536    jzfb->framedesc->id = 0xdeafbead;
537537    jzfb->framedesc->cmd = 0;
538    jzfb->framedesc->cmd |= max_videosize / 4;
538    jzfb->framedesc->cmd |= max_framesize / 4;
539539
540540    return 0;
541541

Archive Download the corresponding diff file



interactive