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

Commit 00648f41 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dt-bindings: gpu: Update properties for bus scaling table"

parents 9622652a 003f9bbe
Loading
Loading
Loading
Loading
+23 −15
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@ Required properties:
				above this powerlevel isense clock is at working frequency.

Bus Scaling Data:
- qcom,gpu-bus-table:		Defines a bus voting table with the below properties. Multiple sets of bus
				voting tables can be defined for given platform based on the type of ddr system.

Properties:
- compatible:			Must be "qcom,gpu-bus-table". Additionally, "qcom,gpu-bus-table-ddr" must also
				be provided, with the ddr type value(integer) appended to the string.
- qcom,msm-bus,name:		String property to describe the name of the 3D graphics processor.
- qcom,msm-bus,num-cases:	This is the the number of Bus Scaling use cases defined in the vectors property.
- qcom,msm-bus,active-only:	A boolean flag indicating if it is active only.
@@ -171,8 +177,7 @@ Optional Properties:
				certain protected registers and also pass to the user as
				a property.
- qcom,l2pc-cpu-mask:
				Disables L2PC on masked CPUs when any of Graphics
				rendering thread is running on masked CPUs.
				Disables L2PC on masked CPUto the string.rendering thread is running on masked CPUs.
				Bit 0 is for CPU-0, bit 1 is for CPU-1...

- qcom,l2pc-update-queue:
@@ -339,6 +344,8 @@ Example of A330 GPU in MSM8916:
				"mem_iface_clk", "alt_mem_iface_clk";

		/* Bus Scale Settings */
		qcom, gpu-bus-table {
			compatible="qcom,gpu-bus-table","qcom,gpu-bus-table-ddr7";
			qcom,msm-bus,name = "grp3d";
			qcom,msm-bus,num-cases = <4>;
			qcom,msm-bus,num-paths = <1>;
@@ -347,6 +354,7 @@ Example of A330 GPU in MSM8916:
				<26 512 0 1600000>,
				<26 512 0 3200000>,
				<26 512 0 4264000>;
		};

		/* GDSC oxili regulators */
		vdd-supply = <&gdsc_oxili_gx>;
+30 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2008-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
 */
#include <linux/module.h>
#include <linux/fb.h>
@@ -26,6 +26,8 @@
#include <linux/ion.h>
#include <asm/cacheflush.h>
#include <uapi/linux/sched/types.h>
#include <linux/of_fdt.h>
#include <linux/msm-bus.h>

#include "kgsl.h"
#include "kgsl_debugfs.h"
@@ -1354,6 +1356,33 @@ static inline void kgsl_mem_entry_unset_pend(struct kgsl_mem_entry *entry)
	spin_unlock(&entry->priv->mem_lock);
}

struct msm_bus_scale_pdata *kgsl_get_bus_scale_table(struct kgsl_device *device)
{
	struct device_node *child = NULL, *parent;
	char str[24];

	parent = device->pdev->dev.of_node;

	snprintf(str, sizeof(str), "qcom,gpu-bus-table-ddr%d",
		of_fdt_get_ddrtype());

	child = of_find_compatible_node(parent, NULL, str);

	/* Go with the first bus table node */
	if (child == NULL)
		child = of_find_compatible_node(parent, NULL,
			"qcom,gpu-bus-table");

	if (child) {
		struct msm_bus_scale_pdata *data = msm_bus_pdata_from_node(
					device->pdev, child);
		of_node_put(child);
		return data;
	}

	return msm_bus_cl_get_pdata(device->pdev);
}

/**
 * kgsl_mem_entry_set_pend() - Set the pending free flag of a memory entry
 * @entry - The memory entry
+16 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2002,2007-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2002,2007-2019, The Linux Foundation. All rights reserved.
 */
#ifndef __KGSL_DEVICE_H
#define __KGSL_DEVICE_H
@@ -914,6 +914,21 @@ void kgsl_snapshot_add_section(struct kgsl_device *device, u16 id,
	size_t (*func)(struct kgsl_device *, u8 *, size_t, void *),
	void *priv);

/**
 * kgsl_get_bus_scale_table() - Get the bus scaling table from devicetree
 * @device: kgsl device handle
 *
 * This function will try to find the correct bus table data from the device
 * tree based on the the underlying ddr type. If no matching child is found,
 * it will fallback to the first child node containing the bus scaling data.
 * If no child is found, it will pass the current device node, hoping that
 * bus scaling data is provided as properties of the current device node.
 *
 * Return: Pointer to the structure containing the parsed bus scaling data
 */
struct msm_bus_scale_pdata *kgsl_get_bus_scale_table(
	struct kgsl_device *device);

/**
 * struct kgsl_pwr_limit - limit structure for each client
 * @node: Local list node for the limits list
+2 −2
Original line number Diff line number Diff line
@@ -1111,9 +1111,9 @@ static int gmu_clocks_probe(struct gmu_device *gmu, struct device_node *node)

static int gmu_gpu_bw_probe(struct kgsl_device *device, struct gmu_device *gmu)
{
	struct msm_bus_scale_pdata *bus_scale_table;
	struct msm_bus_scale_pdata *bus_scale_table =
		kgsl_get_bus_scale_table(device);

	bus_scale_table = msm_bus_cl_get_pdata(device->pdev);
	if (bus_scale_table == NULL) {
		dev_err(&gmu->pdev->dev, "dt: cannot get bus table\n");
		return -ENODEV;
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2010-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/export.h>
@@ -2044,7 +2044,7 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
	struct device_node *gpubw_dev_node = NULL;
	struct platform_device *p2dev;

	bus_scale_table = msm_bus_cl_get_pdata(device->pdev);
	bus_scale_table = kgsl_get_bus_scale_table(device);
	if (bus_scale_table == NULL)
		return -EINVAL;