aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/vivi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/vivi.c')
-rw-r--r--drivers/media/video/vivi.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 01c977671311..650e959aeb78 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -229,9 +229,8 @@ static u8 bars[8][3] = {
229#define TSTAMP_MAX_Y TSTAMP_MIN_Y+15 229#define TSTAMP_MAX_Y TSTAMP_MIN_Y+15
230#define TSTAMP_MIN_X 64 230#define TSTAMP_MIN_X 64
231 231
232
233static void gen_line(char *basep,int inipos,int wmax, 232static void gen_line(char *basep,int inipos,int wmax,
234 int hmax, int line, char *timestr) 233 int hmax, int line, int count, char *timestr)
235{ 234{
236 int w,i,j,pos=inipos,y; 235 int w,i,j,pos=inipos,y;
237 char *p,*s; 236 char *p,*s;
@@ -242,9 +241,10 @@ static void gen_line(char *basep,int inipos,int wmax,
242 241
243 /* Generate a standard color bar pattern */ 242 /* Generate a standard color bar pattern */
244 for (w=0;w<wmax;w++) { 243 for (w=0;w<wmax;w++) {
245 r=bars[w*7/wmax][0]; 244 int colorpos=((w+count)*8/(wmax+1)) % 8;
246 g=bars[w*7/wmax][1]; 245 r=bars[colorpos][0];
247 b=bars[w*7/wmax][2]; 246 g=bars[colorpos][1];
247 b=bars[colorpos][2];
248 248
249 for (color=0;color<4;color++) { 249 for (color=0;color<4;color++) {
250 p=basep+pos; 250 p=basep+pos;
@@ -327,18 +327,23 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
327 struct timeval ts; 327 struct timeval ts;
328 char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL); 328 char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL);
329 void *vbuf=videobuf_to_vmalloc (&buf->vb); 329 void *vbuf=videobuf_to_vmalloc (&buf->vb);
330 /* FIXME: move to dev struct */
331 static int mv_count=0;
330 332
331 if (!tmpbuf) 333 if (!tmpbuf)
332 return; 334 return;
333 335
334 for (h=0;h<hmax;h++) { 336 for (h=0;h<hmax;h++) {
335 gen_line(tmpbuf,0,wmax,hmax,h,dev->timestr); 337 gen_line(tmpbuf,0,wmax,hmax,h,mv_count,
338 dev->timestr);
336 /* FIXME: replacing to __copy_to_user */ 339 /* FIXME: replacing to __copy_to_user */
337 if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0) 340 if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0)
338 dprintk(2,"vivifill copy_to_user failed.\n"); 341 dprintk(2,"vivifill copy_to_user failed.\n");
339 pos += wmax*2; 342 pos += wmax*2;
340 } 343 }
341 344
345 mv_count++;
346
342 kfree(tmpbuf); 347 kfree(tmpbuf);
343 348
344 /* Updates stream time */ 349 /* Updates stream time */