Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65928
b: refs/heads/master
c: 3bef5e4
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Oct 10, 2007
1 parent b000cc8 commit b47fb32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 123f8ef64e3996e06a930756b6b2cdede4b18da0
refs/heads/master: 3bef5e4a1f73898dc8c8433f938d3a8b22f2be22
17 changes: 11 additions & 6 deletions trunk/drivers/media/video/vivi.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ static u8 bars[8][3] = {
#define TSTAMP_MAX_Y TSTAMP_MIN_Y+15
#define TSTAMP_MIN_X 64


static void gen_line(char *basep,int inipos,int wmax,
int hmax, int line, char *timestr)
int hmax, int line, int count, char *timestr)
{
int w,i,j,pos=inipos,y;
char *p,*s;
Expand All @@ -242,9 +241,10 @@ static void gen_line(char *basep,int inipos,int wmax,

/* Generate a standard color bar pattern */
for (w=0;w<wmax;w++) {
r=bars[w*7/wmax][0];
g=bars[w*7/wmax][1];
b=bars[w*7/wmax][2];
int colorpos=((w+count)*8/(wmax+1)) % 8;
r=bars[colorpos][0];
g=bars[colorpos][1];
b=bars[colorpos][2];

for (color=0;color<4;color++) {
p=basep+pos;
Expand Down Expand Up @@ -327,18 +327,23 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
struct timeval ts;
char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL);
void *vbuf=videobuf_to_vmalloc (&buf->vb);
/* FIXME: move to dev struct */
static int mv_count=0;

if (!tmpbuf)
return;

for (h=0;h<hmax;h++) {
gen_line(tmpbuf,0,wmax,hmax,h,dev->timestr);
gen_line(tmpbuf,0,wmax,hmax,h,mv_count,
dev->timestr);
/* FIXME: replacing to __copy_to_user */
if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0)
dprintk(2,"vivifill copy_to_user failed.\n");
pos += wmax*2;
}

mv_count++;

kfree(tmpbuf);

/* Updates stream time */
Expand Down

0 comments on commit b47fb32

Please sign in to comment.