GitHub/exynos8895/android_kernel_samsung_universal8895.git
14 years agodrm/i915: avoid struct mutex output_poll mutex lock loop on unload
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>
14 years agoMerge branch 'drm-intel-fixes' into drm-intel-next
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

14 years agodrm/i915: Use pipe state to tell when pipe is off
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>
14 years agodrm/i915: vblank status not valid while training display port
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>
14 years agodrivers/gpu/drm/i915/i915_gem.c: Add missing error handling code
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
14 years agodrm/i915: Don't mask the return code whilst relocating.
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>
14 years agodrm/i915: If the GPU hangs twice within 5 seconds, declare it wedged.
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>
14 years agodrm/i915: Only print 'generating error event' if we actually are
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>
14 years agodrm/i915: Try to reset gen2 devices.
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>
14 years agodrm/i915: Clear fence registers on GPU reset
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>
14 years agodrm/i915: Force the domain to CPU on unbinding whilst wedged.
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>
14 years agodrm: Move the GTT accounting to i915
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>
14 years agodrm/i915: Fix refleak during eviction.
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>
14 years agoi915: Added function to initialize VBT settings
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>
14 years agodrm/i915: Remove redundant deletion of obj->gpu_write_list
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>
14 years agodrm/i915: Make get/put pages static
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>
14 years agodrm/i915/debugfs: Include list totals
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>
14 years agodrm/i915: Report the deferred free list in debugfs
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>
14 years agodrm/i915/debug: Convert i915_verify_active() to scan all lists
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>
14 years agodrm/i915: Avoid blocking the kworker thread on a stuck mutex
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>
14 years agodrm/i915/debug: Remove default WATCH_BUF
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>
14 years agodrm/i915/debug: Remove defunct WATCH_LRU
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>
14 years agodrm/i915/dvo: Fix panel and DDC i2c pins
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>
14 years agodrm/i915: Tidy dvo_ch7017 and print out which chip we detect
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>
14 years agodrm/i915: Disable LVDS i2c probing when using GPIO bit banging
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>
14 years agoMerge branch 'drm-intel-fixes' into drm-intel-next
Chris Wilson [Tue, 28 Sep 2010 14:48:38 +0000 (15:48 +0100)]
Merge branch 'drm-intel-fixes' into drm-intel-next

14 years agoMAINTAINERS: Add contact details for drm/i915
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>
14 years agodrm/i915: Use i2c bit banging instead of GMBUS
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>
14 years agodrm/i915/sdvo: Fix GMBUSification
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>
14 years agoRevert "drm/i915: Drop ring->lazy_request"
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>
14 years agodrm/i915: fix GMCH power reporting
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
14 years agodrm/i915: Ensure that the mode change flushing is currently uninterruptible
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>
14 years agodrm/i915: fix debugging compilation error from previous commit
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>
14 years agodrm/i915: Convert the file mutex into a spinlock
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>
14 years agodrm/i915: kill ring->setup_status_page
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>
14 years agodrm/i915: kill ring->get_active_head
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>
14 years agodrm/i915: kill per-ring macros
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>
14 years agodrm/i915: fix ACTHD for gen <= 3
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>
14 years agodrm/i915: kill now unnecessary gtt defines from i915_reg.h
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>
14 years agodrm/i915: Make the mutex_lock interruptible on ioctl paths
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>
14 years agodrm/i915: Adjust hangcheck EIO semantics
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>
14 years agodrm/i915: Only hold a process-local lock whilst throttling.
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>
14 years agodrm/i915/dp: Wait for PP_CONTROL to take effect.
Hette Visser [Fri, 24 Sep 2010 09:51:30 +0000 (10:51 +0100)]
drm/i915/dp: Wait for PP_CONTROL to take effect.

This patch fixes the black screen bug on Dell e6510, by
adding two delays to give the eDP panel time to turn on before we
continue with the next write.

300ms is rather arbitray and a rather long sleep, we need to find a way
of refining this value.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29278
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
14 years agosome clean up to intel-gtt.c
Jan Beulich [Fri, 24 Sep 2010 12:25:30 +0000 (13:25 +0100)]
some clean up to intel-gtt.c

In commit e517a5e97080bbe52857bd0d7df9b66602d53c4d the call to
map_page_into_agp() got removed from intel_i830_setup_flush(), but the
counterpart call from intel_i830_fini_flush() to unmap_page_from_agp()
was left in place.

Additionally, the page allocated here never gets its physical address
used for sending to hardware, so there's no need to allocate it with
GFP_DMA32. Nor is __GFP_ZERO really necessary, as the page is used
only to store data to force flushing of some internal processor state.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Parse the eDP link configuration from the vBIOS
Chris Wilson [Fri, 24 Sep 2010 09:24:28 +0000 (10:24 +0100)]
drm/i915: Parse the eDP link configuration from the vBIOS

First step, lets have a look at the values for troublesome panels and
see if they may be used to improve our link training.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/lvds: Use the GMBUS pin if specified in VBT
Chris Wilson [Fri, 24 Sep 2010 00:15:02 +0000 (01:15 +0100)]
drm/i915/lvds: Use the GMBUS pin if specified in VBT

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Use an uninterruptible wait for page-flips during modeset
Chris Wilson [Thu, 23 Sep 2010 22:04:43 +0000 (23:04 +0100)]
drm/i915: Use an uninterruptible wait for page-flips during modeset

We need to drain the pending flips prior to disabling the pipe during
modeset, and these need to be done in an uninterruptible fashion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Remove unused dev_priv->panel_wants_dither
Chris Wilson [Thu, 23 Sep 2010 21:12:23 +0000 (22:12 +0100)]
drm/i915: Remove unused dev_priv->panel_wants_dither

This is now private to the DVO connector, remove it from the main device
private.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/ringbuffer: Fix sign of ring space.
Chris Wilson [Thu, 23 Sep 2010 16:45:39 +0000 (17:45 +0100)]
drm/i915/ringbuffer: Fix sign of ring space.

As we presume space is signed when computing and looking for wrap along,
make it so.

Reported-by: Owain G. Ainsworth <zerooa@googlemail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Remove idle timer debugging messages
Chris Wilson [Thu, 23 Sep 2010 15:45:52 +0000 (16:45 +0100)]
drm/i915: Remove idle timer debugging messages

These have served their purpose and are now just noise in the debug
stream.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/lvds: Probe DDC on creation
Chris Wilson [Thu, 23 Sep 2010 10:16:49 +0000 (11:16 +0100)]
drm/i915/lvds: Probe DDC on creation

Try to validate the panel's connection by writing to address 0xA0.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=18072
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/sdvo: Handle unsupported GET_SUPPORTED_ENHANCEMENTS gracefully
Chris Wilson [Thu, 23 Sep 2010 15:17:33 +0000 (16:17 +0100)]
drm/i915/sdvo: Handle unsupported GET_SUPPORTED_ENHANCEMENTS gracefully

In the event that the external chipset doesn't implement the
GET_SUPPORTED_ENHANCEMENTS commands, gracefully treat it as having no
enhancments rather than bailing.

Reported-and-tested-by: Woody Suwalski <terraluna977@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=18342
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/sdvo: Cleanup connector on error path
Chris Wilson [Thu, 23 Sep 2010 15:15:21 +0000 (16:15 +0100)]
drm/i915/sdvo: Cleanup connector on error path

We weren't unlinking the freed connector from the drm lists, and so
hit some use-after-free if we failed to initialise the connector.

Reported-and-tested-by: Woody Suwalski <terraluna977@gmail.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=18342
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/tv: Sleep before checking for state changes.
Chris Wilson [Wed, 22 Sep 2010 18:10:09 +0000 (19:10 +0100)]
drm/i915/tv: Sleep before checking for state changes.

We need to wait for the PLLs to settle prior to detecting the state
changes. The BIOS writers guide suggests waiting for the next vblank.

Reported-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Remove the broken flush_ring from page-flip
Chris Wilson [Thu, 23 Sep 2010 10:00:38 +0000 (11:00 +0100)]
drm/i915: Remove the broken flush_ring from page-flip

This is already performed with the pipelined flush, so by the time we
schedule the flush in the page-flip, the ring is NULL and we OOPs
instead.

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Fix 945GM regression in e259befd
Chris Wilson [Wed, 22 Sep 2010 18:10:44 +0000 (19:10 +0100)]
drm/i915: Fix 945GM regression in e259befd

A minor typo caused a single fence register to be incorrectly
programmed, resulting in occassional tiling corruption.

Reported-and-tested-by: Hans de Bruin <bruinjm@xs4all.nl>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=18962
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
14 years agodrm/i915/crt: Use a DDC probe on 0xA0 before load-detect
Chris Wilson [Wed, 22 Sep 2010 17:17:01 +0000 (18:17 +0100)]
drm/i915/crt: Use a DDC probe on 0xA0 before load-detect

The BIOS writer's guide suggests that a VGA connection will ACK a write
to address 0xA0 and that this should be used before doing legacy
load-detection. Considering the extreme cost of load-detection,
performing an extra DDC seems a risk worth taking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Disable "disabled FBC" message when a no-op
Chris Wilson [Wed, 22 Sep 2010 12:15:10 +0000 (13:15 +0100)]
drm/i915: Disable "disabled FBC" message when a no-op

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Drop ring->lazy_request
Chris Wilson [Wed, 22 Sep 2010 10:22:30 +0000 (11:22 +0100)]
drm/i915: Drop ring->lazy_request

We are not currently using it as intended, so remove the complication.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Don't offset the pin used for crt_ddc
Chris Wilson [Wed, 22 Sep 2010 09:54:48 +0000 (10:54 +0100)]
drm/i915: Don't offset the pin used for crt_ddc

Previously when converting the GMBUS pin to the GPIO reg, we would
offset the pin by one and then use the look-up table. Now that we first
try to use the GMBUS pin, we no longer need the offset and can use the
value from the VBIOS directly.

Reported-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Clear the gpu_write_list on resetting write_domain upon hang
Chris Wilson [Wed, 22 Sep 2010 09:31:52 +0000 (10:31 +0100)]
drm/i915: Clear the gpu_write_list on resetting write_domain upon hang

Otherwise we will hit a list handling assertion when moving the object
to the inactive list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Don't overwrite the returned error-code
Chris Wilson [Tue, 21 Sep 2010 14:05:24 +0000 (15:05 +0100)]
drm/i915: Don't overwrite the returned error-code

During i915_gem_create_mmap_offset() if the subsystem reports an error
code, use it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/lvds: Unlock the PP register when panel-fitting
Chris Wilson [Tue, 21 Sep 2010 13:06:12 +0000 (14:06 +0100)]
drm/i915/lvds: Unlock the PP register when panel-fitting

As we do not wait for the panel to turn off when we need to adjust the
panel-fitting registers we also need to unlock the PLLs as with the
non-pfit update path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Use the correct DPB GMBUS port for GPIOE
Chris Wilson [Tue, 21 Sep 2010 11:34:25 +0000 (12:34 +0100)]
drm/i915: Use the correct DPB GMBUS port for GPIOE

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Drop crtc->fb pin on disable.
Chris Wilson [Wed, 8 Sep 2010 15:30:16 +0000 (16:30 +0100)]
drm/i915: Drop crtc->fb pin on disable.

In order to handle disable_functions() where the framebuffer is
decoupled from the crtc we need to unpin the fb in order to prevent a
leak.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29857
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Disable output polling across suspend & resume
Chris Wilson [Wed, 8 Sep 2010 08:45:11 +0000 (09:45 +0100)]
drm/i915: Disable output polling across suspend & resume

Suspending (especially hibernating) may take a finite amount of time,
during which a hotplug event may trigger and we will attempt to handle
it with inconsistent state. Disable hotplug polling around suspend and
resume.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30070
Reported-by: Rui Tiago Matos <tiagomatos@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt add a cleanup function for chipset specific stuff
Daniel Vetter [Sun, 12 Sep 2010 15:11:15 +0000 (17:11 +0200)]
intel-gtt add a cleanup function for chipset specific stuff

The old code didn't clean up the i830 chipset flush page. And it
looks nicer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: store the dma mask size in intel_gtt_driver
Daniel Vetter [Sun, 12 Sep 2010 14:38:55 +0000 (16:38 +0200)]
intel-gtt: store the dma mask size in intel_gtt_driver

Storing this explicitly makes for clearer code and hopefully
less further confusion.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: clean up gtt size reporting
Daniel Vetter [Sun, 12 Sep 2010 12:04:03 +0000 (14:04 +0200)]
intel-gtt: clean up gtt size reporting

Consolidate everything in intel-gtt.c and also kill the export
of intel_max_stolen.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agoagp: kill agp_(unmap|map)_memory
Daniel Vetter [Sun, 12 Sep 2010 09:07:15 +0000 (11:07 +0200)]
agp: kill agp_(unmap|map)_memory

DMA remapping was only used by the intel-gtt driver. With that
code now folded into the driver, kill the agp generic support for
it.

Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: consolidate fake_agp driver structs
Daniel Vetter [Sat, 11 Sep 2010 22:29:26 +0000 (00:29 +0200)]
intel-gtt: consolidate fake_agp driver structs

They're now all the same.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: move chipset flush to the gtt driver struct
Daniel Vetter [Sat, 11 Sep 2010 22:27:24 +0000 (00:27 +0200)]
intel-gtt: move chipset flush to the gtt driver struct

This is the last differentiator between the different fake agp drivers.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: kill mask_memory functions
Daniel Vetter [Sun, 12 Sep 2010 10:34:44 +0000 (12:34 +0200)]
intel-gtt: kill mask_memory functions

That indirection mess can now go. Add a dummy i81x gtt_driver to
avoid a NULL pointer check.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: generic (insert|remove)_entries for sandybridge
Daniel Vetter [Sat, 11 Sep 2010 21:55:20 +0000 (23:55 +0200)]
intel-gtt: generic (insert|remove)_entries for sandybridge

Like before, but now with the added bonus of being able to kill
quite a bit of no-longer userful code (the old dmar support stuff).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: generic (insert|remove)_entries for g33/i965
Daniel Vetter [Sat, 11 Sep 2010 21:48:25 +0000 (23:48 +0200)]
intel-gtt: generic (insert|remove)_entries for g33/i965

Like for the i915.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: generic (insert|remove)_entries for i915
Daniel Vetter [Sat, 11 Sep 2010 20:12:11 +0000 (22:12 +0200)]
intel-gtt: generic (insert|remove)_entries for i915

Beef up the generic version to support dmar. Otherwise like for the i830.

v2: Don't try to DMA remap on resume for already remapped pages.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: generic (insert|remove)_entries for i830
Daniel Vetter [Sat, 11 Sep 2010 19:31:04 +0000 (21:31 +0200)]
intel-gtt: generic (insert|remove)_entries for i830

Well, not all too generic because it does not yet support dmar.
Add a new function check_flags to ensure that non-gem code does
not try to screw us over.

v2: Beautify i830_check_flags with an idea from Chris Wilson.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agoagp: kill agp_(map|unmap)_page
Daniel Vetter [Thu, 9 Sep 2010 16:17:34 +0000 (18:17 +0200)]
agp: kill agp_(map|unmap)_page

Only used to remap the scratch page. Now that intel-gtt does this
itself, kill the support code.

Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: drop agp scratch page support stuff
Daniel Vetter [Thu, 9 Sep 2010 16:11:41 +0000 (18:11 +0200)]
intel-gtt: drop agp scratch page support stuff

intel-gtt.c now handles the scratch page itself, so drop all that
was just there to support it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: introduce pte write function for gen6
Daniel Vetter [Thu, 9 Sep 2010 15:52:20 +0000 (17:52 +0200)]
intel-gtt: introduce pte write function for gen6

Like for i830. intel_i9xx_configure is now unused, so kill it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: introduce pte write function for g33/i965/gm45
Daniel Vetter [Sat, 11 Sep 2010 12:01:43 +0000 (14:01 +0200)]
intel-gtt: introduce pte write function for g33/i965/gm45

Like for the i830.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: introduce pte write function for i8xx/i915/i945
Daniel Vetter [Tue, 7 Sep 2010 20:41:04 +0000 (22:41 +0200)]
intel-gtt: introduce pte write function for i8xx/i915/i945

And put it to use in the gtt configuration code that writes
the scratch page addr in all gtt ptes. This makes intel_i830_configure
generic, hence rename it to intel_fake_agp_configure.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agointel-gtt: initialize our own scratch page
Daniel Vetter [Tue, 7 Sep 2010 20:11:15 +0000 (22:11 +0200)]
intel-gtt: initialize our own scratch page

The intel gtt fake agp driver is the only agp driver to use dma
address remapping. So it makes sense to fold this code back into the
only user (and thus reduce the reliance on the agp code).

This patch does the first step by initializing (and remapping) the
scratch page in a new function intel_gtt_setup_scratch_page.
Unfortunately intel_gtt_cleanup had to move to avoid a forward
declaration. The new scratch page is not yet used, though.

v2: Refactor out scratch page teardown.  Suggested by Chris Wilson on
irc. This makes it clear what's going on and results in a nice
symmetry between setup and teardown.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Track pinned objects
Chris Wilson [Mon, 20 Sep 2010 16:36:15 +0000 (17:36 +0100)]
drm/i915: Track pinned objects

Keep a list of pinned objects and display it via debugfs. Now all
objects that exist in the GTT are always tracked on one of the
active, flushing, inactive or pinned lists.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Drain any pending flips on the fb prior to unpinning
Chris Wilson [Mon, 20 Sep 2010 14:41:01 +0000 (15:41 +0100)]
drm/i915: Drain any pending flips on the fb prior to unpinning

If we have queued a page flip on the current fb and then request a mode
change, wait until the page flip completes before performing the new
request.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Merge ring flushing and lazy requests
Chris Wilson [Mon, 20 Sep 2010 11:50:23 +0000 (12:50 +0100)]
drm/i915: Merge ring flushing and lazy requests

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Track gpu fence usage
Chris Wilson [Mon, 20 Sep 2010 10:40:50 +0000 (11:40 +0100)]
drm/i915: Track gpu fence usage

Track if the gpu requires the fence for the execution of a batch buffer
and so only wait upon the retirement of the object's last rendering
seqno if the fence is in use by the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/ringbuffer: whitespace cleanup
Chris Wilson [Sun, 19 Sep 2010 16:53:44 +0000 (17:53 +0100)]
drm/i915/ringbuffer: whitespace cleanup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: drop alignment ringbuffer parameter
Daniel Vetter [Mon, 2 Aug 2010 15:22:48 +0000 (17:22 +0200)]
drm/i915: drop alignment ringbuffer parameter

Always PAGE_SIZE and only complicates the code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: don't explicitly initialize ringbuffer members to zero
Daniel Vetter [Mon, 2 Aug 2010 15:08:41 +0000 (17:08 +0200)]
drm/i915: don't explicitly initialize ringbuffer members to zero

The compiler happily does that for us.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: use new macros to access the ring ctl register
Daniel Vetter [Mon, 2 Aug 2010 15:06:59 +0000 (17:06 +0200)]
drm/i915: use new macros to access the ring ctl register

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: use new macros to access the ring head register
Daniel Vetter [Mon, 2 Aug 2010 15:06:23 +0000 (17:06 +0200)]
drm/i915: use new macros to access the ring head register

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: use new macros to access the ring start register
Daniel Vetter [Mon, 2 Aug 2010 14:33:33 +0000 (16:33 +0200)]
drm/i915: use new macros to access the ring start register

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: use new macros to access the ring tail register
Daniel Vetter [Mon, 2 Aug 2010 14:29:44 +0000 (16:29 +0200)]
drm/i915: use new macros to access the ring tail register

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: add relative ring register macros
Daniel Vetter [Mon, 2 Aug 2010 14:24:01 +0000 (16:24 +0200)]
drm/i915: add relative ring register macros

Documentation explicitly mentions that the ring registers are
designed to have the same offsets relative to a base registers.

Use this to fight the code beaurocratic in intel_ringbuffer.c.

No code changes in this patch, just the new definitions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: kill duplicated/unneeded register defines
Daniel Vetter [Mon, 2 Aug 2010 13:28:30 +0000 (15:28 +0200)]
drm/i915: kill duplicated/unneeded register defines

This looks like a copy-paste remnant from the i810. All the regs
that are actually used are already defined somewhere else in i915_reg.h!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: Use ring->flush() instead of MI_FLUSH
Chris Wilson [Sun, 19 Sep 2010 14:05:13 +0000 (15:05 +0100)]
drm/i915: Use ring->flush() instead of MI_FLUSH

Use the ring abstraction to hide the details of having choose the
appropriate flushing method.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/ringbuffer: Mark the initialisation structs as constant.
Chris Wilson [Sun, 19 Sep 2010 13:46:27 +0000 (14:46 +0100)]
drm/i915/ringbuffer: Mark the initialisation structs as constant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915: add a new BSD ring buffer for Sandybridge
Xiang, Haihao [Sun, 19 Sep 2010 13:40:43 +0000 (14:40 +0100)]
drm/i915: add a new BSD ring buffer for Sandybridge

This ring buffer is used for video decoding/encoding on Sandybridge.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
14 years agodrm/i915/ringbuffer: Implement advance using set_tail
Chris Wilson [Sun, 19 Sep 2010 13:36:46 +0000 (14:36 +0100)]
drm/i915/ringbuffer: Implement advance using set_tail

As noted by Zhenyu, we can now simply replace the existing advance hook
by calling the new set_tail function pointer directly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>