Commit b325b5ed authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
From: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ <CAF6AEGv0SSXArdYs=mOLqJPJdkvk8CpxaJGecqgbOGazQ2n5og@mail.gmail.com
parents 9ebcfadb 30480e6e
...@@ -408,7 +408,7 @@ a2xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev) ...@@ -408,7 +408,7 @@ a2xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev)
struct msm_gem_address_space *aspace; struct msm_gem_address_space *aspace;
aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M, aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
SZ_16M + 0xfff * SZ_64K); 0xfff * SZ_64K);
if (IS_ERR(aspace) && !IS_ERR(mmu)) if (IS_ERR(aspace) && !IS_ERR(mmu))
mmu->funcs->destroy(mmu); mmu->funcs->destroy(mmu);
......
...@@ -1121,7 +1121,7 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu) ...@@ -1121,7 +1121,7 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu)
return -ENODEV; return -ENODEV;
mmu = msm_iommu_new(gmu->dev, domain); mmu = msm_iommu_new(gmu->dev, domain);
gmu->aspace = msm_gem_address_space_create(mmu, "gmu", 0x0, 0x7fffffff); gmu->aspace = msm_gem_address_space_create(mmu, "gmu", 0x0, 0x80000000);
if (IS_ERR(gmu->aspace)) { if (IS_ERR(gmu->aspace)) {
iommu_domain_free(domain); iommu_domain_free(domain);
return PTR_ERR(gmu->aspace); return PTR_ERR(gmu->aspace);
......
...@@ -893,8 +893,8 @@ static const struct adreno_gpu_funcs funcs = { ...@@ -893,8 +893,8 @@ static const struct adreno_gpu_funcs funcs = {
#if defined(CONFIG_DRM_MSM_GPU_STATE) #if defined(CONFIG_DRM_MSM_GPU_STATE)
.gpu_state_get = a6xx_gpu_state_get, .gpu_state_get = a6xx_gpu_state_get,
.gpu_state_put = a6xx_gpu_state_put, .gpu_state_put = a6xx_gpu_state_put,
.create_address_space = adreno_iommu_create_address_space,
#endif #endif
.create_address_space = adreno_iommu_create_address_space,
}, },
.get_timestamp = a6xx_get_timestamp, .get_timestamp = a6xx_get_timestamp,
}; };
......
...@@ -194,7 +194,7 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, ...@@ -194,7 +194,7 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu,
struct msm_gem_address_space *aspace; struct msm_gem_address_space *aspace;
aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M, aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
0xfffffff); 0xffffffff - SZ_16M);
if (IS_ERR(aspace) && !IS_ERR(mmu)) if (IS_ERR(aspace) && !IS_ERR(mmu))
mmu->funcs->destroy(mmu); mmu->funcs->destroy(mmu);
......
...@@ -521,7 +521,7 @@ static struct msm_display_topology dpu_encoder_get_topology( ...@@ -521,7 +521,7 @@ static struct msm_display_topology dpu_encoder_get_topology(
struct dpu_kms *dpu_kms, struct dpu_kms *dpu_kms,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct msm_display_topology topology; struct msm_display_topology topology = {0};
int i, intf_count = 0; int i, intf_count = 0;
for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++) for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++)
...@@ -537,7 +537,8 @@ static struct msm_display_topology dpu_encoder_get_topology( ...@@ -537,7 +537,8 @@ static struct msm_display_topology dpu_encoder_get_topology(
* 1 LM, 1 INTF * 1 LM, 1 INTF
* 2 LM, 1 INTF (stream merge to support high resolution interfaces) * 2 LM, 1 INTF (stream merge to support high resolution interfaces)
* *
* Adding color blocks only to primary interface * Adding color blocks only to primary interface if available in
* sufficient number
*/ */
if (intf_count == 2) if (intf_count == 2)
topology.num_lm = 2; topology.num_lm = 2;
...@@ -546,8 +547,11 @@ static struct msm_display_topology dpu_encoder_get_topology( ...@@ -546,8 +547,11 @@ static struct msm_display_topology dpu_encoder_get_topology(
else else
topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1; topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) {
topology.num_dspp = topology.num_lm; if (dpu_kms->catalog->dspp &&
(dpu_kms->catalog->dspp_count >= topology.num_lm))
topology.num_dspp = topology.num_lm;
}
topology.num_enc = 0; topology.num_enc = 0;
topology.num_intf = intf_count; topology.num_intf = intf_count;
...@@ -2136,7 +2140,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, ...@@ -2136,7 +2140,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
dpu_enc = to_dpu_encoder_virt(enc); dpu_enc = to_dpu_encoder_virt(enc);
mutex_init(&dpu_enc->enc_lock);
ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info); ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
if (ret) if (ret)
goto fail; goto fail;
...@@ -2151,7 +2154,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, ...@@ -2151,7 +2154,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
0); 0);
mutex_init(&dpu_enc->rc_lock);
INIT_DELAYED_WORK(&dpu_enc->delayed_off_work, INIT_DELAYED_WORK(&dpu_enc->delayed_off_work,
dpu_encoder_off_work); dpu_encoder_off_work);
dpu_enc->idle_timeout = IDLE_TIMEOUT; dpu_enc->idle_timeout = IDLE_TIMEOUT;
...@@ -2183,7 +2185,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, ...@@ -2183,7 +2185,7 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
dpu_enc = devm_kzalloc(dev->dev, sizeof(*dpu_enc), GFP_KERNEL); dpu_enc = devm_kzalloc(dev->dev, sizeof(*dpu_enc), GFP_KERNEL);
if (!dpu_enc) if (!dpu_enc)
return ERR_PTR(ENOMEM); return ERR_PTR(-ENOMEM);
rc = drm_encoder_init(dev, &dpu_enc->base, &dpu_encoder_funcs, rc = drm_encoder_init(dev, &dpu_enc->base, &dpu_encoder_funcs,
drm_enc_mode, NULL); drm_enc_mode, NULL);
...@@ -2196,6 +2198,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, ...@@ -2196,6 +2198,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
spin_lock_init(&dpu_enc->enc_spinlock); spin_lock_init(&dpu_enc->enc_spinlock);
dpu_enc->enabled = false; dpu_enc->enabled = false;
mutex_init(&dpu_enc->enc_lock);
mutex_init(&dpu_enc->rc_lock);
return &dpu_enc->base; return &dpu_enc->base;
} }
......
...@@ -780,7 +780,7 @@ static int _dpu_kms_mmu_init(struct dpu_kms *dpu_kms) ...@@ -780,7 +780,7 @@ static int _dpu_kms_mmu_init(struct dpu_kms *dpu_kms)
mmu = msm_iommu_new(dpu_kms->dev->dev, domain); mmu = msm_iommu_new(dpu_kms->dev->dev, domain);
aspace = msm_gem_address_space_create(mmu, "dpu1", aspace = msm_gem_address_space_create(mmu, "dpu1",
0x1000, 0xfffffff); 0x1000, 0x100000000 - 0x1000);
if (IS_ERR(aspace)) { if (IS_ERR(aspace)) {
mmu->funcs->destroy(mmu); mmu->funcs->destroy(mmu);
......
...@@ -514,7 +514,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev) ...@@ -514,7 +514,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
config->iommu); config->iommu);
aspace = msm_gem_address_space_create(mmu, aspace = msm_gem_address_space_create(mmu,
"mdp4", 0x1000, 0xffffffff); "mdp4", 0x1000, 0x100000000 - 0x1000);
if (IS_ERR(aspace)) { if (IS_ERR(aspace)) {
if (!IS_ERR(mmu)) if (!IS_ERR(mmu))
......
...@@ -633,7 +633,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev) ...@@ -633,7 +633,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
mmu = msm_iommu_new(iommu_dev, config->platform.iommu); mmu = msm_iommu_new(iommu_dev, config->platform.iommu);
aspace = msm_gem_address_space_create(mmu, "mdp5", aspace = msm_gem_address_space_create(mmu, "mdp5",
0x1000, 0xffffffff); 0x1000, 0x100000000 - 0x1000);
if (IS_ERR(aspace)) { if (IS_ERR(aspace)) {
if (!IS_ERR(mmu)) if (!IS_ERR(mmu))
......
...@@ -71,8 +71,10 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx, ...@@ -71,8 +71,10 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx,
queue->flags = flags; queue->flags = flags;
if (priv->gpu) { if (priv->gpu) {
if (prio >= priv->gpu->nr_rings) if (prio >= priv->gpu->nr_rings) {
kfree(queue);
return -EINVAL; return -EINVAL;
}
queue->prio = prio; queue->prio = prio;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment