X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0582-staging-vcsm-cma-Fixup-the-alloc-code-handling-of-ke.patch;fp=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0582-staging-vcsm-cma-Fixup-the-alloc-code-handling-of-ke.patch;h=5e5c6bc2de448c59bb8c1981af0263c97ef16032;hb=67dcc43f3a22dc3a7ac07a7065971b426feeb043;hp=0000000000000000000000000000000000000000;hpb=47a93a810f78adce5a130d287f82b28e9b54313c;p=openwrt%2Fopenwrt.git diff --git a/target/linux/brcm2708/patches-4.19/950-0582-staging-vcsm-cma-Fixup-the-alloc-code-handling-of-ke.patch b/target/linux/brcm2708/patches-4.19/950-0582-staging-vcsm-cma-Fixup-the-alloc-code-handling-of-ke.patch new file mode 100644 index 0000000000..5e5c6bc2de --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0582-staging-vcsm-cma-Fixup-the-alloc-code-handling-of-ke.patch @@ -0,0 +1,35 @@ +From 52f881e3afa89bb1ca9e8b037f7600bcc97626e8 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 22 May 2019 15:40:37 +0100 +Subject: [PATCH] staging: vcsm-cma: Fixup the alloc code handling of + kernel_id + +The allocation code had been copied in from an old branch prior +to having added the IDR for 64bit support. It was therefore pushing +a pointer into the kernel_id field instead of an IDR handle, the +lookup therefore failed, and we never released the buffer. + +Signed-off-by: Dave Stevenson +--- + drivers/staging/vc04_services/vc-sm-cma/vc_sm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c ++++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c +@@ -1206,7 +1206,7 @@ int vc_sm_cma_ioctl_alloc(struct vc_sm_p + + import.addr = (uint32_t)sg_dma_address(buffer->sg_table->sgl); + import.size = aligned_size; +- import.kernel_id = (uint32_t)buffer; ++ import.kernel_id = get_kernel_id(buffer); + + /* Wrap it into a videocore buffer. */ + status = vc_sm_cma_vchi_import(sm_state->sm_handle, &import, &result, +@@ -1231,6 +1231,7 @@ int vc_sm_cma_ioctl_alloc(struct vc_sm_p + buffer->size = import.size; + buffer->dma_addr = import.addr; + buffer->vpu_state = VPU_MAPPED; ++ buffer->kernel_id = import.kernel_id; + //buffer->res_cached = ioparam->cached; + + fd = dma_buf_fd(dmabuf, O_CLOEXEC);