Commit Graph

366 Commits (27fae006853647ad0087067adc4eaa8d4ed4594a)

Author SHA1 Message Date
Eric Anholt 02445eab64 intel: Retry pin ioctl on -EINTR. 2009-01-14 16:12:08 -08:00
Owain G. Ainsworth 65b90fb377 Don't use DRM_BO_FLAG_NO_MOVE in bufmgr fake. It's a ttm flag.
It's also unused, so worthless.
2009-01-13 17:18:43 -08:00
Owain G. Ainsworth 13ff0e58c3 Remove drmModeReplaceFb after it was removed from the kernel.
It is impossible to replace the original semantics of this call purely
in userland, since the fb_id would change.

after discussion with Dr_Jakob

Signed-Off-By: Owain Ainsworth <oga@openbsd.org>
Acked-By: Jakob Bornecrantz <jakob@vmware.com>
2009-01-12 13:14:25 +01:00
Jesse Barnes badc63464c libdrm: add autoconf check for clock_gettime
Should be more portable this way.
2009-01-07 11:47:52 -08:00
Jesse Barnes ca37077fb7 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.
2009-01-07 10:48:26 -08:00
Jesse Barnes f4f76a6894 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-01-07 10:18:08 -08:00
Keith Packard 18f091d136 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>
2008-12-17 10:29:15 -08:00
Keith Packard 40334c6410 intel: Debug output %u vs uint64_t warning fix
Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-17 10:28:25 -08:00
Keith Packard bd14b2cf75 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>
2008-12-17 10:28:25 -08:00
Keith Packard b13f4e1a32 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>
2008-12-17 10:28:25 -08:00
Jesse Barnes 731cd5526e libdrm: add mode setting files
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-17 10:11:37 -08:00
Eric Anholt c86d431fe6 intel: don't skip set_domain on mapping of shared buffers. 2008-12-14 16:50:02 -08:00
Eric Anholt cebbd2edb5 intel: don't let named buffers into the BO cache.
We wouldn't want some remaining 3D rendering to scribble on our batchbuffer.
2008-12-14 16:50:02 -08:00
Eric Anholt 782316801b intel: Remove the mapped flag, which is adequately covered by bo_gem->virtual. 2008-12-14 16:50:02 -08:00
Jesse Barnes 9583c099b4 Revert "Merge branch 'modesetting-gem'"
This reverts commit 6656db1055.

We really just want the libdrm and ioctl bits, not all the driver
stuff.
2008-12-10 15:50:22 -08:00
Jesse Barnes 6656db1055 Merge branch 'modesetting-gem' 2008-12-09 10:23:43 -08:00
Dave Airlie c99566fb81 libdrm: bump to 2.4 for lib version
we already have a 2.3.x version out there
2008-12-08 14:05:32 +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
Keith Packard a59ea02ff8 intel: ioctl is not defined to return -errno
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-16 23:54:19 -07:00
Dave Airlie 4c8aeb6fc7 link libdrm_intel properly
libdrm_intel needs symbols from libdrm, so link against it.
(cherry picked from commit d9c2f65dd8)

Conflicts:

	libdrm/Makefile.am
2008-10-17 06:40:38 +10:00
Dave Airlie 9dda3a8f63 libdrm: don't depend or link to libdrm_intel 2008-10-17 06:39:58 +10:00
Eric Anholt 6df7b0719f intel: Protect bufmgr objects with a pthread mutex.
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-17 06:38:57 +10:00