aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-22 08:36:53 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-22 08:39:14 -0400
commitf8ddadc4db6c7b7029b6d0e0d9af24f74ad27ca2 (patch)
tree0a6432aba336bae42313613f4c891bcfce02bd4e /drivers/gpu/drm/msm
parentbdd091bab8c631bd2801af838e344fad34566410 (diff)
parentb5ac3beb5a9f0ef0ea64cd85faf94c0dc4de0e42 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
There were quite a few overlapping sets of changes here. Daniel's bug fix for off-by-ones in the new BPF branch instructions, along with the added allowances for "data_end > ptr + x" forms collided with the metadata additions. Along with those three changes came veritifer test cases, which in their final form I tried to group together properly. If I had just trimmed GIT's conflict tags as-is, this would have split up the meta tests unnecessarily. In the socketmap code, a set of preemption disabling changes overlapped with the rename of bpf_compute_data_end() to bpf_compute_data_pointers(). Changes were made to the mv88e6060.c driver set addr method which got removed in net-next. The hyperv transport socket layer had a locking change in 'net' which overlapped with a change of socket state macro usage in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r--drivers/gpu/drm/msm/dsi/dsi_host.c2
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c2
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c2
-rw-r--r--drivers/gpu/drm/msm/msm_gem.c15
-rw-r--r--drivers/gpu/drm/msm/msm_gem_submit.c24
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c3
-rw-r--r--drivers/gpu/drm/msm/msm_rd.c12
7 files changed, 35 insertions, 25 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index dbb31a014419..deaf869374ea 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -248,7 +248,7 @@ disable_clks:
248 clk_disable_unprepare(ahb_clk); 248 clk_disable_unprepare(ahb_clk);
249disable_gdsc: 249disable_gdsc:
250 regulator_disable(gdsc_reg); 250 regulator_disable(gdsc_reg);
251 pm_runtime_put_autosuspend(dev); 251 pm_runtime_put_sync(dev);
252put_clk: 252put_clk:
253 clk_put(ahb_clk); 253 clk_put(ahb_clk);
254put_gdsc: 254put_gdsc:
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
index c2bdad88447e..824067d2d427 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
@@ -83,6 +83,8 @@ const struct mdp5_cfg_hw msm8x74v1_config = {
83 .caps = MDP_LM_CAP_WB }, 83 .caps = MDP_LM_CAP_WB },
84 }, 84 },
85 .nb_stages = 5, 85 .nb_stages = 5,
86 .max_width = 2048,
87 .max_height = 0xFFFF,
86 }, 88 },
87 .dspp = { 89 .dspp = {
88 .count = 3, 90 .count = 3,
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
index 6fcb58ab718c..440977677001 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
@@ -804,8 +804,6 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
804 804
805 spin_unlock_irqrestore(&mdp5_crtc->cursor.lock, flags); 805 spin_unlock_irqrestore(&mdp5_crtc->cursor.lock, flags);
806 806
807 pm_runtime_put_autosuspend(&pdev->dev);
808
809set_cursor: 807set_cursor:
810 ret = mdp5_ctl_set_cursor(ctl, pipeline, 0, cursor_enable); 808 ret = mdp5_ctl_set_cursor(ctl, pipeline, 0, cursor_enable);
811 if (ret) { 809 if (ret) {
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index f15821a0d900..ea5bb0e1632c 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -610,17 +610,6 @@ int msm_gem_sync_object(struct drm_gem_object *obj,
610 struct dma_fence *fence; 610 struct dma_fence *fence;
611 int i, ret; 611 int i, ret;
612 612
613 if (!exclusive) {
614 /* NOTE: _reserve_shared() must happen before _add_shared_fence(),
615 * which makes this a slightly strange place to call it. OTOH this
616 * is a convenient can-fail point to hook it in. (And similar to
617 * how etnaviv and nouveau handle this.)
618 */
619 ret = reservation_object_reserve_shared(msm_obj->resv);
620 if (ret)
621 return ret;
622 }
623
624 fobj = reservation_object_get_list(msm_obj->resv); 613 fobj = reservation_object_get_list(msm_obj->resv);
625 if (!fobj || (fobj->shared_count == 0)) { 614 if (!fobj || (fobj->shared_count == 0)) {
626 fence = reservation_object_get_excl(msm_obj->resv); 615 fence = reservation_object_get_excl(msm_obj->resv);
@@ -1045,10 +1034,10 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size,
1045 } 1034 }
1046 1035
1047 vaddr = msm_gem_get_vaddr(obj); 1036 vaddr = msm_gem_get_vaddr(obj);
1048 if (!vaddr) { 1037 if (IS_ERR(vaddr)) {
1049 msm_gem_put_iova(obj, aspace); 1038 msm_gem_put_iova(obj, aspace);
1050 drm_gem_object_unreference(obj); 1039 drm_gem_object_unreference(obj);
1051 return ERR_PTR(-ENOMEM); 1040 return ERR_CAST(vaddr);
1052 } 1041 }
1053 1042
1054 if (bo) 1043 if (bo)
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index 5d0a75d4b249..93535cac0676 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -221,7 +221,7 @@ fail:
221 return ret; 221 return ret;
222} 222}
223 223
224static int submit_fence_sync(struct msm_gem_submit *submit) 224static int submit_fence_sync(struct msm_gem_submit *submit, bool no_implicit)
225{ 225{
226 int i, ret = 0; 226 int i, ret = 0;
227 227
@@ -229,6 +229,20 @@ static int submit_fence_sync(struct msm_gem_submit *submit)
229 struct msm_gem_object *msm_obj = submit->bos[i].obj; 229 struct msm_gem_object *msm_obj = submit->bos[i].obj;
230 bool write = submit->bos[i].flags & MSM_SUBMIT_BO_WRITE; 230 bool write = submit->bos[i].flags & MSM_SUBMIT_BO_WRITE;
231 231
232 if (!write) {
233 /* NOTE: _reserve_shared() must happen before
234 * _add_shared_fence(), which makes this a slightly
235 * strange place to call it. OTOH this is a
236 * convenient can-fail point to hook it in.
237 */
238 ret = reservation_object_reserve_shared(msm_obj->resv);
239 if (ret)
240 return ret;
241 }
242
243 if (no_implicit)
244 continue;
245
232 ret = msm_gem_sync_object(&msm_obj->base, submit->gpu->fctx, write); 246 ret = msm_gem_sync_object(&msm_obj->base, submit->gpu->fctx, write);
233 if (ret) 247 if (ret)
234 break; 248 break;
@@ -451,11 +465,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
451 if (ret) 465 if (ret)
452 goto out; 466 goto out;
453 467
454 if (!(args->flags & MSM_SUBMIT_NO_IMPLICIT)) { 468 ret = submit_fence_sync(submit, !!(args->flags & MSM_SUBMIT_NO_IMPLICIT));
455 ret = submit_fence_sync(submit); 469 if (ret)
456 if (ret) 470 goto out;
457 goto out;
458 }
459 471
460 ret = submit_pin_objects(submit); 472 ret = submit_pin_objects(submit);
461 if (ret) 473 if (ret)
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index ffbff27600e0..6a887032c66a 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -718,7 +718,8 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
718 msm_gem_put_iova(gpu->rb->bo, gpu->aspace); 718 msm_gem_put_iova(gpu->rb->bo, gpu->aspace);
719 msm_ringbuffer_destroy(gpu->rb); 719 msm_ringbuffer_destroy(gpu->rb);
720 } 720 }
721 if (gpu->aspace) { 721
722 if (!IS_ERR_OR_NULL(gpu->aspace)) {
722 gpu->aspace->mmu->funcs->detach(gpu->aspace->mmu, 723 gpu->aspace->mmu->funcs->detach(gpu->aspace->mmu,
723 NULL, 0); 724 NULL, 0);
724 msm_gem_address_space_put(gpu->aspace); 725 msm_gem_address_space_put(gpu->aspace);
diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c
index 0366b8092f97..ec56794ad039 100644
--- a/drivers/gpu/drm/msm/msm_rd.c
+++ b/drivers/gpu/drm/msm/msm_rd.c
@@ -111,10 +111,14 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)
111 111
112 wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0); 112 wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0);
113 113
114 /* Note that smp_load_acquire() is not strictly required
115 * as CIRC_SPACE_TO_END() does not access the tail more
116 * than once.
117 */
114 n = min(sz, circ_space_to_end(&rd->fifo)); 118 n = min(sz, circ_space_to_end(&rd->fifo));
115 memcpy(fptr, ptr, n); 119 memcpy(fptr, ptr, n);
116 120
117 fifo->head = (fifo->head + n) & (BUF_SZ - 1); 121 smp_store_release(&fifo->head, (fifo->head + n) & (BUF_SZ - 1));
118 sz -= n; 122 sz -= n;
119 ptr += n; 123 ptr += n;
120 124
@@ -145,13 +149,17 @@ static ssize_t rd_read(struct file *file, char __user *buf,
145 if (ret) 149 if (ret)
146 goto out; 150 goto out;
147 151
152 /* Note that smp_load_acquire() is not strictly required
153 * as CIRC_CNT_TO_END() does not access the head more than
154 * once.
155 */
148 n = min_t(int, sz, circ_count_to_end(&rd->fifo)); 156 n = min_t(int, sz, circ_count_to_end(&rd->fifo));
149 if (copy_to_user(buf, fptr, n)) { 157 if (copy_to_user(buf, fptr, n)) {
150 ret = -EFAULT; 158 ret = -EFAULT;
151 goto out; 159 goto out;
152 } 160 }
153 161
154 fifo->tail = (fifo->tail + n) & (BUF_SZ - 1); 162 smp_store_release(&fifo->tail, (fifo->tail + n) & (BUF_SZ - 1));
155 *ppos += n; 163 *ppos += n;
156 164
157 wake_up_all(&rd->fifo_event); 165 wake_up_all(&rd->fifo_event);