Commit Graph

5009 Commits (c10b08d95954aecd331e5a43b4861c6c04b8aadd)

Author SHA1 Message Date
Chris Wilson 0ab2251b70 intel: Reset vma list upon purge
During free we unconditionally delete the bo from the vma cache. This
relies on the its list member being kept in a sane state. This fails
after the object is purged, as the purge operation performs a pure
deletion and doesn't reset the list member, leaving a pair of dangling
pointers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-14 08:23:02 +00:00
Jesse Barnes ac168bf2a0 libdrm: update drm headers from kernel, including new overlay ioctls & structs
Add structs and functions necessary for the new plane and fb handling code,
including a new header, drm_fourcc.h, that includes the surface formats
supported by various DRM drivers.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-12-13 11:47:15 -08:00
Chris Wilson 7fd1678110 configure: Bump version for 2.4.29
Yet another release required for new API
2011-12-13 10:59:13 +00:00
Chris Wilson 015286f03e intel: Remove the fresh assertions used to debug the vma cacheing
Hopefully all the bugs in the callers have been found, so time to
handle the failures "gracefully" again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-13 10:59:13 +00:00
Chris Wilson c5f0ed1d29 intel: Update map-count for an early error return during mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-13 10:41:33 +00:00
Chris Wilson dd9a5b4f7f intel: Evict cached VMA in order to make room for new mappings
As the max number of VMA mappings is a hard per-process limit, we need
to include the number of currently active mappings when evicting in
order to make room for a new mmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-06 21:45:55 +00:00
Chris Wilson e4b60f2960 intel: Add an interface to limit vma caching
There is a per-process limit on the number of vma that the process can
keep open, so we cannot keep an unlimited cache of unused vma's (besides
keeping track of all those vma in the kernel adds considerable overhead).
However, in order to work around inefficiencies in the kernel it is
beneficial to reuse the vma, so keep a MRU cache of vma.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 22:22:10 +00:00
Dave Airlie 902ee661f1 test/radeon: add missing files for dist 2011-12-05 21:24:48 +00:00
Chris Wilson 5c5332bbc3 intel: Clean up mmaps on freeing the buffer
As a precautionary measure munmap on buffer free so that we never leak
the vma. Also include a warning during debugging.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 10:43:13 +00:00
Chris Wilson e73161a02b configure: Bump version to 2.4.28
So that we can pull a couple of Intel bug fixes into xf86-video-intel.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 10:30:52 +00:00
Chris Wilson c549a777c1 intel: Unmap buffers during drm_intel_gem_bo_unmap
We cannot afford to cache the vma per open bo as this may exhaust the
per-process limits.

References: https://bugs.freedesktop.org/show_bug.cgi?id=43075
References: https://bugs.freedesktop.org/show_bug.cgi?id=40066
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 10:25:53 +00:00
Daniel Vetter 36cff1cbb8 intel: limit aperture space to mappable area on gen3
Otherwise we blow up on heavy tiled blitter loads (with giant
pixmaps).

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-04 13:25:17 +01:00
Maarten Lankhorst 37ccce5e39 nouveau: Mark nouveau subchannel unbound nouveau_grobj_free
Valgrind throws warns about a user-after-free if you try to bind a
new subchannel after the old one in that slot was freed,
so remove it from the channel list.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-27 12:28:20 -05:00
Jerome Glisse ca4971292c tests/radeon: radeon specific test
Initial test only include ttm test for stressing ttm memory
allocations.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-11-10 17:14:42 -05:00
Jeremy Huddleston 961bf9b5c2 Fix compilation with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-01 14:42:13 -07:00
Eric Anholt cc9b751e82 configure: version bump for 2.4.27 release.
Push the new Intel API for use by mesa.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-29 12:04:31 -07:00
Eric Anholt d0ae6837d1 intel: Share the implementation of BO unmap between CPU and GTT mappings.
Before this, consumers of the libdrm API that might map a buffer
either way had to track which way was chosen at map time to call the
appropriate unmap.  This relaxes that requirement by making
drm_intel_bo_unmap() always appropriate.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 12:04:09 -07:00
Eric Anholt 4cb01eeccf intel: Don't call the SW_FINISH ioctl unless a CPU-mapped write was done.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 12:03:54 -07:00
Eric Anholt 77dc16f33d intel: Remove stale comment.
This used to be next to some map refcounting code, but that is long dead.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-29 12:03:34 -07:00
Eric Anholt 515cea6ac6 intel: Add an interface for removing relocs after they're added.
This lets us replace the current inner drawing loop of mesa:

for each prim {
	compute bo list
	if (check_aperture_space(bo list)) {
		batch_flush()
		compute bo list
		if (check_aperture_space(bo list)) {
			whine_about_batch_size()
			fall back;
		}
	}
	upload state to BOs
}

with this inner loop:

for each prim {
 retry:
	upload state to BOs
	if (check_aperture_space(batch)) {
		if (!retried) {
			reset_to_last_prim()
			batch_flush()
		} else {
			if (batch_flush())
				whine_about_batch_size()
			goto retry;
		}
	}
}

This avoids having to implement code to walk over certain sets of GL
state twice (the "compute bo list" step).  While it's not a
performance improvement, it's a significant win in code complexity:
about -200 lines, and one place to make mistakes related to aperture
space instead of N places to forget some BO we should have included.

Note how if we do a reset in the new loop , we immediately flush.  We
don't need to check aperture space -- the kernel will tell us if we
actually ran out of aperture or not.  And if we did run out of
aperture, it's because either the single prim was too big, or because
check_aperture was wrong at the point of setting up the last
primitive.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-28 12:53:59 -07:00
Eric Anholt 2c2bdb36c5 intel: Use stdbool.h for dealing with boolean values.
A few of the bitfield-based booleans are left in place.  Changing them
to "bool" results in the same code size, so I'm erring on the side of
not changing things.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-28 12:53:18 -07:00
Dave Airlie cc088f1721 nouveau: free in error path if drmAvailable fails.
This was reported in coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-19 17:39:54 +01:00
Jakob Bornecrantz d23146f3f0 modetest: Call dirty fb on modeset
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 13:35:07 +02:00
Jakob Bornecrantz 680b9c4fa3 modetest: Print extra info if we fail to create a framebuffer
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 13:35:07 +02:00
Jakob Bornecrantz 3c8adda6e1 modetest: Check error message from pageflip ioctl
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 13:35:07 +02:00
Jakob Bornecrantz c2925e5197 vbltest: Check error codes returned from libdrm
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 13:35:07 +02:00
Jakob Bornecrantz dc11db2e28 tests: Add vmwgfx driver to probed drivers in tests
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 13:35:06 +02:00
Jesse Barnes b317c96361 modetest: use 24 bit depth on the framebuffer
It's more compatible; at least the Intel driver now rejects 32 bit
depths since it generally can't support real 32 bit framebuffers
(supports 30, 36, and 64 bit, but not 32).
2011-10-11 11:10:55 -07:00
Dave Airlie c82ef03e4c drmtest: make check should fail so hard on unable to open device 2011-09-26 16:03:20 +01:00
Dave Airlie 3a551c1274 drm/test: handle usub being empty
fixes a segfault on make check seen in tinderbox
2011-09-26 15:54:13 +01:00
Tapani Pälli cfee5218b1 xf86drm.h : wrap C code for C++ compilation/linking
To enable usage of xf86drm.h from C++ programs/frameworks.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
[ickle: also wrap xf86drmMode.h]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 12:58:56 +01:00
Daniel Vetter 194aa1bee6 drm/i915: y tiling on i915G/i915GM is different
Luckily the kernel has become extremely paranoid about such matters.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-22 22:20:53 +02:00
Daniel Vetter 630dd26fb4 drm/intel: don't clobber bufmgr->pci_device
Otherwise it's pretty hard to differentiate the different chipset
variants.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-22 22:20:09 +02:00
Matt Turner 1459cb9252 modeprint.c: use PRIu64 for printing uint64_t
Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21 11:02:55 -04:00
Marcin Slusarz 7d83816141 nouveau: assert argument cannot have side effects
... because argument is evaluated only if NDEBUG is not defined
2011-09-18 15:26:16 +02:00
Marcin Slusarz 763b618d55 drm mode: fix drmIoctl wrapper
Both drmIoctl and ioctl define second argument as unigned long.

Debugging/tracing tools (like strace or valgrind) on 64-bit machines see
different request value for ioctls with 32nd bit set, because casting
signed int to unsigned long extends 32nd bit to upper word, so 0x80000000
becomes 0xFFFFFFFF80000000)

Nobody noticed because higher 32 bits are chopped off on their way to kernel.
2011-09-18 15:25:18 +02:00
Ben Widawsky 2acaf160df intel: shared header for shader debugging
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-01 14:44:58 -07:00
Yuanhan Liu ce317a6d09 intel: fix the wrong method check for bo_get_subdata
It's going to call bo_get_subdata method, but not bo_subdata

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-07-20 10:46:45 -07:00
Chih-Wei Huang 8d055890d9 Specify the return type explicitly. 2011-07-12 09:52:32 +01:00
Chris Wilson 6dd804c5a9 configure: version bump for 2.4.26 release
Push the new Intel API for use by mesa.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-04 13:01:50 +01:00
Chris Wilson 9d77603d8b intel: Add interface to query aperture sizes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-04 13:01:11 +01:00
Chris Wilson 61be94018a libkms: All current BO_TYPE are 32bpp
... so request a 32bpp dumb buffer rather than a 16bpp.

Fixes modetest and friends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-14 11:17:23 +01:00
Chris Wilson ba11501bb9 configure: version bump for 2.4.25 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-11 08:25:42 +01:00
Ilija Hadzic be8802a941 libdrm: (revised) vblank wait on crtc > 1
Hi Alex,

Enclosed is a revised version of the patch sent on Mar 18, against
the master branch of the drm userspace (i.e. libdrm). Details
summarised in this thread:
http://lists.freedesktop.org/archives/dri-devel/2011-March/009499.html

This patch reconciles libdrm with the the kernel change that Dave
pushed this morning. It *supersedes* the previously sent patch (i.e.
apply it to the master branch as it exists at the time of this writing,
not as an incremental patch to the one sent previously).

Regards,

Ilija

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:04:03 -04:00
Chris Wilson f395b0a25c intel: Also handle mrb_exec fallback with ring == I915_EXEC_RENDER
Reported-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-04 08:59:39 +01:00
Dave Airlie 5cb554a0d6 drm_mode: fix types on recently added ioctls 2011-03-30 06:11:21 +10:00
Daniel Vetter 06ebbf7c2c Cleanup gen2 tiling confusion
A tile on gen2 has a size of 2kb, stride of 128 bytes and 16 rows.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-26 15:04:04 +01:00
Javier Jardón fd3ed34a20 build: Update autotools configuration
Replace some deprecated autoconf macros and use the new libtool
syntax
2011-03-21 13:43:43 +00:00
Dave Airlie 3b04c73650 libdrm: oops fix get cap return value. 2011-03-04 15:48:31 +10:00
Dave Airlie bb99465366 libkms: add dumb support
this uses the drm cap interface to check if the dumb ioctl
is supported.
2011-03-04 15:25:51 +10:00