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 | ||
---|---|---|
497 | 497 | |
498 | 498 | static int jzfb_alloc_devmem(struct jzfb *jzfb) |
499 | 499 | { |
500 | int max_videosize = 0; | |
500 | int max_framesize = 0; | |
501 | 501 | struct fb_videomode *mode = jzfb->pdata->modes; |
502 | 502 | void *page; |
503 | 503 | int i; |
504 | 504 | |
505 | 505 | 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; | |
508 | 508 | } |
509 | 509 | |
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; | |
512 | 511 | |
513 | 512 | jzfb->framedesc = dma_alloc_coherent(&jzfb->pdev->dev, |
514 | 513 | sizeof(*jzfb->framedesc), |
... | ... | |
517 | 516 | if (!jzfb->framedesc) |
518 | 517 | return -ENOMEM; |
519 | 518 | |
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); | |
521 | 521 | jzfb->vidmem = dma_alloc_coherent(&jzfb->pdev->dev, |
522 | 522 | jzfb->vidmem_size, |
523 | 523 | &jzfb->vidmem_phys, GFP_KERNEL); |
... | ... | |
535 | 535 | jzfb->framedesc->addr = jzfb->vidmem_phys; |
536 | 536 | jzfb->framedesc->id = 0xdeafbead; |
537 | 537 | jzfb->framedesc->cmd = 0; |
538 | jzfb->framedesc->cmd |= max_videosize / 4; | |
538 | jzfb->framedesc->cmd |= max_framesize / 4; | |
539 | 539 | |
540 | 540 | return 0; |
541 | 541 |
Branches:
ben-wpan
ben-wpan-stefan
5396a9238205f20f811ea57898980d3ca82df0b6
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9