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 <smahesh@codeaurora.org>
This commit is contained in:
Mahesh Kumar Sharma
2021-10-22 17:57:17 -07:00
parent e3ea015659
commit 767c8ad13d
5 changed files with 21 additions and 5 deletions

View File

@@ -97,9 +97,15 @@
#define NUM_MBS_PER_FRAME(__height, __width) \ #define NUM_MBS_PER_FRAME(__height, __width) \
((ALIGN(__height, 16) / 16) * (ALIGN(__width, 16) / 16)) ((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) ( \ #define IS_PRIV_CTRL(idx) ( \
(V4L2_CTRL_ID2WHICH(idx) == V4L2_CTRL_CLASS_MPEG) && \ (V4L2_CTRL_ID2WHICH(idx) == V4L2_CTRL_CLASS_MPEG) && \
V4L2_CTRL_DRIVER_PRIV(idx)) V4L2_CTRL_DRIVER_PRIV(idx))
#endif
#define BUFFER_ALIGNMENT_SIZE(x) x #define BUFFER_ALIGNMENT_SIZE(x) x
#define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4)) #define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4))

View File

@@ -823,7 +823,14 @@ static int msm_vidc_setup_context_bank(struct msm_vidc_core *core,
* When memory is fragmented, below configuration increases the * When memory is fragmented, below configuration increases the
* possibility to get a mapping for buffer in the configured CB. * 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 * configure device segment size and segment boundary to ensure

View File

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

View File

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

View File

@@ -52,7 +52,11 @@
#endif #endif
/* vendor controls start */ /* 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_DISABLE 0
#define V4L2_MPEG_MSM_VIDC_ENABLE 1 #define V4L2_MPEG_MSM_VIDC_ENABLE 1