openwrt/staging/blogic.git
14 years agodrm/nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout()
Kulikov Vasiliy [Mon, 26 Jul 2010 08:23:54 +0000 (12:23 +0400)]
drm/nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout()

set_current_state() is called only once before the first iteration.
After return from schedule_timeout() current state is TASK_RUNNING. If
we are going to wait again, set_current_state() must be called.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix some not-error error messages
Ben Skeggs [Mon, 26 Jul 2010 01:35:37 +0000 (11:35 +1000)]
drm/nv50: fix some not-error error messages

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: introduce gpio engine
Ben Skeggs [Sun, 25 Jul 2010 23:28:25 +0000 (09:28 +1000)]
drm/nouveau: introduce gpio engine

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: correct wait condition for instmem flush
Ben Skeggs [Sun, 25 Jul 2010 23:11:04 +0000 (09:11 +1000)]
drm/nv50: correct wait condition for instmem flush

Reported-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix TV-out detection on unposted cards lacking a usable DCB table.
Francisco Jerez [Sat, 24 Jul 2010 15:42:20 +0000 (17:42 +0200)]
drm/nouveau: Fix TV-out detection on unposted cards lacking a usable DCB table.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Get rid of the remaining VGA CRTC locking.
Francisco Jerez [Sat, 24 Jul 2010 15:41:48 +0000 (17:41 +0200)]
drm/nouveau: Get rid of the remaining VGA CRTC locking.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Move display init to a new nouveau_engine.
Francisco Jerez [Sat, 24 Jul 2010 15:37:33 +0000 (17:37 +0200)]
drm/nouveau: Move display init to a new nouveau_engine.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Put back the old 2-messages I2C slave test.
Francisco Jerez [Fri, 23 Jul 2010 21:17:57 +0000 (23:17 +0200)]
drm/nouveau: Put back the old 2-messages I2C slave test.

I was hoping we could detect I2C devices at a given address without
actually writing data into them, but apparently some DDC slaves get
confused with 0-bytes transactions. Put the good old test back.

Reported-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Reset AGP before running the init scripts.
Francisco Jerez [Fri, 23 Jul 2010 18:29:13 +0000 (20:29 +0200)]
drm/nouveau: Reset AGP before running the init scripts.

BIOS scripts usually make an attempt to reset the AGP controller,
however on some nv4x cards doing it properly involves switching FW off
and on: if we do that without updating the AGP bridge settings
accordingly (e.g. with the corresponding calls to agp_enable()) we
will be locking ourselves out of the card MMIO space. Do it from
nouveau_mem_reset_agp() before the init scripts are executed.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv30: Init the PFB+0x3xx memory timing regs.
Francisco Jerez [Wed, 21 Jul 2010 19:08:11 +0000 (21:08 +0200)]
drm/nv30: Init the PFB+0x3xx memory timing regs.

Fixes the randomly flashing vertical lines seen on some nv3x after a
cold-boot.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: disable hotplug detect around DP link training
Ben Skeggs [Fri, 23 Jul 2010 01:39:03 +0000 (11:39 +1000)]
drm/nouveau: disable hotplug detect around DP link training

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: add function to control GPIO IRQ reporting
Ben Skeggs [Fri, 23 Jul 2010 01:31:08 +0000 (11:31 +1000)]
drm/nv50: add function to control GPIO IRQ reporting

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: add nv_mask register accessor
Ben Skeggs [Fri, 23 Jul 2010 01:17:57 +0000 (11:17 +1000)]
drm/nouveau: add nv_mask register accessor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: fix build without CONFIG_ACPI
Ben Skeggs [Fri, 23 Jul 2010 00:00:12 +0000 (10:00 +1000)]
drm/nouveau: fix build without CONFIG_ACPI

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Reset CRTC owner to 0 before BIOS init.
Francisco Jerez [Tue, 20 Jul 2010 12:17:23 +0000 (14:17 +0200)]
drm/nouveau: Reset CRTC owner to 0 before BIOS init.

Fixes suspend+multihead on some boards that also use BIOS scripts for
modesetting.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: No need to lock/unlock the VGA CRTC regs all the time.
Francisco Jerez [Tue, 20 Jul 2010 01:08:25 +0000 (03:08 +0200)]
drm/nouveau: No need to lock/unlock the VGA CRTC regs all the time.

Locking only makes sense in the VBIOS parsing code as it's executed
before CRTC init.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Remove useless CRTC_OWNER logging.
Francisco Jerez [Tue, 20 Jul 2010 00:33:16 +0000 (02:33 +0200)]
drm/nouveau: Remove useless CRTC_OWNER logging.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Add some generic I2C gadget detection code.
Francisco Jerez [Mon, 19 Jul 2010 13:55:08 +0000 (15:55 +0200)]
drm/nouveau: Add some generic I2C gadget detection code.

Clean up and move the external TV encoder detection code to
nouveau_i2c.c, it's also going to be useful for external TMDS and DDC
detection.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/i2c/ch7006: Don't assume that the specified config points to static memory.
Francisco Jerez [Mon, 19 Jul 2010 13:28:41 +0000 (15:28 +0200)]
drm/i2c/ch7006: Don't assume that the specified config points to static memory.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv04-nv3x: Implement init-compute-mem.
Francisco Jerez [Tue, 13 Jul 2010 13:59:50 +0000 (15:59 +0200)]
drm/nv04-nv3x: Implement init-compute-mem.

Init-compute-mem was the last piece missing for nv0x-nv3x card
cold-booting. This implementation is somewhat lacking but it's been
reported to work on most chipsets it was tested in. Let me know if it
breaks suspend to RAM for you.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Patrice Mandin <patmandin@gmail.com>
Tested-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Xavier Chantry <chantry.xavier@gmail.com>
Tested-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Add some PFB register defines.
Francisco Jerez [Tue, 13 Jul 2010 13:50:23 +0000 (15:50 +0200)]
drm/nouveau: Add some PFB register defines.

Also collect all the PFB registers in a single place and remove some
duplicated definitions.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Add another Zotac FX5200 TV-out quirk.
Francisco Jerez [Sun, 18 Jul 2010 15:07:16 +0000 (17:07 +0200)]
drm/nouveau: Add another Zotac FX5200 TV-out quirk.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Don't pick an interlaced mode as the panel native mode.
Francisco Jerez [Sun, 18 Jul 2010 14:19:16 +0000 (16:19 +0200)]
drm/nouveau: Don't pick an interlaced mode as the panel native mode.

Rescaling interlaced modes isn't going to work correctly, and even if
it did, come on, interlaced flat panels? are you pulling my leg?

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix a sparse warning.
Francisco Jerez [Tue, 13 Jul 2010 14:16:26 +0000 (16:16 +0200)]
drm/nouveau: Fix a sparse warning.

It doesn't like variable length arrays.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix regression that break LVDS in some places
Ben Skeggs [Fri, 16 Jul 2010 06:17:27 +0000 (16:17 +1000)]
drm/nv50: fix regression that break LVDS in some places

A previous commit started additionally using the SOR link when trying to
match the correct output script.  However, we never fill in this field
for LVDS so we can never match a script at all.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: support fetching LVDS EDID from ACPI
Ben Skeggs [Mon, 12 Jul 2010 05:33:07 +0000 (15:33 +1000)]
drm/nouveau: support fetching LVDS EDID from ACPI

Based on a patch from Matthew Garrett.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
14 years agodrm/nouveau: remove quirk to fabricate DVI-A output on DCB 1.5 boards
Ben Skeggs [Thu, 15 Jul 2010 01:25:55 +0000 (11:25 +1000)]
drm/nouveau: remove quirk to fabricate DVI-A output on DCB 1.5 boards

There's a report of this quirk breaking modesetting on at least one board.
After discussion with Francisco Jerez, we've decided to remove it:

<darktama> it's not worth limiting the quirk to just where we know it can
           work?  i'm happy either way really :)
<curro> hmm, don't think so, most if not all DCB15 cards have just one DAC
<curro> and with that quirk there's no way to tell if the load comes from
        the VGA or DVI port

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Acked-by: Francisco Jerez <currojerez@riseup.net>
14 years agodrm/nv50: use correct PRAMIN flush register on original nv50
Ben Skeggs [Thu, 15 Jul 2010 01:02:54 +0000 (11:02 +1000)]
drm/nv50: use correct PRAMIN flush register on original nv50

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/i2c/ch7006: Fix up suspend/resume.
Francisco Jerez [Sat, 10 Jul 2010 20:34:13 +0000 (22:34 +0200)]
drm/i2c/ch7006: Fix up suspend/resume.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: reduce usage of fence spinlock to when absolutely necessary
Ben Skeggs [Mon, 31 May 2010 02:00:43 +0000 (12:00 +1000)]
drm/nouveau: reduce usage of fence spinlock to when absolutely necessary

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix RAMHT size
Ben Skeggs [Mon, 12 Jul 2010 03:45:51 +0000 (13:45 +1000)]
drm/nv50: fix RAMHT size

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: fix pcirom vbios shadow breakage from acpi rom patch
Ben Skeggs [Mon, 12 Jul 2010 03:15:44 +0000 (13:15 +1000)]
drm/nouveau: fix pcirom vbios shadow breakage from acpi rom patch

On nv50 it became impossible to attempt a PCI ROM shadow of the VBIOS,
which will break some setups.

This patch also removes the different ordering of shadow methods for
pre-nv50 chipsets.  The reason for the different ordering was paranoia,
but it should hopefully be OK to try shadowing PRAMIN first.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv04: Enable context switching on PFIFO init.
Francisco Jerez [Sun, 11 Jul 2010 15:19:15 +0000 (17:19 +0200)]
drm/nv04: Enable context switching on PFIFO init.

Fixes a lockup when coming back from suspend.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Disable PROM access on init.
Francisco Jerez [Sat, 10 Jul 2010 16:10:59 +0000 (18:10 +0200)]
drm/nouveau: Disable PROM access on init.

On older cards (<nv17) scanout gets blocked when the ROM is being
accessed. PROM access usually comes out enabled from suspend, switch
it off.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix crashes during fbcon init on single head cards.
Francisco Jerez [Sat, 10 Jul 2010 15:37:00 +0000 (17:37 +0200)]
drm/nouveau: Fix crashes during fbcon init on single head cards.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: initialise display before enabling interrupts
Ben Skeggs [Fri, 9 Jul 2010 00:56:08 +0000 (10:56 +1000)]
drm/nouveau: initialise display before enabling interrupts

In some situations it's possible we can receive a spurious hotplug IRQ
before we're ready to handle it, leading to an oops.

Calling the display init before enabling interrupts should clear any
pending IRQs on the GPU and prevent this from happening.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: move dp_set_tmds() function to happen in the last display irq
Ben Skeggs [Fri, 9 Jul 2010 00:37:42 +0000 (10:37 +1000)]
drm/nv50: move dp_set_tmds() function to happen in the last display irq

It seems on some chipsets that doing this from the 0x20 handler causes the
display engine to not ever signal the final 0x40 stage.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: fix mtrr cleanup path
Ben Skeggs [Thu, 8 Jul 2010 22:45:57 +0000 (08:45 +1000)]
drm/nouveau: fix mtrr cleanup path

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix dp_set_tmds to work on the right OR
Ben Skeggs [Thu, 8 Jul 2010 22:40:49 +0000 (08:40 +1000)]
drm/nv50: fix dp_set_tmds to work on the right OR

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv20-nv30: move context table object out of dev_priv
Ben Skeggs [Thu, 8 Jul 2010 05:40:18 +0000 (15:40 +1000)]
drm/nv20-nv30: move context table object out of dev_priv

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: cleanup nv50_fifo.c
Ben Skeggs [Thu, 8 Jul 2010 05:28:48 +0000 (15:28 +1000)]
drm/nv50: cleanup nv50_fifo.c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: remove unused fbdev_info
Ben Skeggs [Thu, 8 Jul 2010 04:57:18 +0000 (14:57 +1000)]
drm/nouveau: remove unused fbdev_info

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: allocate fixed amount of PRAMIN per channel on all chipsets
Ben Skeggs [Thu, 8 Jul 2010 03:15:05 +0000 (13:15 +1000)]
drm/nouveau: allocate fixed amount of PRAMIN per channel on all chipsets

Previously only done on nv50+

This commit also switches unknown NV2x/NV3x chipsets to noaccel mode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: remove ability to use external firmware
Ben Skeggs [Thu, 8 Jul 2010 01:53:19 +0000 (11:53 +1000)]
drm/nouveau: remove ability to use external firmware

This was always really a developer option, and if it's really necessary we
can hack this in ourselves.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: move tlb flushing to a helper function
Ben Skeggs [Thu, 8 Jul 2010 01:39:18 +0000 (11:39 +1000)]
drm/nv50: move tlb flushing to a helper function

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: add instmem flush() hook
Ben Skeggs [Thu, 8 Jul 2010 01:29:10 +0000 (11:29 +1000)]
drm/nouveau: add instmem flush() hook

This removes the previous prepare_access() and finish_access() hooks, and
replaces it with a much simpler flush() hook.

All the chipset-specific code before nv50 has its use removed completely,
as it's not required there at all.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: implement DAC disconnect fix missed in earlier commit
Ben Skeggs [Wed, 7 Jul 2010 01:05:48 +0000 (11:05 +1000)]
drm/nv50: implement DAC disconnect fix missed in earlier commit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: remove dev_priv->init_state and friends
Ben Skeggs [Mon, 7 Jun 2010 05:38:27 +0000 (15:38 +1000)]
drm/nouveau: remove dev_priv->init_state and friends

Nouveau will no longer load at all if card initialisation fails, so all
these checks are unnecessary.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: add scaler-only modes for eDP too
Ben Skeggs [Tue, 6 Jul 2010 01:27:52 +0000 (11:27 +1000)]
drm/nouveau: add scaler-only modes for eDP too

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: set DP display power state during DPMS
Ben Skeggs [Tue, 6 Jul 2010 01:20:17 +0000 (11:20 +1000)]
drm/nv50: set DP display power state during DPMS

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: move DP script invocation to nouveau_dp.c
Ben Skeggs [Tue, 6 Jul 2010 01:00:42 +0000 (11:00 +1000)]
drm/nouveau: move DP script invocation to nouveau_dp.c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: rewrite display irq handler
Ben Skeggs [Mon, 5 Jul 2010 22:54:34 +0000 (08:54 +1000)]
drm/nv50: rewrite display irq handler

The previous handler basically worked correctly for a full-blown mode
change.  However, it did nothing at all when a partial (encoder only)
reconfiguation was necessary, leading to the display hanging on certain
types of mode switch.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: send evo "update" command after each disconnect
Ben Skeggs [Mon, 5 Jul 2010 05:19:16 +0000 (15:19 +1000)]
drm/nv50: send evo "update" command after each disconnect

It turns out that the display engine signals an interrupt for disconnects
too.  In order to make it easier to process the display interrupts
correctly, we want to ensure we only get one operation per interrupt
sequence - this is what this commit achieves.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Workaround broken TV load detection on a "Zotac FX5200".
Francisco Jerez [Sun, 4 Jul 2010 14:46:01 +0000 (16:46 +0200)]
drm/nouveau: Workaround broken TV load detection on a "Zotac FX5200".

The blob seems to have the same problem so it's probably a hardware
issue (bug 28810).

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Move the fence wait before migration resource clean-up.
Francisco Jerez [Sun, 4 Jul 2010 10:54:23 +0000 (12:54 +0200)]
drm/nouveau: Move the fence wait before migration resource clean-up.

Avoids an oops in the fence wait failure path (bug 26521).

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv04-nv40: Drop redundant logging.
Francisco Jerez [Sun, 4 Jul 2010 02:03:48 +0000 (04:03 +0200)]
drm/nv04-nv40: Drop redundant logging.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: INIT_CONFIGURE_PREINIT/CLK/MEM on newer BIOSes is not an error.
Francisco Jerez [Sat, 3 Jul 2010 18:47:44 +0000 (20:47 +0200)]
drm/nouveau: INIT_CONFIGURE_PREINIT/CLK/MEM on newer BIOSes is not an error.

No need to spam the logs when they're found, they're equivalent to
INIT_DONE.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Fix a couple of sparse warnings.
Francisco Jerez [Sat, 3 Jul 2010 16:36:39 +0000 (18:36 +0200)]
drm/nouveau: Fix a couple of sparse warnings.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv04-nv40: Disable connector polling when there're no spare CRTCs left.
Francisco Jerez [Sat, 3 Jul 2010 13:52:03 +0000 (15:52 +0200)]
drm/nv04-nv40: Disable connector polling when there're no spare CRTCs left.

Load detection needs the connector wired to a CRTC, when there are no
inactive CRTCs left that means we need to cut some other head off for
a while, causing intermittent flickering.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv04-nv40: Prevent invalid DAC/TVDAC combinations.
Francisco Jerez [Sun, 4 Jul 2010 14:14:42 +0000 (16:14 +0200)]
drm/nv04-nv40: Prevent invalid DAC/TVDAC combinations.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv17-nv40: Avoid using active CRTCs for load detection.
Francisco Jerez [Sat, 3 Jul 2010 10:47:14 +0000 (12:47 +0200)]
drm/nv17-nv40: Avoid using active CRTCs for load detection.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: when debugging on, log which crtc we connect an encoder to
Ben Skeggs [Fri, 2 Jul 2010 03:47:38 +0000 (13:47 +1000)]
drm/nv50: when debugging on, log which crtc we connect an encoder to

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: supply encoder disable() hook for SOR outputs
Ben Skeggs [Thu, 1 Jul 2010 05:33:45 +0000 (15:33 +1000)]
drm/nv50: supply encoder disable() hook for SOR outputs

Allows us to remove a driver hack that used to be necessary to disable
encoders in certain situations before setting up a mode.  The DRM has
better knowledge of when this is needed than the driver does.

This fixes a number of display switching issues.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: DCB quirk for Dell M6300
Ben Skeggs [Thu, 1 Jul 2010 01:31:45 +0000 (11:31 +1000)]
drm/nv50: DCB quirk for Dell M6300

Uncertain if this is a weirdo configuration, or a BIOS bug.  If it's not
a BIOS bug, we still don't know how to make it work anyway so ignore a
"conflicting" DCB entry to prevent a display hang.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix DP->DVI if output has been programmed for native DP previously
Ben Skeggs [Wed, 30 Jun 2010 05:25:57 +0000 (15:25 +1000)]
drm/nv50: fix DP->DVI if output has been programmed for native DP previously

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: downgrade severity of most init table parser errors
Ben Skeggs [Tue, 29 Jun 2010 06:09:24 +0000 (16:09 +1000)]
drm/nouveau: downgrade severity of most init table parser errors

As long as we know the length of the opcode, we're probably better off
trying to parse the remainder of an init table rather than aborting in
the middle of it.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: tidy connector/encoder creation a little
Ben Skeggs [Mon, 28 Jun 2010 04:35:50 +0000 (14:35 +1000)]
drm/nouveau: tidy connector/encoder creation a little

Create connectors before encoders to avoid having to do another loop across
encoder list whenever we create a new connector.  This allows us to pass
the connector to the encoder creation functions, and avoid using a
create_resources() callback since we can now call it directly.

This can also potentially modify the connector ordering on nv50.  On cards
where the DCB connector and encoder tables are in the same order, things
will be unchanged.  However, there's some cards where the ordering between
the tables differ, and in one case, leads us to naming the connectors
"wrongly".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: set encoder for lvds
Albert Damen [Sun, 20 Jun 2010 14:57:57 +0000 (16:57 +0200)]
drm/nouveau: set encoder for lvds

fixes oops in nouveau_connector_get_modes with nv_encoder is NULL

Signed-off-by: Albert Damen <albrt@gmx.net>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Ignore broken legacy I2C entries.
Francisco Jerez [Sat, 19 Jun 2010 11:54:48 +0000 (13:54 +0200)]
drm/nouveau: Ignore broken legacy I2C entries.

The nv05 card in the bug report [1] doesn't have usable I2C port
register offsets (they're all filled with zeros). Ignore them and use
the defaults.

[1] http://bugs.launchpad.net/bugs/569505

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Don't clear AGPCMD completely on INIT_RESET.
Francisco Jerez [Thu, 17 Jun 2010 10:42:14 +0000 (12:42 +0200)]
drm/nouveau: Don't clear AGPCMD completely on INIT_RESET.

We just need to clear the SBA and ENABLE bits to reset the AGP
controller: If the AGP bridge was configured to use "fast writes",
clearing the FW bit would break the subsequent MMIO writes and
eventually end with a lockup.

Note that all the BIOSes I've seen do the same as we did (it works for
them because they don't use MMIO), OTOH the blob leaves FW untouched.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Put the dithering check back in nouveau_connector_create.
Francisco Jerez [Wed, 16 Jun 2010 13:52:44 +0000 (15:52 +0200)]
drm/nouveau: Put the dithering check back in nouveau_connector_create.

a7b9f9e5adef dropped it by accident.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Thibaut Girka <thib@sitedethib.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix memory detection for cards with >=4GiB VRAM
Ben Skeggs [Wed, 2 Jun 2010 00:12:00 +0000 (10:12 +1000)]
drm/nv50: fix memory detection for cards with >=4GiB VRAM

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: missed some braces
Ben Skeggs [Tue, 1 Jun 2010 22:38:19 +0000 (08:38 +1000)]
drm/nouveau: missed some braces

Luckily this had absolutely no effect whatsoever :)

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: remove left-over !DRIVER_MODESET paths
Ben Skeggs [Tue, 1 Jun 2010 05:56:22 +0000 (15:56 +1000)]
drm/nouveau: remove left-over !DRIVER_MODESET paths

It's far preferable to have the driver do nothing at all for "nomodeset".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: use drm_mm in preference to custom code doing the same thing
Ben Skeggs [Tue, 1 Jun 2010 05:32:24 +0000 (15:32 +1000)]
drm/nouveau: use drm_mm in preference to custom code doing the same thing

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: move LVDS detection back to connector detect() time
Ben Skeggs [Tue, 1 Jun 2010 03:32:42 +0000 (13:32 +1000)]
drm/nouveau: move LVDS detection back to connector detect() time

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: place notifiers in system memory by default
Ben Skeggs [Mon, 31 May 2010 23:47:43 +0000 (09:47 +1000)]
drm/nouveau: place notifiers in system memory by default

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm: disable encoder rather than dpms off in drm_crtc_prepare_encoders()
Ben Skeggs [Thu, 1 Jul 2010 06:49:57 +0000 (16:49 +1000)]
drm: disable encoder rather than dpms off in drm_crtc_prepare_encoders()

Original behaviour will be preserved for drivers that don't implement
disable() hooks for an encoder.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: add PCI requirements to low-level drivers.
Dave Airlie [Thu, 8 Jul 2010 21:43:27 +0000 (07:43 +1000)]
drm: add PCI requirements to low-level drivers.

Now that highlevel DRM no longer requires PCI, we can move the requirement
into the lowlevel drivers.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge branch 'drm-tracepoints' into drm-testing
Dave Airlie [Wed, 7 Jul 2010 08:38:44 +0000 (18:38 +1000)]
Merge branch 'drm-tracepoints' into drm-testing

14 years agodrm/kms: add crtc disable function
Alex Deucher [Fri, 11 Jun 2010 21:04:35 +0000 (17:04 -0400)]
drm/kms: add crtc disable function

More explicit than dpms. Same as the encoder disable function.

Need this to explicity disconnect plls from crtcs for reuse when you
plls:crtcs ratio isn't 1:1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge branch 'drm-intel-lru' into drm-testing
Dave Airlie [Wed, 7 Jul 2010 08:37:37 +0000 (18:37 +1000)]
Merge branch 'drm-intel-lru' into drm-testing

* drm-intel-lru:
  drm: implement helper functions for scanning lru list
  drm_mm: extract check_free_mm_node
  drm: sane naming for drm_mm.c
  drm: kill dead code in drm_mm.c
  drm: kill drm_mm_node->private
  drm: use list_for_each_entry in drm_mm.c

14 years agoMerge branch 'drm-platform' into drm-testing
Dave Airlie [Wed, 7 Jul 2010 08:37:35 +0000 (18:37 +1000)]
Merge branch 'drm-platform' into drm-testing

* drm-platform:
  drm: Make sure the DRM offset matches the CPU
  drm: Add __arm defines to DRM
  drm: Add support for platform devices to register as DRM devices
  drm: Remove drm_resource wrappers

14 years agoMerge tag 'v2.6.35-rc4' into drm-testing
Dave Airlie [Wed, 7 Jul 2010 08:37:34 +0000 (18:37 +1000)]
Merge tag 'v2.6.35-rc4' into drm-testing

14 years agodrm: correctly update connector DPMS status in drm_fb_helper
Jesse Barnes [Fri, 2 Jul 2010 17:48:08 +0000 (10:48 -0700)]
drm: correctly update connector DPMS status in drm_fb_helper

We don't currently update the DPMS status of the connector (both in the
connector itself and the connector's DPMS property) in the fb helper
code.  This means that if the kernel FB core has blanked the screen,
sysfs will still show a DPMS status of "on".  It also means that when X
starts, it will try to light up the connectors, but the drm_crtc_helper
code will ignore the DPMS change since according to the connector, the
DPMS status is already on.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28436 (the annoying
"my screen was blanked when I started X and now it won't light up" bug).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix shared ddc handling
Alex Deucher [Thu, 1 Jul 2010 14:34:56 +0000 (10:34 -0400)]
drm/radeon/kms: fix shared ddc handling

Connectors with a shared ddc line can be connected to different
encoders.

Reported by Pasi Kärkkäinen <pasik@iki.fi> on dri-devel

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: implement helper functions for scanning lru list
Daniel Vetter [Fri, 2 Jul 2010 14:02:16 +0000 (15:02 +0100)]
drm: implement helper functions for scanning lru list

These helper functions can be used to efficiently scan lru list
for eviction. Eviction becomes a three stage process:
1. Scanning through the lru list until a suitable hole has been found.
2. Scan backwards to restore drm_mm consistency and find out which
   objects fall into the hole.
3. Evict the objects that fall into the hole.

These helper functions don't allocate any memory (at the price of
not allowing any other concurrent operations). Hence this can also be
used for ttm (which does lru scanning under a spinlock).

Evicting objects in this fashion should be more fair than the current
approach by i915 (scan the lru for a object large enough to contain
the new object). It's also more efficient than the current approach used
by ttm (uncoditionally evict objects from the lru until there's enough
free space).

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thomas Hellstrom <thellstrom@vmwgfx.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm_mm: extract check_free_mm_node
Daniel Vetter [Fri, 2 Jul 2010 14:02:15 +0000 (15:02 +0100)]
drm_mm: extract check_free_mm_node

There are already two copies of this logic. And the new scanning
stuff will add some more. So extract it into a small helper
function.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thomas Hellstrom <thellstrom@vmwgfx.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: sane naming for drm_mm.c
Daniel Vetter [Fri, 2 Jul 2010 14:02:14 +0000 (15:02 +0100)]
drm: sane naming for drm_mm.c

Yeah, I've kinda noticed that fl_entry is the free stack. Still
give it (and the memory node list ml_entry) decent names.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thomas Hellstrom <thellstrom@vmwgfx.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: kill dead code in drm_mm.c
Daniel Vetter [Fri, 2 Jul 2010 14:02:13 +0000 (15:02 +0100)]
drm: kill dead code in drm_mm.c

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thomas Hellstrom <thellstrom@vmwgfx.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: kill drm_mm_node->private
Daniel Vetter [Fri, 2 Jul 2010 14:02:12 +0000 (15:02 +0100)]
drm: kill drm_mm_node->private

Only ever assigned, never used.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[glisse: I will re-add if needed for range-restricted allocations]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: use list_for_each_entry in drm_mm.c
Daniel Vetter [Fri, 2 Jul 2010 14:02:11 +0000 (15:02 +0100)]
drm: use list_for_each_entry in drm_mm.c

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Thomas Hellstrom <thellstrom@vmwgfx.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/ttm: Allocate the page pool manager in the heap.
Francisco Jerez [Sun, 4 Jul 2010 02:03:07 +0000 (04:03 +0200)]
drm/ttm: Allocate the page pool manager in the heap.

Repeated ttm_page_alloc_init/fini fails noisily because the pool
manager kobj isn't zeroed out between uses (we could do just that but
statically allocated kobjects are generally considered a bad thing).
Move it to kzalloc'ed memory.

Note that this patch drops the refcounting behavior of the pool
allocator init/fini functions: it would have led to a race condition
in its current form, and anyway it was never exploited.

This fixes a regression with reloading kms modules at runtime, since
page allocator was introduced.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoLinux 2.6.35-rc4
Linus Torvalds [Mon, 5 Jul 2010 03:22:50 +0000 (20:22 -0700)]
Linux 2.6.35-rc4

14 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Mon, 5 Jul 2010 03:21:39 +0000 (20:21 -0700)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: 6205/1: perf: ensure counter delta is treated as unsigned
  ARM: 6202/1: Do not ARM_DMA_MEM_BUFFERABLE on RealView boards with L210/L220
  ARM: 6201/1: RealView: Do not use outer_sync() on ARM11MPCore boards with L220
  ARM: 6195/1: OMAP3: pmu: make CPU_HAS_PMU dependent on OMAP3_EMU
  ARM: 6194/1: change definition of cpu_relax() for ARM11MPCore
  ARM: 6193/1: RealView: Align the machine_desc.phys_io to 1MB section
  ARM: 6192/1: VExpress: Align the machine_desc.phys_io to 1MB section
  ARM: 6188/1: Add a config option for the ARM11MPCore DMA cache maintenance workaround
  ARM: 6187/1: The v6_dma_inv_range() function must preserve data on SMP
  ARM: 6186/1: Avoid the CONSISTENT_DMA_SIZE warning on noMMU builds
  ARM: mx3: mx31lilly: fix build error for !CONFIG_USB_ULPI
  [ARM] mmp: fix build failure due to IRQ_PMU depends on ARCH_PXA
  [ARM] pxa/mioa701: fix camera regression
  [ARM] pxa/z2: fix flash layout to final version
  [ARM] pxa/z2: fix missing include in battery driver
  [ARM] pxa: fix incorrect gpio type in udc_pxa2xx.h

14 years agoMerge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 5 Jul 2010 03:20:53 +0000 (20:20 -0700)]
Merge branch 'perf-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf, x86: Fix incorrect branches event on AMD CPUs
  perf tools: Fix find tids routine by excluding "." and ".."
  x86: Send a SIGTRAP for user icebp traps

14 years agomodule: initialize module dynamic debug later
Yehuda Sadeh [Sat, 3 Jul 2010 03:07:35 +0000 (13:07 +1000)]
module: initialize module dynamic debug later

We should initialize the module dynamic debug datastructures
only after determining that the module is not loaded yet. This
fixes a bug that introduced in 2.6.35-rc2, where when a trying
to load a module twice, we also load it's dynamic printing data
twice which causes all sorts of nasty issues. Also handle
the dynamic debug cleanup later on failure.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (removed a #ifdef)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Mon, 5 Jul 2010 03:13:31 +0000 (20:13 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: remove block number from inode lookup code
  xfs: rename XFS_IGET_BULKSTAT to XFS_IGET_UNTRUSTED
  xfs: validate untrusted inode numbers during lookup
  xfs: always use iget in bulkstat
  xfs: prevent swapext from operating on write-only files

14 years agoMerge branch 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Mon, 5 Jul 2010 03:12:31 +0000 (20:12 -0700)]
Merge branch 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6

* 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6:
  of/dma: fix build breakage in ppc4xx adma driver

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Mon, 5 Jul 2010 03:12:06 +0000 (20:12 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/i7core

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/i7core:
  MAINTAINERS: Add an entry for i7core_edac
  i7core_edac: Avoid doing multiple probes for the same card
  i7core_edac: Properly discover the first QPI device