Date:2010-05-20 01:58:54 (10 years 4 months ago)
Author:Maarten ter Huurne
Commit:973dc02c4c8e6c099225c3b6a9e3e648e3930f48
Message:jz4740-slcd-fb: Compute the number of pixels instead of hardcoding it.

Files: drivers/video/jz4740_slcd_fb.c (2 diffs)

Change Details

drivers/video/jz4740_slcd_fb.c
235235
236236static void jzfb_upload_frame_dma(struct jzfb *jzfb)
237237{
238    int num_pixels = 320 * 240;
239
240238    jz4740_dma_set_src_addr(jzfb->dma, jzfb->vidmem_phys);
241239    jz4740_dma_set_dst_addr(jzfb->dma,
242240        CPHYSADDR(jzfb->base + JZ_REG_SLCD_FIFO));
243    jz4740_dma_set_transfer_count(jzfb->dma, num_pixels * 2);
241    jz4740_dma_set_transfer_count(jzfb->dma,
242        jzfb->fb->mode->xres * jzfb->fb->mode->yres *
243            (jzfb_get_controller_bpp(jzfb) >> 3)
244        );
244245
245246    while (readb(jzfb->base + JZ_REG_SLCD_STATE) & SLCD_STATE_BUSY);
246247    writeb(readb(jzfb->base + JZ_REG_SLCD_CTRL) | SLCD_CTRL_DMA_EN,
...... 
250251
251252static void jzfb_upload_frame_cpu(struct jzfb *jzfb)
252253{
253    int num_pixels = 320 * 240;
254    int i;
254    const int num_pixels = jzfb->fb->mode->xres * jzfb->fb->mode->yres;
255255    uint16_t *p = jzfb->vidmem;
256    int i;
256257
257258    jzfb_disable_dma(jzfb);
258259    for (i = 0; i < num_pixels; i++) {

Archive Download the corresponding diff file



interactive