alistair23-linux/drivers/gpu/drm/msm
Rob Clark 786813c343 drm/msm/mdp5: use __drm_atomic_helper_plane_duplicate_state()
Somehow the helper was never retrofitted for mdp5.  Which meant when
plane_state->fence was added, it could get copied into new state in
mdp5_plane_duplicate_state().

If an update to disable the plane (for example on rmfb) managed to sneak
in after an nonblock update had swapped state, but before it was
committed, we'd get a splat:

    WARNING: CPU: 1 PID: 69 at ../drivers/gpu/drm/drm_atomic_helper.c:1061 drm_atomic_helper_wait_for_fences+0xe0/0xf8
   Modules linked in:

   CPU: 1 PID: 69 Comm: kworker/1:1 Tainted: G        W       4.11.0-rc8+ #1187
   Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
   Workqueue: events drm_mode_rmfb_work_fn
   task: ffffffc036560d00 task.stack: ffffffc036550000
   PC is at drm_atomic_helper_wait_for_fences+0xe0/0xf8
   LR is at complete_commit.isra.1+0x44/0x1c0
   pc : [<ffffff80084f6040>] lr : [<ffffff800854176c>] pstate: 20000145
   sp : ffffffc036553b60
   x29: ffffffc036553b60 x28: ffffffc0264e6a00
   x27: ffffffc035659000 x26: 0000000000000000
   x25: ffffffc0240e8000 x24: 0000000000000038
   x23: 0000000000000000 x22: ffffff800858f200
   x21: ffffffc0240e8000 x20: ffffffc02f56a800
   x19: 0000000000000000 x18: 0000000000000000
   x17: 0000000000000000 x16: 0000000000000000
   x15: 0000000000000000 x14: ffffffc00a192700
   x13: 0000000000000004 x12: 0000000000000000
   x11: ffffff80089a1690 x10: 00000000000008f0
   x9 : ffffffc036553b20 x8 : ffffffc036561650
   x7 : ffffffc03fe6cb40 x6 : 0000000000000000
   x5 : 0000000000000001 x4 : 0000000000000002
   x3 : ffffffc035659000 x2 : ffffffc0240e8c80
   x1 : 0000000000000000 x0 : ffffffc02adbe588

   ---[ end trace 13aeec77c3fb55e2 ]---
   Call trace:
   Exception stack(0xffffffc036553990 to 0xffffffc036553ac0)
   3980:                                   0000000000000000 0000008000000000
   39a0: ffffffc036553b60 ffffff80084f6040 0000000000004ff0 0000000000000038
   39c0: ffffffc0365539d0 ffffff800857e098 ffffffc036553a00 ffffff800857e1b0
   39e0: ffffffc036553a10 ffffff800857c554 ffffffc0365e8400 ffffffc0365e8400
   3a00: ffffffc036553a20 ffffff8008103358 000000000001aad7 ffffff800851b72c
   3a20: ffffffc036553a50 ffffff80080e9228 ffffffc02adbe588 0000000000000000
   3a40: ffffffc0240e8c80 ffffffc035659000 0000000000000002 0000000000000001
   3a60: 0000000000000000 ffffffc03fe6cb40 ffffffc036561650 ffffffc036553b20
   3a80: 00000000000008f0 ffffff80089a1690 0000000000000000 0000000000000004
   3aa0: ffffffc00a192700 0000000000000000 0000000000000000 0000000000000000
   [<ffffff80084f6040>] drm_atomic_helper_wait_for_fences+0xe0/0xf8
   [<ffffff800854176c>] complete_commit.isra.1+0x44/0x1c0
   [<ffffff8008541c64>] msm_atomic_commit+0x32c/0x350
   [<ffffff8008516230>] drm_atomic_commit+0x50/0x60
   [<ffffff8008517548>] drm_atomic_remove_fb+0x158/0x250
   [<ffffff80085186d0>] drm_framebuffer_remove+0x50/0x158
   [<ffffff8008518818>] drm_mode_rmfb_work_fn+0x40/0x58
   [<ffffff80080d5668>] process_one_work+0x1d0/0x378
   [<ffffff80080d5a54>] worker_thread+0x244/0x488
   [<ffffff80080db7fc>] kthread+0xfc/0x128
   [<ffffff8008082ec0>] ret_from_fork+0x10/0x50

Fixes: 9626014 ("drm/fence: add in-fences support")
Cc: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reported-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-05-27 13:48:25 -04:00
..
adreno drm/msm: gpu: Use OPP tables if we can 2017-04-08 06:59:37 -04:00
dsi Merge tag 'drm-misc-next-2017-04-07' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2017-04-11 07:41:10 +10:00
edp drm: bridge: Link encoder and bridge in core code 2016-12-18 16:31:45 +05:30
hdmi drm/msm/hdmi: redefinitions of macros not required 2017-04-08 06:59:33 -04:00
mdp drm/msm/mdp5: use __drm_atomic_helper_plane_duplicate_state() 2017-05-27 13:48:25 -04:00
Kconfig drm/msm: select PM_OPP 2017-05-27 13:48:24 -04:00
Makefile drm/msm/mdp5: Add structs for hw Layer Mixers 2017-04-08 06:59:33 -04:00
msm_atomic.c drm/msm/mdp5: Add cursor planes 2017-02-06 11:28:44 -05:00
msm_debugfs.c drm/msm/gpu: use pm-runtime 2017-04-08 06:59:31 -04:00
msm_debugfs.h drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_drv.c drm/msm: Don't increase priv->num_aspaces until we know that it fits 2017-04-08 06:59:32 -04:00
msm_drv.h drm/msm: Reference count address spaces 2017-04-08 06:59:36 -04:00
msm_fb.c drm: Nuke fb->pixel_format 2016-12-15 14:55:34 +02:00
msm_fbdev.c drm/fb-helper: Automatically clean up fb_info 2017-02-07 21:36:28 +01:00
msm_fence.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
msm_fence.h dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
msm_gem.c drm/msm: Don't allow zero sized buffer objects 2017-04-08 06:59:32 -04:00
msm_gem.h drm/msm: Reference count address spaces 2017-04-08 06:59:36 -04:00
msm_gem_prime.c
msm_gem_shrinker.c Merge branch 'linus' into locking/core, to pick up fixes 2016-11-22 12:37:38 +01:00
msm_gem_submit.c drm/msm: move submit fence wait out of struct_mutex 2017-04-08 06:59:31 -04:00
msm_gem_vma.c drm/msm: Reference count address spaces 2017-04-08 06:59:36 -04:00
msm_gpu.c msm/drm: gpu: Dynamically locate the clocks from the device tree 2017-04-08 06:59:37 -04:00
msm_gpu.h msm/drm: gpu: Dynamically locate the clocks from the device tree 2017-04-08 06:59:37 -04:00
msm_iommu.c drm/msm: pm runtime support for iommu 2017-04-08 06:59:31 -04:00
msm_kms.h drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_mmu.h drm/msm: let gpu wire up it's own fault handler 2017-02-06 11:28:42 -05:00
msm_perf.c drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_rd.c drm/msm: Support 64 bit iova in RD_CMDSTREAM_ADDR 2017-04-08 06:59:32 -04:00
msm_ringbuffer.c drm/msm: Ensure that the hardware write pointer is valid 2016-12-29 15:02:58 -05:00
msm_ringbuffer.h
NOTES