mesa-drm/shared-core
Keith Packard 57b9a54eb6 Allow relocation to be skipped when buffers don't move.
One of the costs of superioctl has been the need to perform relocations
inside the kernel. The cost of mapping the buffers to the CPU and writing
data is fairly high, especially if those buffers have been mapped and read
by the GPU.

If we assume that buffers don't move around very often, we can have the
client compute the relocations itself using the previous GPU address. When
that object doesn't move, the kernel can skip computing and writing the
updated data.

Here's a patch which adds a new field to struct drm_bo_info_req called
'presumed_offset', and a new DRM_BO_HINT_PRESUMED_OFFSET that is set when
this field has been filled in by the client.

There are two separate optimizations performed when the presumed_offset is
correct:

 1. i915_exec_reloc checks to see if all previous buffer offsets were guessed
    correctly. If so, there's no need for it to look at *any* of the
    relocations for a buffer. When this happens, it skips the whole
    relocation process, simply returning success.

 2. i915_apply_reloc checks to see if the target buffer offset was guessed
    correctly. If so, it skips mapping the relocatee, computing the
    relocation and writing the value. If no relocations are needed, the
    relocatee should never be mapped to the CPU, and so the kernel shouldn't
    need to wait for any fences to pass.
2007-12-11 20:23:00 -08:00
..
drm.h Allow relocation to be skipped when buffers don't move. 2007-12-11 20:23:00 -08:00
drm_internal.h Add new shared header file drm_internal.h. 2007-11-14 14:28:34 -05:00
drm_pciids.txt nouveau: Switch over to using PMC_BOOT_0 for card detection. 2007-10-04 09:31:46 +02:00
drm_sarea.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
i915_dma.c Allow relocation to be skipped when buffers don't move. 2007-12-11 20:23:00 -08:00
i915_drm.h drm: more cleanups 2007-11-29 09:38:21 +10:00
i915_drv.h Fix capitalization of __linux__ define. 2007-11-19 08:41:23 -08:00
i915_irq.c Fix pipe<->plane mapping vs. vblank handling (again) 2007-12-07 14:24:45 -08:00
i915_mem.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
imagine_drv.h Add skeletal imagine driver (but don't build it yet). 2005-03-29 01:47:38 +00:00
mach64_dma.c mach64: comment bus master / ring buffer behavior and security 2007-12-08 19:23:18 +00:00
mach64_drm.h drm: detypedef drm.h and fixup all problems 2007-07-16 11:22:15 +10:00
mach64_drv.h mach64: comment bus master / ring buffer behavior and security 2007-12-08 19:23:18 +00:00
mach64_irq.c drm: remove drmP.h internal typedefs 2007-07-16 12:32:51 +10:00
mach64_state.c mach64: comment bus master / ring buffer behavior and security 2007-12-08 19:23:18 +00:00
Makefile.am Move types shared with user mode to xgi_drm.h. 2007-07-09 16:33:14 -07:00
mga_dma.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
mga_drm.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
mga_drv.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
mga_irq.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
mga_state.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
mga_ucode.h Lindent of core build. Drivers checked for no binary diffs. A few files 2004-09-30 21:12:10 +00:00
mga_warp.c Remove DRM_ERR OS macro. 2007-07-20 12:53:52 -07:00
nouveau_dma.c nouveau: store user control reg offsets in channel struct 2007-11-14 04:09:53 +11:00
nouveau_dma.h nouveau: store user control reg offsets in channel struct 2007-11-14 04:09:53 +11:00
nouveau_drm.h Revert "nouveau: stub superioctl" 2007-11-14 05:11:11 +11:00
nouveau_drv.h Revert "nouveau: stub superioctl" 2007-11-14 05:11:11 +11:00
nouveau_fifo.c nouveau: Also wait until CACHE1 gets emptied. 2007-11-14 05:36:20 +11:00
nouveau_irq.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nouveau_mem.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nouveau_notifier.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nouveau_object.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nouveau_reg.h nouveau: Also wait until CACHE1 gets emptied. 2007-11-14 05:36:20 +11:00
nouveau_state.c nouveau: Properly identify NV40 and NV44 generation. 2007-11-30 22:50:34 +01:00
nouveau_swmthd.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nouveau_swmthd.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv04_fb.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv04_fifo.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nv04_graph.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nv04_instmem.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nv04_mc.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv04_timer.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv10_fb.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv10_fifo.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nv10_graph.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nv20_graph.c nouveau: revert the nv34 context size change, it was not the culprit after all. 2007-11-15 18:01:26 +01:00
nv40_fb.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv40_fifo.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nv40_graph.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv40_mc.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv50_fifo.c nouveau: funcs to determine active channel on PFIFO. 2007-11-14 03:27:37 +11:00
nv50_graph.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv50_instmem.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
nv50_mc.c nouveau: enable/disable engine-specific interrupts in _init()/_takedown() 2007-08-08 10:49:05 +10:00
nv_drv.h Skeleton nv drm driver, to enable DMA in EXA. (Lars Knoll, minor updates by 2005-10-06 23:31:29 +00:00
r128_cce.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
r128_drm.h drm: remove XFREE86_VERSION macros 2007-08-28 15:17:36 +10:00
r128_drv.h drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
r128_irq.c drm: remove drmP.h internal typedefs 2007-07-16 12:32:51 +10:00
r128_state.c Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE. 2007-07-20 18:16:42 -07:00
r300_cmdbuf.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
r300_reg.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
radeon_cp.c bsd: Replace other occurrences of msleep with mtx_sleep 2007-12-02 01:45:09 -05:00
radeon_drm.h radeon: refactor out the fb/agp location read/write. 2007-11-18 19:25:31 +10:00
radeon_drv.h drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
radeon_irq.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
radeon_mem.c Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE. 2007-07-20 18:16:42 -07:00
radeon_state.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
savage_bci.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
savage_drm.h drm: detypedef drm.h and fixup all problems 2007-07-16 11:22:15 +10:00
savage_drv.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
savage_state.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
sis_drm.h Assert an MIT copyright on sis_drm.h, since one was lacking and I created 2005-11-28 23:10:41 +00:00
sis_drv.h drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
sis_ds.c complete fix for attribution 2006-01-02 03:30:57 +00:00
sis_ds.h some fixes from linux kernel 2006-01-02 03:44:23 +00:00
sis_mm.c Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE. 2007-07-20 18:16:42 -07:00
tdfx_drv.h Assert an MIT copyright on sis_drm.h, since one was lacking and I created 2005-11-28 23:10:41 +00:00
via_3d_reg.h drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
via_dma.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
via_drm.h drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
via_drv.c drm: detypedef ttm/bo/fence code 2007-07-16 13:37:02 +10:00
via_drv.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
via_ds.c Port the VIA DRM to FreeBSD. Original patch by Jake, with some cleanup by 2005-08-15 18:07:12 +00:00
via_ds.h VIA: Fix sparse warnings (Alexey Dobriyan) 2005-07-15 21:22:51 +00:00
via_irq.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
via_map.c drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00
via_mm.c Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE. 2007-07-20 18:16:42 -07:00
via_mm.h VIA: 2005-05-23 20:56:54 +00:00
via_verifier.c drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
via_verifier.h drm: major whitespace/coding style realignment with kernel 2007-11-22 16:10:36 +10:00
via_video.c Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE. 2007-07-20 18:16:42 -07:00
xgi_drm.h drm: remove lots of spurious whitespace. 2007-11-05 12:42:22 +10:00