Commit Graph

169581 Commits

Author SHA1 Message Date
Francisco Jerez
aeca15e596 drm/nouveau: Drop redundant placement initialization.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:06 +10:00
Francisco Jerez
69a18c328b drm/nouveau: No need to force evict=true when swapping evicted BOs back in.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:05 +10:00
Francisco Jerez
c6af6053be drm/nouveau: Fix "general protection fault" in the flipd/flips eviction path.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:05 +10:00
Francisco Jerez
73cb9276fd drm/i2c/ch7006: Drop build time dependency to nouveau.
This partially reverts e4b41066, as this driver is intended to be
useful with any KMS driver for suitable hardware. The missing build
dependency that commit workarounded was DRM_KMS_HELPER.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:04 +10:00
Francisco Jerez
287c153214 drm/nouveau: Make the MM aware of pre-G80 tiling.
This commit has also the following 3 bugfix commits squashed into it from
the nouveau git tree:

drm/nouveau: Fix up the tiling alignment restrictions for nv1x.
drm/nouveau: Fix up the nv2x tiling alignment restrictions.
drm/nv50: fix align typo for g9x

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:03 +10:00
Francisco Jerez
0d87c10031 drm/nouveau: Pre-G80 tiling support.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:03 +10:00
Francisco Jerez
617e234b01 drm/nouveau: Add cache_flush/pull fifo engine functions.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 14:41:02 +10:00
Dave Airlie
94fd163d86 drm: reduce WARN_ON to a printk.
Lots of ppl keep thinking this is an oops, it was just a warning for
me to see, just make it a printk now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-11 14:36:09 +10:00
Dave Airlie
509c7d83c3 drm/kms/fb: check for depth changes from userspace for resizing.
If userspace (plymouth in this case) asks for a deeper depth,
refuse it as well due to lack of resizing.

This fixes an issue since < 32MB cards went to 8bpp and plymouth
crashes on startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-11 14:36:09 +10:00
David John
89347bb8ef drm: Keep disabled outputs disabled after suspend / resume
With the current DRM code, an output that has been powered off
from userspace will automatically power back on when resuming
from suspend. This patch fixes this behaviour.

Tested only with the Intel i915 driver on an Intel GM45 Express
chipset.

Signed-off-by: David John <davidjon@xenontk.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-11 14:36:08 +10:00
Alex Deucher
804c7559e9 drm/radeon/kms: add additional safe regs for r4xx/rs6xx and r5xx
- r4xx/rs6xx: add support for extended pixel shader
instruction/temp regs
- r5xx: add SM3 regs

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-11 13:42:27 +10:00
Marcin Kościelnicki
fe5a64acbf drm/nv04: Fix set_operation software method.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:53 +10:00
Ben Skeggs
75c99da6cd drm/nouveau: initialise DMA tracking parameters earlier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:45 +10:00
Ben Skeggs
dff3632149 drm/nouveau: use dma.max rather than pushbuf size for checking GET validity
Some upcoming G80 DMA changes will depend on this, but it's split out for
bisectibility just in case it causes some unexpected issues.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:44 +10:00
Ben Skeggs
1dee7a930b drm/nv04: differentiate between nv04/nv05
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:44 +10:00
Luca Barbieri
234896a767 drm/nouveau: Fix null deref in nouveau_fence_emit due to deleted fence
Currently Nouveau will unvalidate all buffers if it is forced to wait on
one, and then start revalidating from the beginning.  While doing so, it
destroys the operation fence, causing nouveau_fence_emit to crash.

This patch fixes this bug by taking the fence object out of validate_op
and creating it just before emit.  The fence pointer is initialized to 0
and unref'ed unconditionally.

In addition to fixing the bug, this prevents its reintroduction and
simplifies the code.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:43 +10:00
Ben Skeggs
7978b9cfa5 drm/nv50: prevent a possible ctxprog hang
The below is mainly an educated guess at what's going on, docs would
sure be handy...  NVIDIA? :P

It appears it's possible for a ctxprog to run even while a GPU exception
is pending.  The GF8 and up ctxprogs appear to have a small snippet of
code which detects this, and stalls the ctxprog until it's been handled,
which essentially looks like:

	if (r2 & 0x00008000) {
		r0 |= 0x80000000;
		while (r0 & 0x80000000) {}
	}

I don't know of any way that flag would get cleared unless the driver
intervenes (and indeed, in the cases I've seen the hang, nothing steps
in to automagically clear it for us).  This patch causes the driver to
clear the flag during the PGRAPH IRQ handler.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:42 +10:00
Ben Skeggs
bbb8c3d882 drm/nouveau: have ttm's fault handler called directly
There's no good reason for us to have our own anymore, this is left over
from an early port to these TTM interfaces.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:42 +10:00
Ben Skeggs
7fb8ec8e2b drm/nv50: restore correct cache1 get/put address on fifoctx load
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:41 +10:00
Marcin Slusarz
846975a97b drm/nouveau: create function for "dealing" with gpu lockup
It's mostly a cleanup, but in nv50_fbcon_accel_init gpu lockup
message was printed, but HWACCEL_DISBALED flag was not set.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:40 +10:00
Ben Skeggs
61768bf1e6 drm/nouveau: remove unused nouveau_channel_idle() function
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:40 +10:00
Ben Skeggs
bf5302b949 drm/nouveau: fix handling of fbcon colours in 8bpp
Depending on the visual, the colours handed to us in fillrect() can either be
an actual colour, or an index into the pseudo-palette.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:39 +10:00
Francisco Jerez
be9721a951 drm/nv04: Context switching fixes.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:39 +10:00
Francisco Jerez
8c032ce73e drm/nouveau: Use the software object for fencing.
This should avoid a race condition on nv0x, if we're doing it with
actual PGRAPH objects and a there's a fence within the FIFO DMA fetch
area when a context switch kicks in.

In that case we get an ILLEGAL_MTHD interrupt as expected, but the
values in PGRAPH_TRAPPED_ADDR aren't calculated correctly and they're
almost useless (e.g. you can see ILLEGAL_MTHDs for the now inactive
channel, with a wrong offset/data pair).

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:38 +10:00
Francisco Jerez
f03a314b46 drm/nouveau: Allocate a per-channel instance of NV_SW.
It will be useful for various synchronization purposes, mostly stolen
from "[PATCH] drm/nv50: synchronize user channel after buffer object
move on kernel channel" by Maarten Maathuis.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:37 +10:00
Maarten Maathuis
a510604df9 drm/nv50: make the blocksize depend on vram size
- This should be better than what we have now.
- I'm less sure about the non power of two path.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
2010-01-11 09:06:37 +10:00
Maarten Maathuis
1c7059e4f3 drm/nouveau: better alignment of bo sizes and use roundup instead of ALIGN
- Aligning to block size should ensure that the extra size is enough.
- Using roundup, because not all sizes are powers of two.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
2010-01-11 09:06:36 +10:00
Francisco Jerez
111b459af1 drm/nouveau: Don't skip card take down on nv0x.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:35 +10:00
Francisco Jerez
0829168b47 drm/nouveau: Implement nv42-nv43 TV load detection.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:35 +10:00
Francisco Jerez
11d6eb2af5 drm/nouveau: Clean up the nv17-nv4x load detection code a bit.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:34 +10:00
Marcin Slusarz
3033f14d65 drm/nv50: fix fillrect color
struct fb_fillrect->color is not a color, but index into pseudo_palette
array

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:33 +10:00
Ben Skeggs
75c722d7ea drm/nv50: ignore vbios table's claim to the contrary if EDID says >8bpc
Should fix dim panel issues reported on Dell M6400/M6500.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 09:06:32 +10:00
Francisco Jerez
8dea4a1935 drm/nouveau: Drop redundant placement initialization.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:32 +10:00
Francisco Jerez
27f691a69d drm/nouveau: No need to force evict=true when swapping evicted BOs back in.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:31 +10:00
Francisco Jerez
77e2b5ed83 drm/nouveau: Fix "general protection fault" in the flipd/flips eviction path.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:30 +10:00
Francisco Jerez
cea7789f2a drm/i2c/ch7006: Drop build time dependency to nouveau.
This partially reverts e4b41066, as this driver is intended to be
useful with any KMS driver for suitable hardware. The missing build
dependency that commit workarounded was DRM_KMS_HELPER.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:06:30 +10:00
Francisco Jerez
a0af9add49 drm/nouveau: Make the MM aware of pre-G80 tiling.
This commit has also the following 3 bugfix commits squashed into it from
the nouveau git tree:

drm/nouveau: Fix up the tiling alignment restrictions for nv1x.
drm/nouveau: Fix up the nv2x tiling alignment restrictions.
drm/nv50: fix align typo for g9x

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 09:03:34 +10:00
Francisco Jerez
cb00f7c141 drm/nouveau: Pre-G80 tiling support.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 08:47:56 +10:00
Francisco Jerez
588d7d1268 drm/nouveau: Add cache_flush/pull fifo engine functions.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-01-11 08:47:48 +10:00
Dave Airlie
e8d6d61586 Merge remote branch 'korg/drm-radeon-testing' into drm-testing 2010-01-08 13:29:53 +10:00
Dave Airlie
a3a06cb6c2 Merge remote branch 'korg/drm-core-next' into drm-testing 2010-01-08 13:29:41 +10:00
Dave Airlie
7751b8cb75 drm/kms/fb: check for depth changes from userspace for resizing.
If userspace (plymouth in this case) asks for a deeper depth,
refuse it as well due to lack of resizing.

This fixes an issue since < 32MB cards went to 8bpp and plymouth
crashes on startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:18:19 +10:00
David John
992dc9ae61 drm: Keep disabled outputs disabled after suspend / resume
With the current DRM code, an output that has been powered off
from userspace will automatically power back on when resuming
from suspend. This patch fixes this behaviour.

Tested only with the Intel i915 driver on an Intel GM45 Express
chipset.

Signed-off-by: David John <davidjon@xenontk.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:17:22 +10:00
Jerome Glisse
003e69f986 drm/radeon/kms: Don't try to enable IRQ if we have no handler installed
If for any reason we haven't installed handler we shouldn't try to
enable IRQ/MSI on the hw so we don't get unhandled IRQ/MSI which
makes the kernel sad.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:12:20 +10:00
Jerome Glisse
e77cef9c2d drm: Avoid calling vblank function is vblank wasn't initialized
In some case vblank might not be initialized and we shouldn't
try to use associated function. This patch make sure this is
the case. It also export drm_vblank_cleanup so driver can cleanup
vblank if for any reason IRQ/MSI is not working.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:12:09 +10:00
Alexander Beregalov
059d233f9c drm/radeon: mkregtable.c: close a file before exit
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:11:55 +10:00
Jerome Glisse
d0269ed858 drm/radeon/kms: Make sure we release AGP device if we acquired it
In some case we weren't releasing the AGP device at module unloading.
This leaded to unfunctional AGP at next module load. This patch make
sure we release the AGP bus if we acquire it.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:10:13 +10:00
Jerome Glisse
cafe6609d6 drm/radeon/kms: Schedule host path read cache flush through the ring V2
R300 family will hard lockup if host path read cache flush is
done through MMIO to HOST_PATH_CNTL. But scheduling same flush
through ring seems harmless. This patch remove the hdp_flush
callback and add a flush after each fence emission which means
a flush after each IB schedule. Thus we should have same behavior
without the hard lockup.

Tested on R100,R200,R300,R400,R500,R600,R700 family.

V2: Adjust fence counts in r600_blit_prepare_copy()

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:09:59 +10:00
Corbin Simpson
62cdc0c206 drm/radeon/kms: Workaround RV410/R420 CP errata (V3)
Long story short, this fixes sporadic hardlocks with my rv410 during
times of intense 2D acceleration (Flash on Fx3).

V2: Fix indentation and move errata_fini to suspend function so we
don't leak scratch register over suspend/resume cycle.
V3: Move scratch_reg to asic specific structure (aim is to slowly
    move stuff to asic specific structure and avoid poluting
    radeon_device struct with asic specific variables)

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:09:46 +10:00
Alex Deucher
06b6476d6b drm/radeon/kms: detect sideport memory on IGP chips
This detects if the sideport memory is enabled and
if it is VRAM is evicted on suspend/resume.

This should fix s/r issues on some IGPs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-08 13:08:56 +10:00