Stephane Marchesin [Wed, 19 Nov 2008 22:17:27 +0000 (23:17 +0100)]
Unbreak drm build.
Jesse Barnes [Thu, 13 Nov 2008 21:58:32 +0000 (13:58 -0800)]
libdrm_intel: fix warnings on 64 bit
Cast a couple of %llx args to unsigned long long.
Jesse Barnes [Thu, 13 Nov 2008 21:52:04 +0000 (13:52 -0800)]
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.
Eric Anholt [Fri, 7 Nov 2008 20:58:52 +0000 (12:58 -0800)]
intel: Restart on interrupt of bo_wait_rendering instead of complaining.
Pekka Paalanen [Sun, 2 Nov 2008 11:48:32 +0000 (13:48 +0200)]
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>
Eric Anholt [Thu, 30 Oct 2008 18:36:46 +0000 (11:36 -0700)]
libdrm 2.4.1.
Eric Anholt [Thu, 30 Oct 2008 16:33:07 +0000 (09:33 -0700)]
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.
Eric Anholt [Tue, 21 Oct 2008 07:10:54 +0000 (00:10 -0700)]
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.
Ben Skeggs [Tue, 28 Oct 2008 01:00:08 +0000 (12:00 +1100)]
nv50: symlink nv50_grctx.h to linux-core...
Ben Skeggs [Tue, 28 Oct 2008 00:38:30 +0000 (11:38 +1100)]
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 :)
Pekka Paalanen [Mon, 27 Oct 2008 19:21:15 +0000 (21:21 +0200)]
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>
Robert Noland [Mon, 27 Oct 2008 18:39:05 +0000 (14:39 -0400)]
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.
Alex Deucher [Mon, 27 Oct 2008 17:18:07 +0000 (13:18 -0400)]
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
Alex Deucher [Mon, 27 Oct 2008 16:59:39 +0000 (12:59 -0400)]
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.
Matthias Hopf [Sat, 25 Oct 2008 16:11:44 +0000 (12:11 -0400)]
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.
Xiang, Haihao [Fri, 24 Oct 2008 08:35:00 +0000 (16:35 +0800)]
intel: Also total child_size of the target_bos. Partial fix #17964.
Robert Noland [Thu, 23 Oct 2008 19:46:32 +0000 (15:46 -0400)]
[FreeBSD] We should use dev2unit() rather than minor()
Robert Noland [Thu, 23 Oct 2008 19:42:49 +0000 (15:42 -0400)]
[FreeBSD] This check isn't correct and causes at least mga to lockup.
Keith Packard [Fri, 17 Oct 2008 04:15:01 +0000 (21:15 -0700)]
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>
Xiang, Haihao [Thu, 16 Oct 2008 02:37:30 +0000 (10:37 +0800)]
intel: avoid deadlock in intel_bufmgr_fake.
Eric Anholt [Tue, 14 Oct 2008 20:33:38 +0000 (13:33 -0700)]
intel: Fix compile warning.
Eric Anholt [Tue, 14 Oct 2008 20:18:11 +0000 (13:18 -0700)]
intel: Add interface for getting tiling mode of a bo.
Julien Cristau [Mon, 13 Oct 2008 23:25:57 +0000 (01:25 +0200)]
link libdrm_intel properly
libdrm_intel needs symbols from libdrm, so link against it.
Eric Anholt [Mon, 13 Oct 2008 20:41:10 +0000 (13:41 -0700)]
intel: Avoid pthread mutex recursion in bufmgr_fake.
Bug #18035. Fixes deadlock in glean texCube testcase.
Dave Airlie [Sun, 12 Oct 2008 21:16:33 +0000 (07:16 +1000)]
libdrm: don't depend or link to libdrm_intel
Robert Noland [Fri, 10 Oct 2008 22:23:11 +0000 (18:23 -0400)]
[FreeBSD] Plug memory leak in drm_rmdraw() and drm_drawable_free_all()
Robert Noland [Fri, 10 Oct 2008 17:06:22 +0000 (13:06 -0400)]
[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.
Robert Noland [Fri, 10 Oct 2008 02:13:26 +0000 (22:13 -0400)]
[FreeBSD] Fix linux list compat list_for_each_safe()
linux_for_each_safe would not handle lists with a single entry.
Robert Noland [Fri, 10 Oct 2008 02:11:55 +0000 (22:11 -0400)]
i915: Cleanup interrupt handling
Keith Packard [Thu, 9 Oct 2008 21:30:56 +0000 (14:30 -0700)]
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>
Eric Anholt [Fri, 13 Jun 2008 06:22:26 +0000 (23:22 -0700)]
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.
Xiang, Haihao [Thu, 9 Oct 2008 03:57:13 +0000 (11:57 +0800)]
intel: fix for write_domain and static BOs.
http://bugs.freedesktop.org/show_bug.cgi?id=17705
Alex Deucher [Mon, 6 Oct 2008 16:12:49 +0000 (12:12 -0400)]
radeon: add comment to clarify bus mastering on PCIE chips
Alex Deucher [Mon, 6 Oct 2008 16:01:11 +0000 (12:01 -0400)]
radeon: fix duplicate define in my last commit
That's what I get for committing at 3 AM.
Dave Airlie [Mon, 6 Oct 2008 18:47:54 +0000 (04:47 +1000)]
radeon: PCIE cards don't appear to have explicit bus master
Dave Airlie [Tue, 16 Sep 2008 17:00:02 +0000 (03:00 +1000)]
drm: add create gpu tree script
Alex Deucher [Mon, 6 Oct 2008 07:08:27 +0000 (03:08 -0400)]
radeon: fix bus master enabled bits on newer asics
Mihail Zenkov [Mon, 6 Oct 2008 04:49:15 +0000 (00:49 -0400)]
radeon: fix missing bit from rs740 patch
See bug 17908
Alex Deucher [Sun, 5 Oct 2008 00:43:21 +0000 (20:43 -0400)]
radeon: Add support for HD2100 IGP (RS740)
Robert Noland [Fri, 3 Oct 2008 18:11:20 +0000 (14:11 -0400)]
[FreeBSD] Don't explicitly bzero driver softc.
This is already handled for us.
Suggested by John Baldwin
Robert Noland [Fri, 3 Oct 2008 18:05:45 +0000 (14:05 -0400)]
[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
Robert Noland [Fri, 3 Oct 2008 17:56:50 +0000 (13:56 -0400)]
[FreeBSD] Do a bit of optimization on drm_order()
Robert Noland [Sat, 20 Sep 2008 22:34:57 +0000 (18:34 -0400)]
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.
Xiang, Haihao [Sat, 27 Sep 2008 03:01:24 +0000 (11:01 +0800)]
intel: Copy data from card memory back to backing store when mapping.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=17705
Eric Anholt [Wed, 24 Sep 2008 00:06:01 +0000 (17:06 -0700)]
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.
Eric Anholt [Tue, 23 Sep 2008 17:48:39 +0000 (10:48 -0700)]
intel: Replace wraparound test logic in bufmgr_fake. Again.
I'd swapped the operands, so if we weren't in lockstep with the hardware we
said the sequence was always passed. Additionally, a race was available that
we might have failed at recovering from. Instead, I've replaced the logic
with new stuff that should be more robust and not rely on all the parties in
userland following the same IRQ_EMIT() == 1 protocol. Also, in a radical
departure from past efforts, include a long comment describing the failure
modes and how we're working around them.
Thanks to haihao for catching the original issue.
Eric Anholt [Tue, 23 Sep 2008 17:47:21 +0000 (10:47 -0700)]
intel: Do strerror on errno, not on the -1 return value from ioctl.
Xiang, Haihao [Mon, 22 Sep 2008 02:16:19 +0000 (10:16 +0800)]
intel: Fix driver-supplied argument to exec function (fd.o bug #17653).
Robert Noland [Thu, 18 Sep 2008 03:10:15 +0000 (23:10 -0400)]
[FreeBSD] Convert to using cdevpriv for file_priv tracking
Ben Skeggs [Wed, 17 Sep 2008 12:18:03 +0000 (22:18 +1000)]
nv50: add initial context for chipset 0xaa
This just doesn't look right..
Ben Skeggs [Wed, 17 Sep 2008 12:03:38 +0000 (22:03 +1000)]
nv50: add initial context to match ctxprog for chipset 0x50
Ben Skeggs [Wed, 17 Sep 2008 05:13:27 +0000 (15:13 +1000)]
nv50: add ctxprog for chipset 0x50
Ben Skeggs [Wed, 17 Sep 2008 05:02:54 +0000 (15:02 +1000)]
nv50: add ctxprog for chipset 0xaa
Ben Skeggs [Wed, 17 Sep 2008 04:49:04 +0000 (14:49 +1000)]
nv50: add support for chipset 0x92
vehemens [Tue, 9 Sep 2008 05:06:09 +0000 (22:06 -0700)]
Remove incomplete and obsolete free/net/open code.
Signed-off-by: Robert Noland <rnoland@2hip.net>
Eric Anholt [Thu, 11 Sep 2008 03:04:42 +0000 (20:04 -0700)]
Add missing \ to libdrm_la_SOURCES
Reported by jcristau.
Eric Anholt [Wed, 10 Sep 2008 20:54:34 +0000 (13:54 -0700)]
intel: don't forget to include config.h in bufmgr code.
Thanks to airlied for catching this.
Eric Anholt [Mon, 8 Sep 2008 15:51:40 +0000 (08:51 -0700)]
intel: move drm calls to exec buffers to libdrm_intel.
This avoids duplicating the effort in 3 places. Also, added emit/wait fence
callbacks back in bufmgr_fake since we need it for non-drm 2d. Sigh.
Eric Anholt [Sat, 6 Sep 2008 02:07:41 +0000 (03:07 +0100)]
intel: Move IRQ emit/wait from callbacks into the bufmgr.
In the process, work around the glaring bugs of the kernel irq wait function.
Eric Anholt [Fri, 5 Sep 2008 09:35:32 +0000 (10:35 +0100)]
Move intel libdrm stuff to libdrm_intel.so
dri_bufmgr.h is replaced by intel_bufmgr.h, and several functions are renamed,
though the structures and many functions remain dri_bufmgr_* and dri_bo_*
Eric Anholt [Wed, 3 Sep 2008 22:05:16 +0000 (23:05 +0100)]
drm: Add tests for GEM_FLINK ioctl.
Robert Noland [Mon, 8 Sep 2008 20:40:52 +0000 (16:40 -0400)]
[FreeBSD] We need to call drm_detach before we free dev->driver.
The driver is in control of the show, so when you try and unload a module
the driver detach routine is called first. It is what drives the whole
unload process and so lots of panics occur if dev->driver is already
free.
Robert Noland [Sun, 7 Sep 2008 16:44:02 +0000 (12:44 -0400)]
[FreeBSD] Implement drm_ioremap_wc() to set a range of mem to write-combining
Robert Noland [Sun, 7 Sep 2008 01:08:33 +0000 (21:08 -0400)]
[FreeBSD] IGP gart needs to be un-cached.
Airlied inadvertently discovered that the IGP gart needs to be un-cached
for radeon rs485 and rs690 to work. Initial tests by placing a wbinvd()
after allocating the gart were successful. This is an attempt at a more
appropriate method of achieving success.
vehemens [Sun, 7 Sep 2008 01:02:31 +0000 (18:02 -0700)]
Free temp_pagelist on error. Free in reverse order. Noticed by open.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Sat, 6 Sep 2008 22:33:47 +0000 (15:33 -0700)]
Pass lock data like linux and open.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Sat, 6 Sep 2008 21:19:32 +0000 (14:19 -0700)]
Move order to end like linux.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Sat, 6 Sep 2008 21:16:51 +0000 (14:16 -0700)]
Style white space cleanup part 2.
Signed-off-by: Robert Noland <rnoland@2hip.net>
Robert Noland [Sat, 6 Sep 2008 22:37:06 +0000 (18:37 -0400)]
[FreeBSD] Ensure that drm_pci_alloc is never called while locks are held.
vehemens [Tue, 2 Sep 2008 20:56:35 +0000 (13:56 -0700)]
Reorder lock functions like linux.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Tue, 2 Sep 2008 11:57:36 +0000 (04:57 -0700)]
Style white space cleanup.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Tue, 2 Sep 2008 09:43:19 +0000 (02:43 -0700)]
Need M_NOWAIT for malloc.
Signed-off-by: Robert Noland <rnoland@2hip.net>
Robert Noland [Fri, 5 Sep 2008 15:52:53 +0000 (11:52 -0400)]
i915: fix i915_ring_validate()
Stephane Marchesin [Thu, 4 Sep 2008 22:17:52 +0000 (00:17 +0200)]
nouveau: 8200 cards are 0xA0 family.
Dave Airlie [Tue, 2 Sep 2008 00:07:14 +0000 (10:07 +1000)]
drm: fix sysfs error path.
Pointed out by Roel Kluin on dri-devel.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 30 Aug 2008 21:27:26 +0000 (07:27 +1000)]
radeon: make writeback work after suspend/resume.
While re-writing this for modesetting, I find we disable writeback on
resume.
vehemens [Thu, 28 Aug 2008 02:11:04 +0000 (19:11 -0700)]
[FreeBSD] Use driver features macros and flags
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Fri, 29 Aug 2008 17:18:54 +0000 (13:18 -0400)]
[FreeBSD] Convert drm_driver to a pointer like linux.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Fri, 29 Aug 2008 16:47:00 +0000 (12:47 -0400)]
[FreeBSD] Replace typedefs on bsd.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Fri, 29 Aug 2008 16:40:30 +0000 (12:40 -0400)]
[FreeBSD] Catch up to vblank rework for via.
(No, we don't build via right now.)
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Fri, 29 Aug 2008 16:37:29 +0000 (12:37 -0400)]
[FreeBSD] Correct debug message
Signed-off-by: Robert Noland <rnoland@2hip.net>
Robert Noland [Fri, 29 Aug 2008 16:29:50 +0000 (12:29 -0400)]
[FreeBSD] Fix a couple of locking problems.
Robert Noland [Fri, 29 Aug 2008 16:23:35 +0000 (12:23 -0400)]
[FreeBSD] Increase debugging output for vblank code.
Doing my part to make DRM_DEBUG more chatty...
Tomas Carnecky [Thu, 28 Aug 2008 22:43:19 +0000 (00:43 +0200)]
Fix drm_realloc when you're reallocing into something smaller.
Stephane Marchesin [Wed, 27 Aug 2008 00:27:10 +0000 (02:27 +0200)]
Change git-describe into git describe.
Kristian Høgsberg [Tue, 26 Aug 2008 18:28:08 +0000 (14:28 -0400)]
[intel_bufmgr_gem] Remember global name when creating buffer from name.
Robert Noland [Sun, 24 Aug 2008 19:53:17 +0000 (15:53 -0400)]
i915: Fix i915 build on FreeBSD
ifdef out all the gem stuff for now. Also, the msi stuff isn't portable
the way it is... I'll try and fix that up sometime soon.
Robert Noland [Sat, 23 Aug 2008 01:45:41 +0000 (21:45 -0400)]
[FreeBSD] Add drm_drawable_free_all()
Robert Noland [Sat, 23 Aug 2008 01:34:25 +0000 (21:34 -0400)]
[FreeBSD] Fix long standing memory leak in drm_remove_magic.
We shuffled all the links around to disconnect the entry, but
never free it. We would incorrectly free the last entry in the
hash chain if nothing matched.
Robert Noland [Sat, 23 Aug 2008 01:32:37 +0000 (21:32 -0400)]
i915: Convert vblank on disabled pipe DRM_ERROR to DRM_DEBUG.
Robert Noland [Wed, 20 Aug 2008 21:20:31 +0000 (17:20 -0400)]
i915: Clear sarea_priv during lastclose.
sarea_priv needs to be NULL before i915_initialized is called to
properly reset it. The stale value produces a panic any time something
opens/closes drm without calling initialize. i.e. version checking
Robert Noland [Wed, 20 Aug 2008 21:15:46 +0000 (17:15 -0400)]
i915: Free dev->dev_private on unload.
vehemens [Wed, 13 Aug 2008 21:19:35 +0000 (17:19 -0400)]
[FreeBSD] Move vblank bits into their own structure.
Signed-off-by: Robert Noland <rnoland@2hip.net>
vehemens [Wed, 13 Aug 2008 21:17:05 +0000 (17:17 -0400)]
[FreeBSD] Fix lock leak.
Signed-off-by: Robert Noland <rnoland@2hip.net>
Robert Noland [Wed, 13 Aug 2008 21:05:59 +0000 (17:05 -0400)]
i915: Move spinlock init / destroy to load / unload time.
This resolves the panic on FreeBSD during VT switch, without attempting
any of the more lofty goals for the time being.
Dave Airlie [Sun, 24 Aug 2008 06:54:43 +0000 (16:54 +1000)]
libdrm: add udev support.
This patch allows you to --enable-udev, and will avoid having libdrm
make device nodes. If you are using udev, you should really --enable-udev
your libdrm.
root [Tue, 6 May 2008 22:04:55 +0000 (23:04 +0100)]
nouveau: fifo and graphics engine suspend and resume for nv04-nv4x
Corresponding DDX patch at http://people.freedesktop.org/~stuart/nv0x-nv4x_suspend/
Coleman Kane [Mon, 18 Aug 2008 21:08:21 +0000 (17:08 -0400)]
Change prototype of drmIoctl to unsigned long request.
This resolves and issue on amd64 FreeBSD and it looks like the
linux ioctl syscall should be unsigned long as well.
Signed-off-by: Robert Noland <rnoland@2hip.net>
Maarten Maathuis [Sat, 16 Aug 2008 22:41:50 +0000 (00:41 +0200)]
nouveau: make it compile under 2.6.27
Maarten Maathuis [Thu, 14 Aug 2008 17:35:55 +0000 (19:35 +0200)]
linux: on_each_cpu has 3 args on 2.6.27