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

Commit c035ae81 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian Committed by Praneeth Paladugu
Browse files

msm: vidc: limit only OCMEM vote to lowest vector



Previously the driver was preventing any bus vote from going down to 0
as part of vote_buses().  This was to prevent the ocmem core from
accidentally resetting.  Since this is a ocmem specific issue, we can
allow DDR votes to go to 0, which affords us some minor power saving.

CRs-Fixed: 713172
Change-Id: I63396710236cb5dc4f983801eda25ab92e97ac1a
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent d5fc7ff6
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -935,13 +935,18 @@ static int venus_hfi_vote_buses(void *dev, struct vidc_bus_vote_data *data,
			continue;
		}

		/* Annoying little hack here: if the bus vector is 0, it
		 * actually means "unvote".  However if the client is calling
		 * vote_bus, it's probably not very nice to unvote the buses.
		 * So pick up the lowest bandwidth table and use that instead.
		 * If client wants to unvote, it'll call venus_hfi_unvote\
		 * _buses */
		bus_vector = venus_hfi_get_bus_vector(device, bus, load) ?: 1;
		bus_vector = venus_hfi_get_bus_vector(device, bus, load);
		/*
		 * Annoying little hack here: if the bus vector for ocmem is 0,
		 * we end up unvoting for ocmem bandwidth. This ends up
		 * resetting the ocmem core on some targets, due to some ocmem
		 * clock being tied to the virtual ocmem noc clk. As a result,
		 * just lower our ocmem vote to the lowest level.
		*/
		if (strnstr(bus->pdata->name, "ocmem",
					strlen(bus->pdata->name)))
			bus_vector = bus_vector ?: 1;

		rc = msm_bus_scale_client_update_request(bus->priv, bus_vector);
		if (rc) {
			dprintk(VIDC_ERR, "Failed voting for bus %s @ %d: %d\n",