Skip to content

Commit 9a767fa

Browse files
committed
Merge tag 'drm-msm-fixes-2023-07-27' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
Fixes for v6.5-rc4 Display: + Fix to correct the UBWC programming for decoder version 4.3 seen on SM8550 + Add the missing flush and fetch bits for DMA4 and DMA5 SSPPs. + Fix to drop the unused dpu_core_perf_data_bus_id enum from the code + Drop the unused dsi_phy_14nm_17mA_regulators from QCM 2290 DSI cfg. GPU: + Fix warn splat for newer devices without revn + Remove name/revn for a690.. we shouldn't be populating these for newer devices, for consistency, but it slipped through review + Fix a6xx gpu snapshot BINDLESS_DATA size (was listed in bytes instead of dwords, causing AHB faults on a6xx gen4/a660-family) + Disallow submit with fence id 0 Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGs9MwCSfiyv8i7yWAsJKYEzCDyzaTx=ujX80Y23rZd9RA@mail.gmail.com
2 parents 0dd9c51 + 1b5d0dd commit 9a767fa

File tree

10 files changed

+54
-28
lines changed

10 files changed

+54
-28
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit
8989
* since we've already mapped it once in
9090
* submit_reloc()
9191
*/
92-
if (WARN_ON(!ptr))
92+
if (WARN_ON(IS_ERR_OR_NULL(ptr)))
9393
return;
9494

9595
for (i = 0; i < dwords; i++) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static const struct a6xx_shader_block {
206206
SHADER(A6XX_SP_LB_3_DATA, 0x800),
207207
SHADER(A6XX_SP_LB_4_DATA, 0x800),
208208
SHADER(A6XX_SP_LB_5_DATA, 0x200),
209-
SHADER(A6XX_SP_CB_BINDLESS_DATA, 0x2000),
209+
SHADER(A6XX_SP_CB_BINDLESS_DATA, 0x800),
210210
SHADER(A6XX_SP_CB_LEGACY_DATA, 0x280),
211211
SHADER(A6XX_SP_UAV_DATA, 0x80),
212212
SHADER(A6XX_SP_INST_TAG, 0x80),

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ static const struct adreno_info gpulist[] = {
369369
.hwcg = a640_hwcg,
370370
}, {
371371
.rev = ADRENO_REV(6, 9, 0, ANY_ID),
372-
.revn = 690,
373-
.name = "A690",
374372
.fw = {
375373
[ADRENO_FW_SQE] = "a660_sqe.fw",
376374
[ADRENO_FW_GMU] = "a690_gmu.bin",

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ bool adreno_cmp_rev(struct adreno_rev rev1, struct adreno_rev rev2);
149149

150150
static inline bool adreno_is_revn(const struct adreno_gpu *gpu, uint32_t revn)
151151
{
152-
WARN_ON_ONCE(!gpu->revn);
152+
/* revn can be zero, but if not is set at same time as info */
153+
WARN_ON_ONCE(!gpu->info);
153154

154155
return gpu->revn == revn;
155156
}
@@ -161,14 +162,16 @@ static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu)
161162

162163
static inline bool adreno_is_a2xx(const struct adreno_gpu *gpu)
163164
{
164-
WARN_ON_ONCE(!gpu->revn);
165+
/* revn can be zero, but if not is set at same time as info */
166+
WARN_ON_ONCE(!gpu->info);
165167

166168
return (gpu->revn < 300);
167169
}
168170

169171
static inline bool adreno_is_a20x(const struct adreno_gpu *gpu)
170172
{
171-
WARN_ON_ONCE(!gpu->revn);
173+
/* revn can be zero, but if not is set at same time as info */
174+
WARN_ON_ONCE(!gpu->info);
172175

173176
return (gpu->revn < 210);
174177
}
@@ -307,7 +310,8 @@ static inline int adreno_is_a680(const struct adreno_gpu *gpu)
307310

308311
static inline int adreno_is_a690(const struct adreno_gpu *gpu)
309312
{
310-
return adreno_is_revn(gpu, 690);
313+
/* The order of args is important here to handle ANY_ID correctly */
314+
return adreno_cmp_rev(ADRENO_REV(6, 9, 0, ANY_ID), gpu->rev);
311315
};
312316

313317
/* check for a615, a616, a618, a619 or any derivatives */

drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@
1414

1515
#define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000
1616

17-
/**
18-
* enum dpu_core_perf_data_bus_id - data bus identifier
19-
* @DPU_CORE_PERF_DATA_BUS_ID_MNOC: DPU/MNOC data bus
20-
* @DPU_CORE_PERF_DATA_BUS_ID_LLCC: MNOC/LLCC data bus
21-
* @DPU_CORE_PERF_DATA_BUS_ID_EBI: LLCC/EBI data bus
22-
*/
23-
enum dpu_core_perf_data_bus_id {
24-
DPU_CORE_PERF_DATA_BUS_ID_MNOC,
25-
DPU_CORE_PERF_DATA_BUS_ID_LLCC,
26-
DPU_CORE_PERF_DATA_BUS_ID_EBI,
27-
DPU_CORE_PERF_DATA_BUS_ID_MAX,
28-
};
29-
3017
/**
3118
* struct dpu_core_perf_params - definition of performance parameters
3219
* @max_per_pipe_ib: maximum instantaneous bandwidth request

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
static const u32 fetch_tbl[SSPP_MAX] = {CTL_INVALID_BIT, 16, 17, 18, 19,
5353
CTL_INVALID_BIT, CTL_INVALID_BIT, CTL_INVALID_BIT, CTL_INVALID_BIT, 0,
54-
1, 2, 3, CTL_INVALID_BIT, CTL_INVALID_BIT};
54+
1, 2, 3, 4, 5};
5555

5656
static int _mixer_stages(const struct dpu_lm_cfg *mixer, int count,
5757
enum dpu_lm lm)
@@ -198,6 +198,12 @@ static void dpu_hw_ctl_update_pending_flush_sspp(struct dpu_hw_ctl *ctx,
198198
case SSPP_DMA3:
199199
ctx->pending_flush_mask |= BIT(25);
200200
break;
201+
case SSPP_DMA4:
202+
ctx->pending_flush_mask |= BIT(13);
203+
break;
204+
case SSPP_DMA5:
205+
ctx->pending_flush_mask |= BIT(14);
206+
break;
201207
case SSPP_CURSOR0:
202208
ctx->pending_flush_mask |= BIT(22);
203209
break;

drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,8 +1087,6 @@ const struct msm_dsi_phy_cfg dsi_phy_14nm_8953_cfgs = {
10871087

10881088
const struct msm_dsi_phy_cfg dsi_phy_14nm_2290_cfgs = {
10891089
.has_phy_lane = true,
1090-
.regulator_data = dsi_phy_14nm_17mA_regulators,
1091-
.num_regulators = ARRAY_SIZE(dsi_phy_14nm_17mA_regulators),
10921090
.ops = {
10931091
.enable = dsi_14nm_phy_enable,
10941092
.disable = dsi_14nm_phy_disable,

drivers/gpu/drm/msm/msm_fence.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ msm_fence_init(struct dma_fence *fence, struct msm_fence_context *fctx)
191191

192192
f->fctx = fctx;
193193

194+
/*
195+
* Until this point, the fence was just some pre-allocated memory,
196+
* no-one should have taken a reference to it yet.
197+
*/
198+
WARN_ON(kref_read(&fence->refcount));
199+
194200
dma_fence_init(&f->base, &msm_fence_ops, &fctx->spinlock,
195201
fctx->context, ++fctx->last_fence);
196202
}

drivers/gpu/drm/msm/msm_gem_submit.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,19 @@ void __msm_gem_submit_destroy(struct kref *kref)
8686
}
8787

8888
dma_fence_put(submit->user_fence);
89-
dma_fence_put(submit->hw_fence);
89+
90+
/*
91+
* If the submit is freed before msm_job_run(), then hw_fence is
92+
* just some pre-allocated memory, not a reference counted fence.
93+
* Once the job runs and the hw_fence is initialized, it will
94+
* have a refcount of at least one, since the submit holds a ref
95+
* to the hw_fence.
96+
*/
97+
if (kref_read(&submit->hw_fence->refcount) == 0) {
98+
kfree(submit->hw_fence);
99+
} else {
100+
dma_fence_put(submit->hw_fence);
101+
}
90102

91103
put_pid(submit->pid);
92104
msm_submitqueue_put(submit->queue);
@@ -889,7 +901,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
889901
* after the job is armed
890902
*/
891903
if ((args->flags & MSM_SUBMIT_FENCE_SN_IN) &&
892-
idr_find(&queue->fence_idr, args->fence)) {
904+
(!args->fence || idr_find(&queue->fence_idr, args->fence))) {
893905
spin_unlock(&queue->idr_lock);
894906
idr_preload_end();
895907
ret = -EINVAL;

drivers/gpu/drm/msm/msm_mdss.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)
189189
#define UBWC_2_0 0x20000000
190190
#define UBWC_3_0 0x30000000
191191
#define UBWC_4_0 0x40000000
192+
#define UBWC_4_3 0x40030000
192193

193194
static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss)
194195
{
@@ -227,7 +228,10 @@ static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss)
227228
writel_relaxed(1, msm_mdss->mmio + UBWC_CTRL_2);
228229
writel_relaxed(0, msm_mdss->mmio + UBWC_PREDICTION_MODE);
229230
} else {
230-
writel_relaxed(2, msm_mdss->mmio + UBWC_CTRL_2);
231+
if (data->ubwc_dec_version == UBWC_4_3)
232+
writel_relaxed(3, msm_mdss->mmio + UBWC_CTRL_2);
233+
else
234+
writel_relaxed(2, msm_mdss->mmio + UBWC_CTRL_2);
231235
writel_relaxed(1, msm_mdss->mmio + UBWC_PREDICTION_MODE);
232236
}
233237
}
@@ -271,6 +275,7 @@ static int msm_mdss_enable(struct msm_mdss *msm_mdss)
271275
msm_mdss_setup_ubwc_dec_30(msm_mdss);
272276
break;
273277
case UBWC_4_0:
278+
case UBWC_4_3:
274279
msm_mdss_setup_ubwc_dec_40(msm_mdss);
275280
break;
276281
default:
@@ -569,6 +574,16 @@ static const struct msm_mdss_data sm8250_data = {
569574
.macrotile_mode = 1,
570575
};
571576

577+
static const struct msm_mdss_data sm8550_data = {
578+
.ubwc_version = UBWC_4_0,
579+
.ubwc_dec_version = UBWC_4_3,
580+
.ubwc_swizzle = 6,
581+
.ubwc_static = 1,
582+
/* TODO: highest_bank_bit = 2 for LP_DDR4 */
583+
.highest_bank_bit = 3,
584+
.macrotile_mode = 1,
585+
};
586+
572587
static const struct of_device_id mdss_dt_match[] = {
573588
{ .compatible = "qcom,mdss" },
574589
{ .compatible = "qcom,msm8998-mdss" },
@@ -585,7 +600,7 @@ static const struct of_device_id mdss_dt_match[] = {
585600
{ .compatible = "qcom,sm8250-mdss", .data = &sm8250_data },
586601
{ .compatible = "qcom,sm8350-mdss", .data = &sm8250_data },
587602
{ .compatible = "qcom,sm8450-mdss", .data = &sm8250_data },
588-
{ .compatible = "qcom,sm8550-mdss", .data = &sm8250_data },
603+
{ .compatible = "qcom,sm8550-mdss", .data = &sm8550_data },
589604
{}
590605
};
591606
MODULE_DEVICE_TABLE(of, mdss_dt_match);

0 commit comments

Comments
 (0)