All of lore.kernel.org
 help / color / mirror / Atom feed
From: Himadri Pandya <himadri18.07@gmail.com>
To: laurent.pinchart@ideasonboard.com, mchehab@kernel.org,
	gregkh@linuxfoundation.org
Cc: outreachy-kernel@googlegroups.com,
	Himadri Pandya <himadri18.07@gmail.com>
Subject: [PATCH 1/2] staging: media: omap4iss: redefine to_iss_buffer()
Date: Tue,  2 Apr 2019 00:50:14 +0530	[thread overview]
Message-ID: <20190401192015.96166-2-himadri18.07@gmail.com> (raw)
In-Reply-To: <20190401192015.96166-1-himadri18.07@gmail.com>

Currently macro to_iss_buffer converts vb2_v4l2_buffer into iss_buffer.
But the application needs the conversion from vb2_buffer to iss_bufffer.
So they need to convert vb2_buffer into vb2_v4l2_buffer first and then
vb2_v4l2_buffer into iss_buffer. Redefining to_iss_buffer to convert
from vb2_buffer into iss_buffer directly helps the situation.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
---
 drivers/staging/media/omap4iss/iss_video.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/omap4iss/iss_video.h b/drivers/staging/media/omap4iss/iss_video.h
index f22489edb562..3722ac8ba2fa 100644
--- a/drivers/staging/media/omap4iss/iss_video.h
+++ b/drivers/staging/media/omap4iss/iss_video.h
@@ -118,7 +118,12 @@ struct iss_buffer {
 	dma_addr_t iss_addr;
 };
 
-#define to_iss_buffer(buf)	container_of(buf, struct iss_buffer, vb)
+static inline struct iss_buffer *to_iss_buffer(struct vb2_buffer *vb)
+{
+	struct vb2_v4l2_buffer *vbuf = container_of(vb, struct vb2_v4l2_buffer, vb2_buf);
+
+	return container_of(vbuf, struct iss_buffer, vb);
+}
 
 enum iss_video_dmaqueue_flags {
 	/* Set if DMA queue becomes empty when ISS_PIPELINE_STREAM_CONTINUOUS */
-- 
2.17.1



  reply	other threads:[~2019-04-01 19:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 19:20 [PATCH 0/2] staging: media: omap4iss: redefine and use to_iss_buffer Himadri Pandya
2019-04-01 19:20 ` Himadri Pandya [this message]
2019-04-02  6:58   ` [PATCH 1/2] staging: media: omap4iss: redefine to_iss_buffer() Laurent Pinchart
2019-04-02  8:49     ` Himadri Pandya
2019-04-01 19:20 ` [PATCH 2/2] staging: media: omap4iss: use to_iss_buffer instead of container_of Himadri Pandya
2019-04-02  5:53 ` [PATCH 0/2] staging: media: omap4iss: redefine and use to_iss_buffer Greg KH
2019-04-02  8:41   ` Himadri Pandya

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=20190401192015.96166-2-himadri18.07@gmail.com \
    --to=himadri18.07@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=mchehab@kernel.org \
    --cc=outreachy-kernel@googlegroups.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.