diff options
author | Dave Airlie <airlied@redhat.com> | 2017-01-22 18:13:45 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-01-22 18:13:45 -0500 |
commit | b310348530c44bcfe98ea29c97274562853b4583 (patch) | |
tree | 683616cb88f965e99f1ad0f7217cde8e1e722f6f | |
parent | 78337c0697e669554c28b8b48c644bbaad0ffc5e (diff) | |
parent | de85d2b35ac74f6be769573d4a8708c823219900 (diff) |
Merge branch 'msm-fixes-4.10-rc4' of git://people.freedesktop.org/~robclark/linux into drm-fixes
* 'msm-fixes-4.10-rc4' of git://people.freedesktop.org/~robclark/linux:
drm/msm: fix potential null ptr issue in non-iommu case
drm/msm/mdp5: rip out plane->pending tracking
-rw-r--r-- | drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem.c | 2 |
5 files changed, 4 insertions, 35 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index 14ff87686a36..686a580c711a 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c | |||
@@ -345,7 +345,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, | |||
345 | { | 345 | { |
346 | struct adreno_platform_config *config = pdev->dev.platform_data; | 346 | struct adreno_platform_config *config = pdev->dev.platform_data; |
347 | struct msm_gpu *gpu = &adreno_gpu->base; | 347 | struct msm_gpu *gpu = &adreno_gpu->base; |
348 | struct msm_mmu *mmu; | ||
349 | int ret; | 348 | int ret; |
350 | 349 | ||
351 | adreno_gpu->funcs = funcs; | 350 | adreno_gpu->funcs = funcs; |
@@ -385,8 +384,8 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, | |||
385 | return ret; | 384 | return ret; |
386 | } | 385 | } |
387 | 386 | ||
388 | mmu = gpu->aspace->mmu; | 387 | if (gpu->aspace && gpu->aspace->mmu) { |
389 | if (mmu) { | 388 | struct msm_mmu *mmu = gpu->aspace->mmu; |
390 | ret = mmu->funcs->attach(mmu, iommu_ports, | 389 | ret = mmu->funcs->attach(mmu, iommu_ports, |
391 | ARRAY_SIZE(iommu_ports)); | 390 | ARRAY_SIZE(iommu_ports)); |
392 | if (ret) | 391 | if (ret) |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c index 5f6cd8745dbc..c396d459a9d0 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | |||
@@ -119,13 +119,7 @@ static void mdp5_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *st | |||
119 | 119 | ||
120 | static void mdp5_complete_commit(struct msm_kms *kms, struct drm_atomic_state *state) | 120 | static void mdp5_complete_commit(struct msm_kms *kms, struct drm_atomic_state *state) |
121 | { | 121 | { |
122 | int i; | ||
123 | struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); | 122 | struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); |
124 | struct drm_plane *plane; | ||
125 | struct drm_plane_state *plane_state; | ||
126 | |||
127 | for_each_plane_in_state(state, plane, plane_state, i) | ||
128 | mdp5_plane_complete_commit(plane, plane_state); | ||
129 | 123 | ||
130 | if (mdp5_kms->smp) | 124 | if (mdp5_kms->smp) |
131 | mdp5_smp_complete_commit(mdp5_kms->smp, &mdp5_kms->state->smp); | 125 | mdp5_smp_complete_commit(mdp5_kms->smp, &mdp5_kms->state->smp); |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h index 17b0cc101171..cdfc63d90c7b 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h | |||
@@ -104,8 +104,6 @@ struct mdp5_plane_state { | |||
104 | 104 | ||
105 | /* assigned by crtc blender */ | 105 | /* assigned by crtc blender */ |
106 | enum mdp_mixer_stage_id stage; | 106 | enum mdp_mixer_stage_id stage; |
107 | |||
108 | bool pending : 1; | ||
109 | }; | 107 | }; |
110 | #define to_mdp5_plane_state(x) \ | 108 | #define to_mdp5_plane_state(x) \ |
111 | container_of(x, struct mdp5_plane_state, base) | 109 | container_of(x, struct mdp5_plane_state, base) |
@@ -232,8 +230,6 @@ int mdp5_irq_domain_init(struct mdp5_kms *mdp5_kms); | |||
232 | void mdp5_irq_domain_fini(struct mdp5_kms *mdp5_kms); | 230 | void mdp5_irq_domain_fini(struct mdp5_kms *mdp5_kms); |
233 | 231 | ||
234 | uint32_t mdp5_plane_get_flush(struct drm_plane *plane); | 232 | uint32_t mdp5_plane_get_flush(struct drm_plane *plane); |
235 | void mdp5_plane_complete_commit(struct drm_plane *plane, | ||
236 | struct drm_plane_state *state); | ||
237 | enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane); | 233 | enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane); |
238 | struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary); | 234 | struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary); |
239 | 235 | ||
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index c099da7bc212..25d9d0a97156 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | |||
@@ -179,7 +179,6 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, | |||
179 | drm_printf(p, "\tzpos=%u\n", pstate->zpos); | 179 | drm_printf(p, "\tzpos=%u\n", pstate->zpos); |
180 | drm_printf(p, "\talpha=%u\n", pstate->alpha); | 180 | drm_printf(p, "\talpha=%u\n", pstate->alpha); |
181 | drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); | 181 | drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); |
182 | drm_printf(p, "\tpending=%u\n", pstate->pending); | ||
183 | } | 182 | } |
184 | 183 | ||
185 | static void mdp5_plane_reset(struct drm_plane *plane) | 184 | static void mdp5_plane_reset(struct drm_plane *plane) |
@@ -220,8 +219,6 @@ mdp5_plane_duplicate_state(struct drm_plane *plane) | |||
220 | if (mdp5_state && mdp5_state->base.fb) | 219 | if (mdp5_state && mdp5_state->base.fb) |
221 | drm_framebuffer_reference(mdp5_state->base.fb); | 220 | drm_framebuffer_reference(mdp5_state->base.fb); |
222 | 221 | ||
223 | mdp5_state->pending = false; | ||
224 | |||
225 | return &mdp5_state->base; | 222 | return &mdp5_state->base; |
226 | } | 223 | } |
227 | 224 | ||
@@ -288,13 +285,6 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, | |||
288 | DBG("%s: check (%d -> %d)", plane->name, | 285 | DBG("%s: check (%d -> %d)", plane->name, |
289 | plane_enabled(old_state), plane_enabled(state)); | 286 | plane_enabled(old_state), plane_enabled(state)); |
290 | 287 | ||
291 | /* We don't allow faster-than-vblank updates.. if we did add this | ||
292 | * some day, we would need to disallow in cases where hwpipe | ||
293 | * changes | ||
294 | */ | ||
295 | if (WARN_ON(to_mdp5_plane_state(old_state)->pending)) | ||
296 | return -EBUSY; | ||
297 | |||
298 | max_width = config->hw->lm.max_width << 16; | 288 | max_width = config->hw->lm.max_width << 16; |
299 | max_height = config->hw->lm.max_height << 16; | 289 | max_height = config->hw->lm.max_height << 16; |
300 | 290 | ||
@@ -370,12 +360,9 @@ static void mdp5_plane_atomic_update(struct drm_plane *plane, | |||
370 | struct drm_plane_state *old_state) | 360 | struct drm_plane_state *old_state) |
371 | { | 361 | { |
372 | struct drm_plane_state *state = plane->state; | 362 | struct drm_plane_state *state = plane->state; |
373 | struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); | ||
374 | 363 | ||
375 | DBG("%s: update", plane->name); | 364 | DBG("%s: update", plane->name); |
376 | 365 | ||
377 | mdp5_state->pending = true; | ||
378 | |||
379 | if (plane_enabled(state)) { | 366 | if (plane_enabled(state)) { |
380 | int ret; | 367 | int ret; |
381 | 368 | ||
@@ -851,15 +838,6 @@ uint32_t mdp5_plane_get_flush(struct drm_plane *plane) | |||
851 | return pstate->hwpipe->flush_mask; | 838 | return pstate->hwpipe->flush_mask; |
852 | } | 839 | } |
853 | 840 | ||
854 | /* called after vsync in thread context */ | ||
855 | void mdp5_plane_complete_commit(struct drm_plane *plane, | ||
856 | struct drm_plane_state *state) | ||
857 | { | ||
858 | struct mdp5_plane_state *pstate = to_mdp5_plane_state(plane->state); | ||
859 | |||
860 | pstate->pending = false; | ||
861 | } | ||
862 | |||
863 | /* initialize plane */ | 841 | /* initialize plane */ |
864 | struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary) | 842 | struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary) |
865 | { | 843 | { |
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index d8bc59c7e261..8098677a3916 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c | |||
@@ -294,6 +294,8 @@ put_iova(struct drm_gem_object *obj) | |||
294 | WARN_ON(!mutex_is_locked(&dev->struct_mutex)); | 294 | WARN_ON(!mutex_is_locked(&dev->struct_mutex)); |
295 | 295 | ||
296 | for (id = 0; id < ARRAY_SIZE(msm_obj->domain); id++) { | 296 | for (id = 0; id < ARRAY_SIZE(msm_obj->domain); id++) { |
297 | if (!priv->aspace[id]) | ||
298 | continue; | ||
297 | msm_gem_unmap_vma(priv->aspace[id], | 299 | msm_gem_unmap_vma(priv->aspace[id], |
298 | &msm_obj->domain[id], msm_obj->sgt); | 300 | &msm_obj->domain[id], msm_obj->sgt); |
299 | } | 301 | } |