Skip to content

Commit 07ba285

Browse files
lumaggouravk-qualcomm
authored andcommitted
FROMLIST: media: qcom: venus: flip the venus/iris switch
With the Iris and Venus driver having more or less feature parity for HFI 6xx platforms and with Iris gaining support for SC7280, flip the switch. Use Iris by default for SM8250 and SC7280, the platforms which are supported by both drivers, and use Venus only if Iris is not compiled at all. Use IS_ENABLED to strip out the code and data structures which are used by the disabled platforms. Link: https://lore.kernel.org/all/20260327-venus-iris-flip-switch-v5-4-2f4b6c636927@oss.qualcomm.com/ Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
1 parent 13e73cf commit 07ba285

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

drivers/media/platform/qcom/iris/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ qcom-iris-objs += iris_buffer.o \
1010
iris_hfi_gen2_packet.o \
1111
iris_hfi_gen2_response.o \
1212
iris_hfi_queue.o \
13+
iris_platform_gen1.o \
1314
iris_platform_gen2.o \
1415
iris_power.o \
1516
iris_probe.o \
@@ -25,8 +26,4 @@ qcom-iris-objs += iris_buffer.o \
2526
iris_vpu_buffer.o \
2627
iris_vpu_common.o \
2728

28-
ifeq ($(CONFIG_VIDEO_QCOM_VENUS),)
29-
qcom-iris-objs += iris_platform_gen1.o
30-
endif
31-
3229
obj-$(CONFIG_VIDEO_QCOM_IRIS) += qcom-iris.o

drivers/media/platform/qcom/iris/iris_probe.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ static const struct of_device_id iris_dt_match[] = {
356356
.compatible = "qcom,qcs8300-iris",
357357
.data = &qcs8300_data,
358358
},
359-
#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_VENUS))
360359
{
361360
.compatible = "qcom,sc7280-venus",
362361
.data = &sc7280_data,
@@ -365,7 +364,6 @@ static const struct of_device_id iris_dt_match[] = {
365364
.compatible = "qcom,sm8250-venus",
366365
.data = &sm8250_data,
367366
},
368-
#endif
369367
{
370368
.compatible = "qcom,sm8550-iris",
371369
.data = &sm8550_data,

drivers/media/platform/qcom/venus/core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,7 @@ static const struct venus_resources sc7180_res = {
949949
.enc_nodename = "video-encoder",
950950
};
951951

952+
#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))
952953
static const struct freq_tbl sm8250_freq_table[] = {
953954
{ 0, 444000000 },
954955
{ 0, 366000000 },
@@ -1069,6 +1070,7 @@ static const struct venus_resources sc7280_res = {
10691070
.dec_nodename = "video-decoder",
10701071
.enc_nodename = "video-encoder",
10711072
};
1073+
#endif
10721074

10731075
static const struct bw_tbl qcm2290_bw_table_dec[] = {
10741076
{ 352800, 597000, 0, 746000, 0 }, /* 1080p@30 + 720p@30 */
@@ -1125,11 +1127,15 @@ static const struct of_device_id venus_dt_match[] = {
11251127
{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
11261128
{ .compatible = "qcom,qcm2290-venus", .data = &qcm2290_res, },
11271129
{ .compatible = "qcom,sc7180-venus", .data = &sc7180_res, },
1130+
#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))
11281131
{ .compatible = "qcom,sc7280-venus", .data = &sc7280_res, },
1132+
#endif
11291133
{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
11301134
{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
11311135
{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
1136+
#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))
11321137
{ .compatible = "qcom,sm8250-venus", .data = &sm8250_res, },
1138+
#endif
11331139
{ }
11341140
};
11351141
MODULE_DEVICE_TABLE(of, venus_dt_match);

drivers/media/platform/qcom/venus/core.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ enum vpu_version {
5454
VPU_VERSION_AR50,
5555
VPU_VERSION_AR50_LITE,
5656
VPU_VERSION_IRIS1,
57+
#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))
5758
VPU_VERSION_IRIS2,
5859
VPU_VERSION_IRIS2_1,
60+
#endif
5961
};
6062

6163
struct firmware_version {
@@ -525,13 +527,22 @@ struct venus_inst {
525527
#define IS_V1(core) ((core)->res->hfi_version == HFI_VERSION_1XX)
526528
#define IS_V3(core) ((core)->res->hfi_version == HFI_VERSION_3XX)
527529
#define IS_V4(core) ((core)->res->hfi_version == HFI_VERSION_4XX)
530+
#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))
528531
#define IS_V6(core) ((core)->res->hfi_version == HFI_VERSION_6XX)
532+
#else
533+
#define IS_V6(core) (0)
534+
#endif
529535

530536
#define IS_AR50(core) ((core)->res->vpu_version == VPU_VERSION_AR50)
531537
#define IS_AR50_LITE(core) ((core)->res->vpu_version == VPU_VERSION_AR50_LITE)
532538
#define IS_IRIS1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS1)
539+
#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))
533540
#define IS_IRIS2(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2)
534541
#define IS_IRIS2_1(core) ((core)->res->vpu_version == VPU_VERSION_IRIS2_1)
542+
#else
543+
#define IS_IRIS2(core) (0)
544+
#define IS_IRIS2_1(core) (0)
545+
#endif
535546

536547
static inline bool is_lite(struct venus_core *core)
537548
{

0 commit comments

Comments
 (0)