GitHub/exynos8895/android_kernel_samsung_universal8895.git
10 years agodrm/radeon/DCE4+: clear bios scratch dpms bit (v2)
Alex Deucher [Mon, 27 Jan 2014 23:29:35 +0000 (18:29 -0500)]
drm/radeon/DCE4+: clear bios scratch dpms bit (v2)

The BlankCrtc table in some DCE8 boards has some
logic shortcuts for the vbios when this bit is set.
Clear it for driver use.

v2: fix typo

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=73420

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
10 years agodrm/radeon: set si_notify_smc_display_change properly
Alex Deucher [Mon, 27 Jan 2014 18:04:56 +0000 (13:04 -0500)]
drm/radeon: set si_notify_smc_display_change properly

This is effectively a revert of 4573388c92ee60b4ed72b8d95b73df861189988c.

Forcing a display active when there is none causes problems with
dpm on some SI boards which results in improperly initialized
dpm state and boot failures on some boards.  As for the bug commit
4573388c92ee tried to address, one can manually force the state to
high for better performance when using the card as a headless compute
node until a better fix is developed.

bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=73788
https://bugs.freedesktop.org/show_bug.cgi?id=69395

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
cc: stable@vger.kernel.org

10 years agodrm/radeon: fix DAC interrupt handling on DCE5+
Alex Deucher [Mon, 27 Jan 2014 16:54:44 +0000 (11:54 -0500)]
drm/radeon: fix DAC interrupt handling on DCE5+

DCE5 and newer hardware only has 1 DAC.  Use the correct
offset.  This may fix display problems on certain board
configurations.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
10 years agodrm/radeon: clean up active vram sizing
Alex Deucher [Mon, 27 Jan 2014 16:26:33 +0000 (11:26 -0500)]
drm/radeon: clean up active vram sizing

If we are not able to properly initialize one of the gpu
engines for buffer paging, we limit vram to the size of
the cpu visible aperture.  We generally either use the gfx
or dma engine to do this.  Clean up the size limiting code
to only adjust the size based on what ring is selected
for buffer paging rather than making assumptions about which
engine is selected for paging.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agodrm/radeon: skip async dma init on r6xx
Alex Deucher [Mon, 27 Jan 2014 15:59:51 +0000 (10:59 -0500)]
drm/radeon: skip async dma init on r6xx

The hw is buggy and it's not currently used, but it's
currently still initialized by the driver.  Skip the init.
Skipping init also seems to improve stability with dpm on
some r6xx asics.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=66963

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agodrm/radeon/runpm: don't runtime suspend non-PX cards
Alex Deucher [Fri, 24 Jan 2014 19:59:42 +0000 (14:59 -0500)]
drm/radeon/runpm: don't runtime suspend non-PX cards

Prevent runtime suspend of non-PX GPUs.  Runtime suspend is
not what we want in those cases.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
10 years agodrm/radeon: add ring to fence trace functions
Christian König [Thu, 23 Jan 2014 13:24:17 +0000 (14:24 +0100)]
drm/radeon: add ring to fence trace functions

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: add missing trace point
Christian König [Thu, 23 Jan 2014 13:24:16 +0000 (14:24 +0100)]
drm/radeon: add missing trace point

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: fix VMID use tracking
Christian König [Thu, 23 Jan 2014 13:24:15 +0000 (14:24 +0100)]
drm/radeon: fix VMID use tracking

Otherwise we allocate a new VMID on nearly every submit.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoMerge tag 'drm/for-3.14-rc1-20140123' of git://anongit.freedesktop.org/tegra/linux...
Dave Airlie [Wed, 29 Jan 2014 02:03:56 +0000 (12:03 +1000)]
Merge tag 'drm/for-3.14-rc1-20140123' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v3.14-rc1 (update)

These patches fix some issues caused by the DRM panel support from the
previous pull request and add two more panels (for the Toshiba AC100 as
well as the Seaboard and Ventana).

* tag 'drm/for-3.14-rc1-20140123' of git://anongit.freedesktop.org/tegra/linux:
  drm/tegra: Obtain head number from DT
  drm/panel: update EDID BLOB in panel_simple_get_modes()
  gpu: host1x: Remove unnecessary include
  drm/tegra: Use proper data type
  drm/tegra: Clarify how panel modes override others
  drm/tegra: Fix possible CRTC mask for RGB outputs
  drm/i915: Use drm_encoder_crtc_ok()
  drm: Move drm_encoder_crtc_ok() to core
  drm: provide a helper for the encoder possible_crtcs mask
  drm/tegra: Don't check resource with devm_ioremap_resource()
  drm/panel: Add support for Chunghwa CLAA101WA01A panel
  drm/panel: Add support for Samsung LTN101NT05 panel

10 years agodrm: ast,cirrus,mgag200: use drm_can_sleep
Dave Airlie [Thu, 23 Jan 2014 23:50:18 +0000 (09:50 +1000)]
drm: ast,cirrus,mgag200: use drm_can_sleep

these 3 were checking in_interrupt but we have situations where
calling vunmap under this could cause a BUG to be hit in
smp_call_function_many. Use the drm_can_sleep macro instead,
which should stop this path from been taken in this case.

Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agoMerge tag 'drm-intel-fixes-2014-01-28' of git://people.freedesktop.org/~danvet/drm...
Dave Airlie [Wed, 29 Jan 2014 00:21:39 +0000 (10:21 +1000)]
Merge tag 'drm-intel-fixes-2014-01-28' of git://people.freedesktop.org/~danvet/drm-intel into drm-next

Pile of -fixes all over the place. Lot's of cc: stable.

Only big thing is that we've dropped the preliminary hw support tag for
bdw - it seems to work. Which also means that I'll shovel a few more bdw
patches through -fixes, there's 5 w/a patches from Ken already on
intel-gfx.

* tag 'drm-intel-fixes-2014-01-28' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: Fix the offset issue for the stolen GEM objects
  drm/i915: Decouple GPU error reporting from ring initialisation
  i915: remove pm_qos request on error
  Revert "drm/i915: Mask reserved bits in display/sprite address registers"
  drm/i915: VLV2 - Fix hotplug detect bits
  drm/i915: Allow reading the TIMESTAMP register on Gen8.
  drm/i915: Repeat evictions whilst pageflip completions are outstanding
  drm/i915: Wait for completion of pending flips when starved of fences
  drm/i915: don't disable DP port after a failed link training
  drm/i915: don't disable the DP port if the link is lost
  drm/i915: Eliminate lots of WARNs when there's no backlight present
  drm/i915: g4x/vlv: fix dp aux interrupt mask
  drm/i915/ppgtt: Defer request freeing on reset
  i915: send D1 opregion notification
  drm/i915/bdw: remove preliminary_hw_support flag from BDW
  drm/i915: Tune down reset_stat output from ERROR to debug
  drm/i915: Make semaphore modparam RO
  drm/i915: Fix disabled semaphores
  drm/i915: Clarify relocation errnos
  drm/i915: Spelling s/auxilliary/auxiliary/

10 years agoMerge branch 'drm-armada-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox into...
Dave Airlie [Tue, 28 Jan 2014 23:38:32 +0000 (09:38 +1000)]
Merge branch 'drm-armada-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox into drm-next

Just one-liner which corrects a select statement for DRM_KMS_FB_HELPER
which looks like it was missed in the initial merge.  Based on 3.13.

* 'drm-armada-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox: (55 commits)
  DRM: armada: fix missing DRM_KMS_FB_HELPER select

10 years agoMerge tag 'omapdrm-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux...
Dave Airlie [Tue, 28 Jan 2014 23:37:47 +0000 (09:37 +1000)]
Merge tag 'omapdrm-3.14' of git://git./linux/kernel/git/tomba/linux into drm-next

omapdrm patches for 3.14

* tag 'omapdrm-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  drm/omap: Enable DT support for DMM
  drm/omap: fix: change dev_unload order
  drm/omap: fix: disable encoder before destroying it
  drm/omap: fix: disconnect devices when omapdrm module is removed
  drm/omap: fix: Defer probe if an omapdss device requests for it at connect
  drm/omap: fix (un)registering irqs inside an irq handler

Conflicts:
drivers/gpu/drm/omapdrm/omap_drv.c

10 years agoMerge branch 'gma500-next' of git://github.com/patjak/drm-gma500 into drm-next
Dave Airlie [Tue, 28 Jan 2014 23:35:48 +0000 (09:35 +1000)]
Merge branch 'gma500-next' of git://github.com/patjak/drm-gma500 into drm-next

Only two patches this time around. One trivial and one locking fix.

* 'gma500-next' of git://github.com/patjak/drm-gma500:
  drm/gma500: Lock struct_mutex around cursor updates
  drivers: gpu: Mark function as static in cdv_intel_dp.c

10 years agodrm/gma500: Lock struct_mutex around cursor updates
Patrik Jakobsson [Wed, 8 Jan 2014 18:30:40 +0000 (19:30 +0100)]
drm/gma500: Lock struct_mutex around cursor updates

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64361
Cc: <stable@vger.kernel.org>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
10 years agodrm/i915: Fix the offset issue for the stolen GEM objects
Akash Goel [Mon, 13 Jan 2014 10:54:45 +0000 (16:24 +0530)]
drm/i915: Fix the offset issue for the stolen GEM objects

The 'offset' field of the 'scatterlist' structure was wrongly
programmed with the offset value from the base of stolen area,
whereas this field indicates the offset from where the interested
data starts within the first PAGE pointed to by 'scattterlist'
structure. As a result when a new GEM object allocated from stolen
area is mapped to GTT, it could lead to an overwrite of GTT entries
as the page count calculation will go wrong, refer the function
'sg_page_count'.

v2: Modified the commit message. (Chris)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71908
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69104
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoDRM: armada: fix missing DRM_KMS_FB_HELPER select
Russell King [Mon, 27 Jan 2014 23:33:11 +0000 (23:33 +0000)]
DRM: armada: fix missing DRM_KMS_FB_HELPER select

Commit 92b6f89f6b8f (drm: Add separate Kconfig option for fbdev helpers)
happened in parallel with the inclusion of Armada DRM into mainline,
and so missed this update.  Add the necessary select statement to avoid
build errors.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
10 years agodrm/i915: Decouple GPU error reporting from ring initialisation
Chris Wilson [Mon, 27 Jan 2014 13:52:34 +0000 (13:52 +0000)]
drm/i915: Decouple GPU error reporting from ring initialisation

Currently we report through our error state only the rings that have
been initialised (as detected by ring->obj). This check is done after
the GPU reset and ring re-initialisation, which means that the software
state may not be the same as when we captured the hardware error and we
may not print out any of the vital information for debugging the hang.

This (and the implied object leak) is a regression from

commit 3d57e5bd1284f44e325f3a52d966259ed42f9e05
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Mon Oct 14 10:01:36 2013 -0700

    drm/i915: Do a fuller init after reset

Note that we are already starting to get bug reports with incomplete
error states from 3.13, which also hampers debugging userspace driver
issues.

v2: Prevent a NULL dereference on 830gm/845g after a GPU reset where
    the scratch obj may be NULL.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=74094
Cc: stable@vger.kernel.org # please don't delay since it's a
vital support/debug feature for the intel gfx stack in general
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: Add a bit of fluff to make it clear we need this expedited in
stable.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoi915: remove pm_qos request on error
Stanislaw Gruszka [Sat, 25 Jan 2014 09:13:37 +0000 (10:13 +0100)]
i915: remove pm_qos request on error

Not removing pm qos request and free memory for it can cause crash,
when some other driver use pm qos. For example, this oops:

BUG: unable to handle kernel paging request at fffffffffffffff8
IP: [<ffffffff81307a6b>] plist_add+0x5b/0xd0
Call Trace:
 [<ffffffff810acf25>] pm_qos_update_target+0x125/0x1e0
 [<ffffffff810ad071>] pm_qos_add_request+0x91/0x100
 [<ffffffffa053ec14>] e1000_open+0xe4/0x5b0 [e1000e]

was caused by earlier i915 probe failure:

[drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
[drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 head 00003004 tail 00000000 start 00003000
[drm:i915_driver_load] *ERROR* failed to init modeset
i915: probe of 0000:00:02.0 failed with error -5

Bug report:
http://bugzilla.redhat.com/show_bug.cgi?id=1057533

Reported-by: Giandomenico De Tullio <ghisha@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
[danvet: Drop unnecessary code movement.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoRevert "drm/i915: Mask reserved bits in display/sprite address registers"
Daniel Vetter [Fri, 24 Jan 2014 09:31:44 +0000 (10:31 +0100)]
Revert "drm/i915: Mask reserved bits in display/sprite address registers"

This reverts commit 446f254566ea8911c9e19c7bc8a162fc0e53cf31.

I've left the masking in the pageflip code since that seems to be some
useful piece of preemptive robustness.

Iirc I've merged this patch under the assumption that the BIOS leaves
some random gunk in the lower bits and gets unhappy if we trample on
them. We have quite a few case like this, so this made sense.

Now I've just learned that there's actual hardware features bits in
the low 12 bits, and the kernel needs to preserve them to allow a
userspace blob to do its job. Given Dave Airlie's clear stance on
userspace blob drivers I've quickly chatted with him and he doesn't
seem too happy. So let's revert this.

If there are indeed bits that we must preserve in this range then we
can ressurrect this patch, but with proper documentation for those
bits supplied. And we probably also need to think a bit about
interactions with our driver.

Cc: Armin Reese <armin.c.reese@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Dave Airlie <airlied@linux.ie>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agodrm/tegra: Obtain head number from DT
Thierry Reding [Thu, 9 Jan 2014 16:08:36 +0000 (17:08 +0100)]
drm/tegra: Obtain head number from DT

The head number of a given display controller is fixed in hardware and
required to program outputs appropriately. Relying on the driver probe
order to determine this number will not work, since that could yield a
situation where the second head was probed first and would be assigned
head number 0 instead of 1.

By explicitly specifying the head number in the device tree, it is no
longer necessary to rely on these assumptions. As a fallback, if the
property isn't available, derive the head number from the display
controller node's position in the device tree. That's somewhat more
reliable than the previous default but not a proper solution.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/i915: VLV2 - Fix hotplug detect bits
Todd Previte [Thu, 23 Jan 2014 07:13:41 +0000 (00:13 -0700)]
drm/i915: VLV2 - Fix hotplug detect bits

Add new definitions for hotplug live status bits for VLV2 since they're
in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct
  bit defintions
- Replaced a lost trailing brace for the added switch()

Signed-off-by: Todd Previte <tprevite@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73951
[danvet: Switch to _VLV postfix instead of prefix and regroupg
comments again so that the g4x warning is right next to those defines.
Also add a _G4X suffix for those special ones. Also cc stable.]
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoMerge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Thu, 23 Jan 2014 03:50:54 +0000 (13:50 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next

Summary:
- GK110/GK208 acceleration
- loads more work towards pm, though, still behind a disable wall for now
- error reporting improvements from both Ilia and myself
- more old-school overlay improvements from Ilia
- misc other bits and pieces

* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (68 commits)
  drm/nouveau: call drm_vblank_cleanup() earlier
  drm/nouveau: create base display from common code
  drm/nv50/gr: print mpc trap name when it's not an mp trap
  drm/nv50/gr: update list of mp errors, make it a bitfield
  drm/nv50/gr: add more trap names to print on error
  drm/nouveau/devinit: lock/unlock crtc regs for all devices, not just pre-nv50
  drm/nouveau: hold mutex while syncing to kernel channel
  drm/nv50-/devinit: prevent use of engines marked as disabled by hw/vbios
  drm/nouveau/device: provide a way for devinit to mark engines as disabled
  drm/nouveau/devinit: tidy up the subdev class definition
  drm/nouveau/bar: tidy up the subdev and object class definitions
  drm/nouveau/instmem: tidy up the object class definition
  drm/nouveau/instmem: tidy up the subdev class definition
  drm/nouveau/pwr: implement a simple i2c stack
  drm/nouveau/pwr: have rd/wr32 routines clobber data instead of addr
  drm/nve0/fb: turn off some bits in 10f584 at init
  drm/nve0/fb/gddr5: merge a fix from ddr3 for one of the timing settings
  drm/nve0/fb/gddr5: yet another random 10f200 bit
  drm/nvc0-/fb: hook up skeleton interrupt handler
  drm/nve0/fb/gddr5: more 10f200 stuff
  ...

10 years agodrm/nouveau: call drm_vblank_cleanup() earlier
Ben Skeggs [Thu, 23 Jan 2014 00:49:47 +0000 (10:49 +1000)]
drm/nouveau: call drm_vblank_cleanup() earlier

Fixes a NULL-ptr deref seen on module unload sometimes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau: create base display from common code
Ben Skeggs [Wed, 22 Jan 2014 02:58:12 +0000 (12:58 +1000)]
drm/nouveau: create base display from common code

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv50/gr: print mpc trap name when it's not an mp trap
Ilia Mirkin [Fri, 17 Jan 2014 05:13:05 +0000 (00:13 -0500)]
drm/nv50/gr: print mpc trap name when it's not an mp trap

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agodrm/nv50/gr: update list of mp errors, make it a bitfield
Ilia Mirkin [Fri, 17 Jan 2014 11:19:46 +0000 (06:19 -0500)]
drm/nv50/gr: update list of mp errors, make it a bitfield

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agodrm/nv50/gr: add more trap names to print on error
Ilia Mirkin [Thu, 16 Jan 2014 07:47:11 +0000 (02:47 -0500)]
drm/nv50/gr: add more trap names to print on error

Also avoids printing the errors bitfield if that information has already
been shown.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agodrm/nouveau/devinit: lock/unlock crtc regs for all devices, not just pre-nv50
Ilia Mirkin [Sun, 19 Jan 2014 09:18:15 +0000 (04:18 -0500)]
drm/nouveau/devinit: lock/unlock crtc regs for all devices, not just pre-nv50

Also make nv_lockvgac work for nv50+ devices. This should fix
IO_CONDITION and related VBIOS opcodes that read/write the crtc regs.

See https://bugs.freedesktop.org/show_bug.cgi?id=60680

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau: hold mutex while syncing to kernel channel
Maarten Lankhorst [Tue, 14 Jan 2014 15:48:58 +0000 (16:48 +0100)]
drm/nouveau: hold mutex while syncing to kernel channel

Not holding the mutex potentially causes corruption of the kernel
channel when page flipping.

Cc: stable@vger.kernel.org #3.13
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv50-/devinit: prevent use of engines marked as disabled by hw/vbios
Ilia Mirkin [Tue, 14 Jan 2014 06:29:06 +0000 (16:29 +1000)]
drm/nv50-/devinit: prevent use of engines marked as disabled by hw/vbios

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/device: provide a way for devinit to mark engines as disabled
Ilia Mirkin [Fri, 10 Jan 2014 02:19:11 +0000 (21:19 -0500)]
drm/nouveau/device: provide a way for devinit to mark engines as disabled

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/devinit: tidy up the subdev class definition
Ben Skeggs [Tue, 14 Jan 2014 05:55:38 +0000 (15:55 +1000)]
drm/nouveau/devinit: tidy up the subdev class definition

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/bar: tidy up the subdev and object class definitions
Ben Skeggs [Sun, 22 Dec 2013 15:51:16 +0000 (01:51 +1000)]
drm/nouveau/bar: tidy up the subdev and object class definitions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/instmem: tidy up the object class definition
Ben Skeggs [Sun, 22 Dec 2013 15:08:00 +0000 (01:08 +1000)]
drm/nouveau/instmem: tidy up the object class definition

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/instmem: tidy up the subdev class definition
Ben Skeggs [Sun, 22 Dec 2013 14:39:47 +0000 (00:39 +1000)]
drm/nouveau/instmem: tidy up the subdev class definition

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/pwr: implement a simple i2c stack
Ben Skeggs [Sat, 9 Nov 2013 01:58:13 +0000 (11:58 +1000)]
drm/nouveau/pwr: implement a simple i2c stack

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/pwr: have rd/wr32 routines clobber data instead of addr
Ben Skeggs [Wed, 11 Dec 2013 23:41:45 +0000 (09:41 +1000)]
drm/nouveau/pwr: have rd/wr32 routines clobber data instead of addr

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb: turn off some bits in 10f584 at init
Ben Skeggs [Tue, 3 Dec 2013 06:25:48 +0000 (16:25 +1000)]
drm/nve0/fb: turn off some bits in 10f584 at init

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: merge a fix from ddr3 for one of the timing settings
Ben Skeggs [Tue, 3 Dec 2013 05:40:18 +0000 (15:40 +1000)]
drm/nve0/fb/gddr5: merge a fix from ddr3 for one of the timing settings

Titan.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: yet another random 10f200 bit
Ben Skeggs [Tue, 3 Dec 2013 04:45:03 +0000 (14:45 +1000)]
drm/nve0/fb/gddr5: yet another random 10f200 bit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nvc0-/fb: hook up skeleton interrupt handler
Ben Skeggs [Tue, 3 Dec 2013 04:10:42 +0000 (14:10 +1000)]
drm/nvc0-/fb: hook up skeleton interrupt handler

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: more 10f200 stuff
Ben Skeggs [Tue, 3 Dec 2013 03:09:34 +0000 (13:09 +1000)]
drm/nve0/fb/gddr5: more 10f200 stuff

Seen on Titan.  NFI what the condition to switch this on is yet, and,
hardcoding it to on currently causes master to report unknown intr
with a mask of 0x08002000.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/clk: report ddr memory frequency
Ben Skeggs [Tue, 3 Dec 2013 01:44:34 +0000 (11:44 +1000)]
drm/nve0/clk: report ddr memory frequency

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/fb/gddr5: make sure we update mr7 when we're supposed to
Ben Skeggs [Tue, 3 Dec 2013 01:09:55 +0000 (11:09 +1000)]
drm/nouveau/fb/gddr5: make sure we update mr7 when we're supposed to

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: 10f698/69c
Ben Skeggs [Tue, 3 Dec 2013 00:44:43 +0000 (10:44 +1000)]
drm/nve0/fb/gddr5: 10f698/69c

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb: it's now safe to obey the memory voltage setting properly
Ben Skeggs [Mon, 2 Dec 2013 23:00:47 +0000 (09:00 +1000)]
drm/nve0/fb: it's now safe to obey the memory voltage setting properly

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb: multi-stage reclock is required for certain transitions
Ben Skeggs [Mon, 2 Dec 2013 22:51:59 +0000 (08:51 +1000)]
drm/nve0/fb: multi-stage reclock is required for certain transitions

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/clk: allow fb to signal it needs to do a multi-stage reclock
Ben Skeggs [Mon, 2 Dec 2013 22:25:04 +0000 (08:25 +1000)]
drm/nouveau/clk: allow fb to signal it needs to do a multi-stage reclock

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: parse bios data into struct rather than using directly
Ben Skeggs [Mon, 2 Dec 2013 03:43:09 +0000 (13:43 +1000)]
drm/nve0/fb/gddr5: parse bios data into struct rather than using directly

Still essentially a struct of magic values with magic names and unknown
purposes.  But, we will shortly need to be able to mix and match bits of
the previous and next configurations to do a transition reclock, as such,
we can no longer directly use the vbios data with any ease.

This is probably nicer anyway in the long run, for a few reasons.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: found LP3 setting
Ben Skeggs [Mon, 2 Dec 2013 02:00:33 +0000 (12:00 +1000)]
drm/nve0/fb/gddr5: found LP3 setting

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb: note the memory voltage toggle, not using it yet
Ben Skeggs [Sun, 1 Dec 2013 23:25:54 +0000 (09:25 +1000)]
drm/nve0/fb: note the memory voltage toggle, not using it yet

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: somewhat better attempt at 100770/10f604/610/614
Ben Skeggs [Sat, 30 Nov 2013 05:15:28 +0000 (15:15 +1000)]
drm/nve0/fb/gddr5: somewhat better attempt at 100770/10f604/610/614

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
fb/gddr5/nve0: 100770 is like 10f604

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: fixup delays a bit
Ben Skeggs [Sat, 30 Nov 2013 02:07:58 +0000 (12:07 +1000)]
drm/nve0/fb/gddr5: fixup delays a bit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/bios: timing 2.0 entries can have subentries
Ben Skeggs [Sat, 30 Nov 2013 01:40:55 +0000 (11:40 +1000)]
drm/nouveau/bios: timing 2.0 entries can have subentries

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: note another semi-unknown
Ben Skeggs [Thu, 28 Nov 2013 02:45:02 +0000 (12:45 +1000)]
drm/nve0/fb/gddr5: note another semi-unknown

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/fb/gddr5: modify mr8 with high bits of CL/WR
Ben Skeggs [Thu, 28 Nov 2013 02:37:56 +0000 (12:37 +1000)]
drm/nouveau/fb/gddr5: modify mr8 with high bits of CL/WR

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: fix calculation of RDQS setting
Ben Skeggs [Thu, 28 Nov 2013 02:34:13 +0000 (12:34 +1000)]
drm/nve0/fb/gddr5: fix calculation of RDQS setting

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: switch off some other random bit at some point
Ben Skeggs [Thu, 28 Nov 2013 02:23:52 +0000 (12:23 +1000)]
drm/nve0/fb/gddr5: switch off some other random bit at some point

As seen when comparing us vs nv on my GTX660

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: punt all 10f910/914 accesses through ram_train
Ben Skeggs [Thu, 28 Nov 2013 02:20:46 +0000 (12:20 +1000)]
drm/nve0/fb/gddr5: punt all 10f910/914 accesses through ram_train

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: not all memory partitions are created equal
Ben Skeggs [Wed, 27 Nov 2013 05:12:53 +0000 (15:12 +1000)]
drm/nve0/fb/gddr5: not all memory partitions are created equal

As seen when comparing us vs nv on my GTX660.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb: typo in register name
Ben Skeggs [Wed, 27 Nov 2013 03:26:00 +0000 (13:26 +1000)]
drm/nve0/fb: typo in register name

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/bios: make common code to handle ramcfg strap etc
Ben Skeggs [Wed, 27 Nov 2013 01:28:19 +0000 (11:28 +1000)]
drm/nouveau/bios: make common code to handle ramcfg strap etc

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: fix an assumption of sane memory controller layout
Ben Skeggs [Tue, 26 Nov 2013 05:39:15 +0000 (15:39 +1000)]
drm/nve0/fb/gddr5: fix an assumption of sane memory controller layout

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fb/gddr5: fix behaviour of lp3 setting
Ben Skeggs [Tue, 26 Nov 2013 04:31:18 +0000 (14:31 +1000)]
drm/nve0/fb/gddr5: fix behaviour of lp3 setting

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fifo: recover from mmu faults on bar1/bar3
Ben Skeggs [Thu, 9 Jan 2014 03:03:17 +0000 (13:03 +1000)]
drm/nve0/fifo: recover from mmu faults on bar1/bar3

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fifo: keep mmu fault interrupts enabled at all times
Ben Skeggs [Thu, 9 Jan 2014 02:30:43 +0000 (12:30 +1000)]
drm/nve0/fifo: keep mmu fault interrupts enabled at all times

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fifo: update human-readable mmu fault descriptions
Ben Skeggs [Wed, 8 Jan 2014 00:59:04 +0000 (10:59 +1000)]
drm/nve0/fifo: update human-readable mmu fault descriptions

Ordering from Android GK20A driver, names from binary driver strings.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fifo: document more intr status bits
Ben Skeggs [Tue, 7 Jan 2014 23:46:55 +0000 (09:46 +1000)]
drm/nve0/fifo: document more intr status bits

As per Android GK20A driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fifo: populate PBDMA status bitfield with more definitions
Ben Skeggs [Tue, 7 Jan 2014 23:06:17 +0000 (09:06 +1000)]
drm/nve0/fifo: populate PBDMA status bitfield with more definitions

As per Android GK20A driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fifo: s/subfifo/PBDMA/
Ben Skeggs [Tue, 7 Jan 2014 22:54:29 +0000 (08:54 +1000)]
drm/nve0/fifo: s/subfifo/PBDMA/

As per Android GK20A driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nve0/fifo: s/playlist/runlist/
Ben Skeggs [Tue, 7 Jan 2014 22:47:52 +0000 (08:47 +1000)]
drm/nve0/fifo: s/playlist/runlist/

As per Android GK20A driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nvf0/gr: enable acceleration with our chsw ucode
Ben Skeggs [Tue, 10 Dec 2013 04:26:31 +0000 (14:26 +1000)]
drm/nvf0/gr: enable acceleration with our chsw ucode

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv108/gr: enable acceleration with our chsw ucode
Ben Skeggs [Mon, 9 Dec 2013 23:18:31 +0000 (09:18 +1000)]
drm/nv108/gr: enable acceleration with our chsw ucode

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nvc0-/gr: handle fwmthd interrupts in ucode
Ben Skeggs [Tue, 10 Dec 2013 04:08:10 +0000 (14:08 +1000)]
drm/nvc0-/gr: handle fwmthd interrupts in ucode

Compute code in mesa triggers one of these, hanging the engine.  Let's
at least ack the request for now to avoid the hang.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nvc0-/gr: fiddle some magic around strand init
Ben Skeggs [Tue, 10 Dec 2013 01:05:41 +0000 (11:05 +1000)]
drm/nvc0-/gr: fiddle some magic around strand init

Fixes HUB_INIT timeout on GK110/GK208 when not using NVIDIA's ucode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv108/gr: initial support (need external fuc)
Ben Skeggs [Tue, 5 Nov 2013 04:49:49 +0000 (14:49 +1000)]
drm/nv108/gr: initial support (need external fuc)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv108/ce: enable copy engines
Ben Skeggs [Tue, 5 Nov 2013 04:39:24 +0000 (14:39 +1000)]
drm/nv108/ce: enable copy engines

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv108/fifo: initial support
Ben Skeggs [Tue, 5 Nov 2013 04:36:45 +0000 (14:36 +1000)]
drm/nv108/fifo: initial support

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nvf0/gr: remove a copy+pasto in ctx reglist
Ben Skeggs [Thu, 5 Dec 2013 22:25:22 +0000 (08:25 +1000)]
drm/nvf0/gr: remove a copy+pasto in ctx reglist

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nvc0-/gr: bring in some macros to abstract falcon isa differences
Ben Skeggs [Fri, 6 Dec 2013 04:12:34 +0000 (14:12 +1000)]
drm/nvc0-/gr: bring in some macros to abstract falcon isa differences

Need. A. Compiler...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/falcon: use vmalloc to create firwmare copies
Ilia Mirkin [Sat, 7 Dec 2013 16:42:19 +0000 (11:42 -0500)]
drm/nouveau/falcon: use vmalloc to create firwmare copies

Some firmware images may be large (64K), so using kmalloc memory is
inappropriate for them. Use vmalloc instead, to avoid high-order
allocation failures.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: stable@vger.kernel.org
10 years agodrm/nouveau/gem: remove (now) unneeded pre-validate fence sync
Ben Skeggs [Fri, 22 Nov 2013 00:44:28 +0000 (10:44 +1000)]
drm/nouveau/gem: remove (now) unneeded pre-validate fence sync

Now that nouveau_bo.c can handle sync when it actually needs to, we can
remove this and avoid a double semaphore acquire when syncing in the
command submission path.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/ttm: explicitly wait for bo idle before memcpy buffer move
Ben Skeggs [Fri, 22 Nov 2013 00:52:54 +0000 (10:52 +1000)]
drm/nouveau/ttm: explicitly wait for bo idle before memcpy buffer move

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/ttm: explicity sync with kernel channel before moving buffer
Ben Skeggs [Fri, 22 Nov 2013 00:39:57 +0000 (10:39 +1000)]
drm/nouveau/ttm: explicity sync with kernel channel before moving buffer

The GEM code handles this currently, but that'll be removed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/ttm: tidy up creation of temporary buffer move vmas
Ben Skeggs [Fri, 22 Nov 2013 00:35:25 +0000 (10:35 +1000)]
drm/nouveau/ttm: tidy up creation of temporary buffer move vmas

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv04/plane: add support for nv04/nv05 video overlay
Ilia Mirkin [Fri, 15 Nov 2013 16:26:45 +0000 (11:26 -0500)]
drm/nv04/plane: add support for nv04/nv05 video overlay

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv10/plane: add YUYV support
Ilia Mirkin [Fri, 15 Nov 2013 16:26:44 +0000 (11:26 -0500)]
drm/nv10/plane: add YUYV support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nv50-: map TTM_PL_SYSTEM through a BAR for CPU access
Maarten Lankhorst [Tue, 12 Nov 2013 12:34:09 +0000 (13:34 +0100)]
drm/nv50-: map TTM_PL_SYSTEM through a BAR for CPU access

Moves bo's to TTM_PL_TT for BAR mapping, to hide tiling from user.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau: fix m2mf copy to tiled gart
Maarten Lankhorst [Tue, 12 Nov 2013 12:34:08 +0000 (13:34 +0100)]
drm/nouveau: fix m2mf copy to tiled gart

Commit de7b7d59d54852c introduced tiled GART, but a linear copy is
still performed. This may result in errors on eviction, fix it by
checking tiling from memtype.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: stable@vger.kernel.org #3.10+
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/nouveau/vm: reduce number of entry-points to vm_map()
Ben Skeggs [Fri, 15 Nov 2013 01:56:49 +0000 (11:56 +1000)]
drm/nouveau/vm: reduce number of entry-points to vm_map()

Pretty much everywhere had to make the decision which to use, so it
makes a lot more sense to just have one entrypoint decide the path
to take instead.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
10 years agodrm/cirrus: correct register values for 16bpp
Takashi Iwai [Tue, 21 Jan 2014 22:34:51 +0000 (14:34 -0800)]
drm/cirrus: correct register values for 16bpp

When the mode is set with 16bpp on QEMU, the output gets totally broken.
The culprit is the bogus register values set for 16bpp, which was likely
copied from from a wrong place.

Addresses https://bugzilla.novell.com/show_bug.cgi?id=799216

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: David Airlie <airlied@linux.ie>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agodrm/nouveau: make vga_switcheroo code depend on VGA_SWITCHEROO
Jeff Mahoney [Tue, 21 Jan 2014 22:34:52 +0000 (14:34 -0800)]
drm/nouveau: make vga_switcheroo code depend on VGA_SWITCHEROO

Commit 8116188fdef594 ("nouveau/acpi: hook up to the MXM method for mux
switching.") broke the build on non-x86 architectures due to the new
dependency on MXM and MXM being an x86 platform driver.

It built previously since the vga switcheroo registration routines were
zereod out on !X86.  The code was built in but unused.

This patch makes all of the DSM code depend on CONFIG_VGA_SWITCHEROO,
allowing it to build on non-x86 and shrinking the module size as well.

[rdunlap@infradead.org: fix build eror when VGA_SWITCHEROO is not enabled]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agodrm/mgag200: on cards with < 2MB VRAM default to 16-bit
Dave Airlie [Tue, 21 Jan 2014 06:47:46 +0000 (01:47 -0500)]
drm/mgag200: on cards with < 2MB VRAM default to 16-bit

This aligns with what the userspace -mga driver does in
the same situation.

Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agodrm/i915: Allow reading the TIMESTAMP register on Gen8.
Kenneth Graunke [Tue, 21 Jan 2014 22:42:38 +0000 (14:42 -0800)]
drm/i915: Allow reading the TIMESTAMP register on Gen8.

Nothing's changed here; we just need to bump the generation check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agodrm/i915: Repeat evictions whilst pageflip completions are outstanding
Chris Wilson [Mon, 20 Jan 2014 10:17:37 +0000 (10:17 +0000)]
drm/i915: Repeat evictions whilst pageflip completions are outstanding

Since an old pageflip will keep its scanout buffer object pinned until
it has executed its unpin task on the common workqueue, we can clog up
our GGTT with stale pinned objects. As we cannot flush those workqueues
without dropping our locks, we have to resort to falling back to
userspace and telling them to repeat the operation in order to have a
chance to run our workqueues and free up the required memory. If we
fail, then we are forced to report ENOSPC back to userspace causing the
operation to fail and best-case scenario is that it introduces temporary
corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jon Bloomfield <jon.bloomfield@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agodrm/i915: Wait for completion of pending flips when starved of fences
Chris Wilson [Mon, 20 Jan 2014 10:17:36 +0000 (10:17 +0000)]
drm/i915: Wait for completion of pending flips when starved of fences

On older generations (gen2, gen3) the GPU requires fences for many
operations, such as blits. The display hardware also requires fences for
scanouts and this leads to a situation where an arbitrary number of
fences may be pinned by old scanouts following a pageflip but before we
have executed the unpin workqueue. This is unpredictable by userspace
and leads to random EDEADLK when submitting an otherwise benign
execbuffer. However, we can detect when we have an outstanding flip and
so cause userspace to wait upon their completion before finally
declaring that the system is starved of fences. This is really no worse
than forcing the GPU to stall waiting for older execbuffer to retire and
release their fences before we can reallocate them for the next
execbuffer.

v2: move the test for a pending fb unpin to a common routine for
later reuse during eviction

Reported-and-tested-by: dimon@gmx.net
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73696
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jon Bloomfield <jon.bloomfield@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agodrm/i915: don't disable DP port after a failed link training
Imre Deak [Fri, 17 Jan 2014 13:46:43 +0000 (15:46 +0200)]
drm/i915: don't disable DP port after a failed link training

Atm after a failed link training we disable the DP port. This can happen
during a modeset-enable or a DP link re-establishment. The latter can be
a problem and we shouldn't disable the DP port, see the previous patch for
the reasoning. In the former case the right thing would be to disable
the DP port, but also the rest of the pipe.

As a stop-gap solution leave the DP port enabled in both cases. It is an
improvement on its own (avoiding HW lock ups) and the proper solution
for the first case requires a bigger change, so let's keep that on the
TODO list.

v2:
- fix explanation of change impact (Chris)

Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agodrm/i915: don't disable the DP port if the link is lost
Imre Deak [Thu, 16 Jan 2014 16:35:57 +0000 (18:35 +0200)]
drm/i915: don't disable the DP port if the link is lost

Currently if the DP link is lost (either because of a hot unplug, or
failed link status check) we disable the DP port, but leave the rest
of the pipe running. This is incompatible with the modeset disabling
sequence of some platforms/configurations. At least this is the case for
DP ports on the CPU as opposed to PCH.

Atm we'll also get a warning when we do a modeset disable after the
above link lost event, since we expect the DP port to be enabled at this
point (see the bugzilla ticket for the related dmesg).

Note that with this patch we'll still end up disabling the port, thanks
to the HPD uevent and subsequent modeset disable.

See also the next patch fixing the other half of this issue.

Solution suggested by Ville.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70570
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>