Browse Source

video: driver: Fix dlkm compilation

1.) New dma_buf_vmap() returns SUCCESS or FAIL unlike legacy dma_buf_vmap()
    which return type is vmap address. dma_buf_vmap() takes two arguments now.
    Now it returns vmap address in pointer passed as second argument.
2.) If defined, use V4L2_CTRL_CLASS_CODEC else use V4L2_CTRL_CLASS_MPEG.
3.) iommu_dma_enable_best_fit_algo is commented temporary.
4.) remove subsystem_resart.h

Change-Id: I73c6a840fa6028f021debff33b88178ac74dcef9
Signed-off-by: Mahesh Kumar Sharma <[email protected]>
Mahesh Kumar Sharma 3 years ago
parent
commit
767c8ad13d

+ 6 - 0
driver/vidc/inc/msm_vidc_internal.h

@@ -97,9 +97,15 @@
 #define NUM_MBS_PER_FRAME(__height, __width) \
 	((ALIGN(__height, 16) / 16) * (ALIGN(__width, 16) / 16))
 
+#ifdef V4L2_CTRL_CLASS_CODEC
+#define IS_PRIV_CTRL(idx) ( \
+	(V4L2_CTRL_ID2WHICH(idx) == V4L2_CTRL_CLASS_CODEC) && \
+	V4L2_CTRL_DRIVER_PRIV(idx))
+#else
 #define IS_PRIV_CTRL(idx) ( \
 	(V4L2_CTRL_ID2WHICH(idx) == V4L2_CTRL_CLASS_MPEG) && \
 	V4L2_CTRL_DRIVER_PRIV(idx))
+#endif
 
 #define BUFFER_ALIGNMENT_SIZE(x) x
 #define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4))

+ 8 - 1
driver/vidc/src/msm_vidc_dt.c

@@ -823,7 +823,14 @@ static int msm_vidc_setup_context_bank(struct msm_vidc_core *core,
 	 * When memory is fragmented, below configuration increases the
 	 * possibility to get a mapping for buffer in the configured CB.
 	 */
-	iommu_dma_enable_best_fit_algo(cb->dev);
+
+	/*
+	 * TBD: iommu_dma_enable_best_fit_algo is commented temoprarily to enable dlkm
+	 * compilation once headers are availbale when the GKI branch for Kailua (android13-5.next)
+	 * branches out
+	 */
+
+	/*iommu_dma_enable_best_fit_algo(cb->dev);*/
 
 	/*
 	 * configure device segment size and segment boundary to ensure

+ 2 - 2
driver/vidc/src/msm_vidc_memory.c

@@ -377,8 +377,8 @@ int msm_vidc_memory_alloc(struct msm_vidc_core *core, struct msm_vidc_alloc *mem
 
 	if (mem->map_kernel) {
 		dma_buf_begin_cpu_access(mem->dmabuf, DMA_BIDIRECTIONAL);
-		mem->kvaddr = dma_buf_vmap(mem->dmabuf);
-		if (!mem->kvaddr) {
+		rc = dma_buf_vmap(mem->dmabuf, mem->kvaddr);
+		if (rc) {
 			d_vpr_e("%s: kernel map failed\n", __func__);
 			rc = -EIO;
 			goto error;

+ 0 - 1
driver/vidc/src/venus_hfi.c

@@ -9,7 +9,6 @@
 #include <linux/irqreturn.h>
 #include <linux/reset.h>
 #include <linux/interconnect.h>
-#include <soc/qcom/subsystem_restart.h>
 #include <linux/of_address.h>
 #include <linux/firmware.h>
 #include <linux/qcom_scm.h>

+ 5 - 1
include/uapi/vidc/media/v4l2_vidc_extensions.h

@@ -52,7 +52,11 @@
 #endif
 
 /* vendor controls start */
-#define V4L2_CID_MPEG_VIDC_BASE                 (V4L2_CTRL_CLASS_MPEG | 0x2000)
+#ifdef V4L2_CTRL_CLASS_CODEC
+#define V4L2_CID_MPEG_VIDC_BASE (V4L2_CTRL_CLASS_CODEC | 0x2000)
+#else
+#define V4L2_CID_MPEG_VIDC_BASE (V4L2_CTRL_CLASS_MPEG | 0x2000)
+#endif
 
 #define V4L2_MPEG_MSM_VIDC_DISABLE 0
 #define V4L2_MPEG_MSM_VIDC_ENABLE 1