Commit graph

4378 commits

Author SHA1 Message Date
Ben Skeggs
5a28449f88 nv50: remove clamp to 512MiB VRAM 2009-02-20 15:33:29 +10:00
Ben Skeggs
8616e8499b nv50: rework vm handling so we can support >512MiB VRAM 2009-02-20 15:26:24 +10:00
Ben Skeggs
3c649c9329 nouveau: generalise waiting on register status with timeout 2009-02-20 15:23:50 +10:00
Ben Skeggs
393494d9bd nv50: fix some fbcon corruption issues 2009-02-20 15:21:42 +10:00
Ben Skeggs
6ec57ecae6 nouveau: signal any outstanding fences on channel destroy 2009-02-20 15:04:23 +10:00
Ben Skeggs
32a7de52a7 nv50: basic fbcon acceleration 2009-02-20 15:03:07 +10:00
Ben Skeggs
776d4fe697 nouveau: use consistant register access macros
We had quite a variety, name them all similarly and add a few new
ones that'll be needed for modesetting.
2009-02-20 14:57:40 +10:00
Ben Skeggs
bedffcd3bc nouveau: always map mmio regs at load time, not first open 2009-02-20 14:39:52 +10:00
Pekka Paalanen
54ba25571a nouveau: support backlight only when kernel does
Loading nouveau.ko would fail with unknown symbols, if the backlight
class device support is not provided in the kernel. Let's make the
backlight support dependant on the kernel configuration.

This is a bit ugly, the proper way would be to check for the config in
Makefile.kernel whether to build nouveau_backlight.o at all, and if not,
nouveau_drv.h should provide the stubs.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-02-20 14:17:02 +10:00
Matthew Garrett
ba41d2df3f nv40, nv50: fix backlight build for <2.6.29 kernels
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-02-20 14:16:54 +10:00
Ben Skeggs
61ff524373 libdrm/nouveau: free drmVersion after we're done with it 2009-02-20 09:25:35 +10:00
Ben Skeggs
7e744d523d libdrm/nouveau: fix dma debugging 2009-02-19 19:40:19 +10:00
Matthew Garrett
a2e02900b6 nouveau: Add in-kernel backlight control support
Several nvidia-based systems don't support backlight control via the
standard ACPI control mechanisms. Instead, it's necessary for the driver
to modify the backlight control registers directly. This patch adds
support for determining whether the registers appear to be in use, and
if so registers a kernel backlight device to control them. The backlight
can then be controlled via existing userspace tools.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-02-18 13:50:38 +10:00
Dave Airlie
d9689e2161 libdrm/radeon: remove unused debug 2009-02-17 10:55:26 +10:00
Dave Airlie
333f3395a0 libdrm/radeon: reset the usage counters post-submit 2009-02-17 10:55:26 +10:00
Ben Skeggs
7436dc6691 nv40: fail completely if we don't have a ctxprog for the chipset 2009-02-15 22:06:57 +10:00
Ben Skeggs
1fee78e8e4 nv50: context info for chipset 0xa0 2009-02-15 21:59:19 +10:00
Eric Anholt
8a1de2a4ee bump version to 2.4.4 2009-02-15 17:03:18 +10:00
Eric Anholt
011a04c7a2 intel: don't count fences on 965 and later, as they don't use them.
(cherry picked from commit cbdd6272c0)
2009-02-15 17:03:18 +10:00
Eric Anholt
544847b774 intel: Fix under-counting of fences registers required in check_aperture.
(cherry picked from commit 9209c9a653)
2009-02-15 17:03:17 +10:00
Jesse Barnes
727feefcac intel: libdrm support for fence management in execbuf
This patch tries to use the available fence count to figure out whether a
given batch can succeed or not (just like the aperture check).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2fa5f28eee)
2009-02-15 17:03:17 +10:00
Eric Anholt
dd027724ba intel: Retry pin ioctl on -EINTR.
(cherry picked from commit 02445eab64)
2009-02-15 17:03:17 +10:00
Owain G. Ainsworth
f78fda0c31 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-02-15 17:03:17 +10:00
Jesse Barnes
7df60d46fd libdrm: add autoconf check for clock_gettime
Should be more portable this way.
(cherry picked from commit badc63464c)
2009-02-15 17:03:16 +10:00
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
f0b1f1dce9 drm/nv50: fix nv9x chipsets
NVIDIA do this fun little sequence after updating the PRAMIN page tables.

On 9xxx chips, none of the PRAMIN BAR bindings (except the initial one)
worked, hence the majority of the setup needed to create a channel
ended up in the wrong place, causing all sorts of fun.

This is done by NVIDIA on nv8x chips also, so we'll do it for them too,
even though they appear to work without it.
2009-02-11 11:22:59 +10:00
Ben Skeggs
55c9884d98 drm/nv50: add context info for nv98
It won't work yet, just like the other 9xxx chips.  Real soon now :)
2009-02-11 11:18:28 +10:00
Ben Skeggs
13d7b06baf drm/nv50: use a slightly different initial context for nv96
I'm not 100% sure that the nv94 one we were using won't work.  The context
layouts are identical (well.. same ctxprog, so of course!), only a couple
of registers differ.  But, be safe until we actually get some 9xxx chips
working.
2009-02-10 09:07:28 +10:00
Ben Skeggs
8a60b2d6a8 drm/nv50: correct ramfc pointer in channel header
Suprisingly the card still worked without this...
2009-02-10 09:02:17 +10:00
Ben Skeggs
bc0e48baa3 nv50: support chipset NV96
ctxprog seen in okias' trace identical to one we use on NV94, assuming
the initial context values for NV94 will work here too.
2009-02-10 09:01:00 +10:00
Ben Skeggs
31caf2f9a9 drm/nv50: let the card handle the initial context switch
Our PFIFO/PGRAPH context save/load functions don't really work well
(at all?) on nv5x yet.  Depending on what random state the card is
in before the drm loads, fbcon probably won't work correctly.

Luckily we've setup the GPU in such a way that it'll actually do a
hw context switch for the first context.  Not sure of how successful
this'd be currently on the older chips (actually, pretty sure it won't
work), so NV50 only for now.
2009-02-10 08:57:21 +10:00
Ben Skeggs
2e7db8cc34 drm/nouveau: init fbcon after we flag the card as initialised 2009-02-10 08:56:17 +10:00
Pekka Paalanen
3762c97c82 drm compat: fix euid for >=2.6.28
drm_fops.c reads the current process' EUID directly from task_struct.
Apparently starting in 2.6.28-rc4 this fails to build.

In Linus' tree, commit b6dff3ec5e116e3af6f537d4caedcad6b9e5082a
"CRED: Separate task security context from task_struct"
moves the euid field from task_struct to another struct.

Earlier commit 9e2b2dc4133f65272a6d3c5dcb2ce63f8a87cae9
"CRED: Introduce credential access wrappers" implements the wrapper
macros to access e.g. euid. This is in 2.6.27-rc4, and this contains the
definition of current_euid() that will be used in the DRM compatibility header
for kernels before 2.6.27. That commit also creates <linux/cred.h>, which
contains the upstream definition of current_euid().

drm_fops.c is fixed to use current_euid(), and drm_compat.h will offer
the compatibility definition for kernels <2.6.27.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2009-02-10 08:55:32 +10:00
Ben Skeggs
933995b1da drm/nouveau: store vram/gart object handles for each channel 2009-02-10 08:55:30 +10:00
Ben Skeggs
417c2c411f nv50: remove some badness, we bail in these situations now anyway 2009-02-06 05:29:14 +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
95fc1b0b52 nv50/kms: be less verbose without debug=1 2009-02-04 15:03:48 +10:00
Ben Skeggs
15ed426dd4 nv50/kms: use DRM_DEBUG 2009-02-04 15:03:48 +10:00
Ben Skeggs
988b805fd6 nv50/kms: oops, re-enable fbcon unregister, got disabled while debugging 2009-02-04 15:03:47 +10:00
Ben Skeggs
bf8181b78a nv50/kms: store dcb entry ptr & or in encoder struct, remove nv50_output.h 2009-02-04 15:03:47 +10:00