OSDN Git Service

msm: vidc: Disable DCVS in DTSI
authorSuprith Malligere Shankaregowda <supgow@codeaurora.org>
Wed, 20 Mar 2019 06:41:48 +0000 (12:11 +0530)
committerSuprith Malligere Shankaregowda <supgow@codeaurora.org>
Tue, 26 Mar 2019 18:58:18 +0000 (00:28 +0530)
DCVS is not required for automotive and it is causing significant
frame drops for some clips. Hence disable it for automotive, adding
an entry in DTSI so that this can be made platform-specific.

Change-Id: I02e7ec16c7024bbc82cae93aa3e27ca8a46bb503
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
Documentation/devicetree/bindings/media/video/msm-vidc.txt
arch/arm/boot/dts/qcom/apq8096-auto-dragonboard.dtsi
arch/arm/boot/dts/qcom/msm8996-agave-adp.dtsi
arch/arm/boot/dts/qcom/msm8996-auto-cdp.dtsi
drivers/media/platform/msm/vidc/msm_vidc_res_parse.c

index c26e9fb..c8271c8 100644 (file)
@@ -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.
index f484eea..d925cd0 100644 (file)
@@ -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
        };
 };
 
+&msm_vidc {
+       disable-dcvs-enc;
+       disable-dcvs-dec;
+};
+
 &ufs_ice {
        status = "ok";
 };
index 560b7a8..db5851c 100644 (file)
        };
 };
 
+&msm_vidc {
+       disable-dcvs-enc;
+       disable-dcvs-dec;
+};
+
 &ufs_ice {
        status = "ok";
 };
index 0a334c4..ded0a5f 100644 (file)
        };
 };
 
+&msm_vidc {
+       disable-dcvs-enc;
+       disable-dcvs-dec;
+};
+
 &ufs_ice {
        status = "ok";
 };
index 59783dc..925914b 100644 (file)
@@ -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);