Skip to content

Commit 59e7a8c

Browse files
committed
Merge tag 'drm-msm-next-2020-03-22' of https://gitlab.freedesktop.org/drm/msm into drm-next
A bit smaller this time around.. there are still a couple uabi additions for vulkan waiting in the wings, but I punted on them this cycle due to running low on time. (They should be easy enough to rebase, and if it is a problem for anyone I can push a next+uabi branch so that tu work can proceed.) The bigger change is refactoring dpu resource manager and moving dpu to use atomic global state. Other than that, it is mostly cleanups and fixes. From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ <CAF6AEGuf1R4Xz-t9Z7_cwx9jD=b4wUvvwfqA5cHR8fCSXSd5XQ@mail.gmail.com Signed-off-by: Dave Airlie <[email protected]>
2 parents 5fc0df9 + a5fb8b9 commit 59e7a8c

File tree

24 files changed

+724
-751
lines changed

24 files changed

+724
-751
lines changed

Documentation/devicetree/bindings/display/msm/gmu.txt

Lines changed: 0 additions & 116 deletions
This file was deleted.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
# Copyright 2019-2020, The Linux Foundation, All Rights Reserved
3+
%YAML 1.2
4+
---
5+
6+
$id: "http://devicetree.org/schemas/display/msm/gmu.yaml#"
7+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
8+
9+
title: Devicetree bindings for the GMU attached to certain Adreno GPUs
10+
11+
maintainers:
12+
- Rob Clark <[email protected]>
13+
14+
description: |
15+
These bindings describe the Graphics Management Unit (GMU) that is attached
16+
to members of the Adreno A6xx GPU family. The GMU provides on-device power
17+
management and support to improve power efficiency and reduce the load on
18+
the CPU.
19+
20+
properties:
21+
compatible:
22+
items:
23+
- enum:
24+
- qcom,adreno-gmu-630.2
25+
- const: qcom,adreno-gmu
26+
27+
reg:
28+
items:
29+
- description: Core GMU registers
30+
- description: GMU PDC registers
31+
- description: GMU PDC sequence registers
32+
33+
reg-names:
34+
items:
35+
- const: gmu
36+
- const: gmu_pdc
37+
- const: gmu_pdc_seq
38+
39+
clocks:
40+
items:
41+
- description: GMU clock
42+
- description: GPU CX clock
43+
- description: GPU AXI clock
44+
- description: GPU MEMNOC clock
45+
46+
clock-names:
47+
items:
48+
- const: gmu
49+
- const: cxo
50+
- const: axi
51+
- const: memnoc
52+
53+
interrupts:
54+
items:
55+
- description: GMU HFI interrupt
56+
- description: GMU interrupt
57+
58+
59+
interrupt-names:
60+
items:
61+
- const: hfi
62+
- const: gmu
63+
64+
power-domains:
65+
items:
66+
- description: CX power domain
67+
- description: GX power domain
68+
69+
power-domain-names:
70+
items:
71+
- const: cx
72+
- const: gx
73+
74+
iommus:
75+
maxItems: 1
76+
77+
operating-points-v2: true
78+
79+
required:
80+
- compatible
81+
- reg
82+
- reg-names
83+
- clocks
84+
- clock-names
85+
- interrupts
86+
- interrupt-names
87+
- power-domains
88+
- power-domain-names
89+
- iommus
90+
- operating-points-v2
91+
92+
examples:
93+
- |
94+
#include <dt-bindings/clock/qcom,gpucc-sdm845.h>
95+
#include <dt-bindings/clock/qcom,gcc-sdm845.h>
96+
#include <dt-bindings/interrupt-controller/irq.h>
97+
#include <dt-bindings/interrupt-controller/arm-gic.h>
98+
99+
gmu: gmu@506a000 {
100+
compatible="qcom,adreno-gmu-630.2", "qcom,adreno-gmu";
101+
102+
reg = <0x506a000 0x30000>,
103+
<0xb280000 0x10000>,
104+
<0xb480000 0x10000>;
105+
reg-names = "gmu", "gmu_pdc", "gmu_pdc_seq";
106+
107+
clocks = <&gpucc GPU_CC_CX_GMU_CLK>,
108+
<&gpucc GPU_CC_CXO_CLK>,
109+
<&gcc GCC_DDRSS_GPU_AXI_CLK>,
110+
<&gcc GCC_GPU_MEMNOC_GFX_CLK>;
111+
clock-names = "gmu", "cxo", "axi", "memnoc";
112+
113+
interrupts = <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
114+
<GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>;
115+
interrupt-names = "hfi", "gmu";
116+
117+
power-domains = <&gpucc GPU_CX_GDSC>,
118+
<&gpucc GPU_GX_GDSC>;
119+
power-domain-names = "cx", "gx";
120+
121+
iommus = <&adreno_smmu 5>;
122+
operating-points-v2 = <&gmu_opp_table>;
123+
};

Documentation/devicetree/bindings/display/msm/gpu.txt

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,54 @@ Required properties:
3535
bring the GPU out of secure mode.
3636
- firmware-name: optional property of the 'zap-shader' node, listing the
3737
relative path of the device specific zap firmware.
38+
- sram: phandle to the On Chip Memory (OCMEM) that's present on some a3xx and
39+
a4xx Snapdragon SoCs. See
40+
Documentation/devicetree/bindings/sram/qcom,ocmem.yaml.
3841

39-
Example 3xx/4xx/a5xx:
42+
Example 3xx/4xx:
4043

4144
/ {
4245
...
4346

44-
gpu: qcom,kgsl-3d0@4300000 {
45-
compatible = "qcom,adreno-320.2", "qcom,adreno";
46-
reg = <0x04300000 0x20000>;
47+
gpu: adreno@fdb00000 {
48+
compatible = "qcom,adreno-330.2",
49+
"qcom,adreno";
50+
reg = <0xfdb00000 0x10000>;
4751
reg-names = "kgsl_3d0_reg_memory";
48-
interrupts = <GIC_SPI 80 0>;
49-
clock-names =
50-
"core",
51-
"iface",
52-
"mem_iface";
53-
clocks =
54-
<&mmcc GFX3D_CLK>,
55-
<&mmcc GFX3D_AHB_CLK>,
56-
<&mmcc MMSS_IMEM_AHB_CLK>;
52+
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
53+
interrupt-names = "kgsl_3d0_irq";
54+
clock-names = "core",
55+
"iface",
56+
"mem_iface";
57+
clocks = <&mmcc OXILI_GFX3D_CLK>,
58+
<&mmcc OXILICX_AHB_CLK>,
59+
<&mmcc OXILICX_AXI_CLK>;
60+
sram = <&gpu_sram>;
61+
power-domains = <&mmcc OXILICX_GDSC>;
62+
operating-points-v2 = <&gpu_opp_table>;
63+
iommus = <&gpu_iommu 0>;
64+
};
65+
66+
gpu_sram: ocmem@fdd00000 {
67+
compatible = "qcom,msm8974-ocmem";
68+
69+
reg = <0xfdd00000 0x2000>,
70+
<0xfec00000 0x180000>;
71+
reg-names = "ctrl",
72+
"mem";
73+
74+
clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
75+
<&mmcc OCMEMCX_OCMEMNOC_CLK>;
76+
clock-names = "core",
77+
"iface";
78+
79+
#address-cells = <1>;
80+
#size-cells = <1>;
81+
82+
gpu_sram: gpu-sram@0 {
83+
reg = <0x0 0x100000>;
84+
ranges = <0 0 0xfec00000 0x100000>;
85+
};
5786
};
5887
};
5988

drivers/gpu/drm/msm/adreno/a5xx_gpu.c

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,18 +1446,31 @@ static const struct adreno_gpu_funcs funcs = {
14461446
static void check_speed_bin(struct device *dev)
14471447
{
14481448
struct nvmem_cell *cell;
1449-
u32 bin, val;
1449+
u32 val;
1450+
1451+
/*
1452+
* If the OPP table specifies a opp-supported-hw property then we have
1453+
* to set something with dev_pm_opp_set_supported_hw() or the table
1454+
* doesn't get populated so pick an arbitrary value that should
1455+
* ensure the default frequencies are selected but not conflict with any
1456+
* actual bins
1457+
*/
1458+
val = 0x80;
14501459

14511460
cell = nvmem_cell_get(dev, "speed_bin");
14521461

1453-
/* If a nvmem cell isn't defined, nothing to do */
1454-
if (IS_ERR(cell))
1455-
return;
1462+
if (!IS_ERR(cell)) {
1463+
void *buf = nvmem_cell_read(cell, NULL);
1464+
1465+
if (!IS_ERR(buf)) {
1466+
u8 bin = *((u8 *) buf);
14561467

1457-
bin = *((u32 *) nvmem_cell_read(cell, NULL));
1458-
nvmem_cell_put(cell);
1468+
val = (1 << bin);
1469+
kfree(buf);
1470+
}
14591471

1460-
val = (1 << bin);
1472+
nvmem_cell_put(cell);
1473+
}
14611474

14621475
dev_pm_opp_set_supported_hw(dev, &val, 1);
14631476
}

0 commit comments

Comments
 (0)