android_kernel_oneplus_msm8998/drivers/gpu/drm/amd/amdgpu
Mario Kleiner d039fc37ec drm/amdgpu: Attach exclusive fence to prime exported bo's. (v5)
commit 8e94a46c1770884166b31adc99eba7da65a446a7 upstream.

External clients which import our bo's wait only
for exclusive dmabuf-fences, not on shared ones,
ditto for bo's which we import from external
providers and write to.

Therefore attach exclusive fences on prime shared buffers
if our exported buffer gets imported by an external
client, or if we import a buffer from an external
exporter.

See discussion in thread:
https://lists.freedesktop.org/archives/dri-devel/2016-October/122370.html

Prime export tested on Intel iGPU + AMD Tonga dGPU as
DRI3/Present Prime render offload, and with the Tonga
standalone as primary gpu.

v2: Add a wait for all shared fences before prime export,
    as suggested by Christian Koenig.

v3: - Mark buffer prime_exported in amdgpu_gem_prime_pin,
    so we only use the exclusive fence when exporting a
    bo to external clients like a separate iGPU, but not
    when exporting/importing from/to ourselves as part of
    regular DRI3 fd passing.

    - Propagate failure of reservation_object_wait_rcu back
    to caller.

v4: - Switch to a prime_shared_count counter instead of a
      flag, which gets in/decremented on prime_pin/unpin, so
      we can switch back to shared fences if all clients
      detach from our exported bo.

    - Also switch to exclusive fence for prime imported bo's.

v5: - Drop lret, instead use int ret -> long ret, as proposed
      by Christian.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95472
Tested-by: Mike Lothian <mike@fireburn.co.uk> (v1)
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>.
Cc: Christian König <christian.koenig@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-26 09:54:52 +01:00
..
amdgpu.h drm/amdgpu: Attach exclusive fence to prime exported bo's. (v5) 2016-11-26 09:54:52 +01:00
amdgpu_acpi.c drm/amdgpu: Drop unnecessary #include <linux/vga_switcheroo.h> 2015-10-14 16:16:38 -04:00
amdgpu_acpi.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_afmt.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_amdkfd.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_amdkfd.h drm/amdgpu: Add amdgpu <--> amdkfd gfx8 interface 2015-07-20 09:16:48 +03:00
amdgpu_amdkfd_gfx_v7.c drm/amdgpu: rework sdma structures 2015-10-14 16:16:36 -04:00
amdgpu_amdkfd_gfx_v8.c drm/amdgpu: rework sdma structures 2015-10-14 16:16:36 -04:00
amdgpu_atombios.c drm/amdgpu: skip TV/CV in display parsing 2016-09-07 08:32:42 +02:00
amdgpu_atombios.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_atpx_handler.c drm/amdgpu: add a delay after ATPX dGPU power off 2016-08-20 18:09:22 +02:00
amdgpu_benchmark.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_bios.c drm/amdgpu: Drop unnecessary #include <linux/vga_switcheroo.h> 2015-10-14 16:16:38 -04:00
amdgpu_bo_list.c drm/amdgpu: Attach exclusive fence to prime exported bo's. (v5) 2016-11-26 09:54:52 +01:00
amdgpu_cgs.c drm/amdgpu/cgs: remove import_gpu_mem 2015-09-30 12:44:16 -04:00
amdgpu_connectors.c drm/amdgpu: Poll for both connect/disconnect on analog connectors 2016-08-20 18:09:22 +02:00
amdgpu_connectors.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_cs.c drm/amdgpu: fix user fence handling 2015-12-16 17:48:59 -05:00
amdgpu_ctx.c drm/amdgpu: don't oops on failure to load (v2) 2015-11-03 11:15:19 -05:00
amdgpu_device.c drm/amdgpu: Disable RPM helpers while reprobing connectors on resume 2016-08-20 18:09:22 +02:00
amdgpu_display.c drm/amdgpu: Fix error handling in amdgpu_flip_work_func. 2016-03-16 08:43:00 -07:00
amdgpu_dpm.c drm/amdgpu: change vblank_time's calculation method to reduce computational error. 2016-10-31 04:13:57 -06:00
amdgpu_dpm.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_drv.c drm/amdgpu: remove exp hardware support from iceland 2016-03-03 15:07:19 -08:00
amdgpu_drv.h drm/amdgpu: merge amdgpu_family.h into amd_shared.h (v2) 2015-08-17 16:50:21 -04:00
amdgpu_encoders.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_fb.c Merge branch 'drm-next-4.4' of git://people.freedesktop.org/~agd5f/linux into drm-next 2015-11-05 10:57:25 +10:00
amdgpu_fence.c drm/amdgpu: add kmem cache for amdgpu fence 2015-11-16 11:05:50 -05:00
amdgpu_gart.c drm/amdgpu: Change GART offset to 64-bit 2016-09-07 08:32:42 +02:00
amdgpu_gds.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_gem.c drm/amdgpu: fix the lost duplicates checking 2015-12-09 00:18:33 -05:00
amdgpu_gfx.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_gfx.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_i2c.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_i2c.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_ib.c drm/amdgpu: record error code when ring test failed 2016-09-07 08:32:42 +02:00
amdgpu_ih.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_ih.h drm/amdgpu: Implement irq interfaces for CGS 2015-08-17 16:50:09 -04:00
amdgpu_ioc32.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_irq.c drm/amdgpu: Fix max_vblank_count value for current display engines 2015-09-23 17:23:42 -04:00
amdgpu_irq.h drm/amdgpu: Implement irq interfaces for CGS 2015-08-17 16:50:09 -04:00
amdgpu_kms.c drm/amdgpu: fix IB alignment for UVD 2016-10-31 04:13:57 -06:00
amdgpu_mn.c drm/amdgpu: fix issue with overlapping userptrs 2016-03-03 15:07:19 -08:00
amdgpu_mode.h drm/amdgpu: bump the afmt limit for CZ, ST, Polaris 2016-05-04 14:48:46 -07:00
amdgpu_object.c drm/amdgpu: set metadata pointer to NULL after freeing. 2016-05-11 11:21:22 +02:00
amdgpu_object.h drm/amdgpu: remove the unnecessary parameter adev for amdgpu_sa_bo_new() 2015-11-16 17:01:32 -05:00
amdgpu_pll.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_pll.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_pm.c drm/amdgpu/pm: update current crtc info after setting the powerstate 2016-03-09 15:34:51 -08:00
amdgpu_pm.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_prime.c drm/amdgpu: Attach exclusive fence to prime exported bo's. (v5) 2016-11-26 09:54:52 +01:00
amdgpu_ring.c drm/amdgpu: move ring_from_fence to common code 2015-10-30 01:54:07 -04:00
amdgpu_sa.c drm/amdgpu: hold reference to fences in amdgpu_sa_bo_new (v2) 2016-03-03 15:07:19 -08:00
amdgpu_sched.c drm/amdgpu: fix incorrect mutex usage v3 2015-11-16 11:05:58 -05:00
amdgpu_semaphore.c drm/amdgpu: remove the unnecessary parameter adev for amdgpu_sa_bo_new() 2015-11-16 17:01:32 -05:00
amdgpu_sync.c drm/amdgpu: fix lost sync_to if scheduler is enabled. 2016-03-03 15:07:18 -08:00
amdgpu_test.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_trace.h drm/amdgpu: add command submission workflow tracepoint 2015-11-16 11:05:57 -05:00
amdgpu_trace_points.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_ttm.c drm/amdgpu: fix amdgpu_move_blit on 32bit systems 2016-09-07 08:32:42 +02:00
amdgpu_ucode.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
amdgpu_ucode.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_uvd.c amdgpu/uvd: add uvd fw version for amdgpu 2016-05-04 14:48:46 -07:00
amdgpu_uvd.h drm/amdgpu: change uvd ib test to use kernel fence directly 2015-08-17 16:50:51 -04:00
amdgpu_vce.c drm/amdgpu: when suspending, if uvd/vce was running. need to cancel delay work. 2016-05-04 14:48:45 -07:00
amdgpu_vce.h drm/amdgpu: use kernel fence for vce ib test 2015-08-17 16:50:52 -04:00
amdgpu_vm.c drm/amdgpu: Use drm_calloc_large for VM page_tables array 2016-03-09 15:34:56 -08:00
atom.c drm/amdgpu/atom: add support for new div32 opcodes (v3) 2015-10-14 16:16:24 -04:00
atom.h drm/amdgpu/atom: add support for new div32 opcodes (v3) 2015-10-14 16:16:24 -04:00
atombios_crtc.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_crtc.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_dp.c drm/amdgpu: fix DP mode validation 2016-11-15 07:46:40 +01:00
atombios_dp.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_encoders.c drm/amdgpu: support backlight control for UNIPHY3 2016-08-20 18:09:22 +02:00
atombios_encoders.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_i2c.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_i2c.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
ci_dpm.c drm/amdgpu: fix bug that can't enter thermal interrupt for bonaire. 2015-11-16 11:05:56 -05:00
ci_dpm.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
ci_smc.c drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
cik.c drm/amdgpu: check before checking pci bridge registers 2015-10-06 10:43:16 -04:00
cik.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cik_dpm.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cik_ih.c drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cik_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cik_sdma.c drm/amd/amdgpu: sdma resume fail during S4 on CI 2016-09-07 08:32:42 +02:00
cik_sdma.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cikd.h drm/amdgpu: add count field for the SDMA NOP packet v2 2015-09-02 12:21:35 -04:00
clearstate_ci.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
clearstate_defs.h
clearstate_vi.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
cz_dpm.c drm/amdgpu/cz: enable/disable vce dpm even if vce pg is disabled 2016-09-15 08:27:50 +02:00
cz_dpm.h drm/amdgpu: correct define SMU_EnabledFeatureScoreboard_SclkDpmOn 2015-06-29 11:21:52 -04:00
cz_ih.c drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cz_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
cz_ppsmc.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
cz_smc.c drm/amdgpu: Update SMC/DPM for Stoney 2015-10-21 12:19:46 -04:00
cz_smumgr.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
dce_v8_0.c drm/amdgpu/dce8: disable hpd on local panels 2016-10-31 04:13:57 -06:00
dce_v8_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
dce_v10_0.c drm/amdgpu/dce10: disable hpd on local panels 2016-10-31 04:13:57 -06:00
dce_v10_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
dce_v11_0.c drm/amdgpu/dce11: add missing drm_mode_config_cleanup call 2016-10-31 04:13:57 -06:00
dce_v11_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
fiji_dpm.c drm/amdgpu: Add Fiji support to SMC and DPM (v2) 2015-08-17 16:50:26 -04:00
fiji_ppsmc.h drm/amdgpu: Add Fiji support to SMC and DPM (v2) 2015-08-17 16:50:26 -04:00
fiji_smc.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
fiji_smumgr.h drm/amdgpu: Add Fiji support to SMC and DPM (v2) 2015-08-17 16:50:26 -04:00
gfx_v7_0.c drm/amdgpu/gfx7: fix broken condition check 2016-07-27 09:47:33 -07:00
gfx_v7_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
gfx_v8_0.c drm/amdgpu/gfx8: specify which engine to wait before vm flush 2016-03-09 15:34:51 -08:00
gfx_v8_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
gmc_v7_0.c drm/amdgpu/gmc7: add missing mullins case 2016-08-20 18:09:22 +02:00
gmc_v7_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
gmc_v8_0.c drm/amdgpu/gmc: use proper register for vram type on Fiji 2016-04-20 15:41:56 +09:00
gmc_v8_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
iceland_dpm.c drm/amdgpu/iceland: don't call smu_init on resume 2015-06-10 09:32:25 -04:00
iceland_ih.c drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
iceland_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
iceland_sdma_pkt_open.h drm/amdgpu: add count field for the SDMA NOP packet v2 2015-09-02 12:21:35 -04:00
iceland_smc.c drm/amdgpu: don't load MEC2 on topaz 2016-03-03 15:07:19 -08:00
iceland_smumgr.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
Kconfig drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
kv_dpm.c drm/amdgpu: add missing dpm check for KV dpm late init 2015-10-19 15:54:21 -04:00
kv_dpm.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
kv_smc.c drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
Makefile drm/amdgpu: move gmc7 support out of CIK dependency 2016-03-03 15:07:19 -08:00
ObjectID.h
ppsmc.h drm/amdgpu: add ppsmc.h 2015-06-03 21:03:13 -04:00
sdma_v2_4.c drm/amdgpu: include the right version of gmc header files for iceland 2016-04-12 09:08:59 -07:00
sdma_v2_4.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
sdma_v3_0.c drm/amdgpu: add SDMA support for Stoney (v2) 2015-10-21 12:20:20 -04:00
sdma_v3_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
smu7.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
smu7_discrete.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
smu7_fusion.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
smu8.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
smu8_fusion.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
smu_ucode_xfer_cz.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
smu_ucode_xfer_vi.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
tonga_dpm.c drm/amdgpu: fix tonga smu resume 2016-03-03 15:07:18 -08:00
tonga_ih.c drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
tonga_ih.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
tonga_ppsmc.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
tonga_sdma_pkt_open.h drm/amdgpu: add count field for the SDMA NOP packet v2 2015-09-02 12:21:35 -04:00
tonga_smc.c drm/amdgpu: export reservation_object from dmabuf to ttm (v2) 2015-09-23 17:23:34 -04:00
tonga_smumgr.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
uvd_v4_2.c drm/amdgpu: remove old lockup detection infrastructure 2015-10-21 11:35:12 -04:00
uvd_v4_2.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
uvd_v5_0.c drm/amdgpu: remove old lockup detection infrastructure 2015-10-21 11:35:12 -04:00
uvd_v5_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
uvd_v6_0.c drm/amdgpu: remove old lockup detection infrastructure 2015-10-21 11:35:12 -04:00
uvd_v6_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vce_v2_0.c drm/amdgpu: remove old lockup detection infrastructure 2015-10-21 11:35:12 -04:00
vce_v2_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vce_v3_0.c drm/amdgpu: vce use multiple cache surface starting from stoney 2015-11-20 18:21:04 -05:00
vce_v3_0.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vi.c drm/amdgpu: fix topaz/tonga gmc assignment in 4.4 stable 2016-03-09 15:34:57 -08:00
vi.h drm/amdgpu: rename amdgpu_ip_funcs to amd_ip_funcs (v2) 2015-06-03 21:03:51 -04:00
vi_dpm.h drm/amdgpu: Add Fiji support to SMC and DPM (v2) 2015-08-17 16:50:26 -04:00
vid.h drm/amdgpu: Add amdgpu <--> amdkfd gfx8 interface 2015-07-20 09:16:48 +03:00