All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Jan Kara <jack@suse.cz>, linux-mm@kvack.org
Cc: linux-media@vger.kernel.org,
	"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>,
	'Tomasz Stanislawski' <t.stanislaws@samsung.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [RFC] Helper to abstract vma handling in media layer
Date: Thu, 10 Apr 2014 12:02:50 +0200	[thread overview]
Message-ID: <53466C4A.2030107@samsung.com> (raw)
In-Reply-To: <1395085776-8626-1-git-send-email-jack@suse.cz>

Hello,

On 2014-03-17 20:49, Jan Kara wrote:
>    The following patch series is my first stab at abstracting vma handling
> from the various media drivers. After this patch set drivers have to know
> much less details about vmas, their types, and locking. My motivation for
> the series is that I want to change get_user_pages() locking and I want
> to handle subtle locking details in as few places as possible.
>
> The core of the series is the new helper get_vaddr_pfns() which is given a
> virtual address and it fills in PFNs into provided array. If PFNs correspond to
> normal pages it also grabs references to these pages. The difference from
> get_user_pages() is that this function can also deal with pfnmap, mixed, and io
> mappings which is what the media drivers need.
>
> The patches are just compile tested (since I don't have any of the hardware
> I'm afraid I won't be able to do any more testing anyway) so please handle
> with care. I'm grateful for any comments.

Thanks for posting this series! I will check if it works with our 
hardware soon.
This is something I wanted to introduce some time ago to simplify buffer
handling in dma-buf, but I had no time to start working.

However I would like to go even further with integration of your pfn 
vector idea.
This structure looks like a best solution for a compact representation 
of the
memory buffer, which should be considered by the hardware as contiguous 
(either
contiguous in physical memory or mapped contiguously into dma address 
space by
the respective iommu). As you already noticed it is widely used by 
graphics and
video drivers.

I would also like to add support for pfn vector directly to the dma-mapping
subsystem. This can be done quite easily (even with a fallback for 
architectures
which don't provide method for it). I will try to prepare rfc soon. This 
will
finally remove the need for hacks in media/v4l2-core/videobuf2-dma-contig.c

Thanks for motivating me to finally start working on this!

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


WARNING: multiple messages have this Message-ID (diff)
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Jan Kara <jack@suse.cz>, linux-mm@kvack.org
Cc: linux-media@vger.kernel.org,
	"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>,
	'Tomasz Stanislawski' <t.stanislaws@samsung.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [RFC] Helper to abstract vma handling in media layer
Date: Thu, 10 Apr 2014 12:02:50 +0200	[thread overview]
Message-ID: <53466C4A.2030107@samsung.com> (raw)
In-Reply-To: <1395085776-8626-1-git-send-email-jack@suse.cz>

Hello,

On 2014-03-17 20:49, Jan Kara wrote:
>    The following patch series is my first stab at abstracting vma handling
> from the various media drivers. After this patch set drivers have to know
> much less details about vmas, their types, and locking. My motivation for
> the series is that I want to change get_user_pages() locking and I want
> to handle subtle locking details in as few places as possible.
>
> The core of the series is the new helper get_vaddr_pfns() which is given a
> virtual address and it fills in PFNs into provided array. If PFNs correspond to
> normal pages it also grabs references to these pages. The difference from
> get_user_pages() is that this function can also deal with pfnmap, mixed, and io
> mappings which is what the media drivers need.
>
> The patches are just compile tested (since I don't have any of the hardware
> I'm afraid I won't be able to do any more testing anyway) so please handle
> with care. I'm grateful for any comments.

Thanks for posting this series! I will check if it works with our 
hardware soon.
This is something I wanted to introduce some time ago to simplify buffer
handling in dma-buf, but I had no time to start working.

However I would like to go even further with integration of your pfn 
vector idea.
This structure looks like a best solution for a compact representation 
of the
memory buffer, which should be considered by the hardware as contiguous 
(either
contiguous in physical memory or mapped contiguously into dma address 
space by
the respective iommu). As you already noticed it is widely used by 
graphics and
video drivers.

I would also like to add support for pfn vector directly to the dma-mapping
subsystem. This can be done quite easily (even with a fallback for 
architectures
which don't provide method for it). I will try to prepare rfc soon. This 
will
finally remove the need for hacks in media/v4l2-core/videobuf2-dma-contig.c

Thanks for motivating me to finally start working on this!

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2014-04-10 10:02 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 19:49 [RFC] Helper to abstract vma handling in media layer Jan Kara
2014-03-17 19:49 ` Jan Kara
2014-03-17 19:49 ` [PATCH 1/9] mm: Provide new get_vaddr_pfns() helper Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 20:53   ` Dave Hansen
2014-03-17 20:53     ` Dave Hansen
2014-03-18 10:25     ` Jan Kara
2014-03-18 10:25       ` Jan Kara
2015-04-24 16:21   ` Jan Kara
2015-04-24 16:21     ` Jan Kara
2014-03-17 19:49 ` [PATCH 2/9] media: omap_vout: Convert omap_vout_uservirt_to_phys() to use get_vaddr_pfns() Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 3/9] media: vb2: Teach vb2_queue_or_prepare_buf() to get pfns for user buffers Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 4/9] media: vb2: Convert vb2_dma_sg_get_userptr() to use pinned pfns Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 5/9] media: vb2: Convert vb2_vmalloc_get_userptr() to use pfns vector Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 6/9] media: vb2: Convert vb2_dc_get_userptr() " Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 7/9] media: vb2: Remove unused functions Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 8/9] drm/exynos: Convert g2d_userptr_get_dma_addr() to use get_vaddr_pfn() Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-03-17 19:49 ` [PATCH 9/9] staging: tidspbridge: Convert to get_vaddr_pfns() Jan Kara
2014-03-17 19:49   ` Jan Kara
2014-04-10 10:02 ` Marek Szyprowski [this message]
2014-04-10 10:02   ` [RFC] Helper to abstract vma handling in media layer Marek Szyprowski
2014-04-10 10:32   ` Jan Kara
2014-04-10 10:32     ` Jan Kara
2014-04-10 11:07     ` Hans Verkuil
2014-04-10 11:07       ` Hans Verkuil
2014-04-10 12:15       ` Jan Kara
2014-04-10 12:15         ` Jan Kara
2014-04-10 12:22         ` Hans Verkuil
2014-04-10 12:22           ` Hans Verkuil
2014-04-10 21:57           ` Jan Kara
2014-04-10 21:57             ` Jan Kara
2014-04-10 22:18             ` Jan Kara
2014-04-10 22:18               ` Jan Kara
2014-04-11  6:58               ` Hans Verkuil
2014-04-11  6:58                 ` Hans Verkuil
2014-04-14 21:19                 ` Jan Kara
2014-04-14 21:19                   ` Jan Kara

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=53466C4A.2030107@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=jack@suse.cz \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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 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.