linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org, Hans Verkuil <hans.verkuil@cisco.com>
Cc: kernel@collabora.com,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Pawel Osciak <pawel@osciak.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Rick Chang <rick.chang@mediatek.com>,
	Bin Liu <bin.liu@mediatek.com>
Subject: [PATCH 2/5] media: mtk-jpeg: Use vb2_get_buffer
Date: Thu,  6 Jun 2019 12:44:23 -0300	[thread overview]
Message-ID: <20190606154426.6899-3-ezequiel@collabora.com> (raw)
In-Reply-To: <20190606154426.6899-1-ezequiel@collabora.com>

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

Cc: Rick Chang <rick.chang@mediatek.com>
Cc: Bin Liu <bin.liu@mediatek.com>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index 3b199662cb34..f8f808abada1 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -526,7 +526,7 @@ static int mtk_jpeg_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
 		return -EINVAL;
 	}
 
-	vb = vq->bufs[buf->index];
+	vb = vb2_get_buffer(vq, buf->index);
 	jpeg_src_buf = mtk_jpeg_vb2_to_srcbuf(vb);
 	jpeg_src_buf->flags = (buf->m.planes[0].bytesused == 0) ?
 		MTK_JPEG_BUF_FLAGS_LAST_FRAME : MTK_JPEG_BUF_FLAGS_INIT;
-- 
2.20.1


  parent reply	other threads:[~2019-06-06 15:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 15:44 [PATCH 0/5] media: Access videobuf2 buffers via an accessor Ezequiel Garcia
2019-06-06 15:44 ` [PATCH 1/5] media: vb2: Introduce a vb2_get_buffer accessor Ezequiel Garcia
2019-06-06 17:39   ` Boris Brezillon
2019-06-06 15:44 ` Ezequiel Garcia [this message]
2019-06-06 15:44 ` [PATCH 3/5] media: mtk-vcodec: Use vb2_get_buffer Ezequiel Garcia
2019-06-06 15:44 ` [PATCH 4/5] media: sti: " Ezequiel Garcia
2019-06-06 15:44 ` [PATCH 5/5] media: rockchip: " Ezequiel Garcia
2019-06-06 17:43 ` [PATCH 0/5] media: Access videobuf2 buffers via an accessor Boris Brezillon
2019-06-06 18:13   ` Ezequiel Garcia
2019-06-06 19:08     ` Boris Brezillon

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=20190606154426.6899-3-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=bin.liu@mediatek.com \
    --cc=boris.brezillon@collabora.com \
    --cc=hans.verkuil@cisco.com \
    --cc=kernel@collabora.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    --cc=rick.chang@mediatek.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 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).