Skip to content

Commit b325b5e

Browse files
committed
Merge tag 'drm-msm-fixes-2020-06-25' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
A few fixes, mostly fallout from the address space refactor and dpu color processing. Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ <CAF6AEGv0SSXArdYs=mOLqJPJdkvk8CpxaJGecqgbOGazQ2n5og@mail.gmail.com
2 parents 9ebcfad + 30480e6 commit b325b5e

File tree

9 files changed

+21
-15
lines changed

9 files changed

+21
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ a2xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev)
408408
struct msm_gem_address_space *aspace;
409409

410410
aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
411-
SZ_16M + 0xfff * SZ_64K);
411+
0xfff * SZ_64K);
412412

413413
if (IS_ERR(aspace) && !IS_ERR(mmu))
414414
mmu->funcs->destroy(mmu);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu)
11211121
return -ENODEV;
11221122

11231123
mmu = msm_iommu_new(gmu->dev, domain);
1124-
gmu->aspace = msm_gem_address_space_create(mmu, "gmu", 0x0, 0x7fffffff);
1124+
gmu->aspace = msm_gem_address_space_create(mmu, "gmu", 0x0, 0x80000000);
11251125
if (IS_ERR(gmu->aspace)) {
11261126
iommu_domain_free(domain);
11271127
return PTR_ERR(gmu->aspace);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,8 @@ static const struct adreno_gpu_funcs funcs = {
893893
#if defined(CONFIG_DRM_MSM_GPU_STATE)
894894
.gpu_state_get = a6xx_gpu_state_get,
895895
.gpu_state_put = a6xx_gpu_state_put,
896-
.create_address_space = adreno_iommu_create_address_space,
897896
#endif
897+
.create_address_space = adreno_iommu_create_address_space,
898898
},
899899
.get_timestamp = a6xx_get_timestamp,
900900
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu,
194194
struct msm_gem_address_space *aspace;
195195

196196
aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
197-
0xfffffff);
197+
0xffffffff - SZ_16M);
198198

199199
if (IS_ERR(aspace) && !IS_ERR(mmu))
200200
mmu->funcs->destroy(mmu);

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ static struct msm_display_topology dpu_encoder_get_topology(
521521
struct dpu_kms *dpu_kms,
522522
struct drm_display_mode *mode)
523523
{
524-
struct msm_display_topology topology;
524+
struct msm_display_topology topology = {0};
525525
int i, intf_count = 0;
526526

527527
for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++)
@@ -537,7 +537,8 @@ static struct msm_display_topology dpu_encoder_get_topology(
537537
* 1 LM, 1 INTF
538538
* 2 LM, 1 INTF (stream merge to support high resolution interfaces)
539539
*
540-
* Adding color blocks only to primary interface
540+
* Adding color blocks only to primary interface if available in
541+
* sufficient number
541542
*/
542543
if (intf_count == 2)
543544
topology.num_lm = 2;
@@ -546,8 +547,11 @@ static struct msm_display_topology dpu_encoder_get_topology(
546547
else
547548
topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
548549

549-
if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI)
550-
topology.num_dspp = topology.num_lm;
550+
if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) {
551+
if (dpu_kms->catalog->dspp &&
552+
(dpu_kms->catalog->dspp_count >= topology.num_lm))
553+
topology.num_dspp = topology.num_lm;
554+
}
551555

552556
topology.num_enc = 0;
553557
topology.num_intf = intf_count;
@@ -2136,7 +2140,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
21362140

21372141
dpu_enc = to_dpu_encoder_virt(enc);
21382142

2139-
mutex_init(&dpu_enc->enc_lock);
21402143
ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
21412144
if (ret)
21422145
goto fail;
@@ -2151,7 +2154,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
21512154
0);
21522155

21532156

2154-
mutex_init(&dpu_enc->rc_lock);
21552157
INIT_DELAYED_WORK(&dpu_enc->delayed_off_work,
21562158
dpu_encoder_off_work);
21572159
dpu_enc->idle_timeout = IDLE_TIMEOUT;
@@ -2183,7 +2185,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
21832185

21842186
dpu_enc = devm_kzalloc(dev->dev, sizeof(*dpu_enc), GFP_KERNEL);
21852187
if (!dpu_enc)
2186-
return ERR_PTR(ENOMEM);
2188+
return ERR_PTR(-ENOMEM);
21872189

21882190
rc = drm_encoder_init(dev, &dpu_enc->base, &dpu_encoder_funcs,
21892191
drm_enc_mode, NULL);
@@ -2196,6 +2198,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
21962198

21972199
spin_lock_init(&dpu_enc->enc_spinlock);
21982200
dpu_enc->enabled = false;
2201+
mutex_init(&dpu_enc->enc_lock);
2202+
mutex_init(&dpu_enc->rc_lock);
21992203

22002204
return &dpu_enc->base;
22012205
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ static int _dpu_kms_mmu_init(struct dpu_kms *dpu_kms)
780780

781781
mmu = msm_iommu_new(dpu_kms->dev->dev, domain);
782782
aspace = msm_gem_address_space_create(mmu, "dpu1",
783-
0x1000, 0xfffffff);
783+
0x1000, 0x100000000 - 0x1000);
784784

785785
if (IS_ERR(aspace)) {
786786
mmu->funcs->destroy(mmu);

drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
514514
config->iommu);
515515

516516
aspace = msm_gem_address_space_create(mmu,
517-
"mdp4", 0x1000, 0xffffffff);
517+
"mdp4", 0x1000, 0x100000000 - 0x1000);
518518

519519
if (IS_ERR(aspace)) {
520520
if (!IS_ERR(mmu))

drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
633633
mmu = msm_iommu_new(iommu_dev, config->platform.iommu);
634634

635635
aspace = msm_gem_address_space_create(mmu, "mdp5",
636-
0x1000, 0xffffffff);
636+
0x1000, 0x100000000 - 0x1000);
637637

638638
if (IS_ERR(aspace)) {
639639
if (!IS_ERR(mmu))

drivers/gpu/drm/msm/msm_submitqueue.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx,
7171
queue->flags = flags;
7272

7373
if (priv->gpu) {
74-
if (prio >= priv->gpu->nr_rings)
74+
if (prio >= priv->gpu->nr_rings) {
75+
kfree(queue);
7576
return -EINVAL;
77+
}
7678

7779
queue->prio = prio;
7880
}

0 commit comments

Comments
 (0)