⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 atixv.c.diff2

📁 linux TV 源码
💻 DIFF2
📖 第 1 页 / 共 3 页
字号:
<   /* make the compiler happy */<   s2offset = s3offset = srcPitch2 = 0;<   <   if(src_w > (drw_w << 4))<     drw_w = src_w >> 4;<   if(src_h > (drw_h << 4))<     drw_h = src_h >> 4;<   <   /* Clip */<   xa = src_x;<   xb = src_x + src_w;<   ya = src_y;<   yb = src_y + src_h;<   <   dstBox.x1 = drw_x;<   dstBox.x2 = drw_x + drw_w;<   dstBox.y1 = drw_y;<   dstBox.y2 = drw_y + drw_h;<   <   if(pPriv->bt829 != NULL || pPriv->zv_port)<     {--->   ScrnInfoPtr pScrn,>   short src_x, short src_y,>   short drw_x, short drw_y,>   short src_w, short src_h,>   short drw_w, short drw_h,>   RegionPtr clipBoxes, pointer data> ){>    ATIPtr pATI = ATIPTR(pScrn);>    ATIPortPrivPtr pPriv = (ATIPortPrivPtr)data;>    INT32 xa, xb, ya, yb, top;>    int pitch, new_size, offset1, offset2, s2offset, s3offset;>    int srcPitch, srcPitch2, dstPitch;>    int bpp;>    BoxRec dstBox;>    CARD32 id;>    int width, height;> >    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PutVideo\n");>    /*>     * s2offset, s3offset - byte offsets into U and V plane of the>     *                      source where copying starts.  Y plane is>     *                      done by editing "buf".>     *>     * offset - byte offset to the first line of the destination.>     *>     * dst_start - byte address to the first displayed pel.>     *>     */> >    /* make the compiler happy */>    s2offset = s3offset = srcPitch2 = 0;> >    if(src_w > (drw_w << 4))> 	drw_w = src_w >> 4;>    if(src_h > (drw_h << 4))> 	drw_h = src_h >> 4;> >    /* Clip */>    xa = src_x;>    xb = src_x + src_w;>    ya = src_y;>    yb = src_y + src_h;> >    dstBox.x1 = drw_x;>    dstBox.x2 = drw_x + drw_w;>    dstBox.y1 = drw_y;>    dstBox.y2 = drw_y + drw_h;> >    if(pPriv->bt829 != NULL)>    {2365,2371c2318,2324< 	width = RagePro_InputVideoEncodings[pPriv->encoding].width;< 	height = RagePro_InputVideoEncodings[pPriv->encoding].height; <       } else {< 	width = VT_GT_InputVideoEncodings[pPriv->encoding].width;< 	height = VT_GT_InputVideoEncodings[pPriv->encoding].height; <       }<     } else ---> 	      width = RagePro_InputVideoEncodings[pPriv->encoding].width;>       	      height = RagePro_InputVideoEncodings[pPriv->encoding].height; > 	      } else {> 	      width = VT_GT_InputVideoEncodings[pPriv->encoding].width;>       	      height = VT_GT_InputVideoEncodings[pPriv->encoding].height; > 	      }>    } else 2373,2376c2326,2423<   <   xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PutVideo %d %d\n", width,height);<   <   if(!ATIClipVideo(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height))--->         >    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PutVideo %d %d\n", width,height);> >    if(!ATIClipVideo(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height))> 	return Success;> >    dstBox.x1 -= pScrn->frameX0;>    dstBox.x2 -= pScrn->frameX0;>    dstBox.y1 -= pScrn->frameY0;>    dstBox.y2 -= pScrn->frameY0;> >    bpp = pScrn->bitsPerPixel >> 3;>    pitch = bpp * pScrn->displayWidth;> >    id = FOURCC_YUY2;>    >    top = ya>>16;> >    switch(id) {>    case FOURCC_YV12:>    case FOURCC_I420:>    	top &= ~1;> 	dstPitch = ((width << 1) + 15) & ~15;> 	new_size = ((dstPitch * height) + bpp - 1) / bpp;> 	srcPitch = (width + 3) & ~3;> 	s2offset = srcPitch * height;> 	srcPitch2 = ((width >> 1) + 3) & ~3;> 	s3offset = (srcPitch2 * (height >> 1)) + s2offset;> 	break;>    case FOURCC_UYVY:>    case FOURCC_YUY2:>    default:> 	dstPitch = ((width << 1) + 15) & ~15;> 	new_size = ((dstPitch * height) + bpp - 1) / bpp;> 	srcPitch = (width << 1);> 	break;>    }> >    new_size += 0x1f;  /* for aligning */> >    if(!(pPriv->linear = ATIAllocateMemory(pScrn, pPriv->linear, new_size*2)))>    {> 	return BadAlloc;>    }> > >    offset1 = (pPriv->linear->offset*bpp+0xf) & (~0xf);>    offset2 = ((pPriv->linear->offset+new_size)*bpp + 0x1f) & (~0xf);>    >    ATIMach64WaitForFIFO(pATI, 9); >    outf(CAPTURE_BUF0_OFFSET, offset1);> /*   outf(BUF0_CAP_ODD_OFFSET, 0); */>    outf(ONESHOT_BUF_OFFSET, offset1);>    outf(CAPTURE_BUF1_OFFSET, offset2);> /*   outf(BUF1_CAP_ODD_OFFSET, 0); */>    >    outf(CAPTURE_X_WIDTH, (width*2)<<16);>    outf(CAPTURE_START_END, (((height)+pPriv->v-1)<<16)|(pPriv->v));>    outf(CAPTURE_CONFIG, ENABLE_ATI_CAPTURE_DOUBLEBUF);>    outf(CAPTURE_DEBUG, 0);>    >    outf(OVERLAY_TEST, 0);>    >    /* activate capture unit */>    outf(TRIG_CNTL, (1<<31) | 1);>    >    if(! pPriv->video_stream_active){>       >    if(pPriv->bt829 != NULL) >    {>       ATI_BT_SetEncoding(pScrn, pPriv);>       xf86_bt829_SetCaptSize(pPriv->bt829, width, height*2);>    }>    >    if(pPriv->i2c!=NULL) ATI_board_setmisc(pPriv);> >    if(pPriv->msp3430 != NULL) ATI_MSP_SetEncoding(pPriv);>    ATIMuteAudio(pPriv, pPriv->mute);>    }> >     /* update cliplist */>     if(!RegionsEqual(&pPriv->clip, clipBoxes)) {> 	REGION_COPY(pScreen, &pPriv->clip, clipBoxes);> 	/* draw these */> 	if(pPriv->autopaint_colorkey)(*pATI->pXAAInfo->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0,> 					REGION_NUM_RECTS(clipBoxes),> 					REGION_RECTS(clipBoxes));>     }> >     pPriv->doubleBuffer = 1;>     ATIDisplayVideo(pScrn, pPriv, id, offset1 +top*srcPitch, offset2+top*srcPitch, width, height, width,> 		     xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);> >     pPriv->video_status = CLIENT_VIDEO_ON;>     pPriv->video_stream_active = TRUE;> >     pATI->VideoTimerCallback = ATIVideoTimerCallback;> 2378,2474d2424<   <   dstBox.x1 -= pScrn->frameX0;<   dstBox.x2 -= pScrn->frameX0;<   dstBox.y1 -= pScrn->frameY0;<   dstBox.y2 -= pScrn->frameY0;<   <   bpp = pScrn->bitsPerPixel >> 3;<   pitch = bpp * pScrn->displayWidth;<   <   id = FOURCC_YUY2;<   <   top = ya>>16;<   <   switch(id) {<   case FOURCC_YV12:<   case FOURCC_I420:<     top &= ~1;<     dstPitch = ((width << 1) + 15) & ~15;<     new_size = ((dstPitch * height) + bpp - 1) / bpp;<     srcPitch = (width + 3) & ~3;<     s2offset = srcPitch * height;<     srcPitch2 = ((width >> 1) + 3) & ~3;<     s3offset = (srcPitch2 * (height >> 1)) + s2offset;<     break;<   case FOURCC_UYVY:<   case FOURCC_YUY2:<   default:<     dstPitch = ((width << 1) + 15) & ~15;<     new_size = ((dstPitch * height) + bpp - 1) / bpp;<     srcPitch = (width << 1);<     break;<   }<   <   new_size += 0x1f;  /* for aligning */<   <   if(!(pPriv->linear = ATIAllocateMemory(pScrn, pPriv->linear, new_size*2)))<     {<       return BadAlloc;<     }<   <   offset1 = (pPriv->linear->offset*bpp+0xf) & (~0xf);<   offset2 = ((pPriv->linear->offset+new_size)*bpp + 0x1f) & (~0xf);<   <   ATIMach64WaitForFIFO(pATI, 9); <   outf(CAPTURE_BUF0_OFFSET, offset1);<   /*   outf(BUF0_CAP_ODD_OFFSET, 0); */<   outf(ONESHOT_BUF_OFFSET, offset1);<   outf(CAPTURE_BUF1_OFFSET, offset2);<   /*   outf(BUF1_CAP_ODD_OFFSET, 0); */<   <   outf(CAPTURE_X_WIDTH, (width*2)<<16);<   outf(CAPTURE_START_END, (((height)+pPriv->v-1)<<16)|(pPriv->v));<   if (pPriv->zv_port) <     outf(CAPTURE_CONFIG, ENABLE_ATI_CAPTURE_DOUBLEBUF | ZV_ENABLE); /* Switch on Zoomed Video (ZV) */<   else<     outf(CAPTURE_CONFIG, ENABLE_ATI_CAPTURE_DOUBLEBUF);<   <   outf(CAPTURE_DEBUG, 0);<   <   outf(OVERLAY_TEST, 0);<   <   /* activate capture unit */<   outf(TRIG_CNTL, (1<<31) | 1);<   <   if(! pPriv->video_stream_active){<     <     if(pPriv->bt829 != NULL) <       {< 	ATI_BT_SetEncoding(pScrn, pPriv);< 	xf86_bt829_SetCaptSize(pPriv->bt829, width, height*2);<       }<     <     if(pPriv->i2c!=NULL) ATI_board_setmisc(pPriv);<     <     if(pPriv->msp3430 != NULL) ATI_MSP_SetEncoding(pPriv);<     ATIMuteAudio(pPriv, pPriv->mute);<   }<   <   /* update cliplist */<   if(!RegionsEqual(&pPriv->clip, clipBoxes)) {<     REGION_COPY(pScreen, &pPriv->clip, clipBoxes);<     /* draw these */<     if(pPriv->autopaint_colorkey)(*pATI->pXAAInfo->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0,< 								   REGION_NUM_RECTS(clipBoxes),< 								   REGION_RECTS(clipBoxes));<   }<   <   pPriv->doubleBuffer = 1;<   ATIDisplayVideo(pScrn, pPriv, id, offset1 +top*srcPitch, offset2+top*srcPitch, width, height, width,< 		  xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h);<   <   pPriv->video_status = CLIENT_VIDEO_ON;<   pPriv->video_stream_active = TRUE;<   <   pATI->VideoTimerCallback = ATIVideoTimerCallback;<   <   return Success;2480,2495c2430,2449<   ATIPtr pATI = ATIPTR(pScrn);<   ATIPortPrivPtr pPriv = pATI->adaptor->pPortPrivates[0].ptr;<   <   if(pPriv->video_status & TIMER_MASK) {<     if(pPriv->video_status & OFF_TIMER) {<       if(pPriv->offTime < time) {< 	ATIMach64WaitForFIFO(pATI, 2); < 	outf(OVERLAY_SCALE_CNTL, 0x80000000);< 	pPriv->video_status = FREE_TIMER;< 	pPriv->freeTime = time + FREE_DELAY;<       }<     } else {  /* FREE_TIMER */<       if(pPriv->freeTime < time) {< 	if(pPriv->linear) {< 	  xf86FreeOffscreenLinear(pPriv->linear);< 	  pPriv->linear = NULL;--->     ATIPtr pATI = ATIPTR(pScrn);>     ATIPortPrivPtr pPriv = pATI->adaptor->pPortPrivates[0].ptr;> >     if(pPriv->video_status & TIMER_MASK) {> 	if(pPriv->video_status & OFF_TIMER) {> 	    if(pPriv->offTime < time) {> 		ATIMach64WaitForFIFO(pATI, 2); > 		outf(OVERLAY_SCALE_CNTL, 0x80000000);> 		pPriv->video_status = FREE_TIMER;> 		pPriv->freeTime = time + FREE_DELAY;> 	    }> 	} else {  /* FREE_TIMER */> 	    if(pPriv->freeTime < time) {> 		if(pPriv->linear) {> 		   xf86FreeOffscreenLinear(pPriv->linear);> 		   pPriv->linear = NULL;> 		}> 		pPriv->video_status = 0;> 		pATI->VideoTimerCallback = NULL;> 	    }2497c2451< 	pPriv->video_status = 0;--->     } else  /* shouldn't get here */2499,2502d2452<       }<     }<   } else  /* shouldn't get here */<     pATI->VideoTimerCallback = NULL;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -