mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Majewski <mattwmajewski@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Uwe Kleine-Konig <u.kleine-koenig@baylibre.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Naushir Patuck <naush@raspberrypi.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matthew Majewski <mattwmajewski@gmail.com>
Subject: [PATCH 0/3] media: vim2m: add multiplanar API support
Date: Tue,  4 Mar 2025 14:16:58 -0500	[thread overview]
Message-ID: <20250304191701.2957096-1-mattwmajewski@gmail.com> (raw)

Hi everyone,

This patch series adds multiplane API support for the virtual M2M
driver, along with some minor driver refactoring/improvements.

I followed the lead of the vivid driver and made multiplanar support
selectable with a module parameter, and the default is to use the
single planar api.

Although there are not yet any pixelformats in the driver that make
use of multiple memory planes, adding support for these should be
easier now with the API level changes taken care of.

v4l2-compliance reports the following with multiplane support disabled:

  Total for vim2m device /dev/video0: 48, Succeeded: 48, Failed: 0, Warnings: 0

and the same with multiplane support enabled:

  Total for vim2m device /dev/video0: 48, Succeeded: 48, Failed: 0, Warnings: 0

Patches need to be applied in increasing numerical order (Patch [3/3]
depends on [1/3] and [2/3]).

Since the multi-plane changes had to touch a lot of the driver, I did
a basic regression test with the following script which generates a
test input image with vivid and an output image from vim2m for each
supported format. I confirmed all outputs visually and verified they
were identical to the outputs before the change. Testing was done on
an x86_64 qemu image.

#!/bin/sh

# tested with HDMI vivid emulation
# modprobe vivid num_inputs=1 input_types=3

vim2m=/dev/video0
vivid=/dev/video1

width=640
height=480
out_width=320
out_height=240

capture_formats=$(v4l2-ctl -d $vim2m --list-formats | awk '/\]:/ {print $2}' | sed "s/'//g")
output_formats=$(v4l2-ctl -d $vim2m --list-formats-out | awk '/\]:/ {print $2}' | sed "s/'//g")

# Turn off text mode so that images will be identical
v4l2-ctl -d $vivid -c osd_text_mode=2

for ofmt in ${output_formats}; do
    # generate input image
    inname="${width}x${height}.${ofmt}"
    v4l2-ctl -d $vivid -v pixelformat=$ofmt,width=$width,height=$height,field=none \
             --stream-mmap --stream-count=1 --stream-to=$inname
    for cfmt in ${capture_formats}; do
        outname="${out_width}x${out_height}-out.${cfmt}"
        v4l2-ctl -d $vim2m -x pixelformat=$ofmt,width=$width,height=$height \
                 -v pixelformat=$cfmt,width=$out_width,height=$out_height \
                 --stream-from=$inname --stream-to=$outname --stream-mmap --stream-out-mmap \
                 --stream-count=1
    done
done

Matthew Majewski (3):
  media: v4l2-common: Add RGBR format info
  media: vim2m: Simplify try_fmt
  media: vim2m: Add parametized support for multiplanar API

 drivers/media/test-drivers/vim2m.c    | 327 +++++++++++++++++++++-----
 drivers/media/v4l2-core/v4l2-common.c |   1 +
 2 files changed, 274 insertions(+), 54 deletions(-)

-- 
2.25.1

             reply	other threads:[~2025-03-04 19:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 19:16 Matthew Majewski [this message]
2025-03-04 19:16 ` [PATCH 1/3] media: v4l2-common: Add RGBR format info Matthew Majewski
2025-03-04 19:17 ` [PATCH 2/3] media: vim2m: Simplify try_fmt Matthew Majewski
2025-03-04 19:17 ` [PATCH 3/3] media: vim2m: Add parametized support for multiplanar API Matthew Majewski
2025-04-27  9:45 ` [PATCH 0/3] media: vim2m: add multiplanar API support Hans Verkuil
2025-04-28 18:40   ` Matthew Majewski
2025-04-29  6:04     ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250304191701.2957096-1-mattwmajewski@gmail.com \
    --to=mattwmajewski@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=naush@raspberrypi.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=skhan@linuxfoundation.org \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®