diff options
5 files changed, 47 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/media/video/msm-vidc.txt b/Documentation/devicetree/bindings/media/video/msm-vidc.txt index c26e9fb456e3..c8271c8473dd 100644 --- a/Documentation/devicetree/bindings/media/video/msm-vidc.txt +++ b/Documentation/devicetree/bindings/media/video/msm-vidc.txt @@ -50,6 +50,8 @@ Optional properties: supports hevc decoder = 0x0c000000 supports hevc_hybrid encoder = 0x10000000 supports hevc_hybrid decoder = 0x30000000 +- disable-dcvs-enc : flag to disable DCVS algorithm for encoders +- disable-dcvs-dec : flag to disable DCVS algorithm for decoders - qcom,dcvs-tbl : specifies the parameter to configure DCVS algorithm. Video instance load (in mbs/sec) and corresponding low and high threshold DCVS load for supported codec formats. diff --git a/arch/arm/boot/dts/qcom/apq8096-auto-dragonboard.dtsi b/arch/arm/boot/dts/qcom/apq8096-auto-dragonboard.dtsi index f484eea9f01a..d925cd092fde 100644 --- a/arch/arm/boot/dts/qcom/apq8096-auto-dragonboard.dtsi +++ b/arch/arm/boot/dts/qcom/apq8096-auto-dragonboard.dtsi @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -27,6 +27,11 @@ }; }; +&msm_vidc { + disable-dcvs-enc; + disable-dcvs-dec; +}; + &ufs_ice { status = "ok"; }; diff --git a/arch/arm/boot/dts/qcom/msm8996-agave-adp.dtsi b/arch/arm/boot/dts/qcom/msm8996-agave-adp.dtsi index 560b7a81f1f0..db5851cbff38 100644 --- a/arch/arm/boot/dts/qcom/msm8996-agave-adp.dtsi +++ b/arch/arm/boot/dts/qcom/msm8996-agave-adp.dtsi @@ -28,6 +28,11 @@ }; }; +&msm_vidc { + disable-dcvs-enc; + disable-dcvs-dec; +}; + &ufs_ice { status = "ok"; }; diff --git a/arch/arm/boot/dts/qcom/msm8996-auto-cdp.dtsi b/arch/arm/boot/dts/qcom/msm8996-auto-cdp.dtsi index 0a334c4b6aa4..ded0a5f167ec 100644 --- a/arch/arm/boot/dts/qcom/msm8996-auto-cdp.dtsi +++ b/arch/arm/boot/dts/qcom/msm8996-auto-cdp.dtsi @@ -28,6 +28,11 @@ }; }; +&msm_vidc { + disable-dcvs-enc; + disable-dcvs-dec; +}; + &ufs_ice { status = "ok"; }; diff --git a/drivers/media/platform/msm/vidc/msm_vidc_res_parse.c b/drivers/media/platform/msm/vidc/msm_vidc_res_parse.c index 59783dc87e5b..925914bc7a6d 100644 --- a/drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +++ b/drivers/media/platform/msm/vidc/msm_vidc_res_parse.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -575,6 +575,28 @@ static int msm_vidc_load_freq_table(struct msm_vidc_platform_resources *res) return rc; } +static int msm_vidc_check_dcvs_enabled(struct msm_vidc_platform_resources *res) +{ + struct platform_device *pdev = res->pdev; + + if (of_find_property(pdev->dev.of_node, "disable-dcvs-enc", NULL)) { + /* + * disable-dcvs-enc is an optional property. + */ + dprintk(VIDC_DBG, "disable-dcvs-enc\n"); + msm_vidc_enc_dcvs_mode = false; + } + if (of_find_property(pdev->dev.of_node, "disable-dcvs-dec", NULL)) { + /* + * disable-dcvs-dec is an optional property. + */ + dprintk(VIDC_DBG, "disable-dcvs-dec\n"); + msm_vidc_dec_dcvs_mode = false; + } + + return 0; +} + static int msm_vidc_load_dcvs_table(struct msm_vidc_platform_resources *res) { int rc = 0; @@ -1023,6 +1045,12 @@ int read_platform_resources_from_dt( goto err_load_freq_table; } + rc = msm_vidc_check_dcvs_enabled(res); + if (rc) { + dprintk(VIDC_ERR, "Failed to check dcvs flags: %d\n", rc); + goto err_load_freq_table; + } + rc = msm_vidc_load_dcvs_table(res); if (rc) dprintk(VIDC_WARN, "Failed to load dcvs table: %d\n", rc); |
