kernels/linux-2.4.0/drivers/media/video/buz.c
/* when this is called the spinlock must be held */
when this is called the spinlock must be held
when this is called the spinlock must be held
static void zoran_feed_stat_com(struct zoran *zr)
{
	int frame, i, max_stat_com;
	max_stat_com = (zr->params.TmpDcm == 1) ? BUZ_NUM_STAT_COM : (BUZ_NUM_STAT_COM >> 1);
	while ((zr->jpg_dma_head - zr->jpg_dma_tail) < max_stat_com
	       && zr->jpg_dma_head != zr->jpg_que_head) {
		frame = zr->jpg_pend[zr->jpg_dma_head & BUZ_MASK_FRAME];
		if (zr->params.TmpDcm == 1) {
			i = zr->jpg_dma_head & BUZ_MASK_STAT_COM;
			zr->stat_com[i] = zr->jpg_gbuf[frame].frag_tab_bus;
		} else {
			i = (zr->jpg_dma_head & 1) * 2;
			zr->stat_com[i] = zr->jpg_gbuf[frame].frag_tab_bus;
			zr->stat_com[i + 1] = zr->jpg_gbuf[frame].frag_tab_bus;
		}
		zr->jpg_gbuf[frame].state = BUZ_STATE_DMA;
		zr->jpg_dma_head++;
	}
}
static void zoran_feed_stat_com ( struct zoran * zr ) { int frame , i , max_stat_com ; max_stat_com = ( zr -> params . TmpDcm == 1 ) ? BUZ_NUM_STAT_COM : ( BUZ_NUM_STAT_COM >> 1 ) ; while ( ( zr -> jpg_dma_head - zr -> jpg_dma_tail ) < max_stat_com && zr -> jpg_dma_head != zr -> jpg_que_head ) { frame = zr -> jpg_pend [ zr -> jpg_dma_head & BUZ_MASK_FRAME ] ; if ( zr -> params . TmpDcm == 1 ) { i = zr -> jpg_dma_head & BUZ_MASK_STAT_COM ; zr -> stat_com [ i ] = zr -> jpg_gbuf [ frame ] . frag_tab_bus ; } else { i = ( zr -> jpg_dma_head & 1 ) * 2 ; zr -> stat_com [ i ] = zr -> jpg_gbuf [ frame ] . frag_tab_bus ; zr -> stat_com [ i + 1 ] = zr -> jpg_gbuf [ frame ] . frag_tab_bus ; } zr -> jpg_gbuf [ frame ] . state = BUZ_STATE_DMA ; zr -> jpg_dma_head ++ ; } }
when this is called the spinlock must be held
when this is called the spinlock must be held
/* move frames from pending queue to DMA */ /* fill 1 stat_com entry */ /* fill 2 stat_com entries */