This is needed for imx-ipu-vout to extract the buffer address from a
saved CPMEM block.

Signed-off-by: Philipp Zabel <p.za...@pengutronix.de>
---
 include/video/imx-ipu-v3.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 77a82f5..e8764dc 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -268,6 +268,15 @@ static inline void ipu_cpmem_set_buffer(struct 
ipu_ch_param __iomem *p,
                ipu_ch_param_write_field(p, IPU_FIELD_EBA0, buf >> 3);
 }
 
+static inline dma_addr_t ipu_cpmem_get_buffer(struct ipu_ch_param __iomem *p,
+               int bufnum)
+{
+       if (bufnum)
+               return ipu_ch_param_read_field(p, IPU_FIELD_EBA1) << 3;
+       else
+               return ipu_ch_param_read_field(p, IPU_FIELD_EBA0) << 3;
+}
+
 static inline void ipu_cpmem_set_resolution(struct ipu_ch_param __iomem *p,
                int xres, int yres)
 {
-- 
2.0.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to