pandora-kernel.git
13 years agodrm/radeon/kms: make sure HPD is set to NONE on analog-only connectors
Alex Deucher [Tue, 20 Jul 2010 07:24:11 +0000 (03:24 -0400)]
drm/radeon/kms: make sure HPD is set to NONE on analog-only connectors

HPD is digital only.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: make sure rio_mem is valid before unmapping it
Alex Deucher [Thu, 8 Jul 2010 16:24:52 +0000 (12:24 -0400)]
drm/radeon/kms: make sure rio_mem is valid before unmapping it

If we were not able to map the io bar in device init, don't attempt
to unmap it in device fini.  All radeons should have a io bar, so
I doubt this would ever trigger, but just to be on the safe side...

Pointed out by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: add basic zmask/hiz support (v4)
Dave Airlie [Tue, 13 Jul 2010 01:11:11 +0000 (11:11 +1000)]
drm/radeon: add basic zmask/hiz support (v4)

This interface allows userspace to request hyperz support, it probably
needs more locking, and really reporting that you can have hyperz is racy
since someone else might get it before you do.

v2: modify so we pass 0 valued packets to let DDX/r300c keep working.
also fixed incorrect 0x4f1c reference.

v3: fixup zb_bw_cntl so older drivers keep working

v4: add locking, fixup SC_HYPERZ_EN - patch stream to disable hiz

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: move a bunch of modesetting debug to correct debug usage.
Dave Airlie [Mon, 2 Aug 2010 00:42:55 +0000 (10:42 +1000)]
drm/radeon/kms: move a bunch of modesetting debug to correct debug usage.

This migrates a bunch of DRM_DEBUG->DRM_DEBUG_KMS so we can get more modesetting related info without all the other ioctl handling easily.

Also the PM code moves to DRM_DEBUG_DRIVER mostly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge remote branch 'nouveau/for-airlied' of ../drm-nouveau-next into drm-core-next
Dave Airlie [Mon, 2 Aug 2010 00:31:47 +0000 (10:31 +1000)]
Merge remote branch 'nouveau/for-airlied' of ../drm-nouveau-next into drm-core-next

* 'nouveau/for-airlied' of ../drm-nouveau-next: (77 commits)
  drm/nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout()
  drm/nv50: fix some not-error error messages
  drm/nouveau: introduce gpio engine
  drm/nv50: correct wait condition for instmem flush
  drm/nouveau: Fix TV-out detection on unposted cards lacking a usable DCB table.
  drm/nouveau: Get rid of the remaining VGA CRTC locking.
  drm/nouveau: Move display init to a new nouveau_engine.
  drm/nouveau: Put back the old 2-messages I2C slave test.
  drm/nouveau: Reset AGP before running the init scripts.
  drm/nv30: Init the PFB+0x3xx memory timing regs.
  drm/nouveau: disable hotplug detect around DP link training
  drm/nv50: add function to control GPIO IRQ reporting
  drm/nouveau: add nv_mask register accessor
  drm/nouveau: fix build without CONFIG_ACPI
  drm/nouveau: Reset CRTC owner to 0 before BIOS init.
  drm/nouveau: No need to lock/unlock the VGA CRTC regs all the time.
  drm/nouveau: Remove useless CRTC_OWNER logging.
  drm/nouveau: Add some generic I2C gadget detection code.
  drm/i2c/ch7006: Don't assume that the specified config points to static memory.
  drm/nv04-nv3x: Implement init-compute-mem.
  ...

Conflicts:
drivers/gpu/drm/nouveau/nouveau_bios.c

13 years agoMerge branch 'drm-radeon-next' of ../drm-radeon-next into drm-core-next
Dave Airlie [Mon, 2 Aug 2010 00:24:46 +0000 (10:24 +1000)]
Merge branch 'drm-radeon-next' of ../drm-radeon-next into drm-core-next

* 'drm-radeon-next' of ../drm-radeon-next: (333 commits)
  drm/radeon/kms: trivial code style fixes for audio
  drm/radeon: remove viewport transform from r6xx/r7xx blit emit
  drm/radeon: group r6xx/r7xx newly sequential blit state
  drm/radeon: reorder r6xx/r7xx blit state emit to make more regs sequential
  drm/radeon: r6xx/r7xx move vport clipping to a single packet
  drm/radeon: group r6xx/r7xx sequential blit state
  drm/radeon: remove duplicate state emit in r6xx/r7xx blit
  drm/radeon: add comments to r6xx/r7xx blit state
  drm/radeon/kms/r7xx: add workaround for hw issue with HDP flush
  drm/radeon/kms: remove rs4xx gart limit
  drm: radeon: fix sign bug
  drm/radeon/kms: check/restore sanity before doing anything else with GPU.
  drm/radeon: fall back to GTT if bo creation/validation in VRAM fails.
  drm/radeon/kms: add ioport register access
  drm/radeon/kms: enable HDMI audio on RS600/RS690/RS740
  drm/radeon/kms: track audio engine state, do not use not setup timer
  drm/radeon/kms/r6xx+: add query for tile config (v2)
  drm/radeon/kms: fix CS alignment checking for tiling (v2)
  drm/radeon/kms: add tiling support to the cs checker for r6xx/r7xx
  drm/radeon/kms: Add crtc tiling setup support for evergreen
  ...

13 years agodrm: Import driver for the sil164 I2C TMDS transmitter.
Francisco Jerez [Thu, 22 Jul 2010 15:06:18 +0000 (17:06 +0200)]
drm: Import driver for the sil164 I2C TMDS transmitter.

sil164 transmitters are used for DVI outputs on Intel/nvidia and ATI setups.

So far only nouveau can use this driver.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Patrice Mandin <patmandin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/sis: fixed brace and spacing coding style issues
Nicolas Kaiser [Fri, 9 Jul 2010 14:47:28 +0000 (16:47 +0200)]
drm/sis: fixed brace and spacing coding style issues

Fixed brace and spacing coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/r128: fixed brace and spacing coding style issues
Nicolas Kaiser [Mon, 12 Jul 2010 11:44:23 +0000 (13:44 +0200)]
drm/r128: fixed brace and spacing coding style issues

Fixed brace and spacing coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/mga: fixed brace, macro and spacing coding style issues
Nicolas Kaiser [Sun, 11 Jul 2010 23:46:57 +0000 (01:46 +0200)]
drm/mga: fixed brace, macro and spacing coding style issues

Fixed brace, macro and spacing coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/via: fixed coding style issues, simplified return
Nicolas Kaiser [Sun, 11 Jul 2010 13:32:42 +0000 (15:32 +0200)]
drm/via: fixed coding style issues, simplified return

Fixed brace, macro and spacing coding style issues.
Simplified
 -if (ret) return ret;
 -return 0;
 +return ret;

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: trivial code style fixes for audio
Rafał Miłecki [Fri, 25 Jun 2010 19:24:20 +0000 (21:24 +0200)]
drm/radeon/kms: trivial code style fixes for audio

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/i830: fixed brace and spacing coding style issues
Nicolas Kaiser [Wed, 14 Jul 2010 22:14:43 +0000 (00:14 +0200)]
drm/i830: fixed brace and spacing coding style issues

Fixed brace and spacing coding style issues.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/i810: fixed coding style issues
Nicolas Kaiser [Wed, 14 Jul 2010 19:54:13 +0000 (21:54 +0200)]
drm/i810: fixed coding style issues

Fixed brace, macro and spacing coding style issues, and a C99 comment.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm: Free devname along with master->unique
Chris Wilson [Sat, 24 Jul 2010 17:29:36 +0000 (18:29 +0100)]
drm: Free devname along with master->unique

The device name is tightly coupled and created at the same time as the
master->unique address, so we need to free it with the master. Currently
we overwrite it each time we create a new master:

unreferenced object 0xe32c54b0 (size 32):
  comm "Xorg", pid 1455, jiffies 4294721798 (age 3196.879s)
  hex dump (first 32 bytes):
    69 39 31 35 40 70 63 69 3a 30 30 30 30 3a 30 30  i915@pci:0000:00
    3a 30 32 2e 30 00 6b 6b 6b 6b 6b 6b 6b 6b 6b a5  :02.0.kkkkkkkkk.
  backtrace:
    [<c04e5657>] create_object+0x124/0x1f1
    [<c07cf0f0>] kmemleak_alloc+0x4c/0x90
    [<c04db84c>] __kmalloc+0x155/0x175
    [<f8316665>] drm_setversion+0x11d/0x1b1 [drm]
    [<f83148d4>] drm_ioctl+0x29a/0x356 [drm]
    [<c04f27c4>] vfs_ioctl+0x33/0x91
    [<c04f31cf>] do_vfs_ioctl+0x46b/0x496
    [<c04f3240>] sys_ioctl+0x46/0x66
    [<c040325f>] sysenter_do_call+0x12/0x38
    [<ffffffff>] 0xffffffff

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm: Free the idr layers before calling idr_destroy()
Chris Wilson [Sat, 24 Jul 2010 21:28:25 +0000 (22:28 +0100)]
drm: Free the idr layers before calling idr_destroy()

/* A typical clean-up sequence for objects stored in an idr tree, will
 * use idr_for_each() to free all objects, if necessary, then
 * idr_remove_all() to remove all ids, and idr_destroy() to free
 * up the cached idr_layers.
 */

We were missing the vital idr_rmove_all() step and so were leaking
the used layers for every dri client:

unreferenced object 0xf32133c0 (size 148):
  comm "plymouthd", pid 131, jiffies 4294678490 (age 2308.030s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 40 19 f3  .............@..
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<c04e5657>] create_object+0x124/0x1f1
    [<c07cf100>] kmemleak_alloc+0x4c/0x90
    [<c04db6a9>] kmem_cache_alloc+0xee/0x13c
    [<c05c3d25>] idr_pre_get+0x24/0x61
    [<f8315c9c>] drm_gem_handle_create+0x27/0x7f [drm]
    [<f89925b2>] i915_gem_create_ioctl+0x4f/0x71 [i915]
    [<f83148ac>] drm_ioctl+0x272/0x356 [drm]
    [<c04f27c4>] vfs_ioctl+0x33/0x91
    [<c04f31cf>] do_vfs_ioctl+0x46b/0x496
    [<c04f3240>] sys_ioctl+0x46/0x66
    [<c040325f>] sysenter_do_call+0x12/0x38
    [<ffffffff>] 0xffffffff

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

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 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>
13 years agodrm/vmgfx: operation on ‘par->dirty.y1’ may be undefined
Chris Wilson [Sat, 24 Jul 2010 16:15:11 +0000 (17:15 +0100)]
drm/vmgfx: operation on ‘par->dirty.y1’ may be undefined

Trivial fix to set y1 = y2 = 0.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: remove viewport transform from r6xx/r7xx blit emit
Alex Deucher [Tue, 27 Jul 2010 15:01:15 +0000 (11:01 -0400)]
drm/radeon: remove viewport transform from r6xx/r7xx blit emit

We aren't using it, so no need.  Save additional dwords.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: group r6xx/r7xx newly sequential blit state
Alex Deucher [Tue, 27 Jul 2010 15:20:54 +0000 (11:20 -0400)]
drm/radeon: group r6xx/r7xx newly sequential blit state

group state that is emitted sequentially into fewer packets.
This saves a number of dwords.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: reorder r6xx/r7xx blit state emit to make more regs sequential
Alex Deucher [Tue, 27 Jul 2010 15:17:44 +0000 (11:17 -0400)]
drm/radeon: reorder r6xx/r7xx blit state emit to make more regs sequential

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: r6xx/r7xx move vport clipping to a single packet
Alex Deucher [Mon, 26 Jul 2010 17:47:54 +0000 (13:47 -0400)]
drm/radeon: r6xx/r7xx move vport clipping to a single packet

Saves lots of dwords in blit emit

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: group r6xx/r7xx sequential blit state
Alex Deucher [Tue, 27 Jul 2010 22:57:06 +0000 (18:57 -0400)]
drm/radeon: group r6xx/r7xx sequential blit state

group state that is emitted sequentially into fewer packets.
This saves a number of dwords.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: remove duplicate state emit in r6xx/r7xx blit
Alex Deucher [Tue, 27 Jul 2010 15:11:19 +0000 (11:11 -0400)]
drm/radeon: remove duplicate state emit in r6xx/r7xx blit

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: add comments to r6xx/r7xx blit state
Alex Deucher [Mon, 26 Jul 2010 16:39:00 +0000 (12:39 -0400)]
drm/radeon: add comments to r6xx/r7xx blit state

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms/r7xx: add workaround for hw issue with HDP flush
Alex Deucher [Mon, 26 Jul 2010 22:51:53 +0000 (18:51 -0400)]
drm/radeon/kms/r7xx: add workaround for hw issue with HDP flush

Use of HDP_*_COHERENCY_FLUSH_CNTL can cause a hang in certain
situations.  Add workaround.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: remove rs4xx gart limit
Alex Deucher [Fri, 16 Jul 2010 14:39:16 +0000 (10:39 -0400)]
drm/radeon/kms: remove rs4xx gart limit

We used to limit the rs4xx gart aperture to 32 MB, but I suspect
that was due to not meeting the alignment requirements of the
aperture.  This patch should only be applied after:
"drm/radeon/kms: fix gtt MC base alignment on rs4xx/rs690/rs740 asics"
has been applied.

This patch should probably soak for a bit in d-r-t.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge tag 'v2.6.35-rc6' into drm-radeon-next
Dave Airlie [Mon, 2 Aug 2010 00:05:18 +0000 (10:05 +1000)]
Merge tag 'v2.6.35-rc6' into drm-radeon-next

Need this to avoid conflicts with future radeon fixes

13 years agodrm: radeon: fix sign bug
Dan Carpenter [Sat, 17 Jul 2010 10:28:02 +0000 (12:28 +0200)]
drm: radeon: fix sign bug

The "error" variable is unsigned so it's never less than zero.  I
changed it to check if (freq < current_freq) directly.

"best_error" is also unsigned so "best_error - 100" could be a large
number instead of a negative.  Since "error" is unsigned it is never
less than a negative and so the cases where "best_error" is less than or
equal to 100 are false.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: check/restore sanity before doing anything else with GPU.
Dave Airlie [Thu, 15 Jul 2010 02:13:50 +0000 (12:13 +1000)]
drm/radeon/kms: check/restore sanity before doing anything else with GPU.

On systems using kexec, the new kernel is booted straight from the old kernel, without any warning to the graphics driver. So the GPU is basically left as-is in a running state, however the CPU side is completly reset.

Without stating the saneness of anyone using kexec on live systems, we should at least try not to crash the GPU. This patch resets 3 registers to 0 that could cause bad things to happen to the running system.

This allows kexec to work on a Power6/RN50 system.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: fall back to GTT if bo creation/validation in VRAM fails.
Michel Dänzer [Thu, 8 Jul 2010 02:43:28 +0000 (12:43 +1000)]
drm/radeon: fall back to GTT if bo creation/validation in VRAM fails.

This fixes a problem where on low VRAM cards we'd run out of space for validation.

[airlied: Tested on my M7, Thinkpad T42, compiz works with no problems.]

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add ioport register access
Alex Deucher [Wed, 30 Jun 2010 15:52:50 +0000 (11:52 -0400)]
drm/radeon/kms: add ioport register access

This is required for the NB_MISC regs on rs780/rs880 which
means HDMI/DVI/DP ports using PCIEPHY won't work without
it. It might also help with s/r (asic init) issues on other
atombios cards.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=28774
and similar issues reported by Alberto Milone.

[airlied: Squash io fix patch]

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Tested-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: enable HDMI audio on RS600/RS690/RS740
Rafał Miłecki [Sat, 19 Jun 2010 10:24:57 +0000 (12:24 +0200)]
drm/radeon/kms: enable HDMI audio on RS600/RS690/RS740

We will need method of selecting encoder that should receive HDMI block. For
now we assign HDMI block to first enabled encoder. Hopefully there are not many
RS6x0 chips with two digital encoders.

[airlied: add RS740 checks as per Alex suggestion.]

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: track audio engine state, do not use not setup timer
Rafał Miłecki [Sat, 19 Jun 2010 10:24:56 +0000 (12:24 +0200)]
drm/radeon/kms: track audio engine state, do not use not setup timer

This is needed to enable audio support on devices using polling. In case user
decides to disable audio (module parameter) we still will try to use timer in
r600_audio_enable_polling. This would lead to BUG in kernel/timer.c.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms/r6xx+: add query for tile config (v2)
Alex Deucher [Fri, 4 Jun 2010 17:10:12 +0000 (13:10 -0400)]
drm/radeon/kms/r6xx+: add query for tile config (v2)

Userspace needs this information to access tiled
buffers via the CPU.

v2: rebased on evergreen accel changes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: fix CS alignment checking for tiling (v2)
Alex Deucher [Fri, 4 Jun 2010 22:41:42 +0000 (18:41 -0400)]
drm/radeon/kms: fix CS alignment checking for tiling (v2)

Covers depth, cb, and textures. Hopefully I got this right.

v2: - fix bugs:
      https://bugs.freedesktop.org/show_bug.cgi?id=28327
      https://bugs.freedesktop.org/show_bug.cgi?id=28381
    - use ALIGNED(), IS_ALIGNED() macros

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add tiling support to the cs checker for r6xx/r7xx
Alex Deucher [Thu, 20 May 2010 16:43:52 +0000 (12:43 -0400)]
drm/radeon/kms: add tiling support to the cs checker for r6xx/r7xx

Check for relocs for DB_DEPTH_INFO, CB_COLOR*_INFO, and texture
resources.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: Add crtc tiling setup support for evergreen
Alex Deucher [Thu, 20 May 2010 16:12:48 +0000 (12:12 -0400)]
drm/radeon/kms: Add crtc tiling setup support for evergreen

Needed for scanning out of a tiled buffer.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: Add crtc tiling setup support for r6xx/r7xx
Alex Deucher [Thu, 20 May 2010 16:04:59 +0000 (12:04 -0400)]
drm/radeon/kms: Add crtc tiling setup support for r6xx/r7xx

Needed for scanning out of a tiled buffer.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add support for internal thermal sensors (v3)
Alex Deucher [Fri, 2 Jul 2010 16:58:16 +0000 (12:58 -0400)]
drm/radeon/kms: add support for internal thermal sensors (v3)

rv6xx/rv7xx/evergreen families supported; older asics did
not have an internal thermal sensor.

Note, not all oems use the internal thermal sensor, so it's
only exposed in cases where it is used.

Note also, that most laptops use an oem specific ACPI solution for
GPU thermal information rather than using the internal thermal
sensor directly.

v2: export millidegrees celsius, use hwmon device properly.
v3: fix Kconfig

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: Add support for the ATIF ACPI method to the radeon driver
Alberto Milone [Tue, 6 Jul 2010 15:40:24 +0000 (11:40 -0400)]
drm/radeon: Add support for the ATIF ACPI method to the radeon driver

By calling the ATIF method in the radeon driver we can make sure
that hotkeys such as the video switch key emit ACPI events when
pressed.

agd5f: fix warning

Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms/atom: bump atom loop timeout from 1 sec to 5 secs
Alex Deucher [Wed, 30 Jun 2010 18:58:59 +0000 (14:58 -0400)]
drm/radeon/kms/atom: bump atom loop timeout from 1 sec to 5 secs

Some tables have delays that can cause the timeout to hit
even when not intended.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=27744
and related bugs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: minor driver cleanups
Alex Deucher [Wed, 30 Jun 2010 16:13:55 +0000 (12:13 -0400)]
drm/radeon/kms: minor driver cleanups

- Make the logic in r100_pll_errata_after_index() match the other
errata functions
- Use rdev->family rather than rdev->flags & RADEON_FAMILY_MASK for kms
- replace rn50 check using ids with ASIC_IS_RN50 convenience macro

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 years agoLinux 2.6.35-rc6 v2.6.35-rc6
Linus Torvalds [Thu, 22 Jul 2010 19:13:38 +0000 (12:13 -0700)]
Linux 2.6.35-rc6

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Thu, 22 Jul 2010 18:46:15 +0000 (11:46 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: synaptics - relax capability ID checks on newer hardware
  Input: twl40300-keypad - fix handling of "all ground" rows
  Input: gamecon - reference correct pad in gc_psx_command()
  Input: gamecon - reference correct input device in NES mode
  Input: w90p910_keypad - change platfrom driver name to 'nuc900-kpi'
  Input: i8042 - add Gigabyte Spring Peak to dmi_noloop_table
  Input: qt2160 - rename kconfig symbol name

13 years agoMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Thu, 22 Jul 2010 18:45:57 +0000 (11:45 -0700)]
Merge branch 'drm-fixes' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms: add quirk to make HP DV5000 laptop resume
  drm/radeon/kms: fix RADEON_INFO_CRTC_FROM_ID info ioctl
  Fix ttm_page_alloc.c build breakage
  drm/radeon/kms: fix legacy LVDS dpms sequence
  drm/radeon/kms: drop taking lock around crtc lookup.

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Thu, 22 Jul 2010 18:45:23 +0000 (11:45 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: talitos - fix bug in sg_copy_end_to_buffer

13 years agoMerge branch 'x86/auditsyscall' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 22 Jul 2010 18:45:02 +0000 (11:45 -0700)]
Merge branch 'x86/auditsyscall' of git://git./linux/kernel/git/frob/linux-2.6-roland

* 'x86/auditsyscall' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland:
  x86: auditsyscall: fix fastpath return value after reschedule

13 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
Linus Torvalds [Thu, 22 Jul 2010 18:44:26 +0000 (11:44 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function
  debug_core,kdb: fix kgdb_connected bit set in the wrong place
  Fix merge regression from external kdb to upstream kdb
  repair gdbstub to match the gdbserial protocol specification
  kdb: break out of kdb_ll() when command is terminated

13 years agoCIFS: Fix a malicious redirect problem in the DNS lookup code
David Howells [Thu, 22 Jul 2010 11:53:18 +0000 (12:53 +0100)]
CIFS: Fix a malicious redirect problem in the DNS lookup code

Fix the security problem in the CIFS filesystem DNS lookup code in which a
malicious redirect could be installed by a random user by simply adding a
result record into one of their keyrings with add_key() and then invoking a
CIFS CFS lookup [CVE-2010-2524].

This is done by creating an internal keyring specifically for the caching of
DNS lookups.  To enforce the use of this keyring, the module init routine
creates a set of override credentials with the keyring installed as the thread
keyring and instructs request_key() to only install lookup result keys in that
keyring.

The override is then applied around the call to request_key().

This has some additional benefits when a kernel service uses this module to
request a key:

 (1) The result keys are owned by root, not the user that caused the lookup.

 (2) The result keys don't pop up in the user's keyrings.

 (3) The result keys don't come out of the quota of the user that caused the
     lookup.

The keyring can be viewed as root by doing cat /proc/keys:

2a0ca6c3 I-----     1 perm 1f030000     0     0 keyring   .dns_resolver: 1/4

It can then be listed with 'keyctl list' by root.

# keyctl list 0x2a0ca6c3
1 key in keyring:
726766307: --alswrv     0     0 dns_resolver: foo.bar.com

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steve French <smfrench@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodrm/radeon/kms: add quirk to make HP DV5000 laptop resume
Alex Deucher [Thu, 22 Jul 2010 03:54:35 +0000 (23:54 -0400)]
drm/radeon/kms: add quirk to make HP DV5000 laptop resume

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

Reported-by: Andres Cimmarusti <acimmarusti@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoInput: synaptics - relax capability ID checks on newer hardware
Dmitry Torokhov [Wed, 21 Jul 2010 07:01:19 +0000 (00:01 -0700)]
Input: synaptics - relax capability ID checks on newer hardware

Older firmwares fixed the middle byte of the Synaptics capabilities
query to 0x47, but starting with firmware 7.5 the middle byte
represents submodel ID, sometimes also called "dash number".

Reported-and-tested-by: Miroslav Šulc <fordfrog@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agox86: auditsyscall: fix fastpath return value after reschedule
Roland McGrath [Thu, 22 Jul 2010 00:44:12 +0000 (17:44 -0700)]
x86: auditsyscall: fix fastpath return value after reschedule

In the CONFIG_AUDITSYSCALL fast-path for x86 64-bit system calls,
we can pass a bad return value and/or error indication for the
system call to audit_syscall_exit().  This happens when
TIF_NEED_RESCHED was set as the system call returned, so we went
out to schedule() and came back to the exit-audit fast-path.  The
fix is to reload the user return value register from the pt_regs
before using it for audit_syscall_exit().

Both the 32-bit kernel's fast path and the 64-bit kernel's 32-bit
system call fast paths work slightly differently, so that they
always leave the fast path entirely to reschedule and don't return
there, so they don't have the analogous bugs.

Reported-by: Alexander Viro <aviro@redhat.com>
Signed-off-by: Roland McGrath <roland@redhat.com>
13 years agosysrq,kdb: Use __handle_sysrq() for kdb's sysrq function
Jason Wessel [Thu, 22 Jul 2010 00:27:07 +0000 (19:27 -0500)]
sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function

The kdb code should not toggle the sysrq state in case an end user
wants to try and resume the normal kernel execution.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
13 years agodebug_core,kdb: fix kgdb_connected bit set in the wrong place
Jason Wessel [Thu, 22 Jul 2010 00:27:07 +0000 (19:27 -0500)]
debug_core,kdb: fix kgdb_connected bit set in the wrong place

Immediately following an exit from the kdb shell the kgdb_connected
variable should be set to zero, unless there are breakpoints planted.
If the kgdb_connected variable is not zeroed out with kdb, it is
impossible to turn off kdb.

This patch is merely a work around for now, the real fix will check
for the breakpoints.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
13 years agoFix merge regression from external kdb to upstream kdb
Jason Wessel [Thu, 22 Jul 2010 00:27:06 +0000 (19:27 -0500)]
Fix merge regression from external kdb to upstream kdb

In the process of merging kdb to the mainline, the kdb lsmod command
stopped printing the base load address of kernel modules.  This is
needed for using kdb in conjunction with external tools such as gdb.

Simply restore the functionality by adding a kdb_printf for the base
load address of the kernel modules.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
13 years agorepair gdbstub to match the gdbserial protocol specification
Jason Wessel [Thu, 22 Jul 2010 00:27:05 +0000 (19:27 -0500)]
repair gdbstub to match the gdbserial protocol specification

The gdbserial protocol handler should return an empty packet instead
of an error string when ever it responds to a command it does not
implement.

The problem cases come from a debugger client sending
qTBuffer, qTStatus, qSearch, qSupported.

The incorrect response from the gdbstub leads the debugger clients to
not function correctly.  Recent versions of gdb will not detach correctly as a result of this behavior.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
13 years agokdb: break out of kdb_ll() when command is terminated
Martin Hicks [Thu, 22 Jul 2010 00:27:05 +0000 (19:27 -0500)]
kdb: break out of kdb_ll() when command is terminated

Without this patch the "ll" linked-list traversal command won't
terminate when you hit q/Q.

Signed-off-by: Martin Hicks <mort@sgi.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
13 years agodrm/radeon/kms: fix RADEON_INFO_CRTC_FROM_ID info ioctl
Alex Deucher [Wed, 21 Jul 2010 18:05:35 +0000 (14:05 -0400)]
drm/radeon/kms: fix RADEON_INFO_CRTC_FROM_ID info ioctl

Return the crtc_id, not the counter value.  They are not
necessarily the same.

Cc: Jerome Glisse <glisse@freedesktop.org>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoFix ttm_page_alloc.c build breakage
Luck, Tony [Wed, 21 Jul 2010 17:15:39 +0000 (10:15 -0700)]
Fix ttm_page_alloc.c build breakage

The commit 1e8655f87333def92bb8215b423adc65403b08a5
    drm/ttm: Fix build on architectures without AGP

looks at TTM_HAS_AGP before it has been set in ttm_bo_driver.h

Move the conditional inclusion of <asm/agp.h> *after* we have included
ttm_bo_driver.h

Signed-of-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: fix legacy LVDS dpms sequence
Alex Deucher [Wed, 21 Jul 2010 23:37:21 +0000 (19:37 -0400)]
drm/radeon/kms: fix legacy LVDS dpms sequence

Add delay after turning off the LVDS encoder.

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

Tested-by: Jan Kreuzer <kontrollator@gmx.de>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: drop taking lock around crtc lookup.
Dave Airlie [Wed, 21 Jul 2010 23:57:13 +0000 (09:57 +1000)]
drm/radeon/kms: drop taking lock around crtc lookup.

We only add/remove crtcs at driver load, you cannot remove when
the GPU is running a CS packet since the fd is open, when
GPU hotplugging on radeons actually is needed all this locking
needs a review and I've started re-working kms core locking to deal
with this better. But for now avoid long delays in CS processing when
hotplug detect is happening in a different thread.

this fixes a regression introduced with hotplug detection.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoMerge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
Linus Torvalds [Wed, 21 Jul 2010 16:31:15 +0000 (09:31 -0700)]
Merge branch 'urgent' of git://git./linux/kernel/git/brodo/pcmcia-2.6

* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: fix 'driver ... did not release config properly' warning

13 years agoMerge branch 'shrinker' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/xfsdev
Linus Torvalds [Wed, 21 Jul 2010 16:30:59 +0000 (09:30 -0700)]
Merge branch 'shrinker' of git://git./linux/kernel/git/dgc/xfsdev

* 'shrinker' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/xfsdev:
  mm: add context argument to shrinker callback to remaining shrinkers

13 years agoMerge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Wed, 21 Jul 2010 16:29:39 +0000 (09:29 -0700)]
Merge branch 'fix/asoc' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ASoC: Select wm_hubs automatically for WM8994
  ASoC: Remove duplicate AUX definition from WM8776
  ASoC:: remove a redundant snd_soc_unregister_codec call in wm8988_register
  ASoC: wm8727: add a missing return in wm8727_platform_probe
  ASoC: fsi: fixup wrong value setting order of TDM
  ASoC: fsi: fixup clock inversion operation

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Wed, 21 Jul 2010 16:28:50 +0000 (09:28 -0700)]
Merge git://git./linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  math-emu: correct test for downshifting fraction in _FP_FROM_INT()
  perf: Add DWARF register lookup for sparc
  MAINTAINERS: Add SBUS driver path to sparc entry.
  drivers/sbus: Remove unnecessary casts of private_data
  sparc: remove homegrown L1_CACHE_ALIGN macro
  sparc64: fix the build error due to smp_kgdb_capture_client()
  sparc64: Fix maybe_change_configuration() PCR setting.
  arch/sparc/kernel: Eliminate what looks like a NULL pointer dereference
  sparc64: Update defconfig.
  sunsu: Fix use after free in su_remove().
  sunserial: Don't call add_preferred_console() when console= is specified.
  sparc32: Kill none_mask, it's bogus.

13 years agoFix up trivial spelling errors ('taht' -> 'that')
Linus Torvalds [Wed, 21 Jul 2010 16:25:42 +0000 (09:25 -0700)]
Fix up trivial spelling errors ('taht' -> 'that')

Pointed out by Lucas who found the new one in a comment in
setup_percpu.c. And then I fixed the others that I grepped
for.

Reported-by: Lucas <canolucas@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agopcmcia: fix 'driver ... did not release config properly' warning
Patrick McHardy [Tue, 20 Jul 2010 22:21:42 +0000 (15:21 -0700)]
pcmcia: fix 'driver ... did not release config properly' warning

Up to 2.6.34 pcmcia_release_irq() reset p_dev->_irq to 0 after releasing
the irq.  The IRQ is now released in pcmcia_disable_device(), however
p_dev->_irq is not reset, triggering a warning in pcmcia_device_remove().

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
13 years agomm: add context argument to shrinker callback to remaining shrinkers
Dave Chinner [Wed, 21 Jul 2010 05:33:01 +0000 (15:33 +1000)]
mm: add context argument to shrinker callback to remaining shrinkers

Add the shrinkers missed in the first conversion of the API in
commit 7f8275d0d660c146de6ee3017e1e2e594c49e820 ("mm: add context argument to
shrinker callback").

Signed-off-by: Dave Chinner <dchinner@redhat.com>
13 years agoInput: twl40300-keypad - fix handling of "all ground" rows
Dmitry Torokhov [Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)]
Input: twl40300-keypad - fix handling of "all ground" rows

The Nokia RX51 board code (arch/arm/mach-omap2/board-rx51-peripherals.c)
defines a key map for the matrix keypad keyboard. The hardware seems to
use all of the 8 rows and 8 columns of the keypad, although not all
possible locations are used.

The TWL4030 supports keypads with at most 8 rows and 8 columns. Most keys
are defined with a row and column number between 0 and 7, except

        KEY(0xff, 2, KEY_F9),
        KEY(0xff, 4, KEY_F10),
        KEY(0xff, 5, KEY_F11),

which represent keycodes that should be emitted when entire row is
connected to the ground.  since the driver handles this case as if we
had an extra column in the key matrix. Unfortunately we do not allocate
enough space and end up owerwriting some random memory.

Reported-and-tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agoInput: gamecon - reference correct pad in gc_psx_command()
Dmitry Torokhov [Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)]
Input: gamecon - reference correct pad in gc_psx_command()

Otherwise we won't see any events from the gamepad.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16408

Reported-and-tested-by: Eugene Yudin <eugene.yudin@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agoInput: gamecon - reference correct input device in NES mode
Dmitry Torokhov [Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)]
Input: gamecon - reference correct input device in NES mode

We moved input devices from 'struct gc' to individial pads (struct
gc-pad), but gc_nes_process_packet() was still trying to use old
ones and crashing.

Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agomath-emu: correct test for downshifting fraction in _FP_FROM_INT()
Mikael Pettersson [Wed, 21 Jul 2010 01:45:14 +0000 (18:45 -0700)]
math-emu: correct test for downshifting fraction in _FP_FROM_INT()

The kernel's math-emu code contains a macro _FP_FROM_INT() which is
used to convert an integer to a raw normalized floating-point value.
It does this basically in three steps:

1. Compute the exponent from the number of leading zero bits.
2. Downshift large fractions to put the MSB in the right position
   for normalized fractions.
3. Upshift small fractions to put the MSB in the right position.

There is an boundary error in step 2, causing a fraction with its
MSB exactly one bit above the normalized MSB position to not be
downshifted.  This results in a non-normalized raw float, which when
packed becomes a massively inaccurate representation for that input.

The impact of this depends on a number of arch-specific factors,
but it is known to have broken emulation of FXTOD instructions
on UltraSPARC III, which was originally reported as GCC bug 44631
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44631>.

Any arch which uses math-emu to emulate conversions from integers to
same-size floats may be affected.

The fix is simple: the exponent comparison used to determine if the
fraction should be downshifted must be "<=" not "<".

I'm sending a kernel module to test this as a reply to this message.
There are also SPARC user-space test cases in the GCC bug entry.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>