linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFCv2 PATCH 00/14] vb2: improve dma-sg, expbuf
@ 2014-09-12 12:59 Hans Verkuil
  2014-09-12 12:59 ` [RFCv2 PATCH 01/14] vb2: introduce buf_prepare/finish_for_cpu Hans Verkuil
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Hans Verkuil @ 2014-09-12 12:59 UTC (permalink / raw)
  To: linux-media; +Cc: pawel, m.szyprowski, laurent.pinchart

Changes since v1:

- Updated commit logs of patches 1 and 3.
- Added patches for tw68 and cx23885.

The patch series adds an allocation context to dma-sg and uses that to move
dma_(un)map_sg into the vb2 framework, which is where it belongs.

Related to that is the addition of buf_prepare/finish _for_cpu variants,
where the _for_cpu ops are called when the buffer is synced for the cpu, and
the others are called when it is synced to the device.

DMABUF export support is added to dma-sg and vmalloc, so now all memory
models support DMABUF importing and exporting.

A new flag was added so drivers know when the DMA engine should be
(re)programmed. This is primarily needed for the dma-sg memory model.

Reviews are very welcome.

There is one thing I am not happy about: the addition of the 'new_cookies'
flag. The idea is that if it is set, then the driver has to setup the
DMA engine descriptors in buf_prepare(). This avoids creating the DMA
descriptors in every buf_prepare and deleting them again for every buf_finish.
The problem is that when using the new flag the cleanup of those descriptors
can't be done in buf_finish anymore since when that op is called you do not
yet know if the descriptors need to be updated. Instead the cleanup has to
happen in buf_cleanup(). The tw68 patch is a good example of that.

Unfortunately, this sequence is asymmetrical.

I cannot think of a good alternative. The only slight improvement that might
be worth doing is that the vb2 core also sets new_cookies when buf_cleanup()
needs to cleanup the descriptors. There is a corner case where buf_cleanup
doesn't need to do that (e.g. if buf_prepare returned an error), and right
now drivers need to detect that. It's probably better to move that logic
to the vb2 core.

Regards,

	Hans


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-09-14  8:11 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12 12:59 [RFCv2 PATCH 00/14] vb2: improve dma-sg, expbuf Hans Verkuil
2014-09-12 12:59 ` [RFCv2 PATCH 01/14] vb2: introduce buf_prepare/finish_for_cpu Hans Verkuil
2014-09-12 21:25   ` Laurent Pinchart
2014-09-12 12:59 ` [RFCv2 PATCH 02/14] vb2-dma-sg: add allocation context to dma-sg Hans Verkuil
2014-09-12 21:49   ` Laurent Pinchart
2014-09-14  3:29   ` Pawel Osciak
2014-09-12 12:59 ` [RFCv2 PATCH 03/14] vb2-dma-sg: add prepare/finish memops Hans Verkuil
2014-09-12 21:54   ` Laurent Pinchart
2014-09-14  3:40   ` Pawel Osciak
2014-09-12 12:59 ` [RFCv2 PATCH 04/14] vb2: memop prepare: return errors Hans Verkuil
2014-09-12 12:59 ` [RFCv2 PATCH 05/14] vb2: call memop prepare before the buf_prepare op is called Hans Verkuil
2014-09-12 12:59 ` [RFCv2 PATCH 06/14] vb2-dma-sg: add dmabuf import support Hans Verkuil
2014-09-14  8:11   ` Laurent Pinchart
2014-09-12 12:59 ` [RFCv2 PATCH 07/14] vb2-dma-sg: add get_dmabuf Hans Verkuil
2014-09-12 12:59 ` [RFCv2 PATCH 08/14] vb2-vmalloc: add get_dmabuf support Hans Verkuil
2014-09-12 12:59 ` [RFCv2 PATCH 09/14] vb2: replace 'write' by 'dma_dir' Hans Verkuil
2014-09-12 22:02   ` Laurent Pinchart
2014-09-12 12:59 ` [RFCv2 PATCH 10/14] vb2: add 'new_cookies' flag Hans Verkuil
2014-09-14  7:02   ` Pawel Osciak
2014-09-12 13:00 ` [RFCv2 PATCH 11/14] tw68: only reprogram DMA engine when necessary Hans Verkuil
2014-09-12 13:00 ` [RFCv2 PATCH 12/14] cx23885: " Hans Verkuil
2014-09-12 13:00 ` [RFCv2 PATCH 13/14] saa7134: don't rebuild the page table unless new_cookies is set Hans Verkuil
2014-09-12 13:00 ` [RFCv2 PATCH 14/14] vivid: enable vb2_expbuf support Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).