Skip to content

Commit af04e65

Browse files
committed
Merge tag 'drm-msm-next-2024-09-02' of https://gitlab.freedesktop.org/drm/msm into drm-next
Updates for v6.12 DPU: - Fix implement DP/PHY mapping on SC8180X - Enable writeback on SM8150, SC8180X, SM6125, SM6350 DP: - Enable widebus on all relevant chipsets DSI: - Fix PHY programming on SM8350 / SM8450 HDMI: - Add support for HDMI on MSM8998 MDP5: - NULL string fix GPU: - A642L speedbin support - A615 support - A306 support - A621 support - Expand UBWC uapi - A7xx GPU devcoredump fixes - A5xx preemption fixes - cleanups Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGudK7YMiKDhtvYgp=bY64OZZt0UQSkEkSxLo4rLmeVd9g@mail.gmail.com
2 parents 88a29f8 + 1530257 commit af04e65

37 files changed

+2527
-130
lines changed

Documentation/devicetree/bindings/display/msm/hdmi.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ properties:
1919
- qcom,hdmi-tx-8974
2020
- qcom,hdmi-tx-8994
2121
- qcom,hdmi-tx-8996
22+
- qcom,hdmi-tx-8998
2223

2324
clocks:
2425
minItems: 1
25-
maxItems: 5
26+
maxItems: 8
2627

2728
clock-names:
2829
minItems: 1
29-
maxItems: 5
30+
maxItems: 8
3031

3132
reg:
3233
minItems: 1
@@ -142,6 +143,7 @@ allOf:
142143
properties:
143144
clocks:
144145
minItems: 5
146+
maxItems: 5
145147
clock-names:
146148
items:
147149
- const: mdp_core
@@ -151,6 +153,28 @@ allOf:
151153
- const: extp
152154
hdmi-mux-supplies: false
153155

156+
- if:
157+
properties:
158+
compatible:
159+
contains:
160+
enum:
161+
- qcom,hdmi-tx-8998
162+
then:
163+
properties:
164+
clocks:
165+
minItems: 8
166+
maxItems: 8
167+
clock-names:
168+
items:
169+
- const: mdp_core
170+
- const: iface
171+
- const: core
172+
- const: alt_iface
173+
- const: extp
174+
- const: bus
175+
- const: mnoc
176+
- const: iface_mmss
177+
154178
additionalProperties: false
155179

156180
examples:

Documentation/devicetree/bindings/phy/qcom,hdmi-phy-qmp.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ properties:
1414
compatible:
1515
enum:
1616
- qcom,hdmi-phy-8996
17+
- qcom,hdmi-phy-8998
1718

1819
reg:
1920
maxItems: 6

drivers/gpu/drm/msm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ msm-display-$(CONFIG_DRM_MSM_HDMI) += \
3737
hdmi/hdmi_phy.o \
3838
hdmi/hdmi_phy_8960.o \
3939
hdmi/hdmi_phy_8996.o \
40+
hdmi/hdmi_phy_8998.o \
4041
hdmi/hdmi_phy_8x60.o \
4142
hdmi/hdmi_phy_8x74.o \
4243
hdmi/hdmi_pll_8960.o \

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ static const struct adreno_info a3xx_gpus[] = {
4141
.gmem = SZ_128K,
4242
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
4343
.init = a3xx_gpu_init,
44+
}, {
45+
.chip_ids = ADRENO_CHIP_IDS(0x03000620),
46+
.family = ADRENO_3XX,
47+
.revn = 308,
48+
.fw = {
49+
[ADRENO_FW_PM4] = "a300_pm4.fw",
50+
[ADRENO_FW_PFP] = "a300_pfp.fw",
51+
},
52+
.gmem = SZ_128K,
53+
.inactive_period = DRM_MSM_INACTIVE_PERIOD,
54+
.init = a3xx_gpu_init,
4455
}, {
4556
.chip_ids = ADRENO_CHIP_IDS(
4657
0x03020000,

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
145145
gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003);
146146
gpu_write(gpu, REG_A3XX_VBIF_OUT_RD_LIM_CONF0, 0x0000000a);
147147
gpu_write(gpu, REG_A3XX_VBIF_OUT_WR_LIM_CONF0, 0x0000000a);
148+
} else if (adreno_is_a306a(adreno_gpu)) {
149+
gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003);
150+
gpu_write(gpu, REG_A3XX_VBIF_OUT_RD_LIM_CONF0, 0x00000010);
151+
gpu_write(gpu, REG_A3XX_VBIF_OUT_WR_LIM_CONF0, 0x00000010);
148152
} else if (adreno_is_a320(adreno_gpu)) {
149153
/* Set up 16 deep read/write request queues: */
150154
gpu_write(gpu, REG_A3XX_VBIF_IN_RD_LIM_CONF0, 0x10101010);
@@ -237,7 +241,9 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
237241
gpu_write(gpu, REG_A3XX_UCHE_CACHE_MODE_CONTROL_REG, 0x00000001);
238242

239243
/* Enable Clock gating: */
240-
if (adreno_is_a305b(adreno_gpu) || adreno_is_a306(adreno_gpu))
244+
if (adreno_is_a305b(adreno_gpu) ||
245+
adreno_is_a306(adreno_gpu) ||
246+
adreno_is_a306a(adreno_gpu))
241247
gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xaaaaaaaa);
242248
else if (adreno_is_a320(adreno_gpu))
243249
gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xbfffffff);
@@ -334,8 +340,10 @@ static int a3xx_hw_init(struct msm_gpu *gpu)
334340
gpu_write(gpu, REG_A3XX_CP_PFP_UCODE_DATA, ptr[i]);
335341

336342
/* CP ROQ queue sizes (bytes) - RB:16, ST:16, IB1:32, IB2:64 */
337-
if (adreno_is_a305(adreno_gpu) || adreno_is_a306(adreno_gpu) ||
338-
adreno_is_a320(adreno_gpu)) {
343+
if (adreno_is_a305(adreno_gpu) ||
344+
adreno_is_a306(adreno_gpu) ||
345+
adreno_is_a306a(adreno_gpu) ||
346+
adreno_is_a320(adreno_gpu)) {
339347
gpu_write(gpu, REG_AXXX_CP_QUEUE_THRESHOLDS,
340348
AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB1_START(2) |
341349
AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB2_START(6) |

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ void a5xx_flush(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
6565

6666
static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit)
6767
{
68+
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
69+
struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);
6870
struct msm_ringbuffer *ring = submit->ring;
6971
struct drm_gem_object *obj;
7072
uint32_t *ptr, dwords;
@@ -109,6 +111,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit
109111
}
110112
}
111113

114+
a5xx_gpu->last_seqno[ring->id] = submit->seqno;
112115
a5xx_flush(gpu, ring, true);
113116
a5xx_preempt_trigger(gpu);
114117

@@ -150,9 +153,13 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
150153
OUT_PKT7(ring, CP_SET_PROTECTED_MODE, 1);
151154
OUT_RING(ring, 1);
152155

153-
/* Enable local preemption for finegrain preemption */
156+
/*
157+
* Disable local preemption by default because it requires
158+
* user-space to be aware of it and provide additional handling
159+
* to restore rendering state or do various flushes on switch.
160+
*/
154161
OUT_PKT7(ring, CP_PREEMPT_ENABLE_LOCAL, 1);
155-
OUT_RING(ring, 0x1);
162+
OUT_RING(ring, 0x0);
156163

157164
/* Allow CP_CONTEXT_SWITCH_YIELD packets in the IB2 */
158165
OUT_PKT7(ring, CP_YIELD_ENABLE, 1);
@@ -206,6 +213,7 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
206213
/* Write the fence to the scratch register */
207214
OUT_PKT4(ring, REG_A5XX_CP_SCRATCH_REG(2), 1);
208215
OUT_RING(ring, submit->seqno);
216+
a5xx_gpu->last_seqno[ring->id] = submit->seqno;
209217

210218
/*
211219
* Execute a CACHE_FLUSH_TS event. This will ensure that the
@@ -1793,5 +1801,9 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
17931801
else
17941802
adreno_gpu->ubwc_config.highest_bank_bit = 14;
17951803

1804+
/* a5xx only supports UBWC 1.0, these are not configurable */
1805+
adreno_gpu->ubwc_config.macrotile_mode = 0;
1806+
adreno_gpu->ubwc_config.ubwc_swizzle = 0x7;
1807+
17961808
return gpu;
17971809
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ struct a5xx_gpu {
3434
struct drm_gem_object *preempt_counters_bo[MSM_GPU_MAX_RINGS];
3535
struct a5xx_preempt_record *preempt[MSM_GPU_MAX_RINGS];
3636
uint64_t preempt_iova[MSM_GPU_MAX_RINGS];
37+
uint32_t last_seqno[MSM_GPU_MAX_RINGS];
3738

3839
atomic_t preempt_state;
40+
spinlock_t preempt_start_lock;
3941
struct timer_list preempt_timer;
4042

4143
struct drm_gem_object *shadow_bo;

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

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ static inline void update_wptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
5555
/* Return the highest priority ringbuffer with something in it */
5656
static struct msm_ringbuffer *get_next_ring(struct msm_gpu *gpu)
5757
{
58+
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
59+
struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);
5860
unsigned long flags;
5961
int i;
6062

@@ -64,6 +66,8 @@ static struct msm_ringbuffer *get_next_ring(struct msm_gpu *gpu)
6466

6567
spin_lock_irqsave(&ring->preempt_lock, flags);
6668
empty = (get_wptr(ring) == gpu->funcs->get_rptr(gpu, ring));
69+
if (!empty && ring == a5xx_gpu->cur_ring)
70+
empty = ring->memptrs->fence == a5xx_gpu->last_seqno[i];
6771
spin_unlock_irqrestore(&ring->preempt_lock, flags);
6872

6973
if (!empty)
@@ -97,12 +101,19 @@ void a5xx_preempt_trigger(struct msm_gpu *gpu)
97101
if (gpu->nr_rings == 1)
98102
return;
99103

104+
/*
105+
* Serialize preemption start to ensure that we always make
106+
* decision on latest state. Otherwise we can get stuck in
107+
* lower priority or empty ring.
108+
*/
109+
spin_lock_irqsave(&a5xx_gpu->preempt_start_lock, flags);
110+
100111
/*
101112
* Try to start preemption by moving from NONE to START. If
102113
* unsuccessful, a preemption is already in flight
103114
*/
104115
if (!try_preempt_state(a5xx_gpu, PREEMPT_NONE, PREEMPT_START))
105-
return;
116+
goto out;
106117

107118
/* Get the next ring to preempt to */
108119
ring = get_next_ring(gpu);
@@ -127,9 +138,11 @@ void a5xx_preempt_trigger(struct msm_gpu *gpu)
127138
set_preempt_state(a5xx_gpu, PREEMPT_ABORT);
128139
update_wptr(gpu, a5xx_gpu->cur_ring);
129140
set_preempt_state(a5xx_gpu, PREEMPT_NONE);
130-
return;
141+
goto out;
131142
}
132143

144+
spin_unlock_irqrestore(&a5xx_gpu->preempt_start_lock, flags);
145+
133146
/* Make sure the wptr doesn't update while we're in motion */
134147
spin_lock_irqsave(&ring->preempt_lock, flags);
135148
a5xx_gpu->preempt[ring->id]->wptr = get_wptr(ring);
@@ -152,6 +165,10 @@ void a5xx_preempt_trigger(struct msm_gpu *gpu)
152165

153166
/* And actually start the preemption */
154167
gpu_write(gpu, REG_A5XX_CP_CONTEXT_SWITCH_CNTL, 1);
168+
return;
169+
170+
out:
171+
spin_unlock_irqrestore(&a5xx_gpu->preempt_start_lock, flags);
155172
}
156173

157174
void a5xx_preempt_irq(struct msm_gpu *gpu)
@@ -188,6 +205,12 @@ void a5xx_preempt_irq(struct msm_gpu *gpu)
188205
update_wptr(gpu, a5xx_gpu->cur_ring);
189206

190207
set_preempt_state(a5xx_gpu, PREEMPT_NONE);
208+
209+
/*
210+
* Try to trigger preemption again in case there was a submit or
211+
* retire during ring switch
212+
*/
213+
a5xx_preempt_trigger(gpu);
191214
}
192215

193216
void a5xx_preempt_hw_init(struct msm_gpu *gpu)
@@ -204,6 +227,8 @@ void a5xx_preempt_hw_init(struct msm_gpu *gpu)
204227
return;
205228

206229
for (i = 0; i < gpu->nr_rings; i++) {
230+
a5xx_gpu->preempt[i]->data = 0;
231+
a5xx_gpu->preempt[i]->info = 0;
207232
a5xx_gpu->preempt[i]->wptr = 0;
208233
a5xx_gpu->preempt[i]->rptr = 0;
209234
a5xx_gpu->preempt[i]->rbase = gpu->rb[i]->iova;
@@ -298,5 +323,6 @@ void a5xx_preempt_init(struct msm_gpu *gpu)
298323
}
299324
}
300325

326+
spin_lock_init(&a5xx_gpu->preempt_start_lock);
301327
timer_setup(&a5xx_gpu->preempt_timer, a5xx_preempt_timer, 0);
302328
}

0 commit comments

Comments
 (0)