Commit a66d2336 authored by Jonathan Corbet's avatar Jonathan Corbet Committed by Mauro Carvalho Chehab

V4L/DVB (4908): Remove the fake RGB32 format from cafe_ccic

Remove RGB32, useful for debugging, but with no place in production.
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent bf5dbed6
...@@ -612,16 +612,6 @@ static void cafe_ctlr_image(struct cafe_camera *cam) ...@@ -612,16 +612,6 @@ static void cafe_ctlr_image(struct cafe_camera *cam)
C0_DF_MASK); C0_DF_MASK);
break; break;
/*
* For "fake rgb32" get the image pitch right.
*/
case V4L2_PIX_FMT_RGB32:
cafe_reg_write_mask(cam, REG_IMGPITCH, fmt->bytesperline/2,
IMGP_YP_MASK);
imgsz = ((fmt->height << IMGSZ_V_SHIFT) & IMGSZ_V_MASK) |
((fmt->bytesperline/2) & IMGSZ_H_MASK);
cafe_reg_write(cam, REG_IMGSIZE, imgsz);
/* fall into ... */
case V4L2_PIX_FMT_RGB444: case V4L2_PIX_FMT_RGB444:
cafe_reg_write_mask(cam, REG_CTRL0, cafe_reg_write_mask(cam, REG_CTRL0,
C0_DF_RGB|C0_RGBF_444|C0_RGB4_XRGB, C0_DF_RGB|C0_RGBF_444|C0_RGB4_XRGB,
...@@ -902,11 +892,8 @@ static int cafe_alloc_dma_bufs(struct cafe_camera *cam, int loadtime) ...@@ -902,11 +892,8 @@ static int cafe_alloc_dma_bufs(struct cafe_camera *cam, int loadtime)
cafe_set_config_needed(cam, 1); cafe_set_config_needed(cam, 1);
if (loadtime) if (loadtime)
cam->dma_buf_size = dma_buf_size; cam->dma_buf_size = dma_buf_size;
else { else
cam->dma_buf_size = cam->pix_format.sizeimage; cam->dma_buf_size = cam->pix_format.sizeimage;
if (cam->pix_format.pixelformat == V4L2_PIX_FMT_RGB32)
cam->dma_buf_size /= 2;
}
if (n_dma_bufs > 3) if (n_dma_bufs > 3)
n_dma_bufs = 3; n_dma_bufs = 3;
...@@ -1751,26 +1738,6 @@ static struct video_device cafe_v4l_template = { ...@@ -1751,26 +1738,6 @@ static struct video_device cafe_v4l_template = {
* Interrupt handler stuff * Interrupt handler stuff
*/ */
/*
* Create RGB32 from RGB444 so it can be displayed before the applications
* know about the latter format.
*/
static void cafe_fake_rgb32(struct cafe_camera *cam, char *dest, char *src)
{
int i;
u16 *ssrc = (u16 *) src;
/* RGB444 version */
for (i = 0; i < cam->pix_format.sizeimage; i += 4) {
// dest[0] = (*ssrc & 0xf000) >> 8;
dest[0] = (*ssrc & 0x000f) << 4;
dest[1] = (*ssrc & 0x00f0);
dest[2] = (*ssrc & 0x0f00) >> 4;
dest[3] = (*ssrc & 0xf000); /* Alpha */
dest += 4;
ssrc++;
}
}
static void cafe_frame_tasklet(unsigned long data) static void cafe_frame_tasklet(unsigned long data)
...@@ -1800,11 +1767,8 @@ static void cafe_frame_tasklet(unsigned long data) ...@@ -1800,11 +1767,8 @@ static void cafe_frame_tasklet(unsigned long data)
*/ */
sbuf = list_entry(cam->sb_avail.next, sbuf = list_entry(cam->sb_avail.next,
struct cafe_sio_buffer, list); struct cafe_sio_buffer, list);
if (cam->pix_format.pixelformat == V4L2_PIX_FMT_RGB32) memcpy(sbuf->buffer, cam->dma_bufs[bufno],
cafe_fake_rgb32(cam, sbuf->buffer, cam->dma_bufs[bufno]); cam->pix_format.sizeimage);
else
memcpy(sbuf->buffer, cam->dma_bufs[bufno],
cam->pix_format.sizeimage);
sbuf->v4lbuf.bytesused = cam->pix_format.sizeimage; sbuf->v4lbuf.bytesused = cam->pix_format.sizeimage;
sbuf->v4lbuf.sequence = cam->buf_seq[bufno]; sbuf->v4lbuf.sequence = cam->buf_seq[bufno];
sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_QUEUED; sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_QUEUED;
......
...@@ -497,19 +497,6 @@ static struct ov7670_format_struct { ...@@ -497,19 +497,6 @@ static struct ov7670_format_struct {
.regs = ov7670_fmt_rgb565, .regs = ov7670_fmt_rgb565,
.cmatrix = { 179, -179, 0, -61, -176, 228 }, .cmatrix = { 179, -179, 0, -61, -176, 228 },
}, },
/*
* Pretend we do RGB32. This is here on the assumption that the
* upper layer will reformat RGB444 appropriately.
*
* The entire purpose for this thing's existence is to enable easy
* display of RGB444 for debugging purposes. It will come out soon.
*/
{
.desc = "RGB32 (faked)",
.pixelformat = V4L2_PIX_FMT_RGB32,
.regs = ov7670_fmt_rgb444,
.cmatrix = { 179, -179, 0, -61, -176, 228 },
},
}; };
#define N_OV7670_FMTS (sizeof(ov7670_formats)/sizeof(ov7670_formats[0])) #define N_OV7670_FMTS (sizeof(ov7670_formats)/sizeof(ov7670_formats[0]))
...@@ -694,8 +681,6 @@ static int ov7670_try_fmt(struct i2c_client *c, struct v4l2_format *fmt, ...@@ -694,8 +681,6 @@ static int ov7670_try_fmt(struct i2c_client *c, struct v4l2_format *fmt,
pix->width = wsize->width; pix->width = wsize->width;
pix->height = wsize->height; pix->height = wsize->height;
pix->bytesperline = pix->width*BYTES_PER_PIXEL; pix->bytesperline = pix->width*BYTES_PER_PIXEL;
if (pix->pixelformat == V4L2_PIX_FMT_RGB32)
pix->bytesperline *= 2;
pix->sizeimage = pix->height*pix->bytesperline; pix->sizeimage = pix->height*pix->bytesperline;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment