Commit Graph

3437 Commits (b0d93c74d884b40bd94469a5ef75fdb2fef17680)

Author SHA1 Message Date
Eric Anholt b0d93c74d8 Bump version to 2.4.2 to signal new libdrm_intel functions. 2008-12-02 12:19:37 -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
Ben Skeggs 7e4e0fbbb8 nv50: support NV94 chipset 2008-11-23 18:49:09 +11:00
Ben Skeggs 52232ad702 nv50: update context-related tables for original 8800GTS
I either messed up when I pulled these from a mmio-trace last time, or
the previous values didn't work on my card.  Hopefully it's the former!

In any case, at least one of the original NV50 chipsets work now.
2008-11-21 13:18:58 +11:00
Jesse Barnes 2e2fd6c632 DRM: make drm_map_type match upstream kernel
Since the TTM type isn't upstream yet, we need to make sure libdrm uses
what the kernel uses, which is _DRM_GEM = 6.
2008-11-20 11:00:29 -08:00
Stephane Marchesin c029ed2510 Unbreak drm build. 2008-11-19 23:17:27 +01: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
Eric Anholt 930c0e7cf4 intel: Restart on interrupt of bo_wait_rendering instead of complaining. 2008-11-07 12:59:43 -08:00
Pekka Paalanen 87e90c7362 nouveau: compat fix for set_page_locked().
The set_page_locked() function has changed its name again.
2.6.28 offers __set_page_locked() instead, which uses non-atomic
__set_bit() to do the work. In this case, offer our own
set_page_locked() using the atomic set_bit(), because I do not know
if atomic access is really necessary. Atomic behaviour is the one
previously expected.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-02 13:55:23 +02:00
Eric Anholt 00847dabe0 libdrm 2.4.1. 2008-10-30 11:36:46 -07: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
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
Ben Skeggs e47ab7a508 nv50: symlink nv50_grctx.h to linux-core... 2008-10-28 12:00:08 +11:00
Ben Skeggs 48b73904b4 nv50: move context-related tables a separate header file
This turns the various nvXX_graph_init_ctxvals() methods into tables,
and speeds up compliation of nv50_graph.c quite a bit.  This has bothered
me for a while, but others are complaining now so it's time to fix it :)
2008-10-28 11:56:07 +11:00
Pekka Paalanen 89ef1b5483 drm: missing init_mm symbol, compatibility fix
The drm_compat.c version of kmap_atomic_prot_pfn() uses the macro
pgd_offset_k(), which references the symbol init_mm.
Starting in 2.6.25, init_mm is no longer exported by default.

The only user of kmap_atomic_prot_pfn() is i915, so this should
not hurt anyone, and it allows people to load drm.ko.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-10-27 21:21:15 +02:00
Robert Noland 145d2d610b i915: Since FreeBSD doesn't have gem support yet, don't advertise it.
This allows us to not crash X when using newer Intel ddx drivers.
2008-10-27 14:39:05 -04:00
Alex Deucher e1372f6727 radeon: fix error in busmaster enable logic
- logic was wrong.  rs400/rs480 should clear the RADEON_BUS_MASTER_DIS bit
- should fix kernel bug 11798
2008-10-27 13:18:07 -04:00
Alex Deucher 848f00d773 radeon: fix some fallout from the busmaster disable cleanup
rs400 is just like rs480.  I mixed up the internal
chipset names for rs600 and rs400.
2008-10-27 12:59:39 -04:00
Matthias Hopf 1d930fc75b drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)
Olaf Kirch noticed that the i915_set_status_page() function of the i915
kernel driver calls ioremap with an address offset that is supplied by
userspace via ioctl. The function zeroes the mapped memory via memset
and tells the hardware about the address. Turns out that access to that
ioctl is not restricted to root so users could probably exploit that to
do nasty things. We haven't tried to write actual exploit code though.

It only affects the Intel G33 series and newer.
2008-10-25 12:15:50 -04:00
Xiang, Haihao b7d54b1dba intel: Also total child_size of the target_bos. Partial fix #17964. 2008-10-24 16:41:54 +08:00
Robert Noland 8256c347cc [FreeBSD] We should use dev2unit() rather than minor() 2008-10-23 15:46:32 -04:00
Robert Noland 7dbeb18777 [FreeBSD] This check isn't correct and causes at least mga to lockup. 2008-10-23 15:42:49 -04: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
Xiang, Haihao 769197c8f1 intel: avoid deadlock in intel_bufmgr_fake. 2008-10-16 10:37:30 +08:00
Eric Anholt 458e2d5bc5 intel: Fix compile warning. 2008-10-14 13:33:38 -07:00
Eric Anholt 993383873c intel: Add interface for getting tiling mode of a bo. 2008-10-14 13:23:04 -07:00
Julien Cristau d9c2f65dd8 link libdrm_intel properly
libdrm_intel needs symbols from libdrm, so link against it.
2008-10-13 16:39:33 -07:00
Eric Anholt 3e03d781f7 intel: Avoid pthread mutex recursion in bufmgr_fake.
Bug #18035. Fixes deadlock in glean texCube testcase.
2008-10-13 13:41:10 -07:00
Dave Airlie c6109df93b libdrm: don't depend or link to libdrm_intel 2008-10-13 07:16:33 +10:00
Robert Noland f5327aca0c [FreeBSD] Plug memory leak in drm_rmdraw() and drm_drawable_free_all() 2008-10-10 18:23:11 -04:00
Robert Noland cdd3e9fc56 [FreeBSD] Rework all of the memory allocations
Allocate memory from different pools.  This allows the OS to track memory
allocations for us, much like the linux memory debugging.  This will ease
tracking down memory leaks since the OS can track the number of allocations
from each pool and help to point us in the right direction.  Also replace
drm_alloc and friends with static __inline__ versions while we are here.
2008-10-10 13:06:22 -04:00
Robert Noland 1150a42d43 [FreeBSD] Fix linux list compat list_for_each_safe()
linux_for_each_safe would not handle lists with a single entry.
2008-10-09 22:13:26 -04:00
Robert Noland a8f73c214d i915: Cleanup interrupt handling 2008-10-09 22:11:55 -04:00
Keith Packard 94c88c151c Manage fences in user-mode bufmgr_fake to clean buffers
When using bufmgr_fake without DRM, the X server idles the ring whenever it
wants to wait for something to complete (brutal, but effective). In this
case, bufmgr_fake must treat the pending fence as having passed. However, it
wasn't recording the fences as it emitted them, nor cleaning buffers as they
passed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-10-09 18:25:58 -07:00
Eric Anholt 3169d9639b 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-09 12:57:09 -07:00
Xiang, Haihao 604759d4a7 intel: fix for write_domain and static BOs.
http://bugs.freedesktop.org/show_bug.cgi?id=17705
2008-10-09 11:59:29 +08:00
Alex Deucher 728d8e226f radeon: add comment to clarify bus mastering on PCIE chips 2008-10-06 12:12:49 -04:00
Alex Deucher 6f9dfa098f radeon: fix duplicate define in my last commit
That's what I get for committing at 3 AM.
2008-10-06 12:01:11 -04:00
Dave Airlie 8e5f5ed189 radeon: PCIE cards don't appear to have explicit bus master 2008-10-07 04:47:54 +10:00
Dave Airlie d0aff12052 drm: add create gpu tree script 2008-10-07 04:07:40 +10:00
Alex Deucher 4b98f6d74f radeon: fix bus master enabled bits on newer asics 2008-10-06 03:08:27 -04:00
Mihail Zenkov 5a36cce349 radeon: fix missing bit from rs740 patch
See bug 17908
2008-10-06 00:49:15 -04:00
Alex Deucher ce40261012 radeon: Add support for HD2100 IGP (RS740) 2008-10-04 20:43:21 -04:00
Robert Noland 60cf3a4db4 [FreeBSD] Don't explicitly bzero driver softc.
This is already handled for us.

Suggested by John Baldwin
2008-10-03 14:11:20 -04:00
Robert Noland 9c0ce38df3 [FreeBSD] Use M_WAITOK when allocating driver memory.
We don't explicitly check for error here and M_WAITOK will just put the
process to sleep waiting on resources to become available.

Suggested by John Baldwin
2008-10-03 14:05:45 -04:00
Robert Noland 4c92abfa8d [FreeBSD] Do a bit of optimization on drm_order() 2008-10-03 13:56:50 -04:00
Robert Noland 81952c7dd1 Use devfs_get_cdevpriv in mmap as well.
d_mmap gets called twice and we are only able to associate the file_priv
during the first call.  The second call will return EBADF and we need to
assume that the call was succesful.  d_mmap will not tolerate having an
error returned for the second call.
2008-10-01 20:49:03 -04:00
Xiang, Haihao 073cb5ee1d intel: Copy data from card memory back to backing store when mapping.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=17705
2008-09-27 11:01:24 +08:00
Eric Anholt 2db8e0c8ef intel: Allow up to 15 seconds chewing on one buffer before acknowledging -EBUSY.
The gltestperf demo in some cases took over seven seconds to make it through
one batchbuffer on a GM965.

Bug #17004.
2008-09-23 17:10:04 -07:00