Lines Matching refs:f

195 static void frame_reset(struct frame *f)  in frame_reset()  argument
197 f->state = FRAME_CLEAR; in frame_reset()
198 f->done = 0; in frame_reset()
199 f->n_packets = 0; in frame_reset()
200 f->frame_begin_timestamp = NULL; in frame_reset()
201 f->assigned_timestamp = 0; in frame_reset()
202 f->cip_syt1 = NULL; in frame_reset()
203 f->cip_syt2 = NULL; in frame_reset()
204 f->mid_frame_timestamp = NULL; in frame_reset()
205 f->frame_end_timestamp = NULL; in frame_reset()
206 f->frame_end_branch = NULL; in frame_reset()
211 struct frame *f = kmalloc(sizeof(*f), GFP_KERNEL); in frame_new() local
212 if (!f) in frame_new()
215 f->video = video; in frame_new()
216 f->frame_num = frame_num; in frame_new()
218 f->header_pool = pci_alloc_consistent(f->video->ohci->dev, PAGE_SIZE, &f->header_pool_dma); in frame_new()
219 if (!f->header_pool) { in frame_new()
221 kfree(f); in frame_new()
226 (unsigned long) f->header_pool, (unsigned long) f->header_pool_dma, PAGE_SIZE); in frame_new()
228 f->descriptor_pool_size = MAX_PACKETS * sizeof(struct DMA_descriptor_block); in frame_new()
230 f->descriptor_pool_size += PAGE_SIZE - (f->descriptor_pool_size%PAGE_SIZE); in frame_new()
232 f->descriptor_pool = pci_alloc_consistent(f->video->ohci->dev, in frame_new()
233 f->descriptor_pool_size, in frame_new()
234 &f->descriptor_pool_dma); in frame_new()
235 if (!f->descriptor_pool) { in frame_new()
236 pci_free_consistent(f->video->ohci->dev, PAGE_SIZE, f->header_pool, f->header_pool_dma); in frame_new()
237 kfree(f); in frame_new()
242 …(unsigned long) f->descriptor_pool, (unsigned long) f->descriptor_pool_dma, f->descriptor_pool_siz… in frame_new()
244 f->data = 0; in frame_new()
245 frame_reset(f); in frame_new()
247 return f; in frame_new()
250 static void frame_delete(struct frame *f) in frame_delete() argument
252 pci_free_consistent(f->video->ohci->dev, PAGE_SIZE, f->header_pool, f->header_pool_dma); in frame_delete()
253 …pci_free_consistent(f->video->ohci->dev, f->descriptor_pool_size, f->descriptor_pool, f->descripto… in frame_delete()
254 kfree(f); in frame_delete()
270 struct frame *f = video->frames[this_frame]; in frame_prepare() local
303 data_p = f->data + full_packets * 480; in frame_prepare()
311 if (f->n_packets >= MAX_PACKETS) { in frame_prepare()
318 block = &(f->descriptor_pool[f->n_packets]); in frame_prepare()
323 block_dma = ((unsigned long) block - (unsigned long) f->descriptor_pool) + f->descriptor_pool_dma; in frame_prepare()
327 if ( ((unsigned long) &(f->header_pool[f->n_packets]) - (unsigned long) f->header_pool) in frame_prepare()
333 cip = &(f->header_pool[f->n_packets]); in frame_prepare()
338 cip_dma = (unsigned long) cip % PAGE_SIZE + f->header_pool_dma; in frame_prepare()
375 if (f->n_packets == 0) { in frame_prepare()
379 } else if (f->n_packets == packets_per_frame) { in frame_prepare()
395 f->cip_syt1 = cip; in frame_prepare()
399 } else if (first_packet_empty && (f->n_packets == 1) ) { in frame_prepare()
402 f->cip_syt2 = cip; in frame_prepare()
437 f->frame_begin_timestamp = &(block->u.out.u.empty.ol.q[3]); in frame_prepare()
439 f->mid_frame_timestamp = &(block->u.out.u.empty.ol.q[3]); in frame_prepare()
441 f->frame_end_timestamp = &(block->u.out.u.empty.ol.q[3]); in frame_prepare()
442 f->frame_end_branch = &(block->u.out.u.empty.ol.q[2]); in frame_prepare()
448 f->first_n_descriptors = n_descriptors; in frame_prepare()
491 f->frame_begin_timestamp = &(block->u.out.u.full.u.cross.ol.q[3]); in frame_prepare()
493 f->mid_frame_timestamp = &(block->u.out.u.full.u.cross.ol.q[3]); in frame_prepare()
495 f->frame_end_timestamp = &(block->u.out.u.full.u.cross.ol.q[3]); in frame_prepare()
496 f->frame_end_branch = &(block->u.out.u.full.u.cross.ol.q[2]); in frame_prepare()
503 f->first_n_descriptors = n_descriptors; in frame_prepare()
526 f->frame_begin_timestamp = &(block->u.out.u.full.u.nocross.ol.q[3]); in frame_prepare()
528 f->mid_frame_timestamp = &(block->u.out.u.full.u.nocross.ol.q[3]); in frame_prepare()
530 f->frame_end_timestamp = &(block->u.out.u.full.u.nocross.ol.q[3]); in frame_prepare()
531 f->frame_end_branch = &(block->u.out.u.full.u.nocross.ol.q[2]); in frame_prepare()
538 f->first_n_descriptors = n_descriptors; in frame_prepare()
556 f->n_packets++; in frame_prepare()
562 *(f->frame_end_branch) = cpu_to_le32(f->descriptor_pool_dma | f->first_n_descriptors); in frame_prepare()
565 dma_region_sync(&video->dv_buf, f->data - (unsigned long) video->dv_buf.kvirt, video->frame_size); in frame_prepare()
570 f->state = FRAME_READY; in frame_prepare()
584 (unsigned long) f->frame_begin_timestamp, in frame_prepare()
585 (unsigned long) f->mid_frame_timestamp, in frame_prepare()
586 (unsigned long) f->frame_end_timestamp, in frame_prepare()
587 (unsigned long) f->frame_end_branch); in frame_prepare()
597 …*(video->frames[last_frame]->frame_end_branch) = cpu_to_le32(f->descriptor_pool_dma | f->first_n_d… in frame_prepare()
636 f->first_n_descriptors); in frame_prepare()
658 f->assigned_timestamp = (ts_cyc&0xF) << 12; in frame_prepare()
661 if (f->cip_syt1) { in frame_prepare()
662 f->cip_syt1->b[6] = f->assigned_timestamp >> 8; in frame_prepare()
663 f->cip_syt1->b[7] = f->assigned_timestamp & 0xFF; in frame_prepare()
665 if (f->cip_syt2) { in frame_prepare()
666 f->cip_syt2->b[6] = f->assigned_timestamp >> 8; in frame_prepare()
667 f->cip_syt2->b[7] = f->assigned_timestamp & 0xFF; in frame_prepare()
758 frame_put_packet (struct frame *f, struct packet *p) in frame_put_packet() argument
769 memcpy( (void *) f->data + dif_sequence * 150 * 80, p->data, 480); in frame_put_packet()
773 memcpy( (void *) f->data + dif_sequence * 150 * 80 + (1 + dif_block) * 80, p->data, 480); in frame_put_packet()
777 memcpy( (void *) f->data + dif_sequence * 150 * 80 + (3 + dif_block) * 80, p->data, 480); in frame_put_packet()
781 … memcpy( (void *) f->data + dif_sequence * 150 * 80 + (6 + dif_block * 16) * 80, p->data, 480); in frame_put_packet()
785 …memcpy( (void *) f->data + dif_sequence * 150 * 80 + (7 + (dif_block / 15) + dif_block) * 80, p->d… in frame_put_packet()
870 struct frame *f = NULL; in receive_packets() local
878 if (j > 0 && f != NULL && f->frame_end_branch != NULL) in receive_packets()
879 *(f->frame_end_branch) = cpu_to_le32(video->frames[j]->descriptor_pool_dma | 1); /* set Z=1 */ in receive_packets()
881 f = video->frames[j]; in receive_packets()
885 block = &(f->descriptor_pool[i]); in receive_packets()
886 … block_dma = ((unsigned long) block - (unsigned long) f->descriptor_pool) + f->descriptor_pool_dma; in receive_packets()
888 data = ((struct packet*)video->packet_buf.kvirt) + f->frame_num * MAX_PACKETS + i; in receive_packets()
897 last_branch_address = f->frame_end_branch; in receive_packets()
902 f->frame_end_branch = &(block->u.in.il.q[2]); in receive_packets()
2128 struct frame *f; in it_tasklet_func() local
2141 f = video->frames[frame]; in it_tasklet_func()
2142 if (f->state != FRAME_READY) { in it_tasklet_func()
2151 if ( *(f->frame_begin_timestamp) ) { in it_tasklet_func()
2168 prev_f->done && (!f->done) ) in it_tasklet_func()
2180 f->done = 1; in it_tasklet_func()
2185 if ( *(f->mid_frame_timestamp) ) { in it_tasklet_func()
2189 *(f->mid_frame_timestamp) = 0; in it_tasklet_func()
2191 begin_ts = le32_to_cpu(*(f->frame_begin_timestamp)); in it_tasklet_func()
2195 f->assigned_timestamp >> 12, f->assigned_timestamp & 0xFFF); in it_tasklet_func()
2204 next_frame = f; in it_tasklet_func()
2211 ts_cyc += f->n_packets + video->syt_offset ; in it_tasklet_func()
2231 if ( *(f->frame_end_timestamp) ) { in it_tasklet_func()
2233 *(f->frame_end_timestamp) = 0; in it_tasklet_func()
2271 struct frame *f; in ir_tasklet_func() local
2299 f = video->frames[video->current_packet / MAX_PACKETS]; in ir_tasklet_func()
2300 block = &(f->descriptor_pool[video->current_packet % MAX_PACKETS]); in ir_tasklet_func()
2306 f = video->frames[video->active_frame]; in ir_tasklet_func()
2333 frame_reset(f); /* f->state = STATE_CLEAR */ in ir_tasklet_func()
2346 f = video->frames[video->active_frame]; in ir_tasklet_func()
2353 f->state = FRAME_READY; in ir_tasklet_func()
2357 if (f->n_packets > (video->frame_size / 480)) { in ir_tasklet_func()
2361 frame_put_packet(f, p); in ir_tasklet_func()
2376 f = video->frames[next_i / MAX_PACKETS]; in ir_tasklet_func()
2377 next = &(f->descriptor_pool[next_i % MAX_PACKETS]); in ir_tasklet_func()
2378 next_dma = ((unsigned long) block - (unsigned long) f->descriptor_pool) + f->descriptor_pool_dma; in ir_tasklet_func()
2384 f = video->frames[prev_i / MAX_PACKETS]; in ir_tasklet_func()
2385 prev = &(f->descriptor_pool[prev_i % MAX_PACKETS]); in ir_tasklet_func()