Dave Airlie [Wed, 6 Oct 2010 01:47:56 +0000 (11:47 +1000)]
Merge branch 'drm-vmware-next' into drm-core-next
* drm-vmware-next:
drm/vmwgfx: Bump minor and driver date
drm/vmwgfx: Save at least one screen layout
drm/vmwgfx: Add modinfo version
drm/vmwgfx: Add a parameter to get the max fb size
drm/vmwgfx: Don't flush fb if we're in the suspended state.
drm/vmwgfx: Prune modes based on available VRAM size
drm/vmwgfx: Take the ttm lock around the dirty ioctl
drm: vmwgfx: Add a struct drm_file parameter to the dirty framebuffer callback
drm/vmwgfx: Add new-style PM hooks to improve hibernation behavior
drm/vmwgfx: Fix ACPI S3 & S4 functionality.
drm/vmwgfx: Really support other depths than 32
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:09 +0000 (12:43 +0200)]
drm/vmwgfx: Bump minor and driver date
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:08 +0000 (12:43 +0200)]
drm/vmwgfx: Save at least one screen layout
Save at least one screen layout during vga save to avoid odd things
happening during restore.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:07 +0000 (12:43 +0200)]
drm/vmwgfx: Add modinfo version
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:06 +0000 (12:43 +0200)]
drm/vmwgfx: Add a parameter to get the max fb size
This can be used by the X server to restrict mode resolutions and size of
root pixmap.
Bump minor to announce this availability.
Bump driver date.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:05 +0000 (12:43 +0200)]
drm/vmwgfx: Don't flush fb if we're in the suspended state.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:04 +0000 (12:43 +0200)]
drm/vmwgfx: Prune modes based on available VRAM size
This needs to be reviewed once we support screen objects and don't rely
on VRAM for the frame-buffer.
Also fix some integer overflow issues pointed out by Michel Daenzer.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:03 +0000 (12:43 +0200)]
drm/vmwgfx: Take the ttm lock around the dirty ioctl
This makes sure noone accesses the fifo while it's taken down using the
dirty ioctl.
Also make sure all workqueues are idled before the fifo is taken down.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:02 +0000 (12:43 +0200)]
drm: vmwgfx: Add a struct drm_file parameter to the dirty framebuffer callback
This is needed for the callback to identify the caller and take
appropriate locks if needed.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:01 +0000 (12:43 +0200)]
drm/vmwgfx: Add new-style PM hooks to improve hibernation behavior
Add the new-style PM hooks prepare and complete. This allows us to
power up the device again after the hibernation image has been created, and
display output will thus be active until the VM is finally powered off.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:43:00 +0000 (12:43 +0200)]
drm/vmwgfx: Fix ACPI S3 & S4 functionality.
Don't suspend or hibernate when there are 3D resources active since we
can't restore the device's 3D state. Instead fail with an error message.
In other cases, make sure we re-enable the fifo and unlock ttm on resume.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Tue, 5 Oct 2010 10:42:59 +0000 (12:42 +0200)]
drm/vmwgfx: Really support other depths than 32
Also add some sanity checks.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 6 Oct 2010 01:10:48 +0000 (11:10 +1000)]
Merge remote branch 'korg/drm-fixes' into drm-vmware-next
necessary for some of the vmware fixes to be pushed in.
Conflicts:
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/i915/intel_fb.c
include/drm/drmP.h
Dave Airlie [Wed, 6 Oct 2010 00:11:56 +0000 (10:11 +1000)]
Merge remote branch 'intel/drm-intel-next' of ../drm-next into drm-core-next
* 'intel/drm-intel-next' of ../drm-next: (266 commits)
drm/i915: Avoid circular locking from intel_fbdev_fini()
drm/i915: mark display port DPMS state as 'ON' when enabling output
drm/i915: Skip pread/pwrite if size to copy is 0.
drm/i915: avoid struct mutex output_poll mutex lock loop on unload
drm/i915: Rephrase pwrite bounds checking to avoid any potential overflow
drm/i915: Sanity check pread/pwrite
drm/i915: Use pipe state to tell when pipe is off
drm/i915: vblank status not valid while training display port
drivers/gpu/drm/i915/i915_gem.c: Add missing error handling code
drm/i915: Don't mask the return code whilst relocating.
drm/i915: If the GPU hangs twice within 5 seconds, declare it wedged.
drm/i915: Only print 'generating error event' if we actually are
drm/i915: Try to reset gen2 devices.
drm/i915: Clear fence registers on GPU reset
drm/i915: Force the domain to CPU on unbinding whilst wedged.
drm: Move the GTT accounting to i915
drm/i915: Fix refleak during eviction.
i915: Added function to initialize VBT settings
drm/i915: Remove redundant deletion of obj->gpu_write_list
drm/i915: Make get/put pages static
...
Chris Wilson [Mon, 4 Oct 2010 14:33:04 +0000 (15:33 +0100)]
drm/i915: Avoid circular locking from intel_fbdev_fini()
lockdep spots that the fb_info->lock takes the dev->struct_mutex during
init (due to the device probing) and so we can not hold
dev->struct_mutex when unregistering the framebuffer. Simply reverse the
order of initialisation during cleanup and so do the intel_fbdev_fini()
before the intel_modeset_cleanup.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Keith Packard [Sun, 3 Oct 2010 20:33:49 +0000 (13:33 -0700)]
drm/i915: mark display port DPMS state as 'ON' when enabling output
The display port DPMS state is tracked internally in the display port
driver so that when a hotplug event comes along, the driver can know
whether to try retraining the link. This doesn't work well if the
driver never sets the DPMS state to ON when the output is enabled.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sun, 26 Sep 2010 19:23:38 +0000 (20:23 +0100)]
drm/i915: Skip pread/pwrite if size to copy is 0.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Mon, 4 Oct 2010 09:07:38 +0000 (10:07 +0100)]
Merge branch 'drm-intel-fixes' into drm-intel-next
Keith Packard [Mon, 4 Oct 2010 02:36:26 +0000 (19:36 -0700)]
drm/i915: avoid struct mutex output_poll mutex lock loop on unload
Cancel the output polling work proc before acquiring the struct mutex
to avoid acquiring the work proc mutex with the struct mutex
held. This avoids inverting the lock order seen when the work proc
runs.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sun, 26 Sep 2010 19:21:44 +0000 (20:21 +0100)]
drm/i915: Rephrase pwrite bounds checking to avoid any potential overflow
... and do the same for pread.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Chris Wilson [Sun, 26 Sep 2010 19:50:05 +0000 (20:50 +0100)]
drm/i915: Sanity check pread/pwrite
Move the access control up from the fast paths, which are no longer
universally taken first, up into the caller. This then duplicates some
sanity checking along the slow paths, but is much simpler.
Tracked as CVE-2010-2962.
Reported-by: Kees Cook <kees@ubuntu.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Chris Wilson [Sun, 3 Oct 2010 09:56:11 +0000 (10:56 +0100)]
Merge branch 'drm-intel-fixes' into drm-intel-next
Conflicts:
drivers/gpu/drm/i915/i915_gem_evict.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
Keith Packard [Sun, 3 Oct 2010 07:33:06 +0000 (00:33 -0700)]
drm/i915: Use pipe state to tell when pipe is off
Instead of waiting for the display line value to settle, we can simply
wait for the pipe configuration register 'state' bit to turn off.
Contrarywise, disabling the plane will not cause the display line
value to stop changing, so instead we wait for the vblank interrupt
bit to get set. And, we only do this when we're not about to wait for
the pipe to turn off.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Keith Packard [Sun, 3 Oct 2010 07:33:05 +0000 (00:33 -0700)]
drm/i915: vblank status not valid while training display port
While the display port is in training mode, vblank interrupts don't
occur. Because we have to wait for the display port output to turn on
before starting the training sequence, enable the output in 'normal'
mode so that we can tell when a vblank has occurred, then start the
training sequence.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Julia Lawall [Sat, 2 Oct 2010 13:59:17 +0000 (15:59 +0200)]
drivers/gpu/drm/i915/i915_gem.c: Add missing error handling code
Extend the error handling code with operations found in other nearby error
handling code
A simplified version of the sematic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
@r@
statement S1,S2,S3;
constant C1,C2,C3;
@@
*if (...)
{... S1 return -C1;}
...
*if (...)
{... when != S1
return -C2;}
...
*if (...)
{... S1 return -C3;}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Chris Wilson [Sat, 2 Oct 2010 14:12:41 +0000 (15:12 +0100)]
drm/i915: Don't mask the return code whilst relocating.
The return from move_to_gtt_domain() may indicate a pending signal which
needs to handled as opposed to an actual error, for instance, so report
the original return value rather than forcing an EINVAL.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Fri, 1 Oct 2010 13:57:56 +0000 (14:57 +0100)]
drm/i915: If the GPU hangs twice within 5 seconds, declare it wedged.
The issue is that we may become stuck executing a long running shader
and continually attempt to reset the GPU. (Or maybe we tickle some bug
and need to break the vicious cycle.) So if we are detect a second hang
within 5 seconds, give up trying to programme the GPU and report it
wedged.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Fri, 1 Oct 2010 12:23:27 +0000 (13:23 +0100)]
drm/i915: Only print 'generating error event' if we actually are
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Fri, 1 Oct 2010 11:05:06 +0000 (12:05 +0100)]
drm/i915: Try to reset gen2 devices.
So far only found registers for i830, i845, i865 and one of those has no
effect on i865!
At this moment in time, attempting to reset i8xx is a little
optimistic...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Thu, 30 Sep 2010 15:53:18 +0000 (16:53 +0100)]
drm/i915: Clear fence registers on GPU reset
When the GPU is reset, the fence registers are invalidated, so release
the objects and clear them out.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Thu, 30 Sep 2010 14:08:57 +0000 (15:08 +0100)]
drm/i915: Force the domain to CPU on unbinding whilst wedged.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30083
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Thu, 30 Sep 2010 10:46:12 +0000 (11:46 +0100)]
drm: Move the GTT accounting to i915
Only drm/i915 does the bookkeeping that makes the information useful,
and the information maintained is driver specific, so move it out of the
core and into its single user.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Fri, 1 Oct 2010 08:21:51 +0000 (10:21 +0200)]
vmwgfx: Fix fb VRAM pinning failure due to fragmentation
If the soon-to-be scanout buffer is partly covering the intended
VRAM region, move and pin will fail. In that case, just move it out
to system before attempting to move it in again.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Fri, 1 Oct 2010 08:21:50 +0000 (10:21 +0200)]
vmwgfx: Remove initialisation of dev::devname
The removed code causes oopses with newer drms on master drop.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Fri, 1 Oct 2010 08:21:49 +0000 (10:21 +0200)]
vmwgfx: Enable use of the vblank system
This is to avoid accessing uninitialized data during
drm_irq_uninstall and vblank ioctls. At the same time, enable error check from
drm_kms_init which previously appeared to ignore all errors.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Fri, 1 Oct 2010 08:21:48 +0000 (10:21 +0200)]
vmwgfx: vt-switch (master drop) fixes
We add an option not to enable fbdev, this option is off (0) by default.
Not enabling fbdev at load time makes it possible to co-operate with
vga16fb and vga text mode when VT switching.
However, if 3D resources are active when VT switching, we're currently
not able to switch over to vga, due to device limitations.
This fixes a bug where we previously lost 3D state during VT switch.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Thu, 30 Sep 2010 10:18:33 +0000 (12:18 +0200)]
drm/vmwgfx: Fix breakage introduced by commit "drm: block userspace under allocating buffer and having drivers overwrite it (v2)"
The mentioned commit breaks the vmwgfx ioctl argument sanity check.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Thu, 30 Sep 2010 08:10:26 +0000 (09:10 +0100)]
drm: Hold the mutex when dropping the last GEM reference (v2)
In order to be fully threadsafe we need to check that the drm_gem_object
refcount is still 0 after acquiring the mutex in order to call the free
function. Otherwise, we may encounter scenarios like:
Thread A: Thread B:
drm_gem_close
unreference_unlocked
kref_put mutex_lock
... i915_gem_evict
... kref_get -> BUG
... i915_gem_unbind
... kref_put
... i915_gem_object_free
... mutex_unlock
mutex_lock
i915_gem_object_free -> BUG
i915_gem_object_unbind
kfree
mutex_unlock
Note that no driver is currently using the free_unlocked vfunc and it is
scheduled for removal, hasten that process.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30454
Reported-and-Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Wed, 29 Sep 2010 21:23:05 +0000 (22:23 +0100)]
drm/i915: Fix refleak during eviction.
Now that we hold onto a reference whilst evicting objects, we need to
be sure that we drop all the references taken -- even on the error
paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Dave Airlie [Mon, 27 Sep 2010 06:17:17 +0000 (16:17 +1000)]
drm/gem: handlecount isn't really a kref so don't make it one.
There were lots of places being inconsistent since handle count
looked like a kref but it really wasn't.
Fix this my just making handle count an atomic on the object,
and have it increase the normal object kref.
Now i915/radeon/nouveau drivers can drop the normal reference on
userspace object creation, and have the handle hold it.
This patch fixes a memory leak or corruption on unload, because
the driver had no way of knowing if a handle had been actually
added for this object, and the fbcon object needed to know this
to clean itself up properly.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Simon Que [Thu, 30 Sep 2010 08:36:39 +0000 (09:36 +0100)]
i915: Added function to initialize VBT settings
Added a function that sets the LVDS values to default settings. This
will be called by intel_init_bios before checking for the VBT (video BIOS
table). The default values are thus loaded regardless of whether a VBT
is found.
The default settings in each parse function have been moved to the new
function. This consolidates all the default settings into one place.
The default dither bit value has been changed from 0 to 1. We can
assume that display devices will want dithering enabled.
Signed-off-by: Simon Que <sque@chromium.org>
Acked-by: Olof Johansson <olof@lixom.net>
[ickle: fixup for -next]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Wed, 29 Sep 2010 20:19:54 +0000 (21:19 +0100)]
drm/i915: Remove redundant deletion of obj->gpu_write_list
At that point as the object is no longer in any GPU write domain it must
not be on the list, so the list_del() is redundant.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Mon, 27 Sep 2010 14:51:07 +0000 (15:51 +0100)]
drm/i915: Make get/put pages static
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sun, 26 Sep 2010 10:44:19 +0000 (11:44 +0100)]
drm/i915/debugfs: Include list totals
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sun, 26 Sep 2010 10:19:33 +0000 (11:19 +0100)]
drm/i915: Report the deferred free list in debugfs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Wed, 29 Sep 2010 15:10:57 +0000 (16:10 +0100)]
drm/i915/debug: Convert i915_verify_active() to scan all lists
... and check more regularly.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Arnd Bergmann [Wed, 29 Sep 2010 15:47:58 +0000 (17:47 +0200)]
drm: i810/i830: fix locked ioctl variant
The i810 and i830 device drivers may replace their file operations
on an open file descriptor. My previous patch to move the BKL
out of the common DRM code into these drivers only caught the
default file operations, not the ones that actually end up being
used.
Found while trying to come up with a way to kill the BKL for
good in these drivers.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Wed, 29 Sep 2010 11:26:37 +0000 (12:26 +0100)]
drm/i915: Avoid blocking the kworker thread on a stuck mutex
Just reschedule the retire requests again if the device is currently
busy. The request list will be pruned along other paths so will never
grow unbounded and so we can afford to miss the occasional pruning.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Wed, 29 Sep 2010 10:39:53 +0000 (11:39 +0100)]
drm/i915/debug: Remove default WATCH_BUF
Replaced by tracepoints.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Wed, 29 Sep 2010 10:36:22 +0000 (11:36 +0100)]
drm/i915/debug: Remove defunct WATCH_LRU
This has bitrotted through inuse and superseded by tracing and debugfs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Tue, 28 Sep 2010 22:34:44 +0000 (23:34 +0100)]
drm/i915/dvo: Fix panel and DDC i2c pins
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Tue, 28 Sep 2010 22:33:17 +0000 (23:33 +0100)]
drm/i915: Tidy dvo_ch7017 and print out which chip we detect
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Tue, 28 Sep 2010 15:41:32 +0000 (16:41 +0100)]
drm/i915: Disable LVDS i2c probing when using GPIO bit banging
This check only appears to succeed when using GMBUS, so we need to skip
it if we have fallen back to using GPIO bit banging.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Tue, 28 Sep 2010 14:48:38 +0000 (15:48 +0100)]
Merge branch 'drm-intel-fixes' into drm-intel-next
Chris Wilson [Tue, 28 Sep 2010 13:07:26 +0000 (14:07 +0100)]
MAINTAINERS: Add contact details for drm/i915
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Tue, 28 Sep 2010 12:35:47 +0000 (13:35 +0100)]
drm/i915: Use i2c bit banging instead of GMBUS
There are several reported instances of GMBUS failing to successfully
read the EDID, so revert back to bit banging until the issue is
resolved.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30371
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Fri, 24 Sep 2010 11:52:03 +0000 (12:52 +0100)]
drm/i915/sdvo: Fix GMBUSification
Besides a couple of bugs when writing more than a single byte along the
GMBUS, SDVO was completely failing whilst trying to use GMBUS, so use
bit banging instead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Tue, 28 Sep 2010 09:07:56 +0000 (10:07 +0100)]
Revert "drm/i915: Drop ring->lazy_request"
With multiple rings generating requests independently, the outstanding
requests must also be track independently.
Reported-by: Wang Jinjin <jinjin.wang@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30380
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Alex Deucher [Mon, 27 Sep 2010 15:33:00 +0000 (11:33 -0400)]
drm/radeon/kms: add quirk for MSI K9A2GM motherboard
Board has no digital connectors
Reported-by: Andy Walls <awalls@md.metrocast.net>
Tested-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Mon, 27 Sep 2010 14:57:10 +0000 (10:57 -0400)]
drm/radeon/kms: fix potential segfault in r600_ioctl_wait_idle
radeon_gem_wait_idle_ioctl can apparently get called prior to
the vram page being set up or even if accel if false, so make
sure it's valid before using it.
Should fix:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597636
https://bugs.freedesktop.org/show_bug.cgi?id=29834
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Mon, 27 Sep 2010 20:28:30 +0000 (21:28 +0100)]
drm: Prune GEM vma entries
Hook the GEM vm open/close ops into the generic drm vm open/close so
that the private vma entries are created and destroy appropriately.
Fixes the leak of the drm_vma_entries during the lifetime of the filp.
Reported-by: Matt Mackall <mpm@selenic.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jesse Barnes [Mon, 27 Sep 2010 17:35:44 +0000 (10:35 -0700)]
drm/i915: fix GMCH power reporting
The IPS driver needs to know the current power consumption of the GMCH
in order to make decisions about when to increase or decrease the CPU
and/or GPU power envelope. So fix up the divisions to save the results
so the numbers are actually correct (contrary to some earlier comments
and code, these functions do not modify the first argument and use it
for the result).
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Alex Deucher [Fri, 24 Sep 2010 18:59:32 +0000 (14:59 -0400)]
drm/radeon/kms: fix up encoder info messages for DFP6
encoder info was not printed properly on boards using the
DFP6 id.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 25 Sep 2010 07:45:50 +0000 (17:45 +1000)]
drm/radeon: fix PCI ID 5657 to be an RV410
fixes https://bugzilla.kernel.org/show_bug.cgi?id=19012
cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Sun, 26 Sep 2010 21:47:46 +0000 (22:47 +0100)]
drm/i915: Ensure that the mode change flushing is currently uninterruptible
Introduced by
48b956c5, I had thought I had already fixed this. Oh well.
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sun, 26 Sep 2010 21:21:10 +0000 (22:21 +0100)]
drm/i915: fix debugging compilation error from previous commit
There is no equivalent to mutex_destroy() for spinlocks so just delete
the code.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sun, 26 Sep 2010 10:03:27 +0000 (11:03 +0100)]
drm/i915: Convert the file mutex into a spinlock
Daniel Vetter pointed out that in this case is would be clearer and
cleaner to use a spinlock instead of a mutex to protect the per-file
request list manipulation. Make it so.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Daniel Vetter [Sat, 25 Sep 2010 22:24:48 +0000 (00:24 +0200)]
drm: readd drm_lock_free in drm_unlock
I've accidently killed a little bit too much in
commit
1da3f87ebb7edb3e0b829ec4bbe5fb3d9d93986f
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Mon Aug 23 22:53:24 2010 +0200
drm: kill kernel_context_switch callbacks
Note to self: Next time also test with AIGLX disabled.
Reported-and-Tested-by: Andy Furniss <lists@andyfurniss.entadsl.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30374
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Al Viro [Sat, 25 Sep 2010 20:07:51 +0000 (21:07 +0100)]
alpha: fix usp value in multithreaded coredumps
rdusp() gives us the right value only for the current thread...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Sat, 25 Sep 2010 20:07:14 +0000 (21:07 +0100)]
alpha: fix hae_cache race in RESTORE_ALL
We want interrupts disabled on all paths leading to RESTORE_ALL;
otherwise, we are risking an IRQ coming between the updates of
alpha_mv->hae_cache and *alpha_mv->hae_register and set_hae()
within the IRQ getting badly confused.
RESTORE_ALL used to play with disabling IRQ itself, but that got
removed back in 2002, without making sure we had them disabled
on all paths. It's cheaper to make sure we have them disabled than
to revert to original variant...
Remove the detritus left from that commit back in 2002; we used to
need a reload of $0 and $1 since swpipl would change those, but
doing that had become pointless when we stopped doing swpipl in
there...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sat, 25 Sep 2010 16:51:54 +0000 (09:51 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: prevent merges of discard and write requests
Linus Torvalds [Sat, 25 Sep 2010 16:51:31 +0000 (09:51 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory
ALSA: hda - Fix auto-parse of SPDIF input of Realtek codecs
ASoC: Fix multi-componentism
ASoC: Fix soc-cache buffer overflow bug
ALSA: oxygen: fix analog capture on Claro halo cards
ALSA: hda - Add Dell Latitude E6400 model quirk
ASoC: fix clkdev API usage in sh/migor.c
Larry Woodman [Fri, 24 Sep 2010 16:04:48 +0000 (12:04 -0400)]
Avoid pgoff overflow in remap_file_pages
Thomas Pollet noticed that the remap_file_pages() system call in
fremap.c has a potential overflow in the first part of the if statement
below, which could cause it to process bogus input parameters.
Specifically the pgoff + size parameters could be wrap thereby
preventing the system call from failing when it should.
Reported-by: Thomas Pollet <thomas.pollet@gmail.com>
Signed-off-by: Larry Woodman <lwoodman@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Takashi Iwai [Sat, 25 Sep 2010 15:57:53 +0000 (17:57 +0200)]
Merge branch 'fix/hda' into for-linus
Takashi Iwai [Sat, 25 Sep 2010 15:57:49 +0000 (17:57 +0200)]
Merge branch 'fix/asoc' into for-linus
Dan Rosenberg [Sat, 25 Sep 2010 15:07:27 +0000 (11:07 -0400)]
ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory
The SNDRV_HDSP_IOCTL_GET_CONFIG_INFO and
SNDRV_HDSP_IOCTL_GET_CONFIG_INFO ioctls in hdspm.c and hdsp.c allow
unprivileged users to read uninitialized kernel stack memory, because
several fields of the hdsp{m}_config_info structs declared on the stack
are not altered or zeroed before being copied back to the user. This
patch takes care of it.
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel Vetter [Fri, 24 Sep 2010 19:49:27 +0000 (21:49 +0200)]
drm/i915: kill ring->setup_status_page
It's the same code, essentially, so kill all copies safe one unified
version.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Daniel Vetter [Fri, 24 Sep 2010 19:20:10 +0000 (21:20 +0200)]
drm/i915: kill ring->get_active_head
All functions are extremely similar, so fold them into one generic
implementation.
This function isn't used anyway, because there's not yet a bsd ring
error state dumper.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Daniel Vetter [Fri, 24 Sep 2010 19:14:22 +0000 (21:14 +0200)]
drm/i915: kill per-ring macros
Two macros that use a base address for HWS_PGA were missing, add them.
Also switch the remaining users of *_ACTHD to the ring-base one.
Kill the other ring-specific macros because they're now unused.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[ickle: And silence checkpatch whilst in the vicinity]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Daniel Vetter [Fri, 24 Sep 2010 19:08:29 +0000 (21:08 +0200)]
drm/i915: fix ACTHD for gen <= 3
This was mixed up in the following patch:
commit
a6c45cf013a57e32ddae43dd4ac911eb4a3919fd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Sep 17 00:32:17 2010 +0100
drm/i915: INTEL_INFO->gen supercedes i8xx, i9xx, i965g
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Daniel Vetter [Fri, 24 Sep 2010 18:54:39 +0000 (20:54 +0200)]
drm/i915: kill now unnecessary gtt defines from i915_reg.h
Everything is now handled in intel-gtt.h so these defines
are only confusing.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sat, 25 Sep 2010 10:22:51 +0000 (11:22 +0100)]
drm/i915: Make the mutex_lock interruptible on ioctl paths
... and combine it with the wedged completion handler.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Sat, 25 Sep 2010 09:19:17 +0000 (10:19 +0100)]
drm/i915: Adjust hangcheck EIO semantics
Owain Ainsworth reported an issue between the interaction of the
hangcheck and userspace immediately (and permanently) falling back to
s/w rasterisation. In order to break the mutex and begin resetting the
GPU, we must abort the current operation (usually within the wait) and
climb sufficiently far back up the call chain to drop the mutex. In his
implementation, Owain has a loop within the ioctl handler to detect the
hang and then sleep until the error handler has run. I've chosen to
return to userspace and report an EAGAIN which should trigger the
userspace ioctl handler to repeat the call (simply because it felt less
invasive...). Before hitting a wedged GPU, we then wait upon completion
of the error handler.
Reported-by: Owain G. Ainsworth <zerooa@googlemail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Adrian Hunter [Sat, 25 Sep 2010 10:42:55 +0000 (12:42 +0200)]
block: prevent merges of discard and write requests
Add logic to prevent two I/O requests being merged if
only one of them is a discard. Ditto secure discard.
Without this fix, it is possible for write requests
to transform into discard requests. For example:
Submit bio 1 to discard 8 sectors from sector n
Submit bio 2 to write 8 sectors from sector n + 16
Submit bio 3 to write 8 sectors from sector n + 8
Bio 1 becomes request 1. Bio 2 becomes request 2.
Bio 3 is merged with request 2, and then subsequently
request 2 is merged with request 1 resulting in just
one I/O request which discards all 24 sectors.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
(Moved the checks above the position checks /Jens)
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Linus Torvalds [Sat, 25 Sep 2010 02:09:20 +0000 (19:09 -0700)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/groeck/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
x86/hwmon: pkgtemp has no dependency on PCI
MAINTAINERS: Update hwmon entry
x86/hwmon: register alternate sibling upon CPU removal
x86/hwmon: fix initialization of pkgtemp
x86/hwmon: fix initialization of coretemp
x86/hwmon: don't leak device attribute file from pkgtemp_probe() and pkgtemp_remove()
x86/hwmon: avoid deadlock on CPU removal in pkgtemp
x86/hwmon: fix module init for hotplug-but-no-device-found case
hwmon: (lis3) Fix Oops with NULL platform data
Linus Torvalds [Sat, 25 Sep 2010 02:08:39 +0000 (19:08 -0700)]
Merge branch 'stable' of git://git./linux/kernel/git/cmetcalf/linux-tile
* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
arch/tile: remove dead code from intvec_32.S
Chris Metcalf [Fri, 24 Sep 2010 21:19:20 +0000 (17:19 -0400)]
arch/tile: remove dead code from intvec_32.S
This "bpt_code" instruction was killed off in our development line a while
ago (the actual definition of bpt_code that is used is in kernel/traps.c)
but I didn't push it for 2.6.36 because it seemed harmless and I didn't
want to try to push more than absolutely necessary.
However, we recently fixed a bug in our gcc that had been causing
"-gdwarf2" not to be passed to the assembler, and passing this flag causes
an erroneous assembler failure in the presence of code in a data section,
sometimes. While we'd like to track down the bug in the assembler,
we'd also like to make sure 2.6.36 builds with the current toolchain,
so I'm removing this dead code as well.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Linus Torvalds [Fri, 24 Sep 2010 21:13:57 +0000 (14:13 -0700)]
fremap: get rid of broken 'end' variable
Thomas Pollet points out that the 'end' variable is broken. It was
computed based on start/size before they were page-aligned, and as such
doesn't actually match any of the other actions we take. The overflow
test on end was also redundant, since we had already tested it with the
properly aligned version.
So just get rid of it entirely. The one remaining use for that broken
variable can just use 'start+size' like all the other cases already did.
Reported-by: Thomas Pollet <thomas.pollet@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Fri, 24 Sep 2010 21:08:15 +0000 (14:08 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jlbec/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
o2dlm: force free mles during dlm exit
ocfs2: Sync inode flags with ext2.
ocfs2: Move 'wanted' into parens of ocfs2_resmap_resv_bits.
ocfs2: Use cpu_to_le16 for e_leaf_clusters in ocfs2_bg_discontig_add_extent.
ocfs2: update ctime when changing the file's permission by setfacl
ocfs2/net: fix uninitialized ret in o2net_send_message_vec()
Ocfs2: Handle empty list in lockres_seq_start() for dlmdebug.c
Ocfs2: Re-access the journal after ocfs2_insert_extent() in dxdir codes.
ocfs2: Fix lockdep warning in reflink.
ocfs2/lockdep: Move ip_xattr_sem out of ocfs2_xattr_get_nolock.
Linus Torvalds [Fri, 24 Sep 2010 20:55:29 +0000 (13:55 -0700)]
Merge git://git./linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
USB: update Kconfig help text for CONFIG_USB_SUSPEND
usb: musb: gadget: restart request on clearing endpoint halt
usb: musb: host: Issue a memory barrier before starting DMA
usb: musb: gadget: fix dma length in txstate
usb: musb: gadget: complete request only if data is transfered over
usb: musb: gadget: fix DMA length for OUT transfer
usb: musb: gadget: enable autoclear for OUT transfer in both DMA 0 and DMA 1
usb: musb: gadget: fix bulk IN infinit hangs in double buffer case
usb: musb: gadget: fix kernel panic if using out ep with FIFO_TXRX style
USB: fix bug in initialization of interface minor numbers
Linus Torvalds [Fri, 24 Sep 2010 20:55:12 +0000 (13:55 -0700)]
Merge git://git./linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
Staging: ti-st: remove st_get_plat_device
Linus Torvalds [Fri, 24 Sep 2010 20:55:01 +0000 (13:55 -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:
vgaarb: trivial fix
drm: radeon cleanup fixes...
drm: fix trivial coding errors
drm: ttm sparse fixes.
drm/nouveau: fix panels using straps-based mode detection
drm/ttm: Clear the ghost cpu_writers flag on ttm_buffer_object_transfer.
drm/radeon: don't allow device to be opened if powered down
Al Viro [Fri, 24 Sep 2010 05:25:34 +0000 (06:25 +0100)]
m32r: fix breakage from "m32r: use generic ptrace_resume code"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Fri, 24 Sep 2010 05:24:53 +0000 (06:24 +0100)]
m32r: hole in shifting pc back
It's a userland pointer; worse, an untrustable one since ptrace
has just provided a chance to modify it.
X-Roothole-Covering-Cabal: TINRCC
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Fri, 24 Sep 2010 05:23:57 +0000 (06:23 +0100)]
m32r: don't block signals if sigframe setup has failed
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Fri, 24 Sep 2010 05:22:30 +0000 (06:22 +0100)]
make m32r handle multiple pending signals
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Fri, 24 Sep 2010 05:20:35 +0000 (06:20 +0100)]
m32r: fix rt_sigsuspend()
do_signal() should know about saved_mask for it to work...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Chris Wilson [Fri, 24 Sep 2010 15:02:42 +0000 (16:02 +0100)]
drm/i915: Only hold a process-local lock whilst throttling.
Avoid cause latencies in other clients by not taking the global struct
mutex and moving the per-client request manipulation a local per-client
mutex. For example, this allows a compositor to schedule a page-flip
(through X) whilst an OpenGL application is monopolising the GPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Jan Beulich [Mon, 13 Sep 2010 10:24:47 +0000 (10:24 +0000)]
x86/hwmon: pkgtemp has no dependency on PCI
Other than coretemp, from which this code was apparently derived, there
is no PCI specific code in this driver.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Guenter Roeck [Fri, 24 Sep 2010 15:43:44 +0000 (08:43 -0700)]
MAINTAINERS: Update hwmon entry
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>