25 #include <linux/module.h>
27 #include <linux/pci.h>
29 #include <linux/videodev2.h>
31 #include <asm/pgtable.h>
39 static unsigned int debug;
55 printk(
"btcx: riscmem free [%d] dma=%lx\n",
56 memcnt, (
unsigned long)risc->
dma);
59 memset(risc,0,
sizeof(*risc));
80 printk(
"btcx: riscmem alloc [%d] dma=%lx cpu=%p size=%d\n",
81 memcnt, (
unsigned long)dma, cpu, size);
99 clips[
n].
c.width = -win->
left;
105 clips[
n].
c.left = swidth - win->
left;
107 clips[
n].
c.width = win->
width - clips[
n].
c.left;
116 clips[
n].
c.height = -win->
top;
122 clips[
n].
c.top = sheight - win->
top;
124 clips[
n].
c.height = win->
height - clips[
n].
c.top;
138 nw = (win->
width) & ~mask;
149 for (i = 0; i <
n; i++) {
150 nx = (clips[
i].
c.left-dx) & ~mask;
151 nw = (clips[
i].
c.width) & ~mask;
152 if (nx + nw < clips[i].
c.left-dx + clips[i].
c.width)
154 clips[
i].
c.left = nx;
155 clips[
i].
c.width = nw;
158 clips[i].
c.width, clips[i].
c.height,
159 clips[i].
c.left, clips[i].
c.top);
172 for (i = nclips-2; i >= 0; i--) {
173 for (n = 0, j = 0; j <=
i; j++) {
174 if (clips[j].
c.left > clips[j+1].
c.left) {
176 clips[
j] = clips[j+1];
189 const struct v4l2_clip *clips,
unsigned int nclips)
191 unsigned int clip,
skip;
196 for (clip = 0; clip < nclips; clip++) {
199 if (clips[clip].
c.left + clips[clip].
c.width <= 0)
201 if (clips[clip].
c.left > (
signed)width)
205 if (line > clips[clip].
c.top+clips[clip].
c.height-1)
207 if (line < clips[clip].
c.top) {
208 if (maxline > clips[clip].
c.top-1)
209 maxline = clips[clip].
c.top-1;
212 if (maxline > clips[clip].
c.top+clips[clip].
c.height-1)
213 maxline = clips[clip].
c.top+clips[clip].
c.height-1;
216 if (0 == skip || clips[clip].
c.left > skips[skip-1].
end) {
219 if (skips[skip].
start < 0)
221 skips[
skip].
end = clips[clip].
c.left + clips[clip].
c.width;
222 if (skips[skip].end > width)
227 end = clips[clip].
c.left + clips[clip].
c.width;
228 if (skips[skip-1].end < end)
230 if (skips[skip-1].end > width)
239 for (skip = 0; skip < *nskips; skip++) {
240 printk(
" %d-%d",skips[skip].
start,skips[skip].end);