linux_dsm_epyc7002/drivers/gpu/drm/radeon
Christian König f72a113a71 drm/radeon: add userptr support v8
This patch adds an IOCTL for turning a pointer supplied by
userspace into a buffer object.

It imposes several restrictions upon the memory being mapped:

1. It must be page aligned (both start/end addresses, i.e ptr and size).

2. It must be normal system memory, not a pointer into another map of IO
space (e.g. it must not be a GTT mmapping of another object).

3. The BO is mapped into GTT, so the maximum amount of memory mapped at
all times is still the GTT limit.

4. The BO is only mapped readonly for now, so no write support.

5. List of backing pages is only acquired once, so they represent a
snapshot of the first use.

Exporting and sharing as well as mapping of buffer objects created by
this function is forbidden and results in an -EPERM.

v2: squash all previous changes into first public version
v3: fix tabs, map readonly, don't use MM callback any more
v4: set TTM_PAGE_FLAG_SG so that TTM never messes with the pages,
    pin/unpin pages on bind/unbind instead of populate/unpopulate
v5: rebased on 3.17-wip, IOCTL renamed to userptr, reject any unknown
    flags, better handle READONLY flag, improve permission check
v6: fix ptr cast warning, use set_page_dirty/mark_page_accessed on unpin
v7: add warning about it's availability in the API definition
v8: drop access_ok check, fix VM mapping bits

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v4)
Reviewed-by: Jérôme Glisse <jglisse@redhat.com> (v4)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-11 11:04:23 -04:00
..
reg_srcs drm/radeon: allow geom rings to be setup on r600/r700 (v2) 2014-02-06 12:13:52 +10:00
.gitignore
atom-bits.h
atom-names.h
atom-types.h
atom.c drm/radeon/atom: initialize more atom interpretor elements to 0 2013-07-30 17:24:12 -04:00
atom.h
atombios_crtc.c drm/radeon: Prevent too early kms-pageflips triggered by vblank. 2014-07-17 09:01:31 -04:00
atombios_dp.c drm/radeon/dp: return -EIO for flags not zero case 2014-07-10 17:01:28 -04:00
atombios_encoders.c drm/radeon: use a fetch function to get the edid 2014-08-05 08:53:30 -04:00
atombios_i2c.c drm/radeon: add a i2c bus mutex 2014-06-02 10:25:02 -04:00
atombios.h drm/radeon: atombios.h updates for hawaii 2013-11-08 12:33:45 -05:00
avivod.h
btc_dpm.c drm/radeon/dpm: move platform caps fetching to a separate function 2014-02-18 16:11:30 +01:00
btc_dpm.h drm/radeon/dpm: fetch the max clk from voltage dep tables helper 2013-09-23 10:29:51 -04:00
btcd.h drm/radeon/dpm: use the driver state for dpm debugfs 2014-02-06 12:22:46 -05:00
cayman_blit_shaders.c drm/radeon/kms: remove r6xx+ blit copy routines 2013-08-30 16:29:57 -04:00
cayman_blit_shaders.h
ci_dpm.c drm/radeon/dpm: handle voltage info fetching on hawaii 2014-08-05 08:53:47 -04:00
ci_dpm.h drm/radeon/dpm: track uvd gated state for ci 2013-08-30 16:31:06 -04:00
ci_smc.c drm/radeon/cik: Add support for new ucode format (v5) 2014-08-05 08:53:24 -04:00
cik_blit_shaders.c
cik_blit_shaders.h
cik_reg.h drm/radeon: add indirect accessors for dift registers on CIK 2013-08-30 16:30:09 -04:00
cik_sdma.c drm/radeon: split PT setup in more functions 2014-08-05 08:53:55 -04:00
cik.c drm/radeon: Use pflip irqs for pageflip completion if possible. (v2) 2014-08-05 08:54:00 -04:00
cikd.h drm/radeon/cik: fix typo in EOP packet 2014-07-02 14:10:19 -04:00
clearstate_cayman.h drm/radeon: use NULL instead of zero in clearstate headers 2014-06-02 10:25:07 -04:00
clearstate_ci.h drm/radeon: use NULL instead of zero in clearstate headers 2014-06-02 10:25:07 -04:00
clearstate_defs.h
clearstate_evergreen.h drm/radeon: convert SI,CIK to use sumo_rlc functions 2013-08-30 16:30:08 -04:00
clearstate_si.h drm/radeon: use NULL instead of zero in clearstate headers 2014-06-02 10:25:07 -04:00
cypress_dpm.c drm/radeon/dpm: fix typo in vddci setup for eg/btc 2014-07-01 12:15:17 -04:00
cypress_dpm.h drm/radeon/dpm: add pre/post_set_power_state callback (BTC) 2013-06-27 19:16:19 -04:00
dce3_1_afmt.c drm/radeon/hdmi: use separated file for DCE 3.1/3.2 code 2014-06-02 10:25:04 -04:00
dce6_afmt.c drm/radeon: use a fetch function to get the edid 2014-08-05 08:53:30 -04:00
evergreen_blit_shaders.c drm/radeon/kms: remove r6xx+ blit copy routines 2013-08-30 16:29:57 -04:00
evergreen_blit_shaders.h
evergreen_cs.c drm/radeon: remove struct radeon_bo_list 2014-03-04 14:34:34 +01:00
evergreen_dma.c drm/radeon: drm/radeon: add missing radeon_semaphore_free to error path 2014-05-06 12:18:41 +02:00
evergreen_hdmi.c drm/radeon: use a fetch function to get the edid 2014-08-05 08:53:30 -04:00
evergreen_reg.h drm/radeon: Prevent too early kms-pageflips triggered by vblank. 2014-07-17 09:01:31 -04:00
evergreen_smc.h drm/radeon/dpm: fix typo in EVERGREEN_SMC_FIRMWARE_HEADER_softRegisters 2014-03-06 16:46:58 -05:00
evergreen.c drm/radeon: Use pflip irqs for pageflip completion if possible. (v2) 2014-08-05 08:54:00 -04:00
evergreend.h drm/radeon: Setup HDMI_CONTROL for hdmi deep color gcp's (v2) 2014-06-02 18:37:33 -04:00
Kconfig
kv_dpm.c drm/radeon: enable bapm by default on KV/KB 2014-07-01 11:16:10 -04:00
kv_dpm.h drm/radeon/dpm: handle bapm on kb/kv 2013-09-11 11:44:38 -04:00
kv_smc.c drm/radeon/dpm: handle bapm on kb/kv 2013-09-11 11:44:38 -04:00
Makefile drm/radeon: separate ring and IB handling 2014-08-05 08:53:44 -04:00
mkregtable.c mkregtable: Fix sscanf handling 2014-01-10 15:28:10 +01:00
ni_dma.c drm/radeon: split PT setup in more functions 2014-08-05 08:53:55 -04:00
ni_dpm.c drm/radeon/dpm: fix vddci setup typo on cayman 2014-07-01 12:15:53 -04:00
ni_dpm.h drm/radeon/dpm: implement vblank_too_short callback for si 2013-07-08 17:41:11 -04:00
ni_reg.h
ni.c drm/radeon: Remove radeon_gart_restore() 2014-08-05 08:53:31 -04:00
nid.h drm/radeon: add proper support for RADEON_VM_BLOCK_SIZE v2 2014-06-02 10:25:03 -04:00
nislands_smc.h drm/radeon/kms: add dpm support for cayman (v5) 2013-06-27 19:16:10 -04:00
ObjectID.h
ppsmc.h drm/radeon/dpm: handle bapm on trinity 2013-09-11 11:44:37 -04:00
pptable.h drm/radeon: fix pptable.h portability 2014-01-03 11:34:21 -05:00
r100_track.h
r100.c drm/radeon: Always flush the HDP cache before submitting a CS to the GPU 2014-08-05 08:53:45 -04:00
r100d.h
r200.c drm/radeon: remove struct radeon_bo_list 2014-03-04 14:34:34 +01:00
r300_cmdbuf.c drm: Kill DRM_COPY_(TO|FROM)_USER 2013-12-18 11:35:01 +10:00
r300_reg.h
r300.c drm/radeon: Pass GART page flags to radeon_gart_set_page() explicitly 2014-08-05 08:53:32 -04:00
r300d.h
r420.c drm/radeon: resume old pm late 2014-03-06 16:46:56 -05:00
r420d.h
r500_reg.h drm/radeon: Bypass hw lut's for > 8 bpc framebuffer scanout. 2014-06-13 12:22:30 -04:00
r520.c drm/radeon: resume old pm late 2014-03-06 16:46:56 -05:00
r520d.h
r600_audio.c drm/radeon: change audio enable logic 2014-02-27 14:21:31 -05:00
r600_blit_shaders.c
r600_blit_shaders.h drm/radeon/kms: remove r6xx+ blit copy routines 2013-08-30 16:29:57 -04:00
r600_blit.c drm/radeon/kms: remove r6xx+ blit copy routines 2013-08-30 16:29:57 -04:00
r600_cp.c drm: Kill DRM_COPY_(TO|FROM)_USER 2013-12-18 11:35:01 +10:00
r600_cs.c drm/radeon: use helpers 2014-07-18 14:25:23 +10:00
r600_dma.c drm/radeon: drm/radeon: add missing radeon_semaphore_free to error path 2014-05-06 12:18:41 +02:00
r600_dpm.c drm/radeon/pm: don't walk the crtc list before it has been initialized (v2) 2014-04-22 16:51:19 +02:00
r600_dpm.h drm/radeon/dpm: move platform caps fetching to a separate function 2014-02-18 16:11:30 +01:00
r600_hdmi.c drm/radeon/hdmi: DCE2: simplify audio workaround 2014-06-02 10:25:06 -04:00
r600_reg.h drm/radeon: add indirect accessors for UVD CTX registers 2013-06-27 19:16:30 -04:00
r600.c drm/radeon: Use pflip irqs for pageflip completion if possible. (v2) 2014-08-05 08:54:00 -04:00
r600d.h drm/radeon/hdmi: DCE2: update setmode 2014-06-02 10:25:05 -04:00
radeon_acpi.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
radeon_acpi.h
radeon_agp.c radeon: Remove useless quirk for zx1/FireGL X1 combo introduced with fdo #7770 2014-06-02 10:25:08 -04:00
radeon_asic.c drm/radeon: split PT setup in more functions 2014-08-05 08:53:55 -04:00
radeon_asic.h drm/radeon: split PT setup in more functions 2014-08-05 08:53:55 -04:00
radeon_atombios.c drm/radeon/atom: add new voltage fetch function for hawaii 2014-08-05 08:53:46 -04:00
radeon_atpx_handler.c drm/radeon: fix ATPX detection on non-VGA GPUs 2014-04-22 16:51:20 +02:00
radeon_benchmark.c drm/radeon: Allow write-combined CPU mappings of BOs in GTT (v2) 2014-08-05 08:53:33 -04:00
radeon_bios.c drm: Remove spurious ';' 2014-06-10 09:35:42 +10:00
radeon_clocks.c
radeon_combios.c drivers: gpu: Move prototype declarations to header file radeon_mode.h from radeon_atombios.c and radeon_combios.c 2014-01-07 13:06:31 -05:00
radeon_connectors.c drm/radeon: Prevent hdmi deep color if max_tmds_clock is undefined. 2014-08-05 11:22:54 -04:00
radeon_cp.c drm: Kill DRM_*MEMORYBARRIER 2013-12-18 11:35:21 +10:00
radeon_cs.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon_cursor.c
radeon_device.c drm/radeon: adjust default radeon_vm_block_size v2 2014-08-05 08:53:52 -04:00
radeon_display.c drm/radeon: Use pflip irqs for pageflip completion if possible. (v2) 2014-08-05 08:54:00 -04:00
radeon_drv.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon_drv.h drm: Kill DRM_IRQ_ARGS 2013-12-18 11:33:46 +10:00
radeon_encoders.c drm/radeon: use a fetch function to get the edid 2014-08-05 08:53:30 -04:00
radeon_family.h drm/radeon: add Mullins chip family 2014-05-06 12:19:57 +02:00
radeon_fb.c drm/radeon: remove discardable flag from radeon_gem_object_create 2014-08-05 08:53:37 -04:00
radeon_fence.c drm/radeon: add debugfs file to trigger GPU reset 2014-06-09 22:06:55 -04:00
radeon_gart.c drm/radeon: Allow write-combined CPU mappings of BOs in GTT (v2) 2014-08-05 08:53:33 -04:00
radeon_gem.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon_i2c.c drm/dp: add a hw mutex around the transfer functions. (v2) 2014-06-05 09:54:29 +10:00
radeon_ib.c drm/radeon: separate ring and IB handling 2014-08-05 08:53:44 -04:00
radeon_ioc32.c drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
radeon_irq_kms.c drm: pass the irq explicitly to drm_irq_install 2014-04-23 10:32:50 +02:00
radeon_irq.c drm: Kill DRM_COPY_(TO|FROM)_USER 2013-12-18 11:35:01 +10:00
radeon_kms.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon_legacy_crtc.c drm: Replace crtc fb with primary plane fb (v3) 2014-04-01 20:18:28 -04:00
radeon_legacy_encoders.c drm/sysfs: sort out minor and connector device object lifetimes. 2013-10-22 09:37:40 +01:00
radeon_legacy_tv.c
radeon_mem.c drm: Kill DRM_COPY_(TO|FROM)_USER 2013-12-18 11:35:01 +10:00
radeon_mode.h drm/radeon: make radeon_connector_encoder_is_hbr2 static 2014-08-05 08:53:39 -04:00
radeon_object.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon_object.h drm/radeon: add radeon_bo_ref function 2014-08-05 08:53:53 -04:00
radeon_pm.c drm/radeon: re-enable dpm by default on BTC 2014-08-05 08:53:49 -04:00
radeon_prime.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon_reg.h
radeon_ring.c drm/radeon: Always flush the HDP cache before submitting a CS to the GPU 2014-08-05 08:53:45 -04:00
radeon_sa.c drm/radeon: Allow write-combined CPU mappings of BOs in GTT (v2) 2014-08-05 08:53:33 -04:00
radeon_semaphore.c drm/radeon: drop non blocking allocations from sub allocator 2014-03-03 11:26:39 +01:00
radeon_state.c drm: Remove DRM_ARRAY_SIZE() for ARRAY_SIZE() 2014-06-10 09:36:17 +10:00
radeon_test.c drm/radeon: use vram/gart pinned size in radeon_do_test_moves 2014-08-05 08:53:35 -04:00
radeon_trace_points.c
radeon_trace.h drm/radeon: use an intervall tree to manage the VMA v2 2014-08-05 08:53:51 -04:00
radeon_ttm.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon_ucode.c drm/radeon: add new firmware header definitions (v3) 2014-08-05 08:53:22 -04:00
radeon_ucode.h drm/radeon: add new firmware header definitions (v3) 2014-08-05 08:53:22 -04:00
radeon_uvd.c drm/radeon: Allow write-combined CPU mappings of BOs in GTT (v2) 2014-08-05 08:53:33 -04:00
radeon_vce.c drm/radeon: Allow write-combined CPU mappings of BOs in GTT (v2) 2014-08-05 08:53:33 -04:00
radeon_vm.c drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
radeon.h drm/radeon: add userptr support v8 2014-08-11 11:04:23 -04:00
rs100d.h
rs400.c drm/radeon: Pass GART page flags to radeon_gart_set_page() explicitly 2014-08-05 08:53:32 -04:00
rs400d.h
rs600.c drm/radeon: Pass GART page flags to radeon_gart_set_page() explicitly 2014-08-05 08:53:32 -04:00
rs600d.h
rs690.c drm/radeon: resume old pm late 2014-03-06 16:46:56 -05:00
rs690d.h
rs780_dpm.c drm/radeon/dpm: move platform caps fetching to a separate function 2014-02-18 16:11:30 +01:00
rs780_dpm.h drm/radeon/kms: add dpm support for rs780/rs880 2013-06-27 10:49:25 -04:00
rs780d.h drm/radeon/dpm: add debugfs support for RS780/RS880 (v3) 2013-07-17 16:47:52 -04:00
rv6xx_dpm.c drm/radeon/dpm: move platform caps fetching to a separate function 2014-02-18 16:11:30 +01:00
rv6xx_dpm.h drm/radeon/kms: add dpm support for rv6xx (v3) 2013-06-27 10:50:08 -04:00
rv6xxd.h drm/radeon/kms: add dpm support for rv6xx (v3) 2013-06-27 10:50:08 -04:00
rv200d.h
rv250d.h
rv350d.h
rv515.c drm/radeon: Prevent too early kms-pageflips triggered by vblank. 2014-07-17 09:01:31 -04:00
rv515d.h
rv730_dpm.c drm/radeon/kms: add dpm support for rv7xx (v4) 2013-06-27 19:14:59 -04:00
rv730d.h drm/radeon/kms: add dpm support for rv7xx (v4) 2013-06-27 19:14:59 -04:00
rv740_dpm.c drm/radeon/dpm/rv7xx: restructure code 2013-06-27 19:16:12 -04:00
rv740d.h drm/radeon/kms: add dpm support for rv7xx (v4) 2013-06-27 19:14:59 -04:00
rv770_dma.c drm/radeon: drm/radeon: add missing radeon_semaphore_free to error path 2014-05-06 12:18:41 +02:00
rv770_dpm.c drm/radeon/dpm: Reenabling SS on Cayman 2014-07-10 17:01:30 -04:00
rv770_dpm.h drm/radeon/dpm: switch on new late_enable callback 2013-12-24 17:56:50 -05:00
rv770_smc.c drm/radeon: protect concurrent smc register access with a spinlock 2013-09-11 11:44:28 -04:00
rv770_smc.h drm/radeon: protect concurrent smc register access with a spinlock 2013-09-11 11:44:28 -04:00
rv770.c drm/radeon: Remove radeon_gart_restore() 2014-08-05 08:53:31 -04:00
rv770d.h drm/radeon: implement pci config reset for r6xx/7xx (v3) 2014-01-08 18:42:22 -05:00
si_blit_shaders.c
si_blit_shaders.h
si_dma.c drm/radeon: split PT setup in more functions 2014-08-05 08:53:55 -04:00
si_dpm.c drm/radeon/dpm: add support for SVI2 voltage for SI 2014-08-05 08:53:21 -04:00
si_dpm.h drm/radeon/dpm: add support for SVI2 voltage for SI 2014-08-05 08:53:21 -04:00
si_reg.h
si_smc.c drm/radeon/si: Add support for new ucode format (v3) 2014-08-05 08:53:23 -04:00
si.c drm/radeon: Use pflip irqs for pageflip completion if possible. (v2) 2014-08-05 08:54:00 -04:00
sid.h Merge commit '9e9a928eed8796a0a1aaed7e0b676db86ba84594' into drm-next 2014-06-05 20:28:59 +10:00
sislands_smc.h drm/radeon/dpm: add support for SVI2 voltage for SI 2014-08-05 08:53:21 -04:00
smu7_discrete.h drm/radeon: add dpm support for CI dGPUs (v2) 2013-08-30 16:30:29 -04:00
smu7_fusion.h drm/radeon/kms: add dpm support for KB/KV 2013-08-30 16:30:28 -04:00
smu7.h drm/radeon/kms: add dpm support for KB/KV 2013-08-30 16:30:28 -04:00
sumo_dpm.c drm/radeon/dpm: move platform caps fetching to a separate function 2014-02-18 16:11:30 +01:00
sumo_dpm.h drm/radeon/sumo add helper to go from vid7 to vid2 2013-08-30 16:30:10 -04:00
sumo_smc.c drm/radeon/dpm: make some functions static for sumo 2014-01-07 12:55:50 -05:00
sumod.h drm/radeon: add dpm UVD handling for sumo asics 2013-06-27 19:15:48 -04:00
trinity_dpm.c drm/radeon/TN: only enable bapm on MSI systems 2014-07-21 13:17:39 -04:00
trinity_dpm.h drm/radeon/dpm: add bapm callback for trinity 2013-09-11 11:44:39 -04:00
trinity_smc.c drm/radeon/dpm: make some functions static for TN 2014-01-07 12:55:57 -05:00
trinityd.h drm/radeon: add dpm UVD handling for TN asics (v2) 2013-06-27 19:15:48 -04:00
uvd_v1_0.c drm/radeon/uvd: use lower clocks on old UVD to boot v2 2014-05-01 10:17:44 +02:00
uvd_v2_2.c drm/radeon: use lower_32_bits where appropriate 2014-06-09 22:06:48 -04:00
uvd_v3_1.c drm/radeon: allow semaphore emission to fail 2013-11-15 15:56:09 -05:00
uvd_v4_2.c drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume 2013-08-30 16:31:12 -04:00
vce_v1_0.c drm/radeon: drop drivers copy of the rptr 2014-02-18 17:49:19 +01:00
vce_v2_0.c drm/radeon: add support for vce 2.0 clock gating 2014-02-18 16:11:44 +01:00