Skip to content

Commit fa0f4d0

Browse files
committed
Merge branch 'msm-fixes' into msm-next
Back-merge msm-fixes to resolve conflicts. Signed-off-by: Rob Clark <[email protected]>
2 parents d93cf45 + 1b5d0dd commit fa0f4d0

File tree

8 files changed

+37
-12
lines changed

8 files changed

+37
-12
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_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/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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,6 @@ static const struct msm_mdss_data sm8550_data = {
603603
.highest_bank_bit = 3,
604604
.macrotile_mode = 1,
605605
};
606-
607606
static const struct of_device_id mdss_dt_match[] = {
608607
{ .compatible = "qcom,mdss" },
609608
{ .compatible = "qcom,msm8998-mdss", .data = &msm8998_data },

0 commit comments

Comments
 (0)