Example #1
0
static void local_vf_put(vframe_t *vf)
{
	int i;
	int  canvas_addr;
	if(!vf)
		return;
	INCPTR(putting_ptr);
	for (i = 0; i < VF_POOL_SIZE; i++) { 
		canvas_addr = index2canvas(i);        
		if(vf->canvas0Addr == canvas_addr ){
			vfbuf_use[i] = 0;   
			vm_vf_put_from_provider(vf); 
		}
	}
}
static irqreturn_t jpeglogo_isr(int irq, void *dev_id)
{
	u32 reg, index;
     	vframe_t  *pvf=&g_jpeg_parser->vf;	

    	WRITE_MPEG_REG(ASSIST_MBOX1_CLR_REG, 1);

    	reg = READ_MPEG_REG(MREG_FROM_AMRISC);

    	if (reg & PICINFO_BUF_IDX_MASK) {
       		index = ((reg & PICINFO_BUF_IDX_MASK) - 1) & 3;

        	pvf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD;
        	pvf->canvas0Addr = pvf->canvas1Addr = index2canvas(index);
		g_jpeg_parser->state= PIC_DECODED;
		g_jpeg_parser->canvas_index=pvf->canvas0Addr;
		amlog_mask_level(LOG_MASK_PARSER,LOG_LEVEL_LOW,"[jpeglogo]: One frame decoded\n");
		
    }

    return IRQ_HANDLED;
}
Example #3
0
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 {
Example #4
0
            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;

            if (error_skip(info, vf)) {
                vfq_push(&recycle_q, vf);
            } else {
                vfq_push(&display_q, vf);
                vf_notify_receiver(PROVIDER_NAME,VFRAME_EVENT_PROVIDER_VFRAME_READY,NULL);
            }

            vf = vfq_pop(&newframe_q);

            set_frame_info(vf);

            vf->index = index;
            vf->type = (info & PICINFO_TOP_FIRST) ?