All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junghak Sung <jh1009.sung@samsung.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, sangbae90.lee@samsung.com,
	inki.dae@samsung.com, nenggun.kim@samsung.com,
	sw0312.kim@samsung.com
Subject: Re: [RFC PATCH 0/3] Refactoring Videobuf2 for common use
Date: Tue, 09 Jun 2015 10:41:55 +0900	[thread overview]
Message-ID: <55764463.7080908@samsung.com> (raw)
In-Reply-To: <20150608143952.41f92946@recife.lan>



On 06/09/2015 02:39 AM, Mauro Carvalho Chehab wrote:
> Em Mon, 08 Jun 2015 16:42:48 +0200
> Hans Verkuil <hverkuil@xs4all.nl> escreveu:
>
>> On 06/08/2015 03:35 PM, Junghak Sung wrote:
>>> Hello everybody,
>>>
>>> This patch series refactories exsiting Videobuf2, so that not only V4L2
>>> but also other frameworks can use it to manage buffer and utilize
>>> queue.
>>>
>>> I would separate existing Videobuf2-core framework into two parts - common
>>> and v4l2-specific part. This work is as follows :
>>>
>>> 1. Separate existing vb2_buffer structure into common buffer and
>>>     v4l2-specific parts by removing v4l2-specific members and
>>>     embedding it into vb2_v4l2_buffer structure like this:
>>>
>>>      struct vb2_v4l2_buffer {
>>>          struct vb2_buffer    vb2;
>>>          struct v4l2_buffer   v4l2_buf;
>>>          struct v4l2_plane    v4l2_planes[VIDEO_MAX_PLANES];
>>>      };
>>>
>>> 2. Abstract the v4l2-specific elements, and specify them when the device
>>>     drives use them. For example, vb2_v4l2_buffer structure can be abstracted
>>>     by vb2_buffer structure, and device drivers can get framework-specific
>>>     object such as vb2_v4l2_buffer by using container_of().
>>>
>>> 3. Separate VB2-core framework into real VB2-core and v4l2-specific part.
>>>     This means that it moves V4L2-specific parts of VB2-core to v4l2-specific
>>>     part because current VB2-core framework has some codes dependent of V4L2.
>>>     As a result, we will have two VB2 files - videobuf2-core.c and
>>>     videobuf2-v4l2.c.
>>>
>>> Why do we try to make the VB2 framework to be common?
>>>
>>> As you may know, current DVB framework uses ringbuffer mechanism to demux
>>> MPEG-2 TS data and pass it to userspace. However, this mechanism requires
>>> extra memory copy because DVB framework provides only read() system call for
>>> application - read() system call copies the kernel data to user-space buffer.
>>>
>>> So if we can use VB2 framework which supports streaming I/O and buffer
>>> sharing mechanism, then we could enhance existing DVB framework by removing
>>> the extra memory copy - with VB2 framework, application can access the kernel
>>> data directly through mmap system call.
>>>
>>> This patch series is the first step for it.
>>>
>>> We have a plan for this work as follows:
>>>
>>> 1. Separate existing VB2 framework into three parts - VB2 common, VB2-v4l2,
>>>     and VB2-dvb. Of course, this change should not affect other v4l2-based
>>>     device drivers. This patch series includes some parts of this step.
>>>
>>> 2. Add new APIs for DVB streaming I/O. These APIs will be implemented
>>>     in VB2-dvb framework. So, we can remove unnecessary memory copy between
>>>     kernel-space and user-space by using these new APIs.
>>>     However, we leaves legacy interfaces as-is for backward compatibility.
>>>
>>> We are working on this project with Mauro and have a discussion with him
>>> on IRC channel weekly. Nowaday, we are discussing more detailed DVB user
>>> scenario for streaming I/O.
>>>
>>> The final goal of this project is to enhance current DVB framework.
>>> The first mission is to achieve zero-copy functionality between kernel-space
>>> and user-space with mmap system call. More missions are under consideration:
>>> i.e., we could share the buffer not only between kernel-space and user-space
>>> but also between devices - demux, hw video codec - by exporting a buffer
>>> to dmabuf fd with VB2 framework.
>>>
>>> Any suggestions and comments are welcome.
>>>
>>> Best regards,
>>> Junghak
>>>
>>> Junghak Sung (3):
>>>    modify the vb2_buffer structure for common video buffer     and make
>>>      struct vb2_v4l2_buffer
>>>    move struct vb2_queue to common and apply the changes related with
>>>      that     Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
>>>    make vb2-core part with not v4l2-specific elements
>> Patch 2/3 didn't arrive at linux-media for some reason. Can you post it again?
> Probably, the patch is too big. Vger doesn't accept patches bigger than
> a few hundreds of KB. Not sure what's the current limit.
>
> Junghak added the patches on his tree too:
> 	http://git.linuxtv.org/cgit.cgi/jsung/dvb-vb2.git/log/?h=dvb-vb2
>
> Junghak,
>
> You may try to play with the git options that improve rename/copy files,
> like:
> 	--find-copies-harder
> 	-M
> 	-C
>
> The last two options accepts a percentage parameter, like:
>    -C60	for detect changes that keep up to 60% of the original content.
>
> and:
> 	--diff-algorithm=minimal
> 	--diff-algorithm=patience
>
> Maybe with those options, the email produced by git format-patch will
> be small enough to fit at the VGER mailing list limits.
>
> If none of those work, please let us know.
I tried to reduce the size of patch 2/3 with the combinations of git 
options you recommended like :
     --minimal, --patience, -M[n], -C[n], --find-copies-harder
I found the patch 3/3 can be optimized with those options.
But, failed to optimize patch 2/3.
Is there any other solutions?

Regards,
Junghak
> Regards,
> Mauro
>   
>
>> Thanks!
>>
>> 	Hans
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


  reply	other threads:[~2015-06-09  1:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 13:35 [RFC PATCH 0/3] Refactoring Videobuf2 for common use Junghak Sung
2015-06-08 13:35 ` [RFC PATCH 1/3] modify the vb2_buffer structure for common video buffer and make struct vb2_v4l2_buffer Junghak Sung
2015-06-12  9:58   ` Hans Verkuil
2015-06-12 10:09     ` Hans Verkuil
2015-06-17 11:55       ` Mauro Carvalho Chehab
2015-06-17 12:27   ` Mauro Carvalho Chehab
2015-06-23  1:11     ` Junghak Sung
2015-06-08 13:35 ` [RFC PATCH 3/3] make vb2-core part with not v4l2-specific elements Junghak Sung
2015-06-08 14:42 ` [RFC PATCH 0/3] Refactoring Videobuf2 for common use Hans Verkuil
2015-06-08 17:39   ` Mauro Carvalho Chehab
2015-06-09  1:41     ` Junghak Sung [this message]
2015-06-12 10:51 ` Hans Verkuil
2015-06-23  0:48   ` Junghak Sung
     [not found] ` <1433770535-21143-3-git-send-email-jh1009.sung@samsung.com>
2015-06-17 13:16   ` [RFC PATCH 2/3] make struct vb2_queue to common and apply the changes related with that Mauro Carvalho Chehab
2015-06-23  1:33     ` Junghak Sung

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=55764463.7080908@samsung.com \
    --to=jh1009.sung@samsung.com \
    --cc=hverkuil@xs4all.nl \
    --cc=inki.dae@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=nenggun.kim@samsung.com \
    --cc=sangbae90.lee@samsung.com \
    --cc=sw0312.kim@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.