public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
	kernel@collabora.com, Ezequiel Garcia <ezequiel@collabora.com>
Subject: [PATCH] media: hantro: Use vb2_get_buffer
Date: Tue, 18 Jun 2019 20:12:37 -0300	[thread overview]
Message-ID: <20190618231237.27466-1-ezequiel@collabora.com> (raw)
In-Reply-To: <12f39255-bae4-0382-740e-4de4802c374d@xs4all.nl>

Use the newly introduced vb2_get_buffer API and avoid
accessing buffers in the queue directly.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/hantro/hantro_drv.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index 1d3af881d088..c3665f0e87a2 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -45,12 +45,14 @@ void *hantro_get_ctrl(struct hantro_ctx *ctx, u32 id)
 
 dma_addr_t hantro_get_ref(struct vb2_queue *q, u64 ts)
 {
+	struct vb2_buffer *buf;
 	int index;
 
 	index = vb2_find_timestamp(q, ts, 0);
-	if (index >= 0)
-		return vb2_dma_contig_plane_dma_addr(q->bufs[index], 0);
-	return 0;
+	if (index < 0)
+		return 0;
+	buf = vb2_get_buffer(q, index);
+	return vb2_dma_contig_plane_dma_addr(buf, 0);
 }
 
 static int
-- 
2.20.1


  reply	other threads:[~2019-06-18 23:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 20:55 [PATCH v2 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 1/5] media: vb2: Introduce a vb2_get_buffer accessor Ezequiel Garcia
2019-06-11 12:27   ` Marek Szyprowski
2019-06-10 20:55 ` [PATCH v2 2/5] media: mtk-jpeg: Use vb2_get_buffer Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 3/5] media: mtk-vcodec: " Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 4/5] media: sti: " Ezequiel Garcia
2019-06-10 20:55 ` [PATCH v2 5/5] media: rockchip: " Ezequiel Garcia
2019-06-14  7:40   ` Hans Verkuil
2019-06-18 23:12     ` Ezequiel Garcia [this message]
2019-06-21 21:03       ` [PATCH] media: hantro: " kbuild test robot
2019-06-22  4:14       ` kbuild test robot

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=20190618231237.27466-1-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=hans.verkuil@cisco.com \
    --cc=kernel@collabora.com \
    --cc=linux-media@vger.kernel.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