mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
media: stm32: dcmipp: add 1X16 RGB / YUV formats support
Add 1X16 RGB & YUV formats support within bytecap & byteproc. Slightly change the link_validate function to be able to validate against either 1X16 or 2X8 variant of a format. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
822c72eb15
commit
e265023155
|
|
@ -56,10 +56,15 @@ struct dcmipp_bytecap_pix_map {
|
|||
|
||||
static const struct dcmipp_bytecap_pix_map dcmipp_bytecap_pix_map_list[] = {
|
||||
PIXMAP_MBUS_PFMT(RGB565_2X8_LE, RGB565),
|
||||
PIXMAP_MBUS_PFMT(RGB565_1X16, RGB565),
|
||||
PIXMAP_MBUS_PFMT(YUYV8_2X8, YUYV),
|
||||
PIXMAP_MBUS_PFMT(YUYV8_1X16, YUYV),
|
||||
PIXMAP_MBUS_PFMT(YVYU8_2X8, YVYU),
|
||||
PIXMAP_MBUS_PFMT(YVYU8_1X16, YVYU),
|
||||
PIXMAP_MBUS_PFMT(UYVY8_2X8, UYVY),
|
||||
PIXMAP_MBUS_PFMT(UYVY8_1X16, UYVY),
|
||||
PIXMAP_MBUS_PFMT(VYUY8_2X8, VYUY),
|
||||
PIXMAP_MBUS_PFMT(VYUY8_1X16, VYUY),
|
||||
PIXMAP_MBUS_PFMT(Y8_1X8, GREY),
|
||||
PIXMAP_MBUS_PFMT(SBGGR8_1X8, SBGGR8),
|
||||
PIXMAP_MBUS_PFMT(SGBRG8_1X8, SGBRG8),
|
||||
|
|
@ -813,8 +818,7 @@ static int dcmipp_bytecap_link_validate(struct media_link *link)
|
|||
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
|
||||
.pad = link->source->index,
|
||||
};
|
||||
const struct dcmipp_bytecap_pix_map *vpix;
|
||||
int ret;
|
||||
int ret, i;
|
||||
|
||||
ret = v4l2_subdev_call(source_sd, pad, get_fmt, NULL, &source_fmt);
|
||||
if (ret < 0)
|
||||
|
|
@ -828,10 +832,17 @@ static int dcmipp_bytecap_link_validate(struct media_link *link)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
vpix = dcmipp_bytecap_pix_map_by_pixelformat(vcap->format.pixelformat);
|
||||
if (source_fmt.format.code != vpix->code) {
|
||||
dev_err(vcap->dev, "Wrong mbus_code 0x%x, (0x%x expected)\n",
|
||||
vpix->code, source_fmt.format.code);
|
||||
for (i = 0; i < ARRAY_SIZE(dcmipp_bytecap_pix_map_list); i++) {
|
||||
if (dcmipp_bytecap_pix_map_list[i].pixelformat ==
|
||||
vcap->format.pixelformat &&
|
||||
dcmipp_bytecap_pix_map_list[i].code ==
|
||||
source_fmt.format.code)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == ARRAY_SIZE(dcmipp_bytecap_pix_map_list)) {
|
||||
dev_err(vcap->dev, "mbus code 0x%x do not match capture device format (0x%x)\n",
|
||||
vcap->format.pixelformat, source_fmt.format.code);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,10 +48,15 @@ struct dcmipp_byteproc_pix_map {
|
|||
}
|
||||
static const struct dcmipp_byteproc_pix_map dcmipp_byteproc_pix_map_list[] = {
|
||||
PIXMAP_MBUS_BPP(RGB565_2X8_LE, 2),
|
||||
PIXMAP_MBUS_BPP(RGB565_1X16, 2),
|
||||
PIXMAP_MBUS_BPP(YUYV8_2X8, 2),
|
||||
PIXMAP_MBUS_BPP(YUYV8_1X16, 2),
|
||||
PIXMAP_MBUS_BPP(YVYU8_2X8, 2),
|
||||
PIXMAP_MBUS_BPP(YVYU8_1X16, 2),
|
||||
PIXMAP_MBUS_BPP(UYVY8_2X8, 2),
|
||||
PIXMAP_MBUS_BPP(UYVY8_1X16, 2),
|
||||
PIXMAP_MBUS_BPP(VYUY8_2X8, 2),
|
||||
PIXMAP_MBUS_BPP(VYUY8_1X16, 2),
|
||||
PIXMAP_MBUS_BPP(Y8_1X8, 1),
|
||||
PIXMAP_MBUS_BPP(SBGGR8_1X8, 1),
|
||||
PIXMAP_MBUS_BPP(SGBRG8_1X8, 1),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user