Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7aa04bc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Disable DCVS in DTSI"

parents 184af681 5ac9e067
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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.
+6 −1
Original line number Diff line number Diff line
/* 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";
};
+5 −0
Original line number Diff line number Diff line
@@ -28,6 +28,11 @@
	};
};

&msm_vidc {
	disable-dcvs-enc;
	disable-dcvs-dec;
};

&ufs_ice {
	status = "ok";
};
+5 −0
Original line number Diff line number Diff line
@@ -28,6 +28,11 @@
	};
};

&msm_vidc {
	disable-dcvs-enc;
	disable-dcvs-dec;
};

&ufs_ice {
	status = "ok";
};
+29 −1
Original line number Diff line number Diff line
/* 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);