linux/drivers/gpu/drm/amd/amdgpu
Chris Wilson 4e64e5539d drm: Improve drm_mm search (and fix topdown allocation) with rbtrees
The drm_mm range manager claimed to support top-down insertion, but it
was neither searching for the top-most hole that could fit the
allocation request nor fitting the request to the hole correctly.

In order to search the range efficiently, we create a secondary index
for the holes using either their size or their address. This index
allows us to find the smallest hole or the hole at the bottom or top of
the range efficiently, whilst keeping the hole stack to rapidly service
evictions.

v2: Search for holes both high and low. Rename flags to mode.
v3: Discover rb_entry_safe() and use it!
v4: Kerneldoc for enum drm_mm_insert_mode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com> # vmwgfx
Reviewed-by: Lucas Stach <l.stach@pengutronix.de> #etnaviv
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170202210438.28702-1-chris@chris-wilson.co.uk
2017-02-03 11:10:32 +01:00
..
amdgpu_acp.c drm/virtio: fix busid in a different way, allocate more vbufs. 2016-11-30 14:18:51 +10:00
amdgpu_acp.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
amdgpu_acpi.c drm/amdgpu: Remove checking for atombios 2017-01-27 11:12:39 -05:00
amdgpu_afmt.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_amdkfd_gfx_v7.c drm/amdkfd: Fix possible infinite loop 2016-09-19 20:58:35 +03:00
amdgpu_amdkfd_gfx_v8.c drm/amdkfd: Fix possible infinite loop 2016-09-19 20:58:35 +03:00
amdgpu_amdkfd.c drm/amdgpu: remove unused functions 2016-09-22 10:24:16 -04:00
amdgpu_amdkfd.h drm/amdgpu: Return -EPROBE_DEFER when amdkfd not loaded 2016-02-27 22:52:40 +02:00
amdgpu_atombios.c drm/amdgpu/atom: remove a bunch of unused functions 2016-10-25 14:38:56 -04:00
amdgpu_atombios.h drm/amdgpu/atom: remove a bunch of unused functions 2016-10-25 14:38:56 -04:00
amdgpu_atpx_handler.c drm/amdgpu: fix check for port PM availability 2016-11-29 09:23:39 -05:00
amdgpu_benchmark.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_bios.c drm/amdgpu: handle vfct with multiple vbios images 2017-01-27 12:20:42 -05:00
amdgpu_bo_list.c drm/amdgpu: Attach exclusive fence to prime exported bo's. (v5) 2016-11-11 10:20:04 -05:00
amdgpu_cgs.c drm/amdgpu: add cgs interface for enter/exit rlc safe mode. 2017-01-27 11:12:46 -05:00
amdgpu_connectors.c drm/virtio: fix busid in a different way, allocate more vbufs. 2016-11-30 14:18:51 +10:00
amdgpu_connectors.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_cs.c drm/amdgpu: use the num_rings variable for checking vce rings 2017-01-27 11:13:29 -05:00
amdgpu_ctx.c Merge tag 'topic/drm-misc-2016-10-27' of git://anongit.freedesktop.org/git/drm-intel into drm-next 2016-10-28 11:33:52 +10:00
amdgpu_device.c Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10:00
amdgpu_display.c drm/amdgpu: Refactor flip into prepare submit and submit. (v3) 2017-01-27 11:13:31 -05:00
amdgpu_dpm.c drm/amdgpu/dpm: add an implementation for get_vce_clock_state (v2) 2016-10-25 14:38:41 -04:00
amdgpu_dpm.h drm/amd/powerplay: Unify dpm level defines 2017-01-27 11:12:53 -05:00
amdgpu_drv.c Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10: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 drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
amdgpu_fence.c drm/amdgpu:no gpu scheduler for KIQ 2016-11-11 10:20:58 -05:00
amdgpu_gart.c drm/amdgpu: add AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag v3 2016-10-25 14:38:13 -04:00
amdgpu_gds.h amdgpu: move ttm stuff to amdgpu_ttm.h 2016-08-19 12:30:58 -04:00
amdgpu_gem.c drm/amd/amdgpu: add check that shadow page tables are GPU-accessible 2017-01-27 11:13:18 -05:00
amdgpu_gfx.c drm/amdgpu: simplify allocation of scratch regs 2017-01-27 11:13:32 -05:00
amdgpu_gfx.h drm/amdgpu: change function declarations and add missing header dependencies 2016-10-25 14:38:58 -04:00
amdgpu_gtt_mgr.c drm: Improve drm_mm search (and fix topdown allocation) with rbtrees 2017-02-03 11:10:32 +01:00
amdgpu_i2c.c drm/amdgpu: Remove checking for atombios 2017-01-27 11:12:39 -05:00
amdgpu_i2c.h drm/amdgpu/i2c: add const where appropriate 2016-09-27 13:00:52 -04:00
amdgpu_ib.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
amdgpu_ih.c drm/amdgpu: free the BO in kernel by helper amdgpu_bo_free_kernel() 2016-09-14 15:10:27 -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/radeon|amdgpu: Remove redundant num_connectors check 2016-12-18 14:18:12 +01:00
amdgpu_irq.h drm/amdgpu: remove amdgpu_irq_get_delayed 2016-11-23 15:08:43 -05:00
amdgpu_job.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
amdgpu_kms.c drm/amdgpu: request/release full gpu access if device is vf 2017-01-27 11:13:25 -05:00
amdgpu_mn.c drm/amdgpu: remove adev pointer from struct amdgpu_bo v2 2016-10-25 14:38:26 -04:00
amdgpu_mode.h drm/amdgpu: Refactor flip into prepare submit and submit. (v3) 2017-01-27 11:13:31 -05:00
amdgpu_object.c drm/amdgpu: Bring bo creation in line with radeon driver (v2) 2017-01-27 12:20:36 -05:00
amdgpu_object.h drm/amd/amdgpu: add amdgpu_bo_gpu_accessible helper function 2017-01-27 11:13:17 -05:00
amdgpu_pll.c drm/amdgpu: add missing header dependencies 2016-09-14 15:10:37 -04:00
amdgpu_pll.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_pm.c drm/amdgpu: fix typo of CGTS 2017-01-27 11:13:27 -05:00
amdgpu_pm.h drm/amdgpu: add parse clock gating state 2017-01-27 11:13:07 -05:00
amdgpu_powerplay.c drm/amd/powerplay: refine powerplay interface. 2017-01-27 11:12:58 -05:00
amdgpu_powerplay.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
amdgpu_prime.c drm/amdgpu: Attach exclusive fence to prime exported bo's. (v5) 2016-11-11 10:20:04 -05:00
amdgpu_ring.c drm/amdgpu:set cond_exec polling value to 1 in ring_init 2017-01-27 11:13:37 -05:00
amdgpu_ring.h drm/amdgpu/ring: add two interfaces to support r/w registers with kiq 2017-01-27 11:13:21 -05:00
amdgpu_sa.c drm/amd/amdgpu : Fix NULL pointer comparison 2016-11-11 10:21:07 -05:00
amdgpu_sync.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_sync.h Merge tag 'topic/drm-misc-2016-10-27' of git://anongit.freedesktop.org/git/drm-intel into drm-next 2016-10-28 11:33:52 +10:00
amdgpu_test.c dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
amdgpu_trace_points.c drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
amdgpu_trace.h drm/amd/amdgpu: Widen mmio trace register address width 2017-01-27 11:12:39 -05:00
amdgpu_ttm.c drm/amd/amdgpu/amdgpu_ttm: Handle return NULL error from ioremap_nocache 2017-01-27 12:20:38 -05:00
amdgpu_ttm.h drm/amdgpu: user BO priority instead of self coding it (v2) 2017-01-27 12:20:33 -05:00
amdgpu_ucode.c drm/amdgpu:properly fix some JumpTable issues 2016-10-25 14:38:23 -04:00
amdgpu_ucode.h drm/amdgpu:add MEC_STORAGE ucode id for sriov 2016-10-25 14:38:23 -04:00
amdgpu_uvd.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
amdgpu_uvd.h drm/amd/amdgpu: get maximum and used UVD handles (v4) 2017-01-27 11:12:38 -05:00
amdgpu_vce.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
amdgpu_vce.h Merge tag 'topic/drm-misc-2016-10-27' of git://anongit.freedesktop.org/git/drm-intel into drm-next 2016-10-28 11:33:52 +10:00
amdgpu_virt.c drm/amdgpu/virt: enable virtual display 2017-01-27 11:13:26 -05:00
amdgpu_virt.h drm/amdgpu:add META_DATA struct for CSA/SRIOV v2 2017-01-27 11:13:33 -05:00
amdgpu_vm.c drm/amdgpu: fix amdgpu_bo_va_mapping flags 2017-01-27 12:20:45 -05:00
amdgpu_vm.h drm/amdgpu: fix amdgpu_bo_va_mapping flags 2017-01-27 12:20:45 -05:00
amdgpu_vram_mgr.c drm: Improve drm_mm search (and fix topdown allocation) with rbtrees 2017-02-03 11:10:32 +01:00
amdgpu.h Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next 2017-02-01 08:39:35 +10:00
atom.c drm/amdgpu/atom: add support for new div32 opcodes (v3) 2015-10-14 16:16:24 -04:00
atom.h drm/amd: cleanup remaining spaces and tabs v2 2016-05-11 12:31:20 -04:00
atombios_crtc.c drm/amdgpu: change function declarations and add missing header dependencies 2016-10-25 14:38:58 -04:00
atombios_crtc.h drm/amdgpu/atom: add SetDCEClock helper 2016-05-04 20:23:53 -04:00
atombios_dp.c drm/amdgpu: Don't retry 7 times in amdgpu_atombios_dp_get_dpcd() 2016-08-08 13:28:39 -04:00
atombios_dp.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_encoders.c drm/amdgpu: Remove checking for atombios 2017-01-27 11:12:39 -05:00
atombios_encoders.h drm/amdgpu: add core driver (v4) 2015-06-03 21:03:15 -04:00
atombios_i2c.c drm/amdgpu: add missing header dependencies 2016-09-14 15:10:37 -04:00
atombios_i2c.h drm/amdgpu: fix power distribution issue for Polaris10 XT 2016-07-14 16:39:35 -04:00
ci_dpm.c drm/amdgpu: refine ci uvd dpm code. 2017-01-27 11:13:33 -05:00
ci_dpm.h drm/amdgpu: add the CI code to enable sclk OD(OverDrive) 2016-07-07 14:50:49 -04:00
ci_smc.c drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -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: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cik_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cik_sdma.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
cik_sdma.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cik.c drm/amdgpu: remove detect_hw_virtualization interface 2017-01-27 11:13:05 -05:00
cik.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cikd.h drm/amdgpu/dce8: simplify hpd code 2016-10-25 14:38:08 -04:00
clearstate_ci.h drm/amdgpu: Add support for CIK parts 2015-06-03 21:03:17 -04:00
clearstate_defs.h
clearstate_si.h drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
clearstate_vi.h drm/amdgpu: Add initial VI support 2015-06-03 21:03:17 -04:00
cz_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
cz_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_v6_0.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2017-01-27 11:00:42 +10:00
dce_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_v8_0.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2017-01-27 11:00:42 +10:00
dce_v8_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_v10_0.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2017-01-27 11:00:42 +10:00
dce_v10_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_v11_0.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2017-01-27 11:00:42 +10:00
dce_v11_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
dce_virtual.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
dce_virtual.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gfx_v6_0.c drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
gfx_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gfx_v7_0.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
gfx_v7_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gfx_v8_0.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
gfx_v8_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v6_0.c drm/amdgpu: fix vm_fault_stop on gfx6 2017-01-12 17:39:34 -05:00
gmc_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v7_0.c drm/amdgpu: access stolen VRAM directly on KV/KB (v2) 2017-01-27 12:20:44 -05:00
gmc_v7_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
gmc_v8_0.c drm/amdgpu: access stolen VRAM directly on CZ (v2) 2017-01-27 12:20:45 -05:00
gmc_v8_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
iceland_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
iceland_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -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
Kconfig drm/amdgpu: remove DRM_AMD_POWERPLAY 2016-10-04 11:15:59 -04:00
kv_dpm.c drm/amdgpu: fix kernel panic when dpm disabled on Kv. 2017-01-27 12:20:44 -05: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/virt: implement VI virt operation interfaces 2017-01-27 11:13:24 -05:00
mxgpu_vi.c drm/amdgpu/virt: implement VI virt operation interfaces 2017-01-27 11:13:24 -05:00
mxgpu_vi.h drm/amdgpu/virt: implement VI virt operation interfaces 2017-01-27 11:13:24 -05:00
ObjectID.h Revert "drm/amdgpu: Add virtual connector and encoder macros." 2016-10-25 14:38:06 -04:00
ppsmc.h drm/amdgpu: add new definitions into ppsmc.h for iceland 2016-07-15 12:33:31 -04:00
r600_dpm.h drm/amdgpu: add SI DPM support (v4) 2016-08-31 15:21:09 -04:00
sdma_v2_4.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
sdma_v2_4.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
sdma_v3_0.c drm/amd/amdgpu: remove the uncessary parameter for ib scheduler 2017-01-27 12:20:37 -05:00
sdma_v3_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si_dma.c drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
si_dma.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si_dpm.c drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
si_dpm.h drm/amdgpu: add SI DPM support (v4) 2016-08-31 15:21:09 -04:00
si_enums.h drm/amd/amdgpu: port of DCE v6 to new headers (v3) 2016-11-23 15:08:42 -05:00
si_ih.c drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
si_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
si_smc.c drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
si.c drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
si.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
sid.h drm/amdgpu: move misc si headers into amdgpu 2017-01-27 12:20:41 -05:00
sislands_smc.h drm/amdgpu/si/dpm: fix phase shedding setup 2016-09-28 16:13:17 -04:00
tonga_ih.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
tonga_ih.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -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
uvd_v4_2.c drm/amdgpu: change clock gating mode for uvd_v4. 2017-01-17 15:25:26 -05:00
uvd_v4_2.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
uvd_v5_0.c drm/amdgpu: add get clockgating_state method for uvd v5&v6 2017-01-27 11:13:10 -05:00
uvd_v5_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
uvd_v6_0.c drm/amdgpu: add get clockgating_state method for uvd v5&v6 2017-01-27 11:13:10 -05:00
uvd_v6_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vce_v2_0.c drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vce_v2_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vce_v3_0.c drm/amdgpu: refine vce3.0 initialize. 2017-01-27 11:13:15 -05:00
vce_v3_0.h drm/amdgpu: rework IP block registration (v2) 2016-10-25 14:38:45 -04:00
vi_dpm.h drm/amdgpu: cleanup useless extern functions 2017-01-27 11:12:43 -05:00
vi.c drm/amdgpu/vi: fix mailbox irq mistake 2017-01-27 11:13:40 -05:00
vi.h drm/amdgpu:add META_DATA struct for CSA/SRIOV v2 2017-01-27 11:13:33 -05:00
vid.h drm/amdgpu/gfx8: add support kernel interface queue(KIQ) 2017-01-27 11:13:03 -05:00