Commit graph

370 commits

Author SHA1 Message Date
Jesse Barnes
3e4b9e9727 libdrm: only check for vblank timeout if we caught EINTR
Michel caught a case where we might overwrite a success or other return
value with EBUSY, so check the return value before checking for the
timeout condition.
(cherry picked from commit ca37077fb7)
2009-02-15 17:03:16 +10:00
Jesse Barnes
ace8c5ec92 libdrm: add timeout handling to drmWaitVBlank
In some cases, vblank interrupts may be disabled or otherwise broken.
The kernel has a 3s timeout builtin to handle these cases, but the X
server's SIGALM for cursor handling may interrupt vblank wait ioctls,
causing libdrm to restart the ioctl, making the kernel's timeout
useless.

This change tracks time across ioctl restarts and returns EBUSY to the
caller if the expected vblank sequence doesn't occur within 1s of the
first call.

Fixes fdo bz #18041, which is caused by a drmWaitVBlank hanging due to
the corresponding pipe getting disabled (thus preventing further events
from coming in).
2009-02-15 17:03:16 +10:00
Keith Packard
f869053223 intel: Cache tiling/swizzle state in user mode. Reset tiling on reuse.
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>
(cherry picked from commit 18f091d136)
2009-02-15 17:03:16 +10:00
Keith Packard
9888b8b0ec intel: Debug output %u vs uint64_t warning fix
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 40334c6410)
2009-02-15 17:03:15 +10:00
Keith Packard
11cfc15299 intel: return error status from drm_intel_gem_bo_map
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>
(cherry picked from commit bd14b2cf75)
2009-02-15 17:03:15 +10:00
Keith Packard
7a5df78cb5 intel: Dump out memory usage information when the kernel fails to pin
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>
(cherry picked from commit b13f4e1a32)
2009-02-15 17:03:15 +10:00
Eric Anholt
5764d9756e intel: don't skip set_domain on mapping of shared buffers.
(cherry picked from commit c86d431fe6)
2009-02-15 17:03:15 +10:00
Eric Anholt
ee310fe05f intel: don't let named buffers into the BO cache.
We wouldn't want some remaining 3D rendering to scribble on our batchbuffer.
(cherry picked from commit cebbd2edb5)
2009-02-15 17:03:14 +10:00
Eric Anholt
3fdda2f9ea intel: Remove the mapped flag, which is adequately covered by bo_gem->virtual.
(cherry picked from commit 782316801b)
2009-02-15 17:03:14 +10:00
Dave Airlie
6117fa1214 radeon: add libdrm_radeon.pc so we can make Mesa detect it 2009-02-15 17:03:14 +10:00
Michel Daenzer
9a1cfb960f radeon: add qword write function 2009-02-15 17:02:46 +10:00
Ben Skeggs
1952a896d0 nouveau: fix some issues where buffer objects never get freed 2009-02-05 23:03:29 +10:00
Ben Skeggs
68891ae2ef nouveau: install libdrm_nouveau with libdrm 2009-02-04 15:03:34 +10:00
Dave Airlie
bbd5e64216 radeon: make dword writes be inlined
This moves the size checks to the begin section and makes dword
writes inline for all CS people.

Gets me back some of my CPU
2009-02-04 11:11:55 +10:00
Dave Airlie
98738555d1 radeon: add space accounting to cs code 2009-01-31 01:50:23 +10:00
Dave Airlie
e9298a02ac radeon: add bo_wait functionality 2009-01-13 16:48:04 +10:00
Dave Airlie
d587c6f150 radeon: make name consistent with libdrm_intel 2008-12-22 12:26:56 +10:00
Dave Airlie
b3d4e7433d radeon: size the relocs correctly 2008-12-22 11:57:15 +10:00
Dave Airlie
c93f1c88ce radeon: drop more cs2 2008-12-19 16:44:22 +10:00
Dave Airlie
8c40a5c648 radeon: more cs2 removal 2008-12-19 16:43:01 +10:00
Dave Airlie
4b10ddff78 radeon: drop CS2 into CS, remove start/end offset 2008-12-19 16:31:55 +10:00
Jesse Barnes
12e68f8059 Merge branch 'master' into modesetting-gem 2008-12-03 11:54:07 -08:00
Eric Anholt
6fb1ad767d intel: Add a function for setting (GTT,GTT) domain, for use by UXA.
This function can also serve the role that the bo_wait_rendering did, when
write_enable is unset.
2008-12-02 12:19:34 -08:00
Jesse Barnes
c67a83dfe1 Merge branch 'modesetting-gem' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-gem 2008-11-19 12:42:49 -08:00
Jesse Barnes
60c1e3a09e libdrm_intel: fix merge error
don't take the lock twice
2008-11-19 10:56:48 -08:00
Jerome Glisse
c0ba14fd90 libdrm-radeon: add print callback to cs & small fixes 2008-11-16 18:04:43 +01:00
Jerome Glisse
5ae79e7edd libdrm-radeon: unref return current BO ptr to reflect BO destruction 2008-11-15 10:39:37 +01:00
Jerome Glisse
080a45624b libdrm-radeon: unreference buffer once cs stream is submited or on cs clean
BO are referenced once by reloc to make sure that they not destroyed
before we get a chance to flush the cmd stream, so we need to unreference
them once in cs submit or cs erase if cs i never submitted so bo can
be destructed.
2008-11-14 12:16:10 +01:00
Jerome Glisse
bfbecc5c42 libdrm-radeon: new tracker tools
To keep record of bo activities and print them when necessary,
should help in tracking unbalanced ref/unref calls.
2008-11-14 12:16:10 +01:00
Jesse Barnes
965b4d662a Merge branch 'master' into modesetting-gem
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-13 15:30:06 -08:00
Jesse Barnes
7e27b3ba88 libdrm_intel: fix warnings on 64 bit
Cast a couple of %llx args to unsigned long long.
2008-11-13 13:58:32 -08:00
Jesse Barnes
276c07d885 libdrm: add support for i915 GTT mapping ioctl
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-13 13:52:04 -08:00
Jakob Bornecrantz
9a4cb7eab4 mode: Minor reodering and renaming 2008-11-12 19:17:18 +01:00
Jakob Bornecrantz
ea849d7ca6 mode: Unify userspace API to uint_t 2008-11-12 18:50:05 +01:00
Jakob Bornecrantz
1ead45c8f0 mode: Remove hotplug support from ioctl interface 2008-11-12 18:40:04 +01:00
Jerome Glisse
a7457915f5 radeon+libdrm-radeon: change relocation informations
Relocation now consist of the following informations (in this order) :
handle          buffer object handle identifier
start_offset    start offset of first data of the buffer object used by the cs
end_offset      end offset of last data of the buffer object used by the cs
read_domain     read domain (either VRAM, or GTT as GPU is invalid for CS)
write_domain    write domain (either VRAM, or GTT as GPU is invalid for CS)
flags           flags used for further optimization (like discard previous
                buffer content or forget buffer content after cs which can
                help in avoiding moving content in or out)
2008-11-12 16:57:09 +01:00
Jerome Glisse
72997fb372 libdrm-radeon: be verbose on bo failure and cleanup cs a bit 2008-11-10 22:18:22 +01:00
Jerome Glisse
751d024dd5 libdrm-radeon: update libdrm-radeon to match current CS relocation structures 2008-11-09 18:45:43 +01:00
Eric Anholt
930c0e7cf4 intel: Restart on interrupt of bo_wait_rendering instead of complaining. 2008-11-07 12:59:43 -08:00
Jerome Glisse
273cc1a698 radeon: lib radeon add bo & cs gem backend 2008-11-06 00:40:06 +01:00
Jerome Glisse
2d822542c7 radeon: libdrm_radeon add handle to debug string 2008-11-05 16:00:04 +01:00
Jerome Glisse
7651b4c424 radeon: debug bo 2008-11-02 16:00:06 +01:00
Eric Anholt
4b9826408f intel: Rename dri_ and intel_ symbols to drm_intel_.
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-30 11:29:40 -07:00
Jerome Glisse
5d861951b3 radeon: libdrm_radeon updates bo & cs interfaces 2008-10-29 23:40:20 +01:00
Eric Anholt
0e86731232 intel: Add dri_bufmgr_check_aperture support for bufmgr_gem.
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-28 14:27:49 -07:00
Jerome Glisse
af118cd186 radeon: reloc are backend dependant 2008-10-27 23:26:15 +01:00
Jerome Glisse
3b17b50e9c Merge branch 'modesetting-gem' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-gem 2008-10-27 19:33:56 +01:00
Jerome Glisse
7617d1fef7 radeon: radeon util library 2008-10-27 19:27:15 +01:00
Jakob Bornecrantz
34a3ebffc3 mode: Try to settle on a standard for struct fields 2008-10-24 18:46:47 +02:00
Xiang, Haihao
b7d54b1dba intel: Also total child_size of the target_bos. Partial fix #17964. 2008-10-24 16:41:54 +08:00