linux_dsm_epyc7002/drivers/gpu/drm
Chris Wilson 18b862dcd5 dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access()
Drivers, especially i915.ko, can fail during the initial migration of a
dma-buf for CPU access. However, the error code from the driver was not
being propagated back to ioctl and so userspace was blissfully ignorant
of the failure. Rendering corruption ensues.

Whilst fixing the ioctl to return the error code from
dma_buf_start_cpu_access(), also do the same for
dma_buf_end_cpu_access().  For most drivers, dma_buf_end_cpu_access()
cannot fail. i915.ko however, as most drivers would, wants to avoid being
uninterruptible (as would be required to guarrantee no failure when
flushing the buffer to the device). As userspace already has to handle
errors from the SYNC_IOCTL, take advantage of this to be able to restart
the syscall across signals.

This fixes a coherency issue for i915.ko as well as reducing the
uninterruptible hold upon its BKL, the struct_mutex.

Fixes commit c11e391da2
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Feb 11 20:04:51 2016 -0200

    dma-buf: Add ioctls to allow userspace to flush

Testcase: igt/gem_concurrent_blit/*dmabuf*interruptible
Testcase: igt/prime_mmap_coherency/ioctl-errors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tiago Vignatti <tiago.vignatti@intel.com>
Cc: Stéphane Marchesin <marcheu@chromium.org>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>
CC: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: intel-gfx@lists.freedesktop.org
Cc: devel@driverdev.osuosl.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1458331359-2634-1-git-send-email-chris@chris-wilson.co.uk
2016-03-19 11:03:49 +01:00
..
amd Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-02-19 11:13:01 +10:00
arm drm: Add support for ARM's HDLCD controller. 2016-02-10 13:44:16 +00:00
armada drm/armada: Remove NULL open/pre/postclose hooks 2016-01-25 19:35:05 +01:00
ast drm/ast: removed optional dummy crtc mode_fixup function. 2016-03-04 18:16:56 +01:00
atmel-hlcdc drm/atmel-hlcdc: use helper to get crtc state 2016-03-15 14:09:48 +01:00
bochs drm/bochs: removed optional dummy crtc mode_fixup function. 2016-03-04 18:16:51 +01:00
bridge drm/bridge: removed dummy mode_fixup function from dw-hdmi. 2016-02-11 09:24:01 +01:00
cirrus drm/cirrus: removed optional dummy crtc mode_fixup function. 2016-03-04 17:54:12 +01:00
etnaviv drm/etnaviv: call correct function when trying to vmap a DMABUF 2016-01-26 18:54:01 +01:00
exynos drm/exynos: removed optional dummy encoder mode_fixup function. 2016-02-16 15:30:36 +01:00
fsl-dcu drm/fsl-dcu: removed optional dummy crtc mode_fixup function. 2016-03-04 18:16:45 +01:00
gma500 drm/gma: removed optional dummy crtc mode_fixup function. 2016-03-04 17:58:34 +01:00
i2c drm/i2c/tda998x: removed unnecessary code, mode_fixup is now optional. 2016-02-11 09:24:01 +01:00
i810
i915 dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access() 2016-03-19 11:03:49 +01:00
imx drm/imx: removed optional dummy encoder mode_fixup function. 2016-02-16 15:33:05 +01:00
mga
mgag200 drm/mgag200: removed optional dummy crtc mode_fixup function. 2016-03-04 17:54:17 +01:00
msm drm/msm/mdp: removed optional dummy crtc mode_fixup function. 2016-03-04 17:59:27 +01:00
nouveau drm/nouveau/dispnv04: removed optional dummy crtc mode_fixup function. 2016-03-04 18:10:41 +01:00
omapdrm dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access() 2016-03-19 11:03:49 +01:00
panel drm/fsl-dcu: use mode flags for hsync/vsync polarity 2016-02-25 16:13:16 -08:00
qxl drm/qxl: removed optional dummy encoder mode_fixup function. 2016-02-16 15:34:00 +01:00
r128
radeon Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-02-19 11:13:01 +10:00
rcar-du drm/rcar-du: removed optional dummy crtc mode_fixup function. 2016-03-04 17:58:47 +01:00
rockchip Merge branch 'drm-rockchip-next-2016-02-18' of https://github.com/markyzq/kernel-drm-rockchip into drm-next 2016-02-19 13:10:18 +10:00
savage
shmobile drm/shmobile: removed optional dummy crtc mode_fixup function. 2016-03-04 17:59:44 +01:00
sis
sti drm/sti: removed optional dummy crtc mode_fixup function. 2016-03-04 18:09:20 +01:00
tdfx
tegra drm/tegra: drop unused variable. 2016-02-09 11:17:37 +10:00
tilcdc drm/tilcdc: removed optional dummy encoder mode_fixup function. 2016-02-16 15:34:40 +01:00
ttm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-01-17 13:40:25 -08:00
udl dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access() 2016-03-19 11:03:49 +01:00
vc4 drm/vc4: Add support for YUV planes. 2016-02-16 11:24:08 -08:00
vgem
via
virtio drm/virtio: removed optional dummy crtc mode_fixup function. 2016-03-04 18:15:38 +01:00
vmwgfx Merge tag 'topic/drm-misc-2016-02-08' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-02-09 10:39:11 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c drm/atomic: use helper to get crtc state 2016-03-15 14:08:06 +01:00
drm_atomic.c drm: introduce pipe color correction properties 2016-03-08 13:57:32 +01:00
drm_auth.c
drm_bridge.c drm/bridge: Improve kerneldoc 2015-12-08 16:07:53 +01:00
drm_bufs.c
drm_cache.c
drm_context.c
drm_crtc_helper.c drm: introduce pipe color correction properties 2016-03-08 13:57:32 +01:00
drm_crtc_internal.h
drm_crtc.c drm: introduce pipe color correction properties 2016-03-08 13:57:32 +01:00
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers. 2016-02-12 14:22:40 +01:00
drm_dp_helper.c drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers. 2016-02-12 14:22:40 +01:00
drm_dp_mst_topology.c drm/dp/mst: deallocate payload on port destruction 2016-02-05 15:23:49 +10:00
drm_drv.c drm: move MODULE_PARM_DESC to other file 2016-01-08 15:32:29 +01:00
drm_edid_load.c
drm_edid.c drm/edid: Extract SADs properly from multiple audio data blocks 2016-03-13 19:36:17 +01:00
drm_encoder_slave.c drm: fixes when i2c encoder slave mode_fixup is null. 2016-02-10 15:14:49 +01:00
drm_fb_cma_helper.c drm/fb_cma_helper: remove duplicate const from drm_fb_cma_alloc 2016-01-20 13:55:57 +01:00
drm_fb_helper.c drm/fb_helper: Use add_one_connector in add_all_connectors. 2016-02-15 14:56:46 +01:00
drm_flip_work.c
drm_fops.c drm: Nuke vblank event file cleanup code 2016-02-08 09:55:47 +01:00
drm_gem_cma_helper.c drm: Use the driver's gem_object_free function from CMA helpers. 2015-12-15 10:23:44 +01:00
drm_gem.c drm: Remove opencoded drm_gem_object_release_handle() 2016-01-05 16:23:09 +01:00
drm_global.c
drm_hashtab.c tree wide: use kvfree() than conditional kfree()/vfree() 2016-01-22 17:02:18 -08:00
drm_info.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c drm/vblank: Use drm_event_reserve_init 2016-02-08 09:54:54 +01:00
drm_kms_helper_common.c drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers. 2016-02-12 14:22:40 +01:00
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c
drm_mm.c
drm_modes.c drm: modes: add missing [drm] to message printing 2016-02-09 16:34:44 +01:00
drm_modeset_lock.c drm/doc: Convert to markdown 2015-12-15 10:22:26 +01:00
drm_of.c
drm_panel.c
drm_pci.c drm: add drm_pcie_get_max_link_width helper (v2) 2015-12-21 16:42:31 -05:00
drm_plane_helper.c drm: Pass 'name' to drm_universal_plane_init() 2015-12-11 09:13:10 +01:00
drm_platform.c
drm_prime.c drm: prime: Honour O_RDWR during prime-handle-to-fd 2016-02-09 09:25:12 +01:00
drm_probe_helper.c Merge branch 'for-linus' into for-next 2015-12-23 08:33:34 +01:00
drm_rect.c
drm_scatter.c
drm_sysfs.c drm/sysfs: use kobj_to_dev() 2016-01-13 16:43:07 +01:00
drm_trace_points.c
drm_trace.h
drm_vm.c
drm_vma_manager.c
Kconfig Merge branch 'drm-next-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-next 2016-02-19 11:13:01 +10:00
Makefile Merge tag 'topic/drm-misc-2016-02-18' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-02-19 10:57:44 +10:00