video: driver: select target and vpu variant based on dtsi
- enable conditional compilation based on defconfig - compile only needed files based target & vpu variant - enabled stubs to avoid compilation issues, for all target variant and vpu types - add support for qcv(same lunch combo) for different PT & VT chipsets. Change-Id: Ic446349fd1532885d7a2e94895d807c62f1ab6e4 Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
21
Kbuild
21
Kbuild
@@ -1,10 +1,11 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
include $(VIDEO_ROOT)/config/waipio_video.conf
|
|
||||||
|
|
||||||
KBUILD_CPPFLAGS += -DCONFIG_MSM_MMRM=1
|
KBUILD_CPPFLAGS += -DCONFIG_MSM_MMRM=1
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ARCH_WAIPIO), y)
|
||||||
|
include $(VIDEO_ROOT)/config/waipio_video.conf
|
||||||
LINUXINCLUDE += -include $(VIDEO_ROOT)/config/waipio_video.h
|
LINUXINCLUDE += -include $(VIDEO_ROOT)/config/waipio_video.h
|
||||||
|
endif
|
||||||
|
|
||||||
LINUXINCLUDE += -I$(VIDEO_ROOT)/driver/vidc/inc \
|
LINUXINCLUDE += -I$(VIDEO_ROOT)/driver/vidc/inc \
|
||||||
-I$(VIDEO_ROOT)/include/uapi/vidc \
|
-I$(VIDEO_ROOT)/include/uapi/vidc \
|
||||||
@@ -16,6 +17,16 @@ USERINCLUDE += -I$(VIDEO_ROOT)/include/uapi/vidc/media \
|
|||||||
|
|
||||||
obj-m += msm_video.o
|
obj-m += msm_video.o
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_MSM_VIDC_WAIPIO), y)
|
||||||
|
msm_video-objs += driver/platform/waipio/src/msm_vidc_waipio.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_MSM_VIDC_IRIS2), y)
|
||||||
|
msm_video-objs += driver/variant/iris2/src/msm_vidc_buffer_iris2.o \
|
||||||
|
driver/variant/iris2/src/msm_vidc_power_iris2.o \
|
||||||
|
driver/variant/iris2/src/msm_vidc_iris2.o
|
||||||
|
endif
|
||||||
|
|
||||||
msm_video-objs += driver/vidc/src/msm_vidc_v4l2.o \
|
msm_video-objs += driver/vidc/src/msm_vidc_v4l2.o \
|
||||||
driver/vidc/src/msm_vidc_vb2.o \
|
driver/vidc/src/msm_vidc_vb2.o \
|
||||||
driver/vidc/src/msm_vidc.o \
|
driver/vidc/src/msm_vidc.o \
|
||||||
@@ -32,8 +43,4 @@ msm_video-objs += driver/vidc/src/msm_vidc_v4l2.o \
|
|||||||
driver/vidc/src/msm_vidc_memory.o \
|
driver/vidc/src/msm_vidc_memory.o \
|
||||||
driver/vidc/src/venus_hfi.o \
|
driver/vidc/src/venus_hfi.o \
|
||||||
driver/vidc/src/hfi_packet.o \
|
driver/vidc/src/hfi_packet.o \
|
||||||
driver/vidc/src/venus_hfi_response.o \
|
driver/vidc/src/venus_hfi_response.o
|
||||||
driver/variant/iris2/src/msm_vidc_buffer_iris2.o \
|
|
||||||
driver/variant/iris2/src/msm_vidc_power_iris2.o \
|
|
||||||
driver/variant/iris2/src/msm_vidc_iris2.o \
|
|
||||||
driver/platform/waipio/src/msm_vidc_waipio.o
|
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
export CONFIG_MSM_VIDC_V4L2=y
|
export CONFIG_MSM_VIDC_WAIPIO=y
|
||||||
|
export CONFIG_MSM_VIDC_IRIS2=y
|
||||||
|
@@ -3,6 +3,5 @@
|
|||||||
* Copyright (c) 2020-2021,, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2020-2021,, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CONFIG_MSM_VIDC_V4L2 1
|
#define CONFIG_MSM_VIDC_WAIPIO 1
|
||||||
#define CONFIG_MSM_VIDC_IRIS2 1
|
#define CONFIG_MSM_VIDC_IRIS2 1
|
||||||
#define CONFIG_MSM_VIDC_WAIPIO 1
|
|
||||||
|
@@ -8,7 +8,18 @@
|
|||||||
|
|
||||||
#include "msm_vidc_core.h"
|
#include "msm_vidc_core.h"
|
||||||
|
|
||||||
int msm_vidc_init_platform_waipio(struct msm_vidc_core *core);
|
#if defined(CONFIG_MSM_VIDC_WAIPIO)
|
||||||
int msm_vidc_deinit_platform_waipio(struct msm_vidc_core *core);
|
int msm_vidc_init_platform_waipio(struct msm_vidc_core *core, struct device *dev);
|
||||||
|
int msm_vidc_deinit_platform_waipio(struct msm_vidc_core *core, struct device *dev);
|
||||||
|
#else
|
||||||
|
int msm_vidc_init_platform_waipio(struct msm_vidc_core *core, struct device *dev)
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
int msm_vidc_deinit_platform_waipio(struct msm_vidc_core *core, struct device *dev)
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _MSM_VIDC_WAIPIO_H_
|
#endif // _MSM_VIDC_WAIPIO_H_
|
||||||
|
@@ -1464,7 +1464,7 @@ static int msm_vidc_init_data(struct msm_vidc_core *core)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int msm_vidc_init_platform_waipio(struct msm_vidc_core *core)
|
int msm_vidc_init_platform_waipio(struct msm_vidc_core *core, struct device *dev)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
@@ -1475,7 +1475,7 @@ int msm_vidc_init_platform_waipio(struct msm_vidc_core *core)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int msm_vidc_deinit_platform_waipio(struct msm_vidc_core *core)
|
int msm_vidc_deinit_platform_waipio(struct msm_vidc_core *core, struct device *dev)
|
||||||
{
|
{
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -3,14 +3,23 @@
|
|||||||
* Copyright (c) 2020-2021,, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2020-2021,, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef _MSM_VIDC_IRIS2_H_
|
||||||
|
#define _MSM_VIDC_IRIS2_H_
|
||||||
|
|
||||||
#include "msm_vidc_core.h"
|
#include "msm_vidc_core.h"
|
||||||
|
|
||||||
//#if defined(CONFIG_MSM_VIDC_IRIS2)
|
#if defined(CONFIG_MSM_VIDC_IRIS2)
|
||||||
int msm_vidc_init_iris2(struct msm_vidc_core *core);
|
int msm_vidc_init_iris2(struct msm_vidc_core *core);
|
||||||
//#else
|
|
||||||
//static inline int msm_vidc_init_iris2(struct msm_vidc_core *core)
|
|
||||||
//{
|
|
||||||
// return -EINVAL;
|
|
||||||
//}
|
|
||||||
//#endif
|
|
||||||
int msm_vidc_deinit_iris2(struct msm_vidc_core *core);
|
int msm_vidc_deinit_iris2(struct msm_vidc_core *core);
|
||||||
|
#else
|
||||||
|
static inline int msm_vidc_init_iris2(struct msm_vidc_core *core)
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
static inline int msm_vidc_deinit_iris2(struct msm_vidc_core *core)
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // _MSM_VIDC_IRIS2_H_
|
||||||
|
@@ -4,15 +4,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
|
|
||||||
#include "msm_vidc_waipio.h"
|
|
||||||
|
|
||||||
#include "msm_vidc_platform.h"
|
#include "msm_vidc_platform.h"
|
||||||
#include "msm_vidc_iris2.h"
|
|
||||||
#include "msm_vidc_debug.h"
|
#include "msm_vidc_debug.h"
|
||||||
#include "msm_vidc_v4l2.h"
|
#include "msm_vidc_v4l2.h"
|
||||||
#include "msm_vidc_vb2.h"
|
#include "msm_vidc_vb2.h"
|
||||||
#include "msm_vidc_control.h"
|
#include "msm_vidc_control.h"
|
||||||
|
#include "msm_vidc_waipio.h"
|
||||||
|
#include "msm_vidc_iris2.h"
|
||||||
|
|
||||||
static struct v4l2_file_operations msm_v4l2_file_operations = {
|
static struct v4l2_file_operations msm_v4l2_file_operations = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
@@ -97,6 +95,102 @@ static int msm_vidc_init_ops(struct msm_vidc_core *core)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int msm_vidc_deinit_platform_variant(struct msm_vidc_core *core, struct device *dev)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
if (!core || !dev) {
|
||||||
|
d_vpr_e("%s: Invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
d_vpr_h("%s()\n", __func__);
|
||||||
|
|
||||||
|
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-waipio")) {
|
||||||
|
rc = msm_vidc_deinit_platform_waipio(core, dev);
|
||||||
|
} else {
|
||||||
|
d_vpr_e("%s(): unknown platform\n", __func__);
|
||||||
|
rc = -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc)
|
||||||
|
d_vpr_e("%s: failed with %d\n", __func__, rc);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_vidc_init_platform_variant(struct msm_vidc_core *core, struct device *dev)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
if (!core || !dev) {
|
||||||
|
d_vpr_e("%s: Invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
d_vpr_h("%s()\n", __func__);
|
||||||
|
|
||||||
|
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-waipio")) {
|
||||||
|
rc = msm_vidc_init_platform_waipio(core, dev);
|
||||||
|
} else {
|
||||||
|
d_vpr_e("%s(): unknown platform\n", __func__);
|
||||||
|
rc = -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc)
|
||||||
|
d_vpr_e("%s: failed with %d\n", __func__, rc);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_vidc_deinit_vpu(struct msm_vidc_core *core, struct device *dev)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
if (!core || !dev) {
|
||||||
|
d_vpr_e("%s: Invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
d_vpr_h("%s()\n", __func__);
|
||||||
|
|
||||||
|
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-iris2")) {
|
||||||
|
rc = msm_vidc_deinit_iris2(core);
|
||||||
|
} else {
|
||||||
|
d_vpr_e("%s(): unknown vpu\n", __func__);
|
||||||
|
rc = -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc)
|
||||||
|
d_vpr_e("%s: failed with %d\n", __func__, rc);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int msm_vidc_init_vpu(struct msm_vidc_core *core, struct device *dev)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
if (!core || !dev) {
|
||||||
|
d_vpr_e("%s: Invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
d_vpr_h("%s()\n", __func__);
|
||||||
|
|
||||||
|
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-iris2")) {
|
||||||
|
rc = msm_vidc_init_iris2(core);
|
||||||
|
} else {
|
||||||
|
d_vpr_e("%s(): unknown vpu\n", __func__);
|
||||||
|
rc = -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc)
|
||||||
|
d_vpr_e("%s: failed with %d\n", __func__, rc);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
int msm_vidc_deinit_platform(struct platform_device *pdev)
|
int msm_vidc_deinit_platform(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct msm_vidc_core *core;
|
struct msm_vidc_core *core;
|
||||||
@@ -115,11 +209,8 @@ int msm_vidc_deinit_platform(struct platform_device *pdev)
|
|||||||
|
|
||||||
d_vpr_h("%s()\n", __func__);
|
d_vpr_h("%s()\n", __func__);
|
||||||
|
|
||||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-vidc"))
|
msm_vidc_deinit_vpu(core, &pdev->dev);
|
||||||
msm_vidc_deinit_iris2(core);
|
msm_vidc_deinit_platform_variant(core, &pdev->dev);
|
||||||
|
|
||||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-vidc"))
|
|
||||||
msm_vidc_deinit_platform_waipio(core);
|
|
||||||
|
|
||||||
kfree(core->platform);
|
kfree(core->platform);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -157,17 +248,13 @@ int msm_vidc_init_platform(struct platform_device *pdev)
|
|||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-vidc")) { // "qcom,msm-vidc-waipio"
|
rc = msm_vidc_init_platform_variant(core, &pdev->dev);
|
||||||
rc = msm_vidc_init_platform_waipio(core);
|
if (rc)
|
||||||
if (rc)
|
return rc;
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-vidc")) { // "qcom,msm-vidc-iris2"
|
rc = msm_vidc_init_vpu(core, &pdev->dev);
|
||||||
rc = msm_vidc_init_iris2(core);
|
if (rc)
|
||||||
if (rc)
|
return rc;
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user