Skip to content

Commit ee48487

Browse files
Hans Verkuilmchehab
authored andcommitted
media: davinci/vpfe_capture.c: drop unused format descriptions
Simplify vpfe_pixel_format to just contain the pixelformat and bpp fields. All others are unused. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
1 parent 610fce5 commit ee48487

2 files changed

Lines changed: 10 additions & 43 deletions

File tree

‎drivers/media/platform/davinci/vpfe_capture.c‎

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -119,57 +119,27 @@ static const struct vpfe_standard vpfe_standards[] = {
119119
/* Used when raw Bayer image from ccdc is directly captured to SDRAM */
120120
static const struct vpfe_pixel_format vpfe_pix_fmts[] = {
121121
{
122-
.fmtdesc = {
123-
.index = 0,
124-
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
125-
.description = "Bayer GrRBGb 8bit A-Law compr.",
126-
.pixelformat = V4L2_PIX_FMT_SBGGR8,
127-
},
122+
.pixelformat = V4L2_PIX_FMT_SBGGR8,
128123
.bpp = 1,
129124
},
130125
{
131-
.fmtdesc = {
132-
.index = 1,
133-
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
134-
.description = "Bayer GrRBGb - 16bit",
135-
.pixelformat = V4L2_PIX_FMT_SBGGR16,
136-
},
126+
.pixelformat = V4L2_PIX_FMT_SBGGR16,
137127
.bpp = 2,
138128
},
139129
{
140-
.fmtdesc = {
141-
.index = 2,
142-
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
143-
.description = "Bayer GrRBGb 8bit DPCM compr.",
144-
.pixelformat = V4L2_PIX_FMT_SGRBG10DPCM8,
145-
},
130+
.pixelformat = V4L2_PIX_FMT_SGRBG10DPCM8,
146131
.bpp = 1,
147132
},
148133
{
149-
.fmtdesc = {
150-
.index = 3,
151-
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
152-
.description = "YCbCr 4:2:2 Interleaved UYVY",
153-
.pixelformat = V4L2_PIX_FMT_UYVY,
154-
},
134+
.pixelformat = V4L2_PIX_FMT_UYVY,
155135
.bpp = 2,
156136
},
157137
{
158-
.fmtdesc = {
159-
.index = 4,
160-
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
161-
.description = "YCbCr 4:2:2 Interleaved YUYV",
162-
.pixelformat = V4L2_PIX_FMT_YUYV,
163-
},
138+
.pixelformat = V4L2_PIX_FMT_YUYV,
164139
.bpp = 2,
165140
},
166141
{
167-
.fmtdesc = {
168-
.index = 5,
169-
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
170-
.description = "Y/CbCr 4:2:0 - Semi planar",
171-
.pixelformat = V4L2_PIX_FMT_NV12,
172-
},
142+
.pixelformat = V4L2_PIX_FMT_NV12,
173143
.bpp = 1,
174144
},
175145
};
@@ -183,7 +153,7 @@ static const struct vpfe_pixel_format *vpfe_lookup_pix_format(u32 pix_format)
183153
int i;
184154

185155
for (i = 0; i < ARRAY_SIZE(vpfe_pix_fmts); i++) {
186-
if (pix_format == vpfe_pix_fmts[i].fmtdesc.pixelformat)
156+
if (pix_format == vpfe_pix_fmts[i].pixelformat)
187157
return &vpfe_pix_fmts[i];
188158
}
189159
return NULL;
@@ -782,7 +752,7 @@ static const struct vpfe_pixel_format *
782752
temp = 0;
783753
found = 0;
784754
while (ccdc_dev->hw_ops.enum_pix(&pix, temp) >= 0) {
785-
if (vpfe_pix_fmt->fmtdesc.pixelformat == pix) {
755+
if (vpfe_pix_fmt->pixelformat == pix) {
786756
found = 1;
787757
break;
788758
}
@@ -899,7 +869,6 @@ static int vpfe_enum_fmt_vid_cap(struct file *file, void *priv,
899869
{
900870
struct vpfe_device *vpfe_dev = video_drvdata(file);
901871
const struct vpfe_pixel_format *pix_fmt;
902-
int temp_index;
903872
u32 pix;
904873

905874
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_enum_fmt_vid_cap\n");
@@ -910,9 +879,7 @@ static int vpfe_enum_fmt_vid_cap(struct file *file, void *priv,
910879
/* Fill in the information about format */
911880
pix_fmt = vpfe_lookup_pix_format(pix);
912881
if (pix_fmt) {
913-
temp_index = fmt->index;
914-
*fmt = pix_fmt->fmtdesc;
915-
fmt->index = temp_index;
882+
fmt->pixelformat = fmt->pixelformat;
916883
return 0;
917884
}
918885
return -EINVAL;

‎include/media/davinci/vpfe_capture.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define CAPTURE_DRV_NAME "vpfe-capture"
3333

3434
struct vpfe_pixel_format {
35-
struct v4l2_fmtdesc fmtdesc;
35+
u32 pixelformat;
3636
/* bytes per pixel */
3737
int bpp;
3838
};

0 commit comments

Comments
 (0)