summaryrefslogtreecommitdiff
path: root/libdrm/intel
AgeCommit message (Collapse)Author
2009-05-14Add new drm_intel_get_pipe_from_crtc_id function.Carl Worth
This wraps the new DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID ioctl, allowing applications to discover the pipe number corresponding to a given CRTC ID. This is necessary for doing pipe-specific operations such as waiting for vblank on a given CRTC.
2009-05-12libdrm/intel: add drm_intel_bo_disable_reuse apiKeith Packard
Scanout buffers need to be freed through the kernel as it holds a reference to them; exposing this API allows applications allocating scanout buffers to flag them as not reusable. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2009-05-01libdrm/intel: assert that clients are using bo refcounting correctlyKeith Packard
Add assertions to drm_intel_gem_bo_reference, drm_intel_gem_bo_reference_locked and drm_intel_gem_bo_unreference_locked that the object has not been freed (refcount > 0). Mistakes in refcounting lead to attempts to insert a bo into a free list more than once which causes application failure as empty free lists are dereferenced as buffer objects. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-04-27intel: NULL fake bo block when freeing in evict_allJesse Barnes
Fixes assertion failures on later use of the object.
2009-03-26libdrm/intel: support GTT maps correctlyJesse Barnes
libdrm has some support for GTT mapping already, but there are bugs with it (no surprise since it hasn't been used much). In fixing 20803, I found that sharing bo_gem->virtual was a bad idea, since a previously mapped object might not end up getting GTT mapped, leading to corruption. So this patch splits the fields according to use, taking care to unmap both at free time (but preserving the map caching). There's still a risk we might run out of mappings (there's a sysctl tunable for max number of mappings per process, defaulted to 64k or so it looks like) but at least GTT maps will work with these changes (and some others for fixing PAT breakage in the kernel). Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-02-27intel: Update reloc_tree_size of the first buffer when we count the tree size.Eric Anholt
This helps avoid the n^2 performance cost of counting tree size when we get a lot of relocations into our batch buffer. rgb10text on keithp's laptop went from 136k glyphs/sec to 234k glyphs/sec.
2009-02-24intel: Don't copy dirty data out when freeing a BO in the fake bufmgr.Eric Anholt
2009-02-21intel: Add a new bufmgr alloc function to get BOs ready for rendering to.Eric Anholt
This avoids using the oldest BO in the BO cache and waiting for it to be idle before we turn around and render to it with the GPU. Thanks to Chris Wilson for pointing out how silly we were being.
2009-02-15intel: Clear ioctl parameter outvalues and pads that confuse valgrind.Eric Anholt
The minor CPU cost here is probably outweighed by bothering us with noise in the tool.
2009-01-27intel: don't count fences on 965 and later, as they don't use them.Eric Anholt
2009-01-27intel: Fix under-counting of fences registers required in check_aperture.Eric Anholt
2009-01-27intel: libdrm support for fence management in execbufJesse Barnes
This patch tries to use the available fence count to figure out whether a given batch can succeed or not (just like the aperture check). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net>
2009-01-14intel: Retry pin ioctl on -EINTR.Eric Anholt
2009-01-13Don't use DRM_BO_FLAG_NO_MOVE in bufmgr fake. It's a ttm flag.Owain G. Ainsworth
It's also unused, so worthless.
2008-12-17intel: Cache tiling/swizzle state in user mode. Reset tiling on reuse.Keith Packard
Remember tiling mode values provided by appplications, and record tiling mode when creating a buffer from another application. This eliminates any need to ask the kernel for tiling values and also makes reused buffers get the right tiling. Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-17intel: Debug output %u vs uint64_t warning fixKeith Packard
Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-17intel: return error status from drm_intel_gem_bo_mapKeith Packard
Applications may actually care if the mapping operation failed, so when it happens, return an error indication. errno is probably trashed by fprintf though. Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-17intel: Dump out memory usage information when the kernel fails to pinKeith Packard
The execbuffer ioctl returns ENOMEM when it fails to pin all of the buffers in the GTT. This is usually caused by the DRM client attempting to use too much memory in a single request. Dumping out the requested and available memory values should help point out failures in the DRM code to catch over commitments of this form. Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-17libdrm: add mode setting filesJesse Barnes
Add mode setting files to libdrm, including xf86drmMode.* and the new drm_mode.h header. Also add a couple of tests to sanity check the kernel interfaces and update code to support them.
2008-12-14intel: don't skip set_domain on mapping of shared buffers.Eric Anholt
2008-12-14intel: don't let named buffers into the BO cache.Eric Anholt
We wouldn't want some remaining 3D rendering to scribble on our batchbuffer.
2008-12-14intel: Remove the mapped flag, which is adequately covered by bo_gem->virtual.Eric Anholt
2008-12-10Revert "Merge branch 'modesetting-gem'"Jesse Barnes
This reverts commit 6656db10551bbb8770dd945b6d81d5138521f208. We really just want the libdrm and ioctl bits, not all the driver stuff.
2008-12-03Merge branch 'master' into modesetting-gemJesse Barnes
2008-12-02intel: Add a function for setting (GTT,GTT) domain, for use by UXA.Eric Anholt
This function can also serve the role that the bo_wait_rendering did, when write_enable is unset.
2008-11-19libdrm_intel: fix merge errorJesse Barnes
don't take the lock twice
2008-11-13Merge branch 'master' into modesetting-gemJesse Barnes
Conflicts: libdrm/Makefile.am libdrm/intel/intel_bufmgr.h libdrm/intel/intel_bufmgr_fake.c libdrm/intel/intel_bufmgr_gem.c shared-core/drm.h shared-core/i915_dma.c shared-core/i915_irq.c shared-core/radeon_cp.c shared-core/radeon_drv.h
2008-11-13libdrm_intel: fix warnings on 64 bitJesse Barnes
Cast a couple of %llx args to unsigned long long.
2008-11-13libdrm: add support for i915 GTT mapping ioctlJesse Barnes
Add a drm_intel_gem_bo_map_gtt() function for mapping a buffer object through the aperture rather than directly to its CPU cacheable memory.
2008-11-07intel: Restart on interrupt of bo_wait_rendering instead of complaining.Eric Anholt
2008-10-30intel: Rename dri_ and intel_ symbols to drm_intel_.Eric Anholt
I wanted to avoid doing this, as it's a bunch of churn, but there was a conflict between the dri_ symbols in libdrm and the symbols that were in Mesa in 7.2, which broke Mesa 7.2 AIGLX when the 2D driver had loaded new libdrm symbols. The new naming was recommended by cworth for giving the code a unique prefix identifying where the code lives. Additionally, take the opportunity to fix up two API mistakes: emit_reloc's arguments were in a nonsensical order, and set_tiling lacked the stride argument that the kernel will want to use soon. API compatibility with released code is maintained using #defines.
2008-10-28intel: Add dri_bufmgr_check_aperture support for bufmgr_gem.Eric Anholt
This relies on a new kernel ioctl to get the available aperture size. In order to provide reasonable performance from dri_bufmgr_check_aperture, we now require that once a buffer has been used as the target of a relocation, it gets no further relocations added to it. This cuts the cost of check_aperture from 10% to 1% in the 3D driver with no code changes, but slightly complicates our plans for the 2D driver.
2008-10-24intel: Also total child_size of the target_bos. Partial fix #17964.Xiang, Haihao
2008-10-16intel: ioctl is not defined to return -errnoKeith Packard
Don't count on ioctl returning -errno; use errno directly. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2008-10-17link libdrm_intel properlyDave Airlie
libdrm_intel needs symbols from libdrm, so link against it. (cherry picked from commit d9c2f65dd8e50736a33e97a55c257ef6843e1ce7) Conflicts: libdrm/Makefile.am
2008-10-17intel: Protect bufmgr objects with a pthread mutex.Eric Anholt
We want to be able to use the bufmgr from multiple threads for GL, and thus we need to protect the internal structures. The pthread-stubs package is used so that programs not linked against pthreads get weak symbols to stubs and don't eat most of the cost.
2008-10-16intel: avoid deadlock in intel_bufmgr_fake.Xiang, Haihao
2008-10-14intel: Fix compile warning.Eric Anholt
2008-10-14intel: Add interface for getting tiling mode of a bo.Eric Anholt
2008-10-13link libdrm_intel properlyJulien Cristau
libdrm_intel needs symbols from libdrm, so link against it.
2008-10-13intel: Avoid pthread mutex recursion in bufmgr_fake.Eric Anholt
Bug #18035. Fixes deadlock in glean texCube testcase.
2008-10-09Manage fences in user-mode bufmgr_fake to clean buffersKeith Packard
When using bufmgr_fake without DRM, the X server idles the ring whenever it wants to wait for something to complete (brutal, but effective). In this case, bufmgr_fake must treat the pending fence as having passed. However, it wasn't recording the fences as it emitted them, nor cleaning buffers as they passed. Signed-off-by: Keith Packard <keithp@keithp.com>
2008-10-09intel: Protect bufmgr objects with a pthread mutex.Eric Anholt
We want to be able to use the bufmgr from multiple threads for GL, and thus we need to protect the internal structures. The pthread-stubs package is used so that programs not linked against pthreads get weak symbols to stubs and don't eat most of the cost.
2008-10-09intel: fix for write_domain and static BOs.Xiang, Haihao
http://bugs.freedesktop.org/show_bug.cgi?id=17705
2008-09-30intel bufmgr: reinstate buffer handle trackingJesse Barnes
We need a way of getting at the underlying handle for use with mode setting. We can either export it in the dri_bo object or provide a new callback to get it.
2008-09-30Merge remote branch 'origin/master' into modesetting-gemDave Airlie
Conflicts: libdrm/Makefile.am libdrm/dri_bufmgr.h linux-core/drm_irq.c linux-core/drm_sysfs.c linux-core/drm_ttm.c shared-core/i915_dma.c shared-core/i915_irq.c shared-core/nouveau_drv.h shared-core/radeon_cp.c
2008-09-27intel: Copy data from card memory back to backing store when mapping.Xiang, Haihao
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=17705
2008-09-23intel: Allow up to 15 seconds chewing on one buffer before acknowledging -EBUSY.Eric Anholt
The gltestperf demo in some cases took over seven seconds to make it through one batchbuffer on a GM965. Bug #17004.
2008-09-23intel: Replace wraparound test logic in bufmgr_fake. Again.Eric Anholt
I'd swapped the operands, so if we weren't in lockstep with the hardware we said the sequence was always passed. Additionally, a race was available that we might have failed at recovering from. Instead, I've replaced the logic with new stuff that should be more robust and not rely on all the parties in userland following the same IRQ_EMIT() == 1 protocol. Also, in a radical departure from past efforts, include a long comment describing the failure modes and how we're working around them. Thanks to haihao for catching the original issue.
2008-09-23intel: Do strerror on errno, not on the -1 return value from ioctl.Eric Anholt