亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bttv-risc.c

?? 是關于linux2.5.1的完全源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*    bttv-risc.c  --  interfaces to other kernel modules    bttv risc code handling	- memory management	- generation    (c) 2000 Gerd Knorr <kraxel@goldbach.in-berlin.de>    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#define __NO_VERSION__ 1#include <linux/version.h>#include <linux/module.h>#include <linux/init.h>#include <linux/pci.h>#include <linux/iobuf.h>#include <linux/vmalloc.h>#include <linux/interrupt.h>#include <asm/page.h>#include <asm/pgtable.h>#include "bttvp.h"/* ---------------------------------------------------------- *//* allocate/free risc memory                                  */int  bttv_riscmem_alloc(struct pci_dev *pci,			struct bttv_riscmem *risc,			unsigned int size){	unsigned long  *cpu;	dma_addr_t     dma;		cpu = pci_alloc_consistent(pci, size, &dma);	if (NULL == cpu)		return -ENOMEM;	memset(cpu,0,size);	if (risc->cpu && risc->size < size) {		/* realloc (enlarge buffer) -- copy old stuff */		memcpy(cpu,risc->cpu,risc->size);		bttv_riscmem_free(pci,risc);	}	risc->cpu  = cpu;	risc->dma  = dma;	risc->size = size;	return 0;}void bttv_riscmem_free(struct pci_dev *pci,		       struct bttv_riscmem *risc){	if (NULL == risc->cpu)		return;	pci_free_consistent(pci, risc->size, risc->cpu, risc->dma);	memset(risc,0,sizeof(*risc));}/* ---------------------------------------------------------- *//* risc code generators                                       */intbttv_risc_packed(struct bttv *btv, struct bttv_riscmem *risc,		 struct scatterlist *sglist,		 int offset, int bpl, int padding, int lines){	int instructions,rc,line,todo;	struct scatterlist *sg;	unsigned long *rp;	/* estimate risc mem: worst case is one write per page border +	   one write per scan line + sync + jump (all 2 dwords) */	instructions  = (bpl * lines) / PAGE_SIZE + lines;	instructions += 2;	if ((rc = bttv_riscmem_alloc(btv->dev,risc,instructions*8)) < 0)		return rc;	/* sync instruction */	rp = risc->cpu;	*(rp++) = cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1);	*(rp++) = cpu_to_le32(0);	/* scan lines */	sg = sglist;	for (line = 0; line < lines; line++) {		while (offset >= sg_dma_len(sg)) {			offset -= sg_dma_len(sg);			sg++;		}		if (bpl <= sg_dma_len(sg)-offset) {			/* fits into current chunk */                        *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|					    BT848_RISC_EOL|bpl);                        *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);                        offset+=bpl;		} else {			/* scanline needs to be splitted */                        todo = bpl;                        *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|					    (sg_dma_len(sg)-offset));                        *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);                        todo -= (sg_dma_len(sg)-offset);                        offset = 0;                        sg++;                        while (todo > sg_dma_len(sg)) {                                *(rp++)=cpu_to_le32(BT848_RISC_WRITE|						    sg_dma_len(sg));                                *(rp++)=cpu_to_le32(sg_dma_address(sg));				todo -= sg_dma_len(sg);				sg++;			}                        *(rp++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|					    todo);			*(rp++)=cpu_to_le32(sg_dma_address(sg));			offset += todo;		}		offset += padding;	}	/* save pointer to jmp instruction address */	risc->jmp = rp;	return 0;}intbttv_risc_planar(struct bttv *btv, struct bttv_riscmem *risc,		 struct scatterlist *sglist,		 int yoffset, int ybpl, int ypadding, int ylines,		 int uoffset, int voffset, int hshift, int vshift,		 int cpadding){	int instructions,rc,line,todo,ylen,chroma;	unsigned long *rp,ri;	struct scatterlist *ysg;	struct scatterlist *usg;	struct scatterlist *vsg;	/* estimate risc mem: worst case is one write per page border +	   one write per scan line (5 dwords)	   plus sync + jump (2 dwords) */	instructions  = (ybpl * ylines * 2) / PAGE_SIZE + ylines;	instructions += 2;	if ((rc = bttv_riscmem_alloc(btv->dev,risc,instructions*4*5)) < 0)		return rc;	/* sync instruction */	rp = risc->cpu;	*(rp++) = cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM3);	*(rp++) = cpu_to_le32(0);	/* scan lines */	ysg = sglist;	usg = sglist;	vsg = sglist;	for (line = 0; line < ylines; line++) {		switch (vshift) {		case 0:  chroma = 1;           break;		case 1:  chroma = !(line & 1); break;		case 2:  chroma = !(line & 3); break;		default: chroma = 0;		}		for (todo = ybpl; todo > 0; todo -= ylen) {			/* go to next sg entry if needed */			while (yoffset >= sg_dma_len(ysg)) {				yoffset -= sg_dma_len(ysg);				ysg++;			}			while (uoffset >= sg_dma_len(usg)) {				uoffset -= sg_dma_len(usg);				usg++;			}			while (voffset >= sg_dma_len(vsg)) {				voffset -= sg_dma_len(vsg);				vsg++;			}			/* calculate max number of bytes we can write */			ylen = todo;			if (yoffset + ylen > sg_dma_len(ysg))				ylen = sg_dma_len(ysg) - yoffset;			if (chroma) {				if (uoffset + (ylen>>hshift) > sg_dma_len(usg))					ylen = (sg_dma_len(usg) - uoffset) << hshift;				if (voffset + (ylen>>hshift) > sg_dma_len(vsg))					ylen = (sg_dma_len(vsg) - voffset) << hshift;				ri = BT848_RISC_WRITE123;			} else {				ri = BT848_RISC_WRITE1S23;			}			if (ybpl == todo)				ri |= BT848_RISC_SOL;			if (ylen == todo)				ri |= BT848_RISC_EOL;			/* write risc instruction */                        *(rp++)=cpu_to_le32(ri | ylen);                        *(rp++)=cpu_to_le32(((ylen >> hshift) << 16) |					    (ylen >> hshift));			*(rp++)=cpu_to_le32(sg_dma_address(ysg)+yoffset);			yoffset += ylen;			if (chroma) {				*(rp++)=cpu_to_le32(sg_dma_address(usg)+uoffset);				uoffset += ylen >> hshift;				*(rp++)=cpu_to_le32(sg_dma_address(vsg)+voffset);				voffset += ylen >> hshift;			}		}		yoffset += ypadding;		if (chroma) {			uoffset += cpadding;			voffset += cpadding;		}	}	/* save pointer to jmp instruction address */	risc->jmp = rp;	return 0;}/* ---------------------------------------------------------- */struct SKIPLIST {	int start;	int end;};intbttv_screen_clips(struct video_buffer *fbuf,		  int x, int y, int width, int height,		  struct video_clip *clips, int n){	if (x < 0) {		/* left */		clips[n].x = 0;		clips[n].y = 0;		clips[n].width  = -x;		clips[n].height = height;		n++;	}	if (x+width > fbuf->width) {		/* right */		clips[n].x = fbuf->width - x;		clips[n].y = 0;		clips[n].width  = width - clips[n].x;		clips[n].height = height;		n++;	}	if (y < 0) {		/* top */		clips[n].x = 0;		clips[n].y = 0;		clips[n].width  = width;		clips[n].height = -y;		n++;	}	if (y+height > fbuf->height) {		/* bottom */		clips[n].x = 0;		clips[n].y = fbuf->height - y;		clips[n].width  = width;		clips[n].height = height - clips[n].y;		n++;	}	return n;}voidbttv_sort_clips(struct video_clip *clips, int nclips){	struct video_clip swap;	int i,j,n;	for (i = nclips-2; i >= 0; i--) {		for (n = 0, j = 0; j <= i; j++) {			if (clips[j].x > clips[j+1].x) {				swap = clips[j];				clips[j] = clips[j+1];				clips[j+1] = swap;				n++;			}		}		if (0 == n)			break;	}}static voidcalc_skips(int line, int width, int *maxy,	   struct SKIPLIST *skips, int *nskips,	   const struct video_clip *clips, int nclips){	int clip,skip,maxline,end;	skip=0;	maxline = 9999;	for (clip = 0; clip < nclips; clip++) {		/* sanity checks */		if (clips[clip].x + clips[clip].width <= 0)			continue;		if (clips[clip].x > width)			break;				/* vertical range */		if (line > clips[clip].y+clips[clip].height-1)			continue;		if (line < clips[clip].y) {			if (maxline > clips[clip].y-1)				maxline = clips[clip].y-1;			continue;		}		if (maxline > clips[clip].y+clips[clip].height-1)			maxline = clips[clip].y+clips[clip].height-1;		/* horizontal range */		if (0 == skip || clips[clip].x > skips[skip-1].end) {			/* new one */			skips[skip].start = clips[clip].x;			if (skips[skip].start < 0)				skips[skip].start = 0;			skips[skip].end = clips[clip].x + clips[clip].width;			if (skips[skip].end > width)				skips[skip].end = width;			skip++;		} else {			/* overlaps -- expand last one */			end = clips[clip].x + clips[clip].width;			if (skips[skip-1].end < end)				skips[skip-1].end = end;			if (skips[skip-1].end > width)				skips[skip-1].end = width;		}	}	*nskips = skip;	*maxy = maxline;	if (bttv_debug) {		printk(KERN_DEBUG "bttv: skips line %d-%d:",line,maxline);		for (skip = 0; skip < *nskips; skip++) {			printk(" %d-%d",skips[skip].start,skips[skip].end);		}		printk("\n");	}}intbttv_risc_overlay(struct bttv *btv, struct bttv_riscmem *risc,		  const struct bttv_format *fmt, struct bttv_overlay *ov,		  int fields){	int instructions,rc,line,maxy,start,end,skip,nskips;	struct SKIPLIST *skips;	unsigned long *rp,ri,ra;	unsigned long addr;	/* skip list for window clipping */	if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL)))		return -ENOMEM;		/* estimate risc mem: worst case is (clip+1) * lines instructions	   + sync + jump (all 2 dwords) */	instructions  = (ov->nclips + 1) *		((fields & VBUF_FIELD_INTER) ? ov->height>>1 :  ov->height);	instructions += 2;	if ((rc = bttv_riscmem_alloc(btv->dev,risc,instructions*8)) < 0)		return rc;	/* sync instruction */	rp = risc->cpu;	*(rp++) = cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1);	*(rp++) = cpu_to_le32(0);	addr  = (unsigned long)btv->fbuf.base;	addr += btv->fbuf.bytesperline * ov->y;	addr += ((btv->fbuf.depth+7) >> 3) * ov->x;	/* scan lines */	for (maxy = -1, line = 0; line < ov->height;	     line++, addr += btv->fbuf.bytesperline) {		if (fields & VBUF_FIELD_INTER) {			if ((line%2) != 0 && (fields & VBUF_FIELD_ODD))				continue;			if ((line%2) != 1 && (fields & VBUF_FIELD_EVEN))				continue;		}		/* calculate clipping */		if (line > maxy)			calc_skips(line, ov->width, &maxy,				   skips, &nskips, ov->clips, ov->nclips);		/* write out risc code */		for (start = 0, skip = 0; start < ov->width; start = end) {			if (skip >= nskips) {				ri  = BT848_RISC_WRITE;				end = ov->width;			} else if (start < skips[skip].start) {				ri  = BT848_RISC_WRITE;				end = skips[skip].start;			} else {				ri  = BT848_RISC_SKIP;				end = skips[skip].end;				skip++;			}			if (BT848_RISC_WRITE == ri)				ra = addr + (fmt->depth>>3)*start;			else				ra = 0;							if (0 == start)				ri |= BT848_RISC_SOL;			if (ov->width == end)				ri |= BT848_RISC_EOL;			ri |= (fmt->depth>>3) * (end-start);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线一区观看| 久久国产夜色精品鲁鲁99| 亚洲永久精品大片| 国模大尺度一区二区三区| 色噜噜狠狠色综合欧洲selulu| 欧美一二三在线| 国产精品伦理在线| 美女视频一区二区| 欧美色倩网站大全免费| 国产精品国产自产拍高清av| 久99久精品视频免费观看| 欧美午夜宅男影院| 亚洲同性同志一二三专区| 精品制服美女丁香| 97久久精品人人做人人爽| 国产一区三区三区| 国产99久久久久| 色婷婷久久久亚洲一区二区三区| 欧美亚洲图片小说| 欧美一级专区免费大片| 久久久www成人免费无遮挡大片| 国产日韩欧美精品综合| 中文字幕一区二区视频| 亚洲国产va精品久久久不卡综合| 美腿丝袜亚洲综合| 国产高清不卡二三区| 色综合久久精品| 欧美一级日韩免费不卡| 久久久久久免费| 亚洲免费在线观看| 久久精品99国产精品| 国产a视频精品免费观看| 日本精品裸体写真集在线观看| 欧美日韩亚洲综合| 国产亚洲精品久| 亚洲午夜一区二区| 国产精品一区三区| 欧美日韩免费在线视频| 国产午夜亚洲精品理论片色戒| 一区二区三区成人在线视频| 久久综合综合久久综合| 色香蕉久久蜜桃| 26uuu色噜噜精品一区| 亚洲在线免费播放| 国产ts人妖一区二区| 欧美久久一二区| 日韩理论电影院| 国产精品一区二区视频| 欧美日韩国产一区| 亚洲私人黄色宅男| 国产在线播放一区二区三区| 欧美三级午夜理伦三级中视频| 欧美国产日韩亚洲一区| 日本欧美肥老太交大片| 91污片在线观看| 国产欧美日韩三级| 久久国产精品露脸对白| 欧美日韩综合在线| 亚洲另类春色校园小说| 亚洲综合另类小说| 欧美在线观看18| 韩国一区二区三区| 国产精品大尺度| 在线91免费看| 国产成人免费在线视频| 亚洲一区二区三区视频在线播放| 日韩午夜精品视频| www.亚洲色图.com| 亚洲18影院在线观看| 国产午夜一区二区三区| 欧美亚洲动漫制服丝袜| 黄色日韩三级电影| 日韩久久一区二区| 欧美精品一区二区三区很污很色的| 99视频有精品| 久久超碰97中文字幕| 亚洲激情自拍偷拍| 精品成人一区二区| 精品污污网站免费看| 国产成人综合视频| 日韩电影一区二区三区四区| 国产精品传媒在线| 欧美一区二区三区在线| 99精品偷自拍| 精品亚洲免费视频| 亚洲第一福利一区| 亚洲视频在线观看三级| 久久久午夜精品| 在线观看av一区二区| 中文字幕五月欧美| 精品久久久久久久人人人人传媒| 91色porny在线视频| 国产精品自产自拍| 日本欧美在线观看| 亚洲一区二区三区中文字幕| 欧美国产精品久久| 欧美一区二区三区日韩视频| 99re热视频这里只精品| 国产乱理伦片在线观看夜一区| 天堂av在线一区| 亚洲国产sm捆绑调教视频| 国产精品国产自产拍在线| 久久久久久亚洲综合| 精品精品欲导航| 欧美一区二区三区四区视频| 欧美视频中文字幕| 色94色欧美sute亚洲线路一ni| 成人精品gif动图一区| 国产乱国产乱300精品| 精品亚洲成a人| 精品一区二区三区久久| 免费成人av资源网| 免费欧美日韩国产三级电影| 日本不卡1234视频| 欧美aaaaa成人免费观看视频| 午夜精品久久久久| 日韩电影一区二区三区| 久久国产三级精品| 国产精品一区二区在线看| 国产精品1区2区| 国产一区二区三区| 国产成人精品午夜视频免费| 国产成人在线色| 不卡av在线网| 色综合天天性综合| 欧美调教femdomvk| 欧美精品自拍偷拍动漫精品| 91精品黄色片免费大全| 欧美成人乱码一区二区三区| 久久欧美中文字幕| 国产网红主播福利一区二区| 中文字幕一区二区三区乱码在线| 成人欧美一区二区三区视频网页| 亚洲人123区| 天天操天天色综合| 国产一区二区在线观看视频| 国产成人高清在线| 在线视频一区二区免费| 欧美一区二区三区视频免费播放 | 4438亚洲最大| 精品精品欲导航| 亚洲婷婷在线视频| 亚洲大片免费看| 激情综合五月婷婷| caoporm超碰国产精品| 欧美日韩综合在线| 久久综合资源网| 亚洲男人的天堂在线aⅴ视频| 日韩黄色小视频| 成人午夜大片免费观看| 欧美三级视频在线播放| 久久久国产一区二区三区四区小说| 亚洲天堂久久久久久久| 日韩激情一二三区| www.在线欧美| 日韩欧美区一区二| 综合久久久久久| 久久国产精品无码网站| 色婷婷久久综合| 久久久精品综合| 日韩中文字幕1| 粉嫩av一区二区三区| 在线成人免费视频| 国产精品免费丝袜| 开心九九激情九九欧美日韩精美视频电影| 国产69精品久久久久毛片| 欧美日韩另类一区| 国产精品第五页| 国产一区二区三区电影在线观看 | 欧美一区二区黄| 综合亚洲深深色噜噜狠狠网站| 老司机精品视频线观看86| 91久久精品一区二区| 国产人成一区二区三区影院| 全部av―极品视觉盛宴亚洲| 91天堂素人约啪| 欧美国产1区2区| 国内精品久久久久影院一蜜桃| 精品视频1区2区| 亚洲欧美日韩一区二区三区在线观看| 激情丁香综合五月| 欧美一区二区三区日韩| 一区二区三区四区激情| 99精品国产一区二区三区不卡| 精品国偷自产国产一区| 五月天国产精品| 欧美性大战久久久久久久蜜臀| 成人欧美一区二区三区视频网页 | 欧美激情资源网| 狠狠色丁香婷婷综合| 日韩三级高清在线| 亚洲福中文字幕伊人影院| 一本大道久久精品懂色aⅴ| 日本一区二区成人在线| 韩国一区二区视频| 精品动漫一区二区三区在线观看| 蜜桃视频在线观看一区| 欧美一三区三区四区免费在线看| 久国产精品韩国三级视频| 91丨porny丨最新|