V4L/DVB (6264): Make the vertical lines to move

While this is not the standard color bar behaviour, having some movement
there allows to check if buffers are being properly handled.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Mauro Carvalho Chehab 2007-09-22 02:01:33 -03:00
Родитель 123f8ef64e
Коммит 3bef5e4a1f
1 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -229,9 +229,8 @@ static u8 bars[8][3] = {
#define TSTAMP_MAX_Y TSTAMP_MIN_Y+15 #define TSTAMP_MAX_Y TSTAMP_MIN_Y+15
#define TSTAMP_MIN_X 64 #define TSTAMP_MIN_X 64
static void gen_line(char *basep,int inipos,int wmax, 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; int w,i,j,pos=inipos,y;
char *p,*s; char *p,*s;
@ -242,9 +241,10 @@ static void gen_line(char *basep,int inipos,int wmax,
/* Generate a standard color bar pattern */ /* Generate a standard color bar pattern */
for (w=0;w<wmax;w++) { for (w=0;w<wmax;w++) {
r=bars[w*7/wmax][0]; int colorpos=((w+count)*8/(wmax+1)) % 8;
g=bars[w*7/wmax][1]; r=bars[colorpos][0];
b=bars[w*7/wmax][2]; g=bars[colorpos][1];
b=bars[colorpos][2];
for (color=0;color<4;color++) { for (color=0;color<4;color++) {
p=basep+pos; p=basep+pos;
@ -327,18 +327,23 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
struct timeval ts; struct timeval ts;
char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL); char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL);
void *vbuf=videobuf_to_vmalloc (&buf->vb); void *vbuf=videobuf_to_vmalloc (&buf->vb);
/* FIXME: move to dev struct */
static int mv_count=0;
if (!tmpbuf) if (!tmpbuf)
return; return;
for (h=0;h<hmax;h++) { 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 */ /* FIXME: replacing to __copy_to_user */
if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0) if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0)
dprintk(2,"vivifill copy_to_user failed.\n"); dprintk(2,"vivifill copy_to_user failed.\n");
pos += wmax*2; pos += wmax*2;
} }
mv_count++;
kfree(tmpbuf); kfree(tmpbuf);
/* Updates stream time */ /* Updates stream time */