linux_dsm_epyc7002/drivers/gpu/drm/i915
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
..
dvo_ch7xxx.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_ch7017.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_ivch.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_ns2501.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_sil164.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo_tfp410.c drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
dvo.h drm/i915: constify intel_dvo_dev_ops structures 2015-12-09 08:21:10 +01:00
i915_cmd_parser.c drm/i915: Type safe register read/write 2015-11-18 15:39:11 +02:00
i915_debugfs.c drm/i915: tidy up a few leftovers 2016-01-21 09:21:29 +01:00
i915_dma.c drm/i915: Nuke intel_modeset_preclose 2016-02-08 09:55:47 +01:00
i915_drv.c drm/i915: Defer probe if gmux is present but its driver isn't 2016-02-09 11:21:12 +01:00
i915_drv.h drm/i915: Update DRIVER_DATE to 20160124 2016-01-24 22:49:17 +01:00
i915_gem_batch_pool.c
i915_gem_batch_pool.h
i915_gem_context.c drm/i915: abolish separate per-ring default_context pointers 2016-01-21 09:21:29 +01:00
i915_gem_debug.c
i915_gem_dmabuf.c dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access() 2016-03-19 11:03:49 +01:00
i915_gem_evict.c drm/i915: Add soft-pinning API for execbuffer 2015-12-09 10:20:17 +00:00
i915_gem_execbuffer.c drm/i915: Decouple execbuf uAPI from internal implementation 2016-01-21 10:55:44 +00:00
i915_gem_fence.c Linux 4.4-rc4 2015-12-08 11:04:26 +10:00
i915_gem_gtt.c drm/i915: Pass the dma_addr_t array as const to rotate_pages() 2016-01-15 21:04:27 +02:00
i915_gem_gtt.h drm/i915: Do not call API requiring struct_mutex where it is not available 2016-01-18 09:58:36 +00:00
i915_gem_render_state.c drm/i915: mark GEM object pages dirty when mapped & written by the CPU 2015-12-11 18:11:53 +01:00
i915_gem_render_state.h
i915_gem_shrinker.c drm/i915: Disable shrinker for non-swapped backed objects 2016-01-05 11:05:38 +01:00
i915_gem_stolen.c Merge branch 'for-linus' into for-next 2016-01-06 21:14:35 +01:00
i915_gem_tiling.c drm/i915: get runtime PM reference around GEM set_tiling IOCTL 2015-11-17 18:43:30 +02:00
i915_gem_userptr.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2015-11-10 09:33:06 -08:00
i915_gem.c drm/i915: Seal busy-ioctl uABI and prevent leaking of internal ids 2016-01-21 11:00:35 +00:00
i915_gpu_error.c drm/i915: abolish separate per-ring default_context pointers 2016-01-21 09:21:29 +01:00
i915_guc_reg.h drm/i915/guc: Add GuC ADS (Addition Data Structure) - allocation 2016-01-05 11:33:34 +01:00
i915_guc_submission.c drm/i915: abolish separate per-ring default_context pointers 2016-01-21 09:21:29 +01:00
i915_ioc32.c
i915_irq.c drm/i915/gen8: Factor out display interrupt handling 2016-01-13 10:01:53 +00:00
i915_params.c drm/i915: Decouple struct i915_params i915 into i915_params.h 2015-12-21 14:35:03 +01:00
i915_params.h drm/i915: Reorder i915_params struct. 2015-12-21 14:35:12 +01:00
i915_reg.h Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued 2016-01-18 08:18:16 +01:00
i915_suspend.c drm/i915: Separate cherryview from valleyview 2015-12-10 11:07:24 +01:00
i915_sysfs.c drm/i915: use kobj_to_dev() 2016-01-13 16:40:50 +01:00
i915_trace_points.c
i915_trace.h drm/i915: Type safe register read/write 2015-11-18 15:39:11 +02:00
i915_vgpu.c drm/i915: Turn __raw_i915_read8() & co. in to inline functions 2015-10-26 16:28:04 +02:00
i915_vgpu.h drm/i915: Type safe register read/write 2015-11-18 15:39:11 +02:00
intel_acpi.c drm/i915: Drop unnecessary #include <linux/vga_switcheroo.h> 2015-10-13 10:18:38 +02:00
intel_atomic_plane.c drm/i915: Remove commit_plane function pointer. 2016-01-07 13:52:04 +01:00
intel_atomic.c Revert "drm/i915: Add two-stage ILK-style watermark programming (v10)" 2016-01-20 10:07:22 +01:00
intel_audio.c Add get_eld audio component for i915/HD-audio 2015-12-11 19:28:27 +01:00
intel_bios.c drm/i915/bios: Fix the sequence size calculations for MIPI seq v3 2016-01-15 11:38:11 +02:00
intel_bios.h drm/i915/bios: add defines for v3 sequence block 2016-01-11 19:16:19 +02:00
intel_crt.c Merge tag 'drm-intel-next-2015-12-18' of git://anongit.freedesktop.org/drm-intel into drm-next 2015-12-23 14:22:09 +10:00
intel_csr.c drm/i915: Demote user facing DMC firmware load failure message 2016-01-19 11:11:58 +01:00
intel_ddi.c Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued 2016-01-18 08:18:16 +01:00
intel_display.c drm/atomic: Add encoder_mask to crtc_state, v3. 2016-02-09 11:21:06 +01:00
intel_dp_link_training.c drm/i915: Make intel_dp_source_supports_hbr2() take an intel_dp pointer 2015-11-05 15:14:56 +02:00
intel_dp_mst.c Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued 2016-01-18 08:18:16 +01:00
intel_dp.c drm/i915: Set aux.dev to the drm_connector device, instead of drm_device. 2016-02-14 19:21:01 +01:00
intel_drv.h 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
intel_dsi_panel_vbt.c drm/i915/dsi: add debug printing of the new sequence block names 2016-01-11 19:20:59 +02:00
intel_dsi_pll.c drm/i915/dsi: remove unused dsi_rr_formula() 2016-01-08 13:30:55 +02:00
intel_dsi.c Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued 2016-01-18 08:18:16 +01:00
intel_dsi.h drm/i915/dsi: abstract get pclk platform differences 2016-01-08 13:25:12 +02:00
intel_dvo.c drm: Pass 'name' to drm_encoder_init() 2015-12-11 09:13:20 +01:00
intel_fbc.c drm/i915: only recompress FBC after flushing a drawing operation 2015-12-03 11:38:11 -02:00
intel_fbdev.c drm/i915: Remove obsolete code from intelfb_alloc() 2015-12-21 17:03:25 +01:00
intel_fifo_underrun.c drm/i915: Introduce bdw_{update,enable,disable}_pipe_irq() 2015-11-26 18:55:39 +02:00
intel_frontbuffer.c
intel_guc_fwif.h drm/i915/gen9: Correct max save/restore register count during gpu reset with GuC 2016-01-19 20:37:55 +01:00
intel_guc_loader.c drm/i915/guc: Fix a memory leak where guc->execbuf_client is not freed 2016-01-18 09:58:49 +00:00
intel_guc.h drm/i915/guc: Add GuC ADS (Addition Data Structure) - allocation 2016-01-05 11:33:34 +01:00
intel_hdmi.c Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued 2016-01-18 08:18:16 +01:00
intel_hotplug.c drm/i915: intel_hpd_init(): Fix suspend/resume reprobing 2016-01-13 10:49:42 +02:00
intel_i2c.c drm/i915: Separate cherryview from valleyview 2015-12-10 11:07:24 +01:00
intel_lrc.c drm/i915: Make sure DC writes are coherent on flush. 2016-01-29 09:11:26 +02:00
intel_lrc.h drm/i915: Do not call API requiring struct_mutex where it is not available 2016-01-18 09:58:36 +00:00
intel_lvds.c drm/i915: Switch DDC when reading the EDID 2016-02-09 11:21:09 +01:00
intel_mocs.c drm/i915: Type safe register read/write 2015-11-18 15:39:11 +02:00
intel_mocs.h
intel_modes.c drm/i915: Add HDMI aspect ratio property for SDVO 2015-09-30 10:20:12 +02:00
intel_opregion.c drm/i915/opregion: handle VBT sizes bigger than 6 KB 2015-12-17 11:40:57 +02:00
intel_overlay.c drm/i915: simplify allocation of driver-internal requests 2016-01-21 09:21:29 +01:00
intel_panel.c drm/i915/backlight: prefer dev_priv over dev pointer 2015-12-18 11:37:44 +02:00
intel_pm.c Revert "drm/i915: Add two-stage ILK-style watermark programming (v10)" 2016-01-20 10:07:22 +01:00
intel_psr.c drm/i915: PSR also doesn't have link_entry_time on SKL. 2015-12-11 16:32:56 -08:00
intel_renderstate_gen6.c
intel_renderstate_gen7.c
intel_renderstate_gen8.c
intel_renderstate_gen9.c
intel_renderstate.h
intel_ringbuffer.c drm/i915: Make sure DC writes are coherent on flush. 2016-01-29 09:11:26 +02:00
intel_ringbuffer.h drm/i915: Seal busy-ioctl uABI and prevent leaking of internal ids 2016-01-21 11:00:35 +00:00
intel_runtime_pm.c drm/i915: Kill intel_prepare_ddi() 2016-01-12 16:05:12 +02:00
intel_sdvo_regs.h drm/i915/sdvo: revert bogus kernel-doc comments to normal comments 2016-01-20 10:21:34 +02:00
intel_sdvo.c drm: Pass 'name' to drm_encoder_init() 2015-12-11 09:13:20 +01:00
intel_sideband.c
intel_sprite.c Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued 2016-01-18 08:18:16 +01:00
intel_tv.c drm: Pass 'name' to drm_encoder_init() 2015-12-11 09:13:20 +01:00
intel_uncore.c drm/i915: Limit the auto arming of mmio debugs on vlv/chv 2016-01-21 11:52:45 +02:00
Kconfig drm/i915: Remove select to deleted STOP_MACHINE from Kconfig 2016-01-29 09:13:58 +02:00
Makefile drm/i915: Move generic link training code to a separate file 2015-11-05 15:14:56 +02:00