Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 472af2b0 authored by Pawel Osciak's avatar Pawel Osciak Committed by Mauro Carvalho Chehab
Browse files

[media] videobuf2-dma-contig: make cookie() return a pointer to dma_addr_t



dma_addr_t may not fit into void* on some architectures. To be safe, make
vb2_dma_contig_cookie() return a pointer to dma_addr_t and dereference it
in vb2_dma_contig_plane_paddr() back to dma_addr_t.

Signed-off-by: default avatarPawel Osciak <pawel@osciak.com>
Reported-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d6db5bfe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ static void *vb2_dma_contig_cookie(void *buf_priv)
{
	struct vb2_dc_buf *buf = buf_priv;

	return (void *)buf->paddr;
	return &buf->paddr;
}

static void *vb2_dma_contig_vaddr(void *buf_priv)
+6 −3
Original line number Diff line number Diff line
@@ -14,11 +14,14 @@
#define _MEDIA_VIDEOBUF2_DMA_COHERENT_H

#include <media/videobuf2-core.h>
#include <linux/dma-mapping.h>

static inline unsigned long vb2_dma_contig_plane_paddr(
		struct vb2_buffer *vb, unsigned int plane_no)
static inline dma_addr_t
vb2_dma_contig_plane_paddr(struct vb2_buffer *vb, unsigned int plane_no)
{
	return (unsigned long)vb2_plane_cookie(vb, plane_no);
	dma_addr_t *paddr = vb2_plane_cookie(vb, plane_no);

	return *paddr;
}

void *vb2_dma_contig_init_ctx(struct device *dev);