Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357093
b: refs/heads/master
c: d40fbf8
h: refs/heads/master
i:
  357091: 9da750e
v: v3
  • Loading branch information
Kirill Smelkov authored and Mauro Carvalho Chehab committed Dec 21, 2012
1 parent 946026b commit ea85d5e
Show file tree
Hide file tree
Showing 2 changed files with 17 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: 13908f330f91996b6d59355aa7860553dd1093d5
refs/heads/master: d40fbf8d52ae6c9b7fe9d76eeab624afc3a3f1ea
22 changes: 16 additions & 6 deletions trunk/drivers/media/platform/vivi.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,22 @@ static void gen_twopix(struct vivi_dev *dev, u8 *buf, int colorpos, bool odd)

static void precalculate_line(struct vivi_dev *dev)
{
int w;

for (w = 0; w < dev->width * 2; w++) {
int colorpos = w / (dev->width / 8) % 8;

gen_twopix(dev, dev->line + w * dev->pixelsize, colorpos, w & 1);
unsigned pixsize = dev->pixelsize;
unsigned pixsize2 = 2*pixsize;
int colorpos;
u8 *pos;

for (colorpos = 0; colorpos < 16; ++colorpos) {
u8 pix[8];
int wstart = colorpos * dev->width / 8;
int wend = (colorpos+1) * dev->width / 8;
int w;

gen_twopix(dev, &pix[0], colorpos % 8, 0);
gen_twopix(dev, &pix[pixsize], colorpos % 8, 1);

for (w = wstart/2*2, pos = dev->line + w*pixsize; w < wend; w += 2, pos += pixsize2)
memcpy(pos, pix, pixsize2);
}
}

Expand Down

0 comments on commit ea85d5e

Please sign in to comment.