inline vframe_t *vfq_pop_display(void) { vframe_t *vf; spin_lock(&vdin_fifo_lock); vf = vfq_pop(&display_q); spin_unlock(&vdin_fifo_lock); return vf; }
inline vframe_t *vfq_pop_recycle(void) { vframe_t *vf; spin_lock(&vdin_fifo_lock); vf = vfq_pop(&recycle_q); spin_unlock(&vdin_fifo_lock); return vf; }
static vframe_t *vdin_vf_get(void* op_arg) { vframe_t *vf; if(init_flag == 0) return NULL; //spin_lock(&vdin_fifo_lock); vf = vfq_pop(&display_q); //spin_unlock(&vdin_fifo_lock); return vf; }
static irqreturn_t vmpeg12_isr(int irq, void *dev_id) { u32 reg, info, seqinfo, offset, pts, pts_valid = 0; vframe_t *vf; ulong flags; WRITE_MPEG_REG(ASSIST_MBOX1_CLR_REG, 1); reg = READ_MPEG_REG(MREG_BUFFEROUT); if (reg) { info = READ_MPEG_REG(MREG_PIC_INFO); offset = READ_MPEG_REG(MREG_FRAME_OFFSET); info = info | PICINFO_TOP_FIRST; if (((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_I) && (pts_lookup_offset(PTS_TYPE_VIDEO, offset, &pts, 0) == 0)) { pts_valid = 1; } /*if (frame_prog == 0)*/ { frame_prog = info & PICINFO_PROG; } if ((dec_control & DEC_CONTROL_FLAG_FORCE_2500_720_576_INTERLACE) && (frame_width == 720) && (frame_height == 576) && (frame_dur == 3840)) { frame_prog = 0; } else if ((dec_control & DEC_CONTROL_FLAG_FORCE_3000_704_480_INTERLACE) && (frame_width == 704) && (frame_height == 480) && (frame_dur == 3200)) { frame_prog = 0; } else if ((dec_control & DEC_CONTROL_FLAG_FORCE_2500_704_576_INTERLACE) && (frame_width == 704) && (frame_height == 576) && (frame_dur == 3840)) { frame_prog = 0; } else if ((dec_control & DEC_CONTROL_FLAG_FORCE_2500_544_576_INTERLACE) && (frame_width == 544) && (frame_height == 576) && (frame_dur == 3840)) { frame_prog = 0; } else if ((dec_control & DEC_CONTROL_FLAG_FORCE_2500_480_576_INTERLACE) && (frame_width == 480) && (frame_height == 576) && (frame_dur == 3840)) { frame_prog = 0; } if (frame_prog & PICINFO_PROG) { u32 index = ((reg & 7) - 1) & 3; seqinfo = READ_MPEG_REG(MREG_SEQ_INFO); vf = vfq_pop(&newframe_q); set_frame_info(vf); vf->index = index; vf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; if ((seqinfo & SEQINFO_EXT_AVAILABLE) && (seqinfo & SEQINFO_PROG)) { if (info & PICINFO_RPT_FIRST) { if (info & PICINFO_TOP_FIRST) { vf->duration = vf->duration * 3; // repeat three times } else { vf->duration = vf->duration * 2; // repeat two times } } vf->duration_pulldown = 0; // no pull down } else { vf->duration_pulldown = (info & PICINFO_RPT_FIRST) ? vf->duration >> 1 : 0; } vf->duration += vf->duration_pulldown; vf->canvas0Addr = vf->canvas1Addr = index2canvas(index); vf->pts = (pts_valid) ? pts : 0; vfbuf_use[index]++; if (error_skip(info, vf)) { spin_lock_irqsave(&lock, flags); vfq_push(&recycle_q, vf); spin_unlock_irqrestore(&lock, flags); } else { vfq_push(&display_q, vf); } vf_notify_receiver(PROVIDER_NAME,VFRAME_EVENT_PROVIDER_VFRAME_READY,NULL); } else {
static vframe_t *ppmgr_vf_get(void *op_arg) { return vfq_pop(&q_ready); }
vfbuf_use[index]++; if (error_skip(info, vf)) { spin_lock_irqsave(&lock, flags); vfq_push(&recycle_q, vf); spin_unlock_irqrestore(&lock, flags); } else { vfq_push(&display_q, vf); } vf_notify_receiver(PROVIDER_NAME,VFRAME_EVENT_PROVIDER_VFRAME_READY,NULL); } else { u32 index = ((reg & 7) - 1) & 3; vf = vfq_pop(&newframe_q); vfbuf_use[index] += 2; set_frame_info(vf); vf->index = index; vf->type = (info & PICINFO_TOP_FIRST) ? VIDTYPE_INTERLACE_TOP : VIDTYPE_INTERLACE_BOTTOM; vf->duration >>= 1; vf->duration_pulldown = (info & PICINFO_RPT_FIRST) ? vf->duration >> 1 : 0; vf->duration += vf->duration_pulldown; vf->canvas0Addr = vf->canvas1Addr = index2canvas(index); vf->pts = (pts_valid) ? pts : 0;
static vframe_t *vdin_vf_get(void) { return vfq_pop(&display_q); }
inline vframe_t *vfq_pop_recycle(void) { return vfq_pop(&recycle_q); }
inline vframe_t *vfq_pop_display(void) { return vfq_pop(&display_q); }
inline vframe_t *vfq_pop_newframe(void) { return vfq_pop(&newframe_q); }