public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Tomasz Stanislawski <t.stanislaws@samsung.com>
Cc: linux-media@vger.kernel.org, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, mchehab@redhat.com, pawel@osciak.com
Subject: Re: [PATCH 1/2] libv4l2: add implicit conversion from single- to multi-plane api
Date: Sun, 17 Jul 2011 23:11:11 +0200	[thread overview]
Message-ID: <4E234FEF.6000204@redhat.com> (raw)
In-Reply-To: <1309944253-11703-1-git-send-email-t.stanislaws@samsung.com>

Hi,

On 07/06/2011 11:24 AM, Tomasz Stanislawski wrote:
> This patch add implicit conversion of single plane variant of ioctl to
> multiplane variant. The conversion is performed only in case if a driver
> implements only mplane api. The conversion is done by substituting SYS_IOCTL
> with a wrapper that converts single plane call to their mplane analogs.
> Function v4l2_fd_open was revised to work correctly with the wrapper.
>
> Signed-off-by: Tomasz Stanislawski<t.stanislaws@samsung.com>
> Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>

Thanks for the patch, I like the general idea, but I'm not completely
happy with the implementation.

I think overloading SYS_ioctl is not such a great idea, since this won't
work for calls made by libv4lconvert, unless we export it from libv4l2
and use it in libv4lconvert too, which is quite ugly from an ABI pov.

This is also problematic in the light of the upcoming plugin support
(which just landed in v4l-utils git). Notice how that has replaced
SYS_ioctl with dev_ops->ioctl, so that plugins can intercept ioctls.

Actually the plugni support should make doing this more easy wrt
libv4lconvert, since libv4lconvert now uses dev_ops->ioctl too.

I think this can and should be handled in the following way, with a
2 patch patch-set:

Patch1: Make the dev_ops member of v4l2_dev_info a struct rather
then a pointer to a struct (and adjust v4l_plugin_init accordingly).

Patch2: If one of the devices in question is detected the original
dev_ops->ioctl should be saved in v4l2_dev_info and be replaced with
the proposed wrapper, which then calls the saved original in cases
where it now calls SYS_ioctl.

Regards,

Hans





      reply	other threads:[~2011-07-17 21:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-06  9:24 [PATCH 1/2] libv4l2: add implicit conversion from single- to multi-plane api Tomasz Stanislawski
2011-07-17 21:11 ` Hans de Goede [this message]

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=4E234FEF.6000204@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@redhat.com \
    --cc=pawel@osciak.com \
    --cc=t.stanislaws@samsung.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