Commit Graph

4582 Commits (b666f4151ab934d3083fa8b5f14ce19bbf999b15)

Author SHA1 Message Date
Chris Wilson b666f4151a intel: Clear bo->used_as_reloc_target flag on destroy
This allows us to keep the assert added in the previous commit that we do
not modify the tree_reloc_size after inserting the buffer into a relocation
tree, which was being hit here:

  #0  0xb78c2424 in __kernel_vsyscall ()
  #1  0xb74f6401 in raise () from /lib/libc.so.6
  #2  0xb74f7b42 in abort () from /lib/libc.so.6
  #3  0xb74ef5a8 in __assert_fail () from /lib/libc.so.6
  #4  0xb737e78b in drm_intel_bo_gem_set_in_aperture_size (bufmgr_gem=<value optimized out>, bo_gem=0x6) at intel_bufmgr_gem.c:373
  #5  0xb737f519 in drm_intel_gem_bo_set_tiling (bo=0xa1030a0, tiling_mode=0xbff6c85c, stride=0) at intel_bufmgr_gem.c:1386
  #6  0xb737f67f in drm_intel_gem_bo_unreference_final (bo=0xa1030a0, time=<value optimized out>) at intel_bufmgr_gem.c:768
  #7  0xb737f5e3 in drm_intel_gem_bo_unreference_locked_timed (bo=0xa1e50d0, time=<value optimized out>) at intel_bufmgr_gem.c:805
  #8  drm_intel_gem_bo_unreference_final (bo=0xa1e50d0, time=<value optimized out>) at intel_bufmgr_gem.c:756
  #9  0xb737fcbb in drm_intel_gem_bo_unreference (bo=0xa1e50d0) at intel_bufmgr_gem.c:821
  #10 0xb737b4e6 in drm_intel_bo_unreference (bo=0x0) at intel_bufmgr.c:80
  #11 0xb7325625 in intel_batch_flush (scrn=0x9d91f78, flush=1) at i830_batchbuffer.c:200

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 23:07:19 +00:00
Chris Wilson e22fb79772 intel: Apply pessimistic alignment to in-aperture buffer size
For the older chipsets, i.e. pre-i965, which have severe alignment
restrictions for tiled buffers we need to pessimistically assume that we
will waste the size of buffer to meet those alignment constraints.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 22:18:15 +00:00
Chris Wilson 60aa803dc7 intel: Only store a buffer in the cache if it is retained.
If the kernel immediately frees the backing store for a buffer when
marking it purgeable, then there is not point adding to the cache. Free
it immediately, instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 20:02:05 +00:00
Robert Noland 6f66de982a Correctly set DRM_MAX_MINOR for all platforms.
DRM_MAJOR is platform specific, but not used outside of xf86drm.c
that I can find.
2009-11-25 15:09:24 -06:00
Alex Deucher 9558f6377f Add missing DRM_MAX_MINOR define
lost in 500f5b5240

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-24 15:03:32 -05:00
Robert Noland 82bf52fbcd More fixups to allow mesa to build 2009-11-24 10:31:41 -06:00
Robert Noland 170674a606 Finish fixing the build on FreeBSD 2009-11-24 09:27:29 -06:00
Kristian Høgsberg 22d4666904 Add drmGetDeviceNameFromFd function
Determines the /dev filename of the drm fd argument.
2009-11-23 20:51:34 -05:00
Kristian Høgsberg 500f5b5240 Fix build on *BSD
This adds a minimal #ifdef clause to drm.h that we'll push upstream.
Once that goes in we can share drm.h between linux, libdrm, and
the bsd's.
2009-11-23 18:25:11 -05:00
Kristian Høgsberg 863e39b56e Don't hardcore 'yes', use in configure.ac output
Oops, I assumed intel was always enable, but it just defaults to on.
2009-11-23 12:42:36 -05:00
Kristian Høgsberg 696fdb11f4 Output summary of enabled features at the end of configure.ac 2009-11-23 11:41:27 -05:00
Kristian Høgsberg dd6cbe7acb Drop duplicated radeon_*.h files in include/drm
These files are userspace headers and live in radeon/
2009-11-23 11:26:26 -05:00
Kristian Høgsberg 6b3cbe7655 Put mach64_drm.h back in to avoid breaking mesa build
We may want to drop mach64 from mesa instead, but that's a different
discussion.
2009-11-20 20:17:26 -05:00
Kristian Høgsberg 4f070d593c Install kernel headers in ${includedir}/drm 2009-11-20 19:46:34 -05:00
Pekka Paalanen 3a87b1f497 nouveau: fix DRM headers
The nouveau_drmif.h is not the Nouveau DRM kernel ABI file, but purely
user space stuff. Remove it, it does not belong in include/drm/.

Copy the right header from Nouveau kernel v2.6.31-rc9-757-gaca551c.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-11-21 01:00:36 +02:00
Kristian Høgsberg 10ce0ec188 Merge remote branch 'origin/master' into libdrm 2009-11-20 17:09:03 -05:00
Kristian Høgsberg 1b064cc428 Update README 2009-11-20 17:08:28 -05:00
Maciej Cencora b4312b639d libdrm_radeon: add radeon_bo_is_referenced_by_cs function
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-18 16:07:13 -05:00
Kristian Høgsberg e8523e087f Drop stale TODO and unused ChangeLog 2009-11-17 11:15:56 -05:00
Kristian Høgsberg 4f57abfe66 Move libdrm/ up one level 2009-11-17 11:15:06 -05:00
Kristian Høgsberg 9dd3613073 Drop shared-core, bsd-core, linux-core and scripts subdirs 2009-11-17 10:54:11 -05:00
Kristian Høgsberg a66cf9ce68 Use headers copied from kernel instead of shared-core 2009-11-17 10:54:11 -05:00
Kristian Høgsberg ba79b1a8c2 Fix typo in i915 pipe_from_crtc_id ioctl struct name 2009-11-17 10:54:11 -05:00
Kristian Høgsberg 2b42af9a2f Copy headers from kernel v2.6.32-rc6-130-g5b8f0be 2009-11-17 10:54:07 -05:00
Kristian Høgsberg a99680384a Add makefile rule to copy headers from kernel tree 2009-11-17 09:23:52 -05:00
Francisco Jerez c20706ffe5 nouveau: Update some nouveau_class.h definitions from renouveau.xml.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-11-15 18:13:28 +02:00
Chris Wilson 83a35b68f4 intel: Export madvise
Wrap the madvise ioctl for use in APPLE_object_purgeable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-11-11 13:09:22 +00:00
Julien Cristau 89cc98c0d5 Only install libdrm_intel.pc if we build libdrm_intel 2009-11-05 15:49:09 +00:00
Ben Skeggs b7ed162d29 nouveau: turn another assertion into an error
Signed-off-by: Ben Skeggs <skeggsb@beleth.(none)>
2009-11-04 17:31:18 +10:00
Ben Skeggs f4c5063026 nouveau: modify api slightly to allow caller to handle reloc failures
Signed-off-by: Ben Skeggs <skeggsb@beleth.(none)>
2009-11-04 15:24:27 +10:00
Ben Skeggs a8bdf0e00c nouveau: add reloc refcnt to pending bo list
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-11-04 14:58:19 +10:00
Ben Skeggs 63910f8aa6 nouveau: drop rendering on the floor rather than asserting if flush fails
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-11-04 13:24:52 +10:00
Ben Skeggs 68c2ac9640 nouveau: update view of available aperture space after each flush
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-11-04 13:24:52 +10:00
Mathias Fröhlich 6eafd1cf38 radeon: fix allocation
The old code increments the command stream size by another kbyte, but does
not make sure that the requested packet size fits into the stream. The patch
ensures that the whole next packet fits there and rounds the allocated size to
a power of two.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-03 11:41:26 -05:00
Kristian Høgsberg b0b96636db Add support for vblank events
The kernel will now write data to the DRM fd for various event types if
requested.  Currently, the only supported event is a vblank event: it contains
the vblank count for the event as well as a timestamp from when the event
ocurred.  Since the DRM fd is now pollable, it's easy to integrate into
existing event loops.
2009-10-29 17:14:09 -07:00
Eric Anholt 0d7ad7e43c intel: Only call clock_gettime once per unreference_final.
Notably when freeing a batchbuffer, we often end up freeing many of the
buffers it points at as well.  Avoiding repeated calls brings us a 9% CPU
win for cairo-gl.

[ # ]  backend                         test   min(s) median(s) stddev. count
before:
[  0]       gl            firefox-talos-gfx   58.941   58.966   0.75%    3/3
after:
[  0]       gl            firefox-talos-gfx   54.186   54.195   0.49%    3/3
2009-10-20 14:24:44 -07:00
Eric Anholt 66d2714f54 intel: Improve bo_references performance by skipping the tree walk.
If the target we're asking about hasn't ever been used as a relocation
target, then it obviously hasn't been used as a target by the batch's reloc
tree.  This is the common case for good GL programming where you only map
fresh buffers, and gives us a 5% win in cairo-gl.

[ # ]  backend                         test   min(s) median(s) stddev. count
before:
[  0]       gl            firefox-talos-gfx   64.680   64.756   0.06%    3/3
after:
[  0]       gl            firefox-talos-gfx   60.816   60.970   0.29%    3/3
2009-10-20 13:31:55 -07:00
Ben Skeggs 67628aa39d nouveau: retry if pushbuf ioctl interrupted by signal
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-20 12:57:46 +10:00
Ben Skeggs fdd960a95c nouveau: function to return status of bo being referenced in pushbuf
Will be used to implement gallium's is_{texture,buffer}_referenced()
callbacks properly.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-10-19 09:07:45 +10:00
Patrice Mandin 3a387a983e nouveau: nv30: add render target logbase2 width,height 2009-10-13 22:50:46 +02:00
Eric Anholt a221e4fd92 intel: Add the defines for the kernel overlay support landing in 2.6.33. 2009-10-13 11:36:01 -07:00
Chris Wilson 901bacd29c intel: Fallback to atomic-ops.h [libatomic-ops-dev]
Use the external implementation for atomic operations across a wide
range of architectures.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-13 15:13:00 +01:00
Chris Wilson 24c905f841 configure: Typo in error message.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-13 14:25:54 +01:00
Chris Wilson fc8f6be5a9 configure: Conditionally build libdrm_intel
Only build libdrm_intel automatically if we have support for atomic
operations. To force configure to build drm pass --enable-intel, which
will cause the configure to error if no support is found. Or pass
--disable-intel to explicitly prevent libdrm_intel from being built.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-12 23:58:47 +01:00
Eric Anholt a107e5b129 Bump to 2.4.15 for release. 2009-10-08 16:59:17 -07:00
Eric Anholt 9764061ab1 intel: Remove the asserts about the ignored alignment parameter.
I slipped it in with the alloc_tiled changes, since we were explicitly
throwing the parameter away.  It caught some bogus released code, which
we've now fixed, so remove the asserts to keep old drivers working.
2009-10-08 15:55:02 -07:00
Jesse Barnes 3a7dfcdfaf intel: Add a bo_alloc function for tiled BOs.
This simplifies driver code in handling object allocation, and also gives us
an opportunity to possibly cache tiled buffers if it turns out to be a win.

[anholt: This is chopped out of the execbuf2 patch, as it seems to be useful
separately and cleans up the execbuf2 changes to be more obvious]
2009-10-06 15:45:10 -07:00
Eric Anholt 02c775fc75 intel: Fix up some stale doxygen comments. 2009-10-06 15:45:10 -07:00
Eric Anholt d70d60529f intel: Reformat to the kernel coding style. Welcome to the 8-space future.
This is done with:
Lindent *.[ch]
perl -pi -e 's|drm_intel_bo \* |drm_intel_bo *|g' *.[ch]
perl -pi -e 's|drm_intel_bufmgr \* |drm_intel_bufmgr *|g' *.[ch]
perl -pi -e 's|drm_intel_bo_gem \* |drm_intel_bo_gem *|g' *.[ch]
perl -pi -e 's|drm_intel_bufmgr_gem \* |drm_intel_bufmgr_gem *|g' *.[ch]
perl -pi -e 's|_fake \* |_fake *|g' *.[ch]
hand-editing to whack indented comments into line and other touchups.
2009-10-06 15:45:06 -07:00
Eric Anholt 3c9bd068e0 intel: Don't allocate more relocation entries than the BO could support.
This saves 32k of relocation entry storage for many 965 state buffers.  No
noticeable impact on performance for cairo-gl firefox.
2009-10-06 13:30:07 -07:00