mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Tomasz Figa <tfiga@chromium.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [PATCH] media: vb2: always set buffer cache sync hints
Date: Fri, 27 Nov 2020 23:30:33 +0900	[thread overview]
Message-ID: <X8ENifLanjYuhF/r@jagdpanzerIV.localdomain> (raw)
In-Reply-To: <0dbfa509-8c82-7470-c18b-24ab5c92dc4b@xs4all.nl>

On (20/11/27 13:59), Hans Verkuil wrote:
> 
> I think this needs a comment, basically explaining what you said in
> the commit log. It's not obvious from the code that this is a
> workaround.

Something like this?

---

diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index 5499013cf82e..21b2b0ae3629 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -414,6 +414,16 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory,
                vb->index = q->num_buffers + buffer;
                vb->type = q->type;
                vb->memory = memory;
+               /*
+                * A workaround fix. We need to set these flags here so that
+                * videobuf2 core will always call ->prepare()/->finish()
+                * cache sync/flush on vb2 buffers. Otherwise, for backends
+                * that don't rely on V4L2 (perhaps dvb) these flags will
+                * always be false and, hence, videobuf2 core will skip cache
+                * sync/flush operations.
+                */
+               vb->need_cache_sync_on_prepare = 1;
+               vb->need_cache_sync_on_finish = 1;
                for (plane = 0; plane < num_planes; ++plane) {
                        vb->planes[plane].length = plane_sizes[plane];
                        vb->planes[plane].min_length = plane_sizes[plane];

  reply	other threads:[~2020-11-27 14:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27  9:41 Sergey Senozhatsky
2020-11-27  9:44 ` Sergey Senozhatsky
2020-11-27 12:59 ` Hans Verkuil
2020-11-27 14:30   ` Sergey Senozhatsky [this message]
2020-11-27 14:56     ` Hans Verkuil
2020-11-27 16:35       ` Sergey Senozhatsky
2020-11-27 16:50         ` Tomasz Figa
2020-11-28  5:04           ` Sergey Senozhatsky

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=X8ENifLanjYuhF/r@jagdpanzerIV.localdomain \
    --to=sergey.senozhatsky@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=tfiga@chromium.org \
    /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®