From 3ae3d87b5c06367892129dab2a4042dd608702e8 Mon Sep 17 00:00:00 2001 From: Thuy Tran Date: Fri, 17 May 2019 17:05:42 +0700 Subject: rcar-gen3: vsp2driver: Add a patch to handle data_offset setting Vsp2 driver doesn't need to set offset of dmabuf for UV plane. However, in case of overlay plane by weston5.0, v4l2src (VIN) takes care of plane offset of dmabuf via mmngr, then vspfilter and vsp2drv also need to care it. Signed-off-by: Thuy Tran Signed-off-by: Takamitsu Honda --- .../kernel-module-vsp2driver.bb | 2 ++ ...-Handle-data_offset-setting-from-V4L2-API.patch | 29 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver/0001-Handle-data_offset-setting-from-V4L2-API.patch (limited to 'meta-rcar-gen3/recipes-kernel') diff --git a/meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver.bb b/meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver.bb index c3c3233..be8f8e0 100644 --- a/meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver.bb +++ b/meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver.bb @@ -21,6 +21,8 @@ SRCREV = "0ecf35aa05c103ba4d3ab83e3320a22fccd912c3" SRC_URI = "${VSP2DRIVER_URL};branch=${BRANCH}" +SRC_URI_append = " file://0001-Handle-data_offset-setting-from-V4L2-API.patch" + S = "${WORKDIR}/git" # Build VSP2 driver kernel module without suffix diff --git a/meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver/0001-Handle-data_offset-setting-from-V4L2-API.patch b/meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver/0001-Handle-data_offset-setting-from-V4L2-API.patch new file mode 100644 index 0000000..3aab174 --- /dev/null +++ b/meta-rcar-gen3/recipes-kernel/kernel-module-vsp2driver/kernel-module-vsp2driver/0001-Handle-data_offset-setting-from-V4L2-API.patch @@ -0,0 +1,29 @@ +From 50dd867589931beef05dbcdb17a37a8a678e4b13 Mon Sep 17 00:00:00 2001 +From: Damian Hobson-Garcia +Date: Fri, 10 May 2019 13:34:42 +0900 +Subject: [PATCH] Handle data_offset setting from V4L2 API + +The data in each buffer does not necessarily start at the +beginning of the buffer. Adjust as necessary according to +the data_offset field specified from user space. +--- + vsp2driver/vsp2_video.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/vsp2driver/vsp2_video.c b/vsp2driver/vsp2_video.c +index 8875578..0abf81c 100644 +--- a/vsp2driver/vsp2_video.c ++++ b/vsp2driver/vsp2_video.c +@@ -764,7 +764,8 @@ static int vsp2_video_buffer_prepare(struct vb2_buffer *vb) + } + + for (i = 0; i < vb->num_planes; ++i) { +- buf->mem.addr[i] = vb2_dma_contig_plane_dma_addr(vb, i); ++ buf->mem.addr[i] = vb2_dma_contig_plane_dma_addr(vb, i) + ++ vb->planes[i].data_offset; + + if (vb2_plane_size(vb, i) < format->plane_fmt[i].sizeimage) + return -EINVAL; +-- +2.17.1 + -- cgit 1.2.3-korg