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

Commit a9a8ec4c 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: parse 10-bit bus entries for msmfalcon"

parents baccd737 12f1d93f
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -183,6 +183,9 @@ Optional properties:
- qcom,bus-rage-kbps : an array of two items (<min max>) that indicate the
  minimum and maximum acceptable votes for the bus.
  In the absence of this property <0 INT_MAX> is used.
- qcom,ubwc-10bit : UBWC 10 bit content has different bus requirements,
  this tag will be used to pick the appropriate bus as per the session profile
  as shown below in example.

Example:

@@ -270,4 +273,17 @@ Example:
			qcom,bus-governor = "msm-vidc-ddr";
			qcom,bus-range-kbps = <1000 3388000>;
		};
		qcom,profile-dec-ubwc-10bit {
			qcom,codec-mask = <0xffffffff>;
			qcom,ubwc-10bit;
			qcom,load-busfreq-tbl =
				<979200 2446336>,  /* UHD30D     */
				<864000 2108416>,  /* 720p240D   */
				<489600 1207296>,  /* 1080p60D   */
				<432000 1058816>,  /* 720p120D   */
				<244800 616448>,   /* 1080p30D   */
				<216000 534528>,   /* 720p60D    */
				<108000 271360>,   /* 720p30D    */
				<0 0>;
		};
	};
+12 −4
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ enum bus_profile {
	VIDC_BUS_PROFILE_NORMAL			= BIT(0),
	VIDC_BUS_PROFILE_LOW			= BIT(1),
	VIDC_BUS_PROFILE_UBWC			= BIT(2),
	VIDC_BUS_PROFILE_UBWC_10_BIT		= BIT(3),
};

struct bus_profile_entry {
@@ -53,7 +54,7 @@ static int __get_bus_freq(struct msm_vidc_bus_table_gov *gov,
	load = NUM_MBS_PER_SEC(data->width, data->height, data->fps);
	sess_type = VIDC_VOTE_DATA_SESSION_VAL(data->codec, data->domain);

	/* check if ubwc bus profile is present */
	/* check if appropriate bus profile is present */
	for (i = 0; i < gov->count; i++) {
		entry = &gov->bus_prof_entries[i];
		if (!entry->bus_table || !entry->bus_table_size)
@@ -119,18 +120,23 @@ static int msm_vidc_table_get_target_freq(struct devfreq *dev,
		}

		profile = VIDC_BUS_PROFILE_NORMAL;
		if (data->color_formats[0] == HAL_COLOR_FORMAT_NV12_TP10_UBWC ||
			data->color_formats[0] == HAL_COLOR_FORMAT_NV12_UBWC)
		if (data->color_formats[0] == HAL_COLOR_FORMAT_NV12_UBWC)
			profile = VIDC_BUS_PROFILE_UBWC;
		else if (data->color_formats[0] ==
					HAL_COLOR_FORMAT_NV12_TP10_UBWC)
			profile = VIDC_BUS_PROFILE_UBWC_10_BIT;

		freq = __get_bus_freq(gov, data, profile);
		/*
		 * chose frequency from normal profile
		 * if specific profile frequency was not found.
		 */
		if (!freq)
		if (!freq) {
			dprintk(VIDC_WARN,
				"appropriate bus table not found, voting with Normal Profile\n");
			freq = __get_bus_freq(gov, data,
				VIDC_BUS_PROFILE_NORMAL);
		}

		*frequency += (unsigned long)freq;

@@ -260,6 +266,8 @@ static int msm_vidc_load_bus_table(struct platform_device *pdev,
			entry->profile = VIDC_BUS_PROFILE_LOW;
		else if (of_find_property(child_node, "qcom,ubwc-mode", NULL))
			entry->profile = VIDC_BUS_PROFILE_UBWC;
		else if (of_find_property(child_node, "qcom,ubwc-10bit", NULL))
			entry->profile = VIDC_BUS_PROFILE_UBWC_10_BIT;
		else
			entry->profile = VIDC_BUS_PROFILE_NORMAL;