summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>2018-05-28 15:01:21 +0200
committerJakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>2018-05-28 15:01:21 +0200
commit3a3b132d8724fff740cf0dab237e4dbd66c5c608 (patch)
tree67c0b76912d7a269ec8c414a211a947c78c57b5d
parent416843d3c48b63677780f97fa768cc4786b1c4fd (diff)
Getting a moving false-color image
Login screen is clearly visible. Lots of pink instead of white.
-rw-r--r--drivers/media/platform/rockchip/isp1/capture.c18
-rw-r--r--drivers/media/platform/rockchip/isp1/common.h4
-rw-r--r--drivers/media/platform/rockchip/isp1/rkisp1.c21
-rw-r--r--include/uapi/linux/videodev2.h2
4 files changed, 34 insertions, 11 deletions
diff --git a/drivers/media/platform/rockchip/isp1/capture.c b/drivers/media/platform/rockchip/isp1/capture.c
index a5f1656a4e9b..f52c05c7e754 100644
--- a/drivers/media/platform/rockchip/isp1/capture.c
+++ b/drivers/media/platform/rockchip/isp1/capture.c
@@ -521,7 +521,7 @@ static const struct capture_fmt sp_fmts[] = {
.mplanes = 1,
.write_format = MI_CTRL_SP_WRITE_PLA,
.output_format = MI_CTRL_SP_OUTPUT_RGB666,
- },
+ },
};
static struct stream_config rkisp1_mp_stream_config = {
@@ -634,17 +634,30 @@ static struct stream_config rkisp1_sp_stream_config = {
},
};
+static void pretty_print_fourcc(u32 f) {
+ printk(KERN_CONT "%c%c%c%c ", f & 0xff, f>>8 & 0xff, f>>16 & 0xff, f>>24);
+}
+
static const
struct capture_fmt *find_fmt(struct rkisp1_stream *stream, const u32 pixelfmt)
{
const struct capture_fmt *fmt;
+ struct video_device *vdev = &stream->vnode.vdev;
int i;
+ printk("%s:%d: stream=%s, wanted fmt: ", __func__, __LINE__, vdev->name);
+ pretty_print_fourcc(pixelfmt);
+ printk("\n");
+ printk(KERN_DEBUG "%s:%d: available: ", __func__, __LINE__);
for (i = 0; i < stream->config->fmt_size; i++) {
fmt = &stream->config->fmts[i];
+ pretty_print_fourcc(fmt->fourcc);
if (fmt->fourcc == pixelfmt)
return fmt;
}
+ printk("\n");
+
+ printk("%s:%d: pixelfmt=%x not found\n", __func__, __LINE__, pixelfmt);
return NULL;
}
@@ -1461,7 +1474,8 @@ void rkisp1_stream_init(struct rkisp1_device *dev, u32 id)
stream->state = RKISP1_STATE_READY;
memset(&pixm, 0, sizeof(pixm));
- pixm.pixelformat = V4L2_PIX_FMT_YUYV;
+ //pixm.pixelformat = V4L2_PIX_FMT_YUYV;
+ pixm.pixelformat = V4L2_PIX_FMT_UYVY;
pixm.width = RKISP1_DEFAULT_WIDTH;
pixm.height = RKISP1_DEFAULT_HEIGHT;
rkisp1_set_fmt(stream, &pixm, false);
diff --git a/drivers/media/platform/rockchip/isp1/common.h b/drivers/media/platform/rockchip/isp1/common.h
index 1adfb9039b60..e33bcfdbdbc7 100644
--- a/drivers/media/platform/rockchip/isp1/common.h
+++ b/drivers/media/platform/rockchip/isp1/common.h
@@ -42,8 +42,8 @@
#include <media/v4l2-device.h>
#include <media/videobuf2-v4l2.h>
-#define RKISP1_DEFAULT_WIDTH 800
-#define RKISP1_DEFAULT_HEIGHT 600
+#define RKISP1_DEFAULT_WIDTH 1920
+#define RKISP1_DEFAULT_HEIGHT 1280
#define RKISP1_MAX_STREAM 2
#define RKISP1_STREAM_SP 0
diff --git a/drivers/media/platform/rockchip/isp1/rkisp1.c b/drivers/media/platform/rockchip/isp1/rkisp1.c
index 47347771cc99..3b012f559233 100644
--- a/drivers/media/platform/rockchip/isp1/rkisp1.c
+++ b/drivers/media/platform/rockchip/isp1/rkisp1.c
@@ -494,6 +494,12 @@ static void rkisp1_config_clk(struct rkisp1_device *dev)
static const struct ispsd_in_fmt rkisp1_isp_input_formats[] = {
{
+ .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16,
+ .fmt_type = FMT_YUV,
+ .mipi_dt = CIF_CSI2_DT_YUV422_8b,
+ .yuv_seq = CIF_ISP_ACQ_PROP_CBYCRY,
+ .bus_width = 16,
+ }, {
.mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10,
.fmt_type = FMT_BAYER,
.mipi_dt = CIF_CSI2_DT_RAW10,
@@ -578,12 +584,6 @@ static const struct ispsd_in_fmt rkisp1_isp_input_formats[] = {
.yuv_seq = CIF_ISP_ACQ_PROP_YCRYCB,
.bus_width = 16,
}, {
- .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16,
- .fmt_type = FMT_YUV,
- .mipi_dt = CIF_CSI2_DT_YUV422_8b,
- .yuv_seq = CIF_ISP_ACQ_PROP_CBYCRY,
- .bus_width = 16,
- }, {
.mbus_code = MEDIA_BUS_FMT_VYUY8_1X16,
.fmt_type = FMT_YUV,
.mipi_dt = CIF_CSI2_DT_YUV422_8b,
@@ -646,6 +646,7 @@ static const struct ispsd_in_fmt *find_in_fmt(u32 mbus_code)
return fmt;
}
+ printk("%s:%d: mbus_code=%x not found\n", __func__, __LINE__, mbus_code);
return NULL;
}
@@ -724,13 +725,17 @@ static void rkisp1_isp_sd_try_fmt(struct v4l2_subdev *sd,
const struct ispsd_in_fmt *in_fmt;
const struct ispsd_out_fmt *out_fmt;
+ printk("%s:%d: called, pad=%x. fmt->code=%x, width=%d, height=%d\n", __func__, __LINE__, pad, fmt->code, fmt->width, fmt->height);
+
switch (pad) {
case RKISP1_ISP_PAD_SINK:
in_fmt = find_in_fmt(fmt->code);
if (in_fmt)
fmt->code = in_fmt->mbus_code;
- else
+ else {
+ printk(KERN_ERR "%s:%d: Fallback to MEDIA_BUS_FMT_SRGGB10_1X10\n", __func__, __LINE__);
fmt->code = MEDIA_BUS_FMT_SRGGB10_1X10;
+ }
fmt->width = clamp_t(u32, fmt->width, CIF_ISP_INPUT_W_MIN,
CIF_ISP_INPUT_W_MAX);
fmt->height = clamp_t(u32, fmt->height, CIF_ISP_INPUT_H_MIN,
@@ -751,6 +756,8 @@ static void rkisp1_isp_sd_try_fmt(struct v4l2_subdev *sd,
break;
}
+ printk("%s:%d: return: fmt->code=%x, width=%d, height=%d\n", __func__, __LINE__, fmt->code, fmt->width, fmt->height);
+
fmt->field = V4L2_FIELD_NONE;
}
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 92e241350848..1ef1da79a375 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -515,7 +515,9 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
+// have: YVYU
#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
+// wanted: UYVY
#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */