linux-2.6-microblaze.git
14 years agodrm/radeon/kms: remove stray radeon_i2c_destroy
Alex Deucher [Thu, 26 Aug 2010 16:22:04 +0000 (12:22 -0400)]
drm/radeon/kms: remove stray radeon_i2c_destroy

I missed this one in the i2c unification patch.  This
is handled in the core radeon i2c code now.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: mm: fix range restricted allocations
Daniel Vetter [Thu, 26 Aug 2010 19:44:17 +0000 (21:44 +0200)]
drm: mm: fix range restricted allocations

With the code cleanup in

7a6b2896f261894dde287d3faefa4b432cddca53 is the first bad commit
commit 7a6b2896f261894dde287d3faefa4b432cddca53
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Jul 2 15:02:15 2010 +0100

    drm_mm: extract check_free_mm_node

I've botched up the range-restriction checks. The result is usually
an X server dying with SIGBUS in libpixman (software fallback rendering).
Change the code to adjust the start and end for range restricted
allocations. IMHO this even makes the code a bit clearer.

Fixes regression bug: https://bugs.freedesktop.org/show_bug.cgi?id=29738

Reported-by-Tested-by: Till MAtthiesen <entropy@everymail.net>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-fixes
Dave Airlie [Thu, 26 Aug 2010 23:09:46 +0000 (09:09 +1000)]
Merge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-fixes

* 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next:
  drm/nouveau: drop drm_global_mutex before sleeping in submission path
  drm: export drm_global_mutex for drivers to use
  drm/nv20: Don't use pushbuf calls on the original nv20.
  drm/nouveau: Fix TMDS on some DCB1.5 boards.
  drm/nouveau: Fix backlight control on PPC machines with an internal TMDS panel.
  drm/nv30: Apply modesetting to the correct slave encoder
  drm/nouveau: Use a helper function to match PCI device/subsystem IDs.
  drm/nv50: add dcb type 14 to enum to prevent compiler complaint

14 years agodrm/nouveau: drop drm_global_mutex before sleeping in submission path
Ben Skeggs [Thu, 26 Aug 2010 05:02:32 +0000 (15:02 +1000)]
drm/nouveau: drop drm_global_mutex before sleeping in submission path

If we keep hold of the mutex here, the process which currently holds the
buffer object will never be able to release it, causing a deadlock.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm: export drm_global_mutex for drivers to use
Ben Skeggs [Thu, 26 Aug 2010 04:58:57 +0000 (14:58 +1000)]
drm: export drm_global_mutex for drivers to use

Nouveau needs to be able to drop the mutex before sleeping to prevent a
deadlock from occuring.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv20: Don't use pushbuf calls on the original nv20.
Francisco Jerez [Wed, 25 Aug 2010 10:54:53 +0000 (12:54 +0200)]
drm/nv20: Don't use pushbuf calls on the original nv20.

The "return" command is buggy on the original nv20, it jumps back to
the caller address as expected, but it doesn't clear the subroutine
active bit making the subsequent pushbuf calls fail with a "stack"
overflow.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix TMDS on some DCB1.5 boards.
Francisco Jerez [Tue, 24 Aug 2010 21:02:02 +0000 (23:02 +0200)]
drm/nouveau: Fix TMDS on some DCB1.5 boards.

The TMDS output of an nv11 was being detected as LVDS, because it uses
DCB type 2 for TMDS instead of type 4.

Reported-by: Bertrand VIEILLE <Vieille.Bertrand@free.fr>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix backlight control on PPC machines with an internal TMDS panel.
Francisco Jerez [Fri, 20 Aug 2010 12:19:45 +0000 (14:19 +0200)]
drm/nouveau: Fix backlight control on PPC machines with an internal TMDS panel.

This commit fixes fdo bug 29685.

Reported-by: Vlado Plaga <rechner@vlado-do.de>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv30: Apply modesetting to the correct slave encoder
Patrice Mandin [Wed, 18 Aug 2010 14:07:34 +0000 (16:07 +0200)]
drm/nv30: Apply modesetting to the correct slave encoder

Signed-off-by: Patrice Mandin <patmandin@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Use a helper function to match PCI device/subsystem IDs.
Francisco Jerez [Sun, 15 Aug 2010 12:31:31 +0000 (14:31 +0200)]
drm/nouveau: Use a helper function to match PCI device/subsystem IDs.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: add dcb type 14 to enum to prevent compiler complaint
Ben Skeggs [Tue, 17 Aug 2010 04:34:00 +0000 (14:34 +1000)]
drm/nv50: add dcb type 14 to enum to prevent compiler complaint

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agoMerge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-core...
Dave Airlie [Sun, 22 Aug 2010 22:34:59 +0000 (08:34 +1000)]
Merge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-core-next

* 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next:
  drm/nouveau: fix earlier mistake when fixing merge conflict
  drm/nvc0: fix thinko in instmem suspend/resume
  drm/nouveau: Workaround missing GPIO tables on an Apple iMac G4 NV18.
  drm/nouveau: Add TV-out quirk for an MSI nForce2 IGP.
  drm/nv50-nvc0: ramht_size is meant to be in bytes, not entries
  drm/nouveau: punt some more log messages to debug level
  drm/nouveau: remove warning about unknown tmds table revisions
  drm/nouveau: check for error when allocating/mapping dummy page
  drm/nouveau: fix race condition when under memory pressure
  drm/nv50: fix minor thinko from nvc0 changes
  drm/nouveau: Don't try DDC on the dummy I2C channel.

14 years agodrm/radeon/kms: fix typo in radeon_compute_pll_gain
Alex Deucher [Tue, 17 Aug 2010 04:35:45 +0000 (00:35 -0400)]
drm/radeon/kms: fix typo in radeon_compute_pll_gain

Looks like this got copied from the ddx wrong.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: try to detect tv vs monitor for underscan
Alex Deucher [Fri, 20 Aug 2010 15:57:19 +0000 (11:57 -0400)]
drm/radeon/kms: try to detect tv vs monitor for underscan

When enabling underscan for hdmi monitors, attempt to detect
whether we are driving a TV or a monitor.  The should hopefully
prevent underscan from being enabled on monitors attached via
hdmi that do not overscan the image.  Only enable underscan
if the mode is a common hdtv mode (480p, 720p, etc.).

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix sideport detection on newer rs880 boards
Alex Deucher [Fri, 20 Aug 2010 16:47:54 +0000 (12:47 -0400)]
drm/radeon/kms: fix sideport detection on newer rs880 boards

The meaning of ucMemoryType changed on recent boards, however,
ulBootUpSidePortClock should be set properly across all boards.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: fix passing wrong type to gem object create.
Dave Airlie [Sun, 22 Aug 2010 22:27:47 +0000 (08:27 +1000)]
drm/radeon: fix passing wrong type to gem object create.

We are passing a ttm type when we want to pass true/false.

Reported-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: set encoder type to DVI for HDMI on evergreen
Alex Deucher [Fri, 20 Aug 2010 05:09:22 +0000 (01:09 -0400)]
drm/radeon/kms: set encoder type to DVI for HDMI on evergreen

Fixes the pink line that shows up with some hdmi monitors.  This
will need to be revisited when audio support is added.

Fixes:
http://bugs.freedesktop.org/show_bug.cgi?id=27452

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add back missing break in info ioctl
Alex Deucher [Thu, 12 Aug 2010 12:25:47 +0000 (08:25 -0400)]
drm/radeon/kms: add back missing break in info ioctl

This seems to have gotten lost in the hyper-z merge.

Noticed by legume on IRC.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: don't enable MSIs on AGP boards
Alex Deucher [Thu, 12 Aug 2010 22:05:34 +0000 (18:05 -0400)]
drm/radeon/kms: don't enable MSIs on AGP boards

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=29327

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix agp mode setup on cards that use pcie bridges
Alex Deucher [Wed, 18 Aug 2010 17:34:11 +0000 (13:34 -0400)]
drm/radeon/kms: fix agp mode setup on cards that use pcie bridges

Asics that use an AGP to PCIE bridge don't have the AGP_STATUS
register so just use whatever mode the host side setup.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Jerome Glisse <glisse@freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: move dereference below check
Dan Carpenter [Thu, 19 Aug 2010 09:46:29 +0000 (11:46 +0200)]
drm: move dereference below check

"fb_helper_conn" is dereferenced before the check for NULL.  It's never
actually NULL here, so this is mostly to keep the static checkers happy.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: fix end of loop test
Dan Carpenter [Thu, 19 Aug 2010 09:39:57 +0000 (11:39 +0200)]
drm: fix end of loop test

"agpmem" is never NULL here because it is the list cursor of a
list_for_each_entry() list.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: rework radeon_dp_detect() logic
Alex Deucher [Thu, 19 Aug 2010 21:29:03 +0000 (17:29 -0400)]
drm/radeon/kms: rework radeon_dp_detect() logic

If the connector is eDP, it can only be DP, not TMDS.
Always set the detected sink type.  If the sink is
detected as non-DP, but there is no EDID, you can still
manually force the port on.  If the sink type is DP
and there's no DPCD, there's no way to force the monitor
on since you need both ends to train the link.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add missing asic callback assignment for evergreen
Alex Deucher [Thu, 19 Aug 2010 18:28:33 +0000 (14:28 -0400)]
drm/radeon/kms: add missing asic callback assignment for evergreen

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/DCE3+: switch pads to ddc mode when going i2c
Alex Deucher [Thu, 19 Aug 2010 15:19:31 +0000 (11:19 -0400)]
drm/radeon/kms/DCE3+: switch pads to ddc mode when going i2c

The pins for ddc and aux are shared so you need to switch the
mode when doing ddc.  The ProcessAuxChannel table already sets
the pin mode to DP.  This should fix unreliable ddc issues
on DP ports using non-DP monitors.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: bail early if nothing's changing
Alex Deucher [Fri, 13 Aug 2010 14:53:35 +0000 (10:53 -0400)]
drm/radeon/kms/pm: bail early if nothing's changing

If we aren't changing the power state, no need to take
locks and schedule fences, etc.

There seem to be lock ordering issues in the CP and
fence code in some cases; see bug 29140 below.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=29140
Possibly also:
https://bugzilla.kernel.org/show_bug.cgi?id=16581

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/atom: clean up dig atom handling
Alex Deucher [Thu, 12 Aug 2010 22:58:48 +0000 (18:58 -0400)]
drm/radeon/kms/atom: clean up dig atom handling

This allows the tables to be run in some additional cases
where the connector info isn't necessary.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: DCE3/4 transmitter fixes
Alex Deucher [Thu, 12 Aug 2010 22:58:46 +0000 (18:58 -0400)]
drm/radeon/kms: DCE3/4 transmitter fixes

- INIT action takes the actual connector type id, not the enum id
- some evergreen cards have the ENABLE_OUTPUT/DISABLE_OUTPUT actions

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: rework encoder handling
Alex Deucher [Thu, 12 Aug 2010 22:58:47 +0000 (18:58 -0400)]
drm/radeon/kms: rework encoder handling

On most newer asics, digital encoders have two links each
and they can be used independantly.  As such, treat them as
separate encoders otherwise the individual links will not
get programmed properly at modeset time.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: DCE3/4 AdjustPixelPll updates
Alex Deucher [Mon, 16 Aug 2010 16:44:47 +0000 (12:44 -0400)]
drm/radeon/kms: DCE3/4 AdjustPixelPll updates

Add options necessary bits for:
- SS on DP
- SS on LVDS
- set clocks right for DP
- deep color on hdmi (needs additional encoder and edid work as well)

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: Fix stack data leak
Jean Delvare [Sun, 15 Aug 2010 12:11:24 +0000 (14:11 +0200)]
drm/radeon: Fix stack data leak

Always zero-init a structure on the stack which is returned by a
function. Otherwise you may leak random stack data from previous
function calls.

This fixes the following warning I was seeing:
  CC [M]  drivers/gpu/drm/radeon/radeon_atombios.o
drivers/gpu/drm/radeon/radeon_atombios.c: In function "radeon_atom_get_hpd_info_from_gpio":
drivers/gpu/drm/radeon/radeon_atombios.c:261: warning: "hpd.plugged_state" is used uninitialized in this function

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix GTT/VRAM overlapping test
Jerome Glisse [Mon, 16 Aug 2010 15:54:36 +0000 (11:54 -0400)]
drm/radeon/kms: fix GTT/VRAM overlapping test

GTT/VRAM overlapping test had a typo which leaded to not
detecting case when vram_end > gtt_end. This patch fix the
logic and should fix #16574

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: block userspace under allocating buffer and having drivers overwrite it (v2)
Dave Airlie [Sat, 14 Aug 2010 10:20:34 +0000 (20:20 +1000)]
drm: block userspace under allocating buffer and having drivers overwrite it (v2)

With the current screwed but its ABI, ioctls for the drm, Linus pointed out that we could allow userspace to specify the allocation size, but we pass it to the driver which then uses it blindly to store a struct. Now if userspace specifies the allocation size as smaller than the driver needs, the driver can possibly overwrite memory.

This patch restructures the driver ioctls so we store the structure size we are expecting, and make sure we allocate at least that size. The copy from/to userspace are still restricted to the size the user specifies, this allows ioctl structs to grow on both sides of the equation.

Up until now we didn't really use the DRM_IOCTL defines in the kernel, so this cleans them up and adds them for nouveau.

v2:
fix nouveau pushbuf arg (thanks to Ben for pointing it out)

Reported-by: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: stop information leak of old kernel stack.
Dave Airlie [Tue, 17 Aug 2010 04:46:00 +0000 (14:46 +1000)]
drm: stop information leak of old kernel stack.

non-critical issue, CVE-2010-2803

Userspace controls the amount of memory to be allocate, so it can
get the ioctl to allocate more memory than the kernel uses, and get
access to kernel stack. This can only be done for processes authenticated
to the X server for DRI access, and if the user has DRI access.

Fix is to just memset the data to 0 if the user doesn't copy into
it in the first place.

Reported-by: Kees Cook <kees@ubuntu.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/nouveau: fix earlier mistake when fixing merge conflict
Ben Skeggs [Tue, 17 Aug 2010 02:02:43 +0000 (12:02 +1000)]
drm/nouveau: fix earlier mistake when fixing merge conflict

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nvc0: fix thinko in instmem suspend/resume
Ben Skeggs [Sun, 15 Aug 2010 22:18:16 +0000 (08:18 +1000)]
drm/nvc0: fix thinko in instmem suspend/resume

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Workaround missing GPIO tables on an Apple iMac G4 NV18.
Francisco Jerez [Sun, 15 Aug 2010 12:32:49 +0000 (14:32 +0200)]
drm/nouveau: Workaround missing GPIO tables on an Apple iMac G4 NV18.

This should fix the reported TV-out load detection false positives
(fdo bug 29455).

Reported-by: Vlado Plaga <rechner@vlado-do.de>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Add TV-out quirk for an MSI nForce2 IGP.
Francisco Jerez [Sat, 14 Aug 2010 16:45:58 +0000 (18:45 +0200)]
drm/nouveau: Add TV-out quirk for an MSI nForce2 IGP.

The blob also thinks there's a TV connected, so hardware bug...

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50-nvc0: ramht_size is meant to be in bytes, not entries
Ben Skeggs [Fri, 13 Aug 2010 00:22:41 +0000 (10:22 +1000)]
drm/nv50-nvc0: ramht_size is meant to be in bytes, not entries

Fixes an infinite loop that can happen in RAMHT lookup.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: punt some more log messages to debug level
Ben Skeggs [Thu, 12 Aug 2010 22:37:55 +0000 (08:37 +1000)]
drm/nouveau: punt some more log messages to debug level

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: remove warning about unknown tmds table revisions
Ben Skeggs [Thu, 12 Aug 2010 22:31:22 +0000 (08:31 +1000)]
drm/nouveau: remove warning about unknown tmds table revisions

This message is apparently confusing people, and is being blamed for some
modesetting issues.  Lets remove the message, and instead replace it
with an unconditional printout of the table revision.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: check for error when allocating/mapping dummy page
Ben Skeggs [Thu, 12 Aug 2010 00:23:06 +0000 (10:23 +1000)]
drm/nouveau: check for error when allocating/mapping dummy page

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: fix race condition when under memory pressure
Ben Skeggs [Thu, 22 Jul 2010 23:06:52 +0000 (09:06 +1000)]
drm/nouveau: fix race condition when under memory pressure

When VRAM is running out it's possible that the client's push buffers get
evicted to main memory.  When they're validated back in, the GPU may
be used for the copy back to VRAM, but the existing synchronisation code
only deals with inter-channel sync, not sync between PFIFO and PGRAPH on
the same channel.  This leads to PFIFO fetching from command buffers that
haven't quite been copied by PGRAPH yet.

This patch marks push buffers as so, and forces any GPU-assisted buffer
moves to be done on a different channel, which triggers the correct
synchronisation to happen before we submit them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix minor thinko from nvc0 changes
Ben Skeggs [Tue, 10 Aug 2010 00:50:13 +0000 (10:50 +1000)]
drm/nv50: fix minor thinko from nvc0 changes

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Don't try DDC on the dummy I2C channel.
Francisco Jerez [Sun, 8 Aug 2010 19:35:57 +0000 (21:35 +0200)]
drm/nouveau: Don't try DDC on the dummy I2C channel.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agoio-mapping: move asm include inside the config option
Dave Airlie [Thu, 12 Aug 2010 01:47:50 +0000 (11:47 +1000)]
io-mapping: move asm include inside the config option

nouveau starting using these APIs, the first on non-x86 hw, and this
include isn't required on anything with real amounts of vmalloc space.

this fixes a build problem on powerpc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agovgaarb: drop vga.h include
Dave Airlie [Thu, 12 Aug 2010 01:44:50 +0000 (11:44 +1000)]
vgaarb: drop vga.h include

We don't actually need this include on any platform.

built on powerpc + x86, reported on m68k.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: Add probing of clocks from device-tree
Benjamin Herrenschmidt [Mon, 9 Aug 2010 06:16:36 +0000 (16:16 +1000)]
drm/radeon: Add probing of clocks from device-tree

When we find no ROM we understand and a device-tree is present, see
if we can retreive clock info from there.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: drop old and broken mesa warning
Dave Airlie [Wed, 11 Aug 2010 23:40:05 +0000 (09:40 +1000)]
drm/radeon: drop old and broken mesa warning

This never really got fixed in mesa, and the kernel deals with the problem
just fine, so don't got reporting things that confuse people.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: Fix pci_map_page() error checking
Benjamin Herrenschmidt [Tue, 10 Aug 2010 04:48:58 +0000 (14:48 +1000)]
drm/radeon: Fix pci_map_page() error checking

0 is a valid DMA address from pci_map_page(), use pci_dma_mapping_error()
instead to check for errors

[airlied: fix warning + two other places with errors.]

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Remove count_lock for calling lastclose() after 58474713 (v2)
Chris Wilson [Wed, 11 Aug 2010 13:41:16 +0000 (14:41 +0100)]
drm: Remove count_lock for calling lastclose() after 58474713 (v2)

When removing of the BKL the locking around lastclose() was rearranged
and resulted in the holding of the open_count spinlock over the call
into drm_lastclose(). The drivers were not ready for this path to be
atomic - it may indeed involve long waits to release old objects and
cleanup the GPU - and so we ended up scheduling whilst atomic.

[   54.625598] BUG: scheduling while atomic: X/3546/0x00000002
[   54.625600] Modules linked in: sco bridge stp llc input_polldev rfcomm bnep l2cap crc16 sch_sfq ipv6 md_mod acpi_cpufreq mperf cryptd aes_x86_64 aes_generic xts gf128mul dm_crypt dm_mod btusb bluetooth usbhid hid zaurus cdc_ether usbnet mii cdc_wdm cdc_acm uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 snd_hda_codec_conexant arc4 pcmcia ecb snd_hda_intel joydev sdhci_pci sdhci snd_hda_codec tpm_tis firewire_ohci mmc_core e1000e uhci_hcd thinkpad_acpi nvram yenta_socket pcmcia_rsrc pcmcia_core tpm wmi sr_mod firewire_core iwlagn ehci_hcd snd_hwdep snd_pcm usbcore tpm_bios thermal led_class snd_timer iwlcore snd soundcore ac snd_page_alloc pcspkr psmouse serio_raw battery sg mac80211 evdev cfg80211 i2c_i801 iTCO_wdt iTCO_vendor_support cdrom processor crc_itu_t rfkill xfs exportfs sd_mod crc_t10dif ahci libahci libata scsi_mod [last unloaded: scsi_wait_scan]
[   54.625663] Pid: 3546, comm: X Not tainted 2.6.35-04771-g1787985 #301
[   54.625665] Call Trace:
[   54.625671]  [<ffffffff8102d599>] __schedule_bug+0x57/0x5c
[   54.625675]  [<ffffffff81384141>] schedule+0xe5/0x832
[   54.625679]  [<ffffffff81163e77>] ? put_dec+0x20/0x3c
[   54.625682]  [<ffffffff81384dd4>] schedule_timeout+0x275/0x29f
[   54.625686]  [<ffffffff810455e1>] ? process_timeout+0x0/0xb
[   54.625688]  [<ffffffff81384e17>] schedule_timeout_uninterruptible+0x19/0x1b
[   54.625691]  [<ffffffff81045893>] msleep+0x16/0x1d
[   54.625695]  [<ffffffff812a2e53>] i9xx_crtc_dpms+0x273/0x2ae
[   54.625698]  [<ffffffff812a18be>] intel_crtc_dpms+0x28/0xe7
[   54.625702]  [<ffffffff811ec0fa>] drm_helper_disable_unused_functions+0xf0/0x118
[   54.625705]  [<ffffffff811ecde3>] drm_crtc_helper_set_config+0x644/0x7c8
[   54.625708]  [<ffffffff811f12dd>] ? drm_copy_field+0x40/0x50
[   54.625711]  [<ffffffff811ebca2>] drm_fb_helper_force_kernel_mode+0x3e/0x85
[   54.625713]  [<ffffffff811ebcf2>] drm_fb_helper_restore+0x9/0x24
[   54.625717]  [<ffffffff81290a41>] i915_driver_lastclose+0x2b/0x5c
[   54.625720]  [<ffffffff811f14a7>] drm_lastclose+0x44/0x2ad
[   54.625722]  [<ffffffff811f1ed2>] drm_release+0x5c6/0x609
[   54.625726]  [<ffffffff810d1275>] fput+0x109/0x1c7
[   54.625728]  [<ffffffff810ce5e4>] filp_close+0x61/0x6b
[   54.625731]  [<ffffffff810ce680>] sys_close+0x92/0xd4
[   54.625734]  [<ffffffff81002a2b>] system_call_fastpath+0x16/0x1b

v2: The spinlock is actually superfluous as access to open_count is
entirely serialised by drm_global_mutex and so can be dropped. The
count_lock spinlock instead appears to be used to protect access to
dev->buf_alloc and dev->buf_use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: allow FG_ALPHA_VALUE on r5xx
Marek Olšák [Wed, 11 Aug 2010 18:42:51 +0000 (04:42 +1000)]
drm/radeon/kms: allow FG_ALPHA_VALUE on r5xx

This is a CS checker fix. I need this for FP16 alpha-test.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: another r6xx/r7xx CS checker fix
Alex Deucher [Wed, 11 Aug 2010 15:54:25 +0000 (11:54 -0400)]
drm/radeon/kms: another r6xx/r7xx CS checker fix

add default case for buffer formats

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Andre Maasikas <amaasikas@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoDRM: Replace kmalloc/memset combos with kzalloc
Davidlohr Bueso [Wed, 11 Aug 2010 13:18:52 +0000 (09:18 -0400)]
DRM: Replace kmalloc/memset combos with kzalloc

Currently most, if not all, memory allocation in drm_bufs.c is followed by initializing the memory with 0.

Replace the use of kmalloc+memset with kzalloc.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: expand gamma_set
James Simmons [Tue, 3 Aug 2010 00:33:19 +0000 (01:33 +0100)]
drm: expand gamma_set

Expand the crtc_gamma_set function to accept a starting offset. The
reason for this is to eventually use this function for setcolreg from
drm_fb_helper.c. The fbdev colormap function can start at any offset in
the color map.

Signed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/edid: Split mode lists out to their own header for readability
Adam Jackson [Tue, 3 Aug 2010 18:38:20 +0000 (14:38 -0400)]
drm/edid: Split mode lists out to their own header for readability

... of the code, not of the mode lists.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/edid: Rewrite mode parse to use the generic detailed block walk
Adam Jackson [Tue, 3 Aug 2010 18:38:19 +0000 (14:38 -0400)]
drm/edid: Rewrite mode parse to use the generic detailed block walk

This brings us in line with the EDID spec recommendation for mode
priority sorting.  We still don't extract all the modes we could from
VTB, but VTB is so rare in the wild that I'm not really concerned.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/edid: Add detailed block walk for VTB extensions
Adam Jackson [Tue, 3 Aug 2010 18:38:18 +0000 (14:38 -0400)]
drm/edid: Add detailed block walk for VTB extensions

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/edid: Add detailed block walk for CEA extensions
Adam Jackson [Tue, 3 Aug 2010 18:38:17 +0000 (14:38 -0400)]
drm/edid: Add detailed block walk for CEA extensions

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Remove unused fields from drm_display_info
Adam Jackson [Tue, 3 Aug 2010 18:38:16 +0000 (14:38 -0400)]
drm: Remove unused fields from drm_display_info

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Use ENOENT consistently for the error return for an unmatched handle.
Chris Wilson [Wed, 4 Aug 2010 13:19:46 +0000 (14:19 +0100)]
drm: Use ENOENT consistently for the error return for an unmatched handle.

This is consistent with trying to access a filename that not exist
within a directory which is a good analogy here. The main reason for the
change is that it is easy to confuse the error code of EBADF as an
performing an ioctl on an invalid file descriptor (rather than an
unknown object).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: mark 3D power states as performance
Alex Deucher [Wed, 4 Aug 2010 15:10:26 +0000 (11:10 -0400)]
drm/radeon/kms: mark 3D power states as performance

Fixes lack of power saving with multiple heads on
some desktop cards.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=16474

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Only set DPMS once on the CRTC not after every encoder.
Chris Wilson [Fri, 6 Aug 2010 14:03:31 +0000 (15:03 +0100)]
drm: Only set DPMS once on the CRTC not after every encoder.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add additional quirk for Acer rv620 laptop
Alex Deucher [Fri, 6 Aug 2010 04:27:44 +0000 (00:27 -0400)]
drm/radeon/kms: add additional quirk for Acer rv620 laptop

HPD pins are reversed

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=29387

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Propagate error code from fb_create()
Chris Wilson [Sun, 8 Aug 2010 12:36:38 +0000 (13:36 +0100)]
drm: Propagate error code from fb_create()

Change the interface to expect a PTR_ERR specifing the real error code
as opposed to assuming a NULL return => -EINVAL. Just once the user may
not be at fault!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: handle errors in radeon_hwmon_init()
Dan Carpenter [Mon, 9 Aug 2010 19:59:42 +0000 (21:59 +0200)]
radeon: handle errors in radeon_hwmon_init()

Smatch complained that the ERR_PTR from hwmon_device_register() wasn't
handled.  I added some error handling in radeon_hwmon_init() to silence
the warning.

Unfortunately errors from radeon_pm_init() aren't handled so this
doesn't really make a difference beyond silencing the warning.

Also I changed DRM_ERROR() to dev_err() which is the new preferred
method.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add support for router objects
Alex Deucher [Fri, 6 Aug 2010 01:21:18 +0000 (21:21 -0400)]
drm/radeon/kms: add support for router objects

router objects are found on systems that use a mux to control
ddc line to connector routing or to control the actual clock and data
routing from the chip to the connectors.  This patch implements ddc line
routing.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: rework combios i2c handling
Alex Deucher [Fri, 6 Aug 2010 01:21:17 +0000 (21:21 -0400)]
drm/radeon/kms: rework combios i2c handling

Handle asic specific table to hw mappings in
combios_setup_i2c_bus() directly.  This allows us
to remove most of the combios quirks and clean up
the i2c bus setup.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: unify i2c handling
Alex Deucher [Fri, 6 Aug 2010 01:21:16 +0000 (21:21 -0400)]
drm/radeon/kms: unify i2c handling

Previously we added i2c buses as needed when enumerating connectors
power management, etc.  This only exposed the actual buses used and
could have lead to the same buse getting created more than once if
one buses was used for more than one purpose.  This patch sets up
all i2c buses on the card in one place and users of the buses just
point back to the one instance.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: r600 CS parser fixes
Alex Deucher [Fri, 6 Aug 2010 06:54:05 +0000 (02:54 -0400)]
drm/radeon/kms: r600 CS parser fixes

- buffer offsets in the base regs are 256b aligned so
shift properly when comparing, fixed by Andre Maasikas
- mipmap size was calculated wrong when nlevel=0
- texture bo offsets were used after the bo base address was added
- vertex resource size register is size - 1, not size

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Andre Maasikas <amaasikas@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: add a way to revoke hyper-z access
Marek Olšák [Sat, 7 Aug 2010 01:36:34 +0000 (03:36 +0200)]
drm/radeon: add a way to revoke hyper-z access

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Fix support for PCI domains
Benjamin Herrenschmidt [Fri, 6 Aug 2010 03:55:10 +0000 (13:55 +1000)]
drm: Fix support for PCI domains

(For some reason I thought that went in ages ago ...)

This fixes support for PCI domains in what should hopefully be a backward
compatible way along with a change to libdrm.

When the interface version is set to 1.4, we assume userspace understands
domains and the world is at peace. We thus pass proper domain numbers
instead of 0 to userspace.

The newer libdrm will then try 1.4 first, and fallback to 1.1, along with
ignoring domains in the later case (well, except on alpha of course)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-core...
Dave Airlie [Mon, 9 Aug 2010 22:17:50 +0000 (08:17 +1000)]
Merge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-core-next

* 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next: (27 commits)
  drm/nvc0: fix typo in PRAMIN flush
  drm/nouveau: Fix DCB TMDS config parsing.
  drm/nv30: Fix PFB init for nv31.
  drm/nv04: Fix up SGRAM density detection.
  drm/i2c/ch7006: Don't use POWER_LEVEL_FULL_POWER_OFF on early chip versions.
  drm/nouveau: Init dcb->or on cards that have no usable DCB table.
  drm/nouveau: reduce severity of some "error" messages
  drm/nvc0: backup bar3 channel on suspend
  drm/nouveau: implement init table opcodex 0x5e and 0x9a
  drm/nouveau: implement init table op 0x57, INIT_LTIME
  drm/nvc0: implement crtc pll setting
  drm/nvc0: fix evo dma object so we display something
  drm/nvc0: rudimentary instmem support
  drm/nvc0: implement memory detection
  drm/nvc0: allow INIT_GPIO
  drm/nvc0: starting point for GF100 support, everything stubbed
  drm/nv30: Workaround dual TMDS brain damage.
  drm/nouveau: No need to set slave TV encoder configs explicitly.
  drm/nv17-nv4x: Attempt to init some external TMDS transmitters.
  drm/nv10: Fix up switching of NV10TCL_DMA_VTXBUF.
  ...

14 years agodrm/radeon/kms: add missing copy from user
Dr. David Alan Gilbert [Sun, 1 Aug 2010 23:43:52 +0000 (09:43 +1000)]
drm/radeon/kms: add missing copy from user

This hasn't mattered up until the ioctl started using the value, and it fell
apart.

fixes fd.o 29340, Ubuntu LP 606081

[airlied: cleaned up whitespace and don't need an error before pushing]

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/nvc0: fix typo in PRAMIN flush
Ben Skeggs [Mon, 9 Aug 2010 05:18:44 +0000 (15:18 +1000)]
drm/nvc0: fix typo in PRAMIN flush

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix DCB TMDS config parsing.
Francisco Jerez [Sun, 8 Aug 2010 15:09:06 +0000 (17:09 +0200)]
drm/nouveau: Fix DCB TMDS config parsing.

Thinko caused by 43bda05428a3d2021f3c12220073e0251c65df8b.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
14 years agodrm/nv30: Fix PFB init for nv31.
Francisco Jerez [Fri, 6 Aug 2010 18:32:25 +0000 (20:32 +0200)]
drm/nv30: Fix PFB init for nv31.

Fixes a regression introduced by 58bbb63720c8997e0136fe1884101e7ca40d68fd
(fdo bug 29324).

Reported-by: Johannes Obermayr <johannesobermayr@gmx.de>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv04: Fix up SGRAM density detection.
Francisco Jerez [Thu, 5 Aug 2010 20:58:42 +0000 (22:58 +0200)]
drm/nv04: Fix up SGRAM density detection.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/i2c/ch7006: Don't use POWER_LEVEL_FULL_POWER_OFF on early chip versions.
Francisco Jerez [Thu, 5 Aug 2010 20:57:08 +0000 (22:57 +0200)]
drm/i2c/ch7006: Don't use POWER_LEVEL_FULL_POWER_OFF on early chip versions.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Init dcb->or on cards that have no usable DCB table.
Francisco Jerez [Tue, 3 Aug 2010 13:34:53 +0000 (15:34 +0200)]
drm/nouveau: Init dcb->or on cards that have no usable DCB table.

We need a valid OR value because there're a few nv17 cards with DCB v1.4.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: reduce severity of some "error" messages
Ben Skeggs [Wed, 4 Aug 2010 13:09:30 +0000 (23:09 +1000)]
drm/nouveau: reduce severity of some "error" messages

There's some known configurations where the lack of these tables/scripts
is perfectly normal, reduce visibilty of complaint messages to debug.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nvc0: backup bar3 channel on suspend
Ben Skeggs [Wed, 4 Aug 2010 12:48:34 +0000 (22:48 +1000)]
drm/nvc0: backup bar3 channel on suspend

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: implement init table opcodex 0x5e and 0x9a
Marcin Kościelnicki [Sun, 4 Jul 2010 02:47:16 +0000 (02:47 +0000)]
drm/nouveau: implement init table opcodex 0x5e and 0x9a

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
14 years agodrm/nouveau: implement init table op 0x57, INIT_LTIME
Marcin Kościelnicki [Fri, 2 Jul 2010 19:33:01 +0000 (19:33 +0000)]
drm/nouveau: implement init table op 0x57, INIT_LTIME

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
14 years agodrm/nvc0: implement crtc pll setting
Ben Skeggs [Wed, 4 Aug 2010 12:08:03 +0000 (22:08 +1000)]
drm/nvc0: implement crtc pll setting

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nvc0: fix evo dma object so we display something
Ben Skeggs [Wed, 4 Aug 2010 07:24:57 +0000 (17:24 +1000)]
drm/nvc0: fix evo dma object so we display something

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nvc0: rudimentary instmem support
Ben Skeggs [Wed, 4 Aug 2010 05:45:33 +0000 (15:45 +1000)]
drm/nvc0: rudimentary instmem support

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nvc0: implement memory detection
Ben Skeggs [Wed, 4 Aug 2010 03:44:41 +0000 (13:44 +1000)]
drm/nvc0: implement memory detection

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nvc0: allow INIT_GPIO
Ben Skeggs [Wed, 4 Aug 2010 03:40:50 +0000 (13:40 +1000)]
drm/nvc0: allow INIT_GPIO

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nvc0: starting point for GF100 support, everything stubbed
Ben Skeggs [Tue, 3 Aug 2010 00:00:56 +0000 (10:00 +1000)]
drm/nvc0: starting point for GF100 support, everything stubbed

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv30: Workaround dual TMDS brain damage.
Francisco Jerez [Sun, 25 Jul 2010 17:13:43 +0000 (19:13 +0200)]
drm/nv30: Workaround dual TMDS brain damage.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: No need to set slave TV encoder configs explicitly.
Francisco Jerez [Tue, 20 Jul 2010 15:16:33 +0000 (17:16 +0200)]
drm/nouveau: No need to set slave TV encoder configs explicitly.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv17-nv4x: Attempt to init some external TMDS transmitters.
Francisco Jerez [Tue, 20 Jul 2010 14:48:08 +0000 (16:48 +0200)]
drm/nv17-nv4x: Attempt to init some external TMDS transmitters.

sil164 and friends are the most common, usually they just need to be
poked once because a fixed configuration is enough for any modes and
clocks, so they worked without this patch if the BIOS had done a good
job on POST. Display couldn't survive a suspend/resume cycle though.
Unfortunately, BIOS scripts are useless here.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv10: Fix up switching of NV10TCL_DMA_VTXBUF.
Francisco Jerez [Wed, 4 Aug 2010 02:54:08 +0000 (04:54 +0200)]
drm/nv10: Fix up switching of NV10TCL_DMA_VTXBUF.

Not very nice, but I don't think there's a simpler workaround.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Ack the context switch interrupt before switching contexts.
Francisco Jerez [Wed, 4 Aug 2010 02:41:55 +0000 (04:41 +0200)]
drm/nouveau: Ack the context switch interrupt before switching contexts.

Leaving the IRQ unack'ed while switching contexts makes the switch
fail randomly on some nv1x.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix the INIT_CONFIGURE_PREINIT BIOS opcode.
Francisco Jerez [Wed, 4 Aug 2010 03:15:11 +0000 (05:15 +0200)]
drm/nouveau: Fix the INIT_CONFIGURE_PREINIT BIOS opcode.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Don't pass misaligned offsets to io_mapping_map_atomic_wc().
Francisco Jerez [Wed, 4 Aug 2010 03:10:57 +0000 (05:10 +0200)]
drm/nouveau: Don't pass misaligned offsets to io_mapping_map_atomic_wc().

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: unwind on load errors
Dan Carpenter [Fri, 30 Jul 2010 15:04:32 +0000 (17:04 +0200)]
drm/nouveau: unwind on load errors

nouveau_load() just returned directly if there was an error instead of
releasing resources.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix AGP reset when AGP FW is already enabled on init.
Francisco Jerez [Fri, 30 Jul 2010 11:57:54 +0000 (13:57 +0200)]
drm/nouveau: Fix AGP reset when AGP FW is already enabled on init.

Previously nouveau_mem_reset_agp() was only disabling AGP fast writes
when coming back from suspend. However, the "locked out of the card
because of FW" problem can also be reproduced on init if you
unload/reload nouveau.ko several times. This patch makes the AGP code
reset FW on init.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: remove unused ttm bo list
Ben Skeggs [Mon, 2 Aug 2010 06:28:19 +0000 (16:28 +1000)]
drm/nouveau: remove unused ttm bo list

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>