Commit Graph

416 Commits (015efd1bfa72ab8b80cc45f11eb22d7f1a1085f7)

Author SHA1 Message Date
Ian Romanick 015efd1bfa strcasecmp is in strings.h.
Based on patch by Pauli Nieminen.  Thanks.
2009-07-06 09:23:59 -07:00
Dave Airlie 39970c67b7 radeon: move cs space checking code to libdrm_radeon.
This ports a lot of the space checking code into a the common
library, so that the DDX and mesa can use it.
2009-07-06 15:10:11 +10:00
Jerome Glisse 72a29340ea radeon: fix cs buffer realloc padding
We always realloc at least 0x1000 dwords (page on most system)
when growing the cs buffer this is to avoid having to realloc
at each cs_begin.
2009-07-03 15:03:03 +02:00
Dave Airlie af90222c45 radeon: fix realloc of packets.
This should use ndw not cdw, using cdw leads to realloc alignment going wrong
2009-07-03 21:13:22 +10:00
Dave Airlie fbac5891b9 radeon: add buffer naming function 2009-07-02 15:42:01 +10:00
Dave Airlie de1ed01214 radeon: add support for write followed by read relocs.
the DDX does this and used to handle it internally
2009-06-30 12:19:28 +10:00
Dave Airlie 2fa2db138b libdrm/radeon: add initial libdrm_radeon
requires --enable-radeon-experimental-api for now
2009-06-17 17:47:42 +10:00
Ben Skeggs 3d4bfe8c89 nouveau: 0.0.14 + extend bo interface to support subrange mapping
Normal map() should operate as before, and map_range()/map_flush() should
give correct results but lacking any performance difference from map().

Nothing exiting being done here yet, but the interface is a good start.
2009-06-05 14:07:23 +10:00
Ben Skeggs 2cb4c64d73 nouveau: fix bo mapping issue 2009-06-04 09:01:32 +10:00
Ben Skeggs 00fae87f96 nouveau: fill in bo->tiled field for referenced buffers
Fixes the dri1 gallium driver if the front buffer happens to be non-linear.
2009-06-03 10:25:53 +10:00
Ben Skeggs c65a343ed2 nouveau: bump for 0.0.13 2009-05-26 15:47:14 +10:00
Eric Anholt f355ad8943 intel: quiet a warning. 2009-05-19 10:07:16 -07:00
Eric Anholt 469655fab7 intel: Only do BO caching up to 64MB objects.
This avoids making objects significantly bigger than they would be
otherwise, which would result in some failing at binding to the GTT.
Found from firefox hanging on:
http://upload.wikimedia.org/wikipedia/commons/b/b7/Singapore_port_panorama.jpg
due to a software fallback trying to do a GTT-mapped copy between two 73MB
BOs that were instead each 128MB, and failing because both couldn't fit
simultaneously.

The cost here is that we get no opportunity to cache these objects and
avoid the mapping.  But since the objects are a significant percentage
of the aperture size, each mapped access is likely having to fault and rebind
the object most of the time anyway.

Bug #20152 (2/3)
2009-05-19 10:05:38 -07:00
Keith Packard f57d7f4b0b libdrm/intel: Make get_pipe_from_crtc_id per-bufmgr. Return -1 on failure.
The convention is that all APIs are per-bufmgr, so make this one the same.
Then, have it return -1 on failure so that the application can know what's
going on and do something sensible.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-05-14 16:58:14 -07:00
Carl Worth afd245dd7f Add new drm_intel_get_pipe_from_crtc_id function.
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-14 15:32:54 -07:00
Keith Packard 5b5ce30128 libdrm/intel: add drm_intel_bo_disable_reuse api
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-12 18:19:22 -07:00
Alan Coopersmith 1bae8844ca Delete extra libdrm_lists.h line after libdrm_la_SOURCES in libdrm/Makefile.am
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-09 17:22:17 -07:00
Keith Packard 68103b2758 libdrm/intel: assert that clients are using bo refcounting correctly
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-05-01 18:49:59 -07:00
Jesse Barnes 11b60973bc intel: NULL fake bo block when freeing in evict_all
Fixes assertion failures on later use of the object.
2009-04-27 11:49:16 -07:00
Dave Airlie 412d370b9a libdrm/mode: align subpixel results 2009-04-22 20:25:40 +10:00
Ben Skeggs a1e3ab9e55 nouveau: write posting got lost somewhere, bring it back 2009-04-17 09:29:19 +10:00
Ben Skeggs 78e753d033 nouveau: store bo handle in public struct in bo_ref_handle 2009-04-15 12:44:21 +10:00
Jesse Barnes 3637dcc66d Revert "libdrm: speed up connector & mode fetching"
This reverts commit cd5c66c659.  It broke too
many kernel assumptions about the double ioctl (connector status, mode
fetching, etc.)
2009-04-10 15:24:10 -07:00
Jesse Barnes cd5c66c659 libdrm: speed up connector & mode fetching
This patch speeds up drmModeGetConnector by pre-allocating mode &
property info space before calling into the kernel.  In many cases this
pre-allocation will be sufficient to hold the returned values (it's easy
enough to tweak if the common case becomes larger), which means we don't
have to make the second call, which saves a lot of time.

Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-03-30 14:37:04 -07:00
Jesse Barnes e2d7dfb61a libdrm/intel: support GTT maps correctly
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-03-26 16:43:00 -07:00
Ben Skeggs d6ad0dba01 libdrm/nouveau: fix typo in nouveau_device_close() 2009-03-25 08:10:12 +10:00
Ben Skeggs 98b0df3953 libdrm/nouveau: ask the kernel for vram/gart aperture sizes 2009-03-20 10:41:28 +10:00
Ben Skeggs bad16a6b22 libdrm/nouveau: remove unneccesary null ptr checks 2009-03-20 10:32:47 +10:00
Ben Skeggs c37fca4ef6 libdrm/nouveau: incr refcount on ref fence before decr on old fence 2009-03-20 10:25:16 +10:00
Maarten Maathuis 00d8e960ca libdrm/nouveau: unref fences when deleting bo
- This was causing a significant memory leak.
2009-03-20 00:02:12 +01:00
Ben Skeggs 6169e3a601 libdrm/nouveau: implement bo_handle_get for !mm_enabled
bo_handle_ref on !mm_enabled treats handle as an offset, make
bo_handle_get do the same rather than failing.
2009-03-18 10:25:22 +10:00
Robert Noland 2e2e8575b1 libdrm_nouveau: The handle that is passed to mmap needs to be drm_handle_t
drm_handle_t is defined to be a u32 on linux and a u64 on everything
else.  This addresses an issue on FreeBSD amd64 where the map offsets
may be greater than 32bits.  When the handle is cast to 32bit, mmap
cannot match the requested map and causes X to crash.

This should be a NOOP on linux since drm_handle_t is always 32bit.

Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-03-16 01:20:08 -05:00
Eric Anholt 7ce8d4c1fe intel: Update reloc_tree_size of the first buffer when we count the tree size.
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-27 14:12:54 -08:00
Eric Anholt efa485b2cf intel: Don't copy dirty data out when freeing a BO in the fake bufmgr. 2009-02-24 22:31:27 -08:00
Kristian Høgsberg c3c21303e3 nouveau: Dist nouvea_dma.h as well.
Oops.  Disting is hard.
2009-02-24 11:42:46 -05:00
Kristian Høgsberg a71d3edd6c nouveau: Also dist nouveau_private.h. 2009-02-24 11:19:41 -05:00
Ivan Kokshaysky 6feac49398 Fix DRM_CAS() on Alpha. (#16549) 2009-02-23 15:54:42 -05:00
Eric Anholt 4d5341340f Fix distcheck for optional nouveau stuff. 2009-02-21 10:01:40 -08:00
Eric Anholt 72abe983ad intel: Add a new bufmgr alloc function to get BOs ready for rendering to.
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-21 09:57:06 -08:00
Ben Skeggs a1345338fe libdrm/nouveau: free drmVersion after we're done with it 2009-02-20 14:11:22 +10:00
Ben Skeggs 18f2fcf5aa libdrm/nouveau: fix dma debugging 2009-02-20 14:11:18 +10:00
Eric Anholt 709b82e1a5 intel: Clear ioctl parameter outvalues and pads that confuse valgrind.
The minor CPU cost here is probably outweighed by bothering us with noise in
the tool.
2009-02-15 18:35:03 -08:00
Ben Skeggs 7e5c512104 libdrm: make libdrm_nouveau conditional, disabled by default
libdrm isn't supposed to ship APIs not present in a released kernel.
2009-02-15 21:51:46 +10:00
Jakob Bornecrantz eb78c53aa1 mode: Make xfdrmMode.[c|h] not depend on drm_mode.h 2009-02-11 17:11:00 +01:00
Pekka Paalanen 2d2f105f79 nouveau: fix type warnings: void* arith, un/signed
nouveau_notifier.c had two places where void* was used in arithmetic,
fixed by using char*.

nouveau_dma_wait(), nouveau_notifier_wait_status() and
nouveau_resource_alloc() had signed/unsigned comparison warnings, fixed
by changing the function parameter into an unsigned type.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-02-11 23:48:49 +02:00
Ben Skeggs 97fdadee6a nouveau: fix some issues where buffer objects never get freed 2009-02-05 23:17:05 +10:00
Ben Skeggs 225e7e274f nouveau: install libdrm_nouveau with libdrm 2009-02-04 14:32:31 +10:00
Eric Anholt cbdd6272c0 intel: don't count fences on 965 and later, as they don't use them. 2009-01-27 17:24:49 -08:00
Eric Anholt 9209c9a653 intel: Fix under-counting of fences registers required in check_aperture. 2009-01-27 17:24:41 -08:00
Jesse Barnes 2fa5f28eee intel: libdrm support for fence management in execbuf
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-27 17:23:42 -08:00