summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2022-05-13 14:53:06 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-06-20 11:30:30 +0200
commit5a531791edb249e41e00cf1cc580dbb09e2157ae (patch)
tree6d88a9c0366ab5c88988dae529ea57bb33673385 /drivers/media
parentmedia: cec-adap.c: log when claiming LA fails unexpectedly (diff)
downloadlinux-5a531791edb249e41e00cf1cc580dbb09e2157ae.tar.xz
linux-5a531791edb249e41e00cf1cc580dbb09e2157ae.zip
media: v4l2-tpg: add HDMI Video Guard Band test pattern
This inserts 4 pixels of the RGB color 0xab55ab at the left hand side of the image. This is only done for 3 or 4 byte RGB pixel formats. The HDMI TMDS encoding of this pixel value equals the Video Guard Band value as defined by HDMI (see section 5.2.2.1 in the HDMI 1.3 Specification) that preceeds the first actual pixel of a video line. If an HDMI receiver doesn't handle this correctly, then it might keep skipping these Video Guard Band patterns and end up with a shorter video line. So this is a nice pattern to test with. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/v4l2-tpg/v4l2-tpg-core.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index 7607b516a7c4..cb985de8ff72 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -2402,6 +2402,44 @@ static void tpg_fill_plane_extras(const struct tpg_data *tpg,
((params->sav_eav_f ^ vact) << 1) |
(hact ^ vact ^ params->sav_eav_f);
}
+ if (tpg->insert_hdmi_video_guard_band) {
+ unsigned int i;
+
+ switch (tpg->fourcc) {
+ case V4L2_PIX_FMT_BGR24:
+ case V4L2_PIX_FMT_RGB24:
+ for (i = 0; i < 3 * 4; i += 3) {
+ vbuf[i] = 0xab;
+ vbuf[i + 1] = 0x55;
+ vbuf[i + 2] = 0xab;
+ }
+ break;
+ case V4L2_PIX_FMT_RGB32:
+ case V4L2_PIX_FMT_ARGB32:
+ case V4L2_PIX_FMT_XRGB32:
+ case V4L2_PIX_FMT_BGRX32:
+ case V4L2_PIX_FMT_BGRA32:
+ for (i = 0; i < 4 * 4; i += 4) {
+ vbuf[i] = 0x00;
+ vbuf[i + 1] = 0xab;
+ vbuf[i + 2] = 0x55;
+ vbuf[i + 3] = 0xab;
+ }
+ break;
+ case V4L2_PIX_FMT_BGR32:
+ case V4L2_PIX_FMT_XBGR32:
+ case V4L2_PIX_FMT_ABGR32:
+ case V4L2_PIX_FMT_RGBX32:
+ case V4L2_PIX_FMT_RGBA32:
+ for (i = 0; i < 4 * 4; i += 4) {
+ vbuf[i] = 0xab;
+ vbuf[i + 1] = 0x55;
+ vbuf[i + 2] = 0xab;
+ vbuf[i + 3] = 0x00;
+ }
+ break;
+ }
+ }
}
static void tpg_fill_plane_pattern(const struct tpg_data *tpg,