From 4f084f805d73655da17693c417a48ad22474f09e Mon Sep 17 00:00:00 2001 From: Jianfeng Liu Date: Sun, 23 Nov 2025 15:53:35 +0800 Subject: [PATCH 1/3] media: cix_vpu: disable jpeg decoder for chromium Chromium will skip decoders that have JPEG format support. Just disable it then we can have vpu decoder detected by chromium. --- drivers/media/platform/cix/cix_vpu/if/mvx_session.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/media/platform/cix/cix_vpu/if/mvx_session.c b/drivers/media/platform/cix/cix_vpu/if/mvx_session.c index 8cc41a8384ad..91d3690a93da 100755 --- a/drivers/media/platform/cix/cix_vpu/if/mvx_session.c +++ b/drivers/media/platform/cix/cix_vpu/if/mvx_session.c @@ -130,10 +130,6 @@ static struct mvx_session_format_map mvx_compressed_fmts[] = { .flags = V4L2_FMT_FLAG_COMPRESSED, .pixelformat = V4L2_PIX_FMT_AV1, .description = "AV1" }, - { .format = MVX_FORMAT_JPEG, - .flags = V4L2_FMT_FLAG_COMPRESSED, - .pixelformat = V4L2_PIX_FMT_JPEG, - .description = "JPEG" }, { .format = MVX_FORMAT_JPEG, .flags = V4L2_FMT_FLAG_COMPRESSED, .pixelformat = V4L2_PIX_FMT_MJPEG, From ebe0b4817ce896c2a4f1ba28a0016595fe7e9d13 Mon Sep 17 00:00:00 2001 From: Jianfeng Liu Date: Sun, 23 Nov 2025 15:58:35 +0800 Subject: [PATCH 2/3] media: cix_vpu: always run vb2_poll for streaming input queue in mvx_v4l2_poll Chromium does not listen POLLOUT event, but it is necessary to run vb2_poll with input queue for source change. This will let vpu decoding work with mainline chromium without patch. --- .../media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_fops.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_fops.c b/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_fops.c index 2c31a15d34f3..7b551aa98fd6 100755 --- a/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_fops.c +++ b/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_fops.c @@ -182,10 +182,14 @@ unsigned int mvx_v4l2_poll(struct file *file, revents |= EPOLLPRI; /* POLLPRI events are handled by Vb2 */ - if (vb2_is_streaming(&vsession->port[MVX_DIR_INPUT].vb2_queue) && - (events & EPOLLOUT)) - revents |= vb2_poll(&vsession->port[MVX_DIR_INPUT].vb2_queue, + if (vb2_is_streaming(&vsession->port[MVX_DIR_INPUT].vb2_queue)) + { + unsigned int input_revents = vb2_poll(&vsession->port[MVX_DIR_INPUT].vb2_queue, file, wait); + if (events & EPOLLOUT) + revents |= input_revents; + } + if (vb2_is_streaming(&vsession->port[MVX_DIR_OUTPUT].vb2_queue) && (events & (EPOLLIN | EPOLLPRI))) revents |= vb2_poll(&vsession->port[MVX_DIR_OUTPUT].vb2_queue, From 4c96b921d92b642594799a22b3fdd419f059162f Mon Sep 17 00:00:00 2001 From: Jianfeng Liu Date: Tue, 9 Dec 2025 09:42:42 +0800 Subject: [PATCH 3/3] media: cix_vpu: Set minimal buf count of OUTPUT queue for chromium --- .../media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_vidioc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_vidioc.c b/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_vidioc.c index a33fbef380a2..58fb1a5b6857 100755 --- a/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_vidioc.c +++ b/drivers/media/platform/cix/cix_vpu/if/v4l2/mvx_v4l2_vidioc.c @@ -326,6 +326,15 @@ static int queue_setup(struct vb2_queue *q, (port->width == 0 || port->height == 0)) *buf_cnt = 1; + /* Chromium requests 2 bufs for OUTPUT queue when decoding VP8. VP9 + * and AV1, but this is not enough for decoding. So we set a minimal + * buf count 8 here. + */ + if (vport->dir == MVX_DIR_INPUT && + !mvx_is_frame(port->format) && + *buf_cnt < 8) + *buf_cnt = 8; + memset(plane_size, 0, sizeof(plane_size[0]) * VB2_MAX_PLANES); *plane_cnt = port->nplanes; port_format_bpp = mvx_get_format_bpp(port->format);