dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

8985 Commits

Author SHA1 Message Date
Marek Olšák c18b117049 drm/radeon: allow FP16 color clear registers on r500
Probably not a candidate for stable kernels because of conflicts
in DRM versioning.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-15 09:07:12 -05:00
Alex Deucher 19fc42ed99 drm/radeon: clear reset flags if engines are idle
Fixes a hard lock in the gpu reset code after the
rework for DMA support (0ecebb9e0d
"drm/radeon: switch to a finer grained reset for evergreen")
due to not bailing before the MC shutdown if the relevant engines
are idle.

Discussion:
http://lists.freedesktop.org/archives/dri-devel/2013-January/032985.html

Reported-by: Eldad Zack <eldad@fogrefinery.com>
Tested-by: Eldad Zack <eldad@fogrefinery.com>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-15 09:06:38 -05:00
Chris Wilson 0f3b6849dd drm/i915: Record DERRMR, FORCEWAKE and RING_CTL in error-state
These are useful for investigating hangs involving WAIT_FOR_EVENT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Apply a droplet of Future-Proof in the if-ladder.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-15 13:34:57 +01:00
Hans de Goede 7b4cf994e4 udldrmfb: udl_get_edid: drop unneeded i--
This is a left-over from when udl_get_edid returned the amount of bytes
successfully read, which it no longer does.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-14 08:45:27 +10:00
Hans de Goede 242187b362 udldrmfb: udl_get_edid: usb_control_msg buffer must not be on the stack
The buffer passed to usb_control_msg may end up in scatter-gather list, and
may thus not be on the stack. Having it on the stack usually works on x86, but
not on other archs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-14 08:44:33 +10:00
Hans de Goede c930812fe5 udldrmfb: Fix EDID not working with monitors with EDID extension blocks
udldrmfb only reads the main EDID block, and if that advertises extensions
the drm_edid code expects them to be present, and starts reading beyond the
buffer udldrmfb passes it.

Although it may be possible to read more EDID info with the udl we simpy don't
know how, and even if trial and error gets it working on one device, that is
no guarantee it will work on other revisions. So this patch does a simple fix
in the form of patching the EDID info to report 0 extension blocks, this
fixes udldrmfb only doing 1024x768 on monitors with EDID extension blocks.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-14 08:44:02 +10:00
Dave Airlie 7d00813f68 Merge branch 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next
Fixes for UMS mode which has been broken for a while plus an rn50 fix
and a dma fix.

* 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux:
  radeon/kms: fix dma relocation checking
  radeon/kms: force rn50 chip to always report connected on analog output
  drm/radeon: fix error path in kpage allocation
  drm/radeon: fix a bogus kfree
  drm/radeon: fix NULL pointer dereference in UMS mode
2013-01-14 08:16:54 +10:00
Dave Airlie 94bc70a8e7 Merge branch 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
Regression fixes since rework mostly.

* 'drm-nouveau-fixes' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nvc0/fb: fix crash when different mutex is used to protect same list
  drm/nouveau/clock: fix support for more than 2 monitors on nve0
  drm/nv50/disp: fix selection of bios script for analog outputs
  drm/nv17-50: restore fence buffer on resume
  drm/nouveau: fix blank LVDS screen regression on pre-nv50 cards
  drm/nouveau: fix nouveau_client allocation failure path
  drm/nouveau: don't return freed object from nouveau_handle_create
  drm/nouveau/vm: fix memory corruption when pgt allocation fails
  drm/nouveau: add locking around instobj list operations
  drm/nouveau: do not forcibly power on lvds panels
  drm/nouveau/devinit: ensure legacy vga control is enabled during post
2013-01-14 08:15:36 +10:00
Aleksi Torhamo 43f789792e drm/nvc0/fb: fix crash when different mutex is used to protect same list
Fixes regression introduced in commit 861d2107
"drm/nouveau/fb: merge fb/vram and port to subdev interfaces"

nv50_fb_vram_{new,del} functions were changed to use
nouveau_subdev->mutex instead of the old nouveau_mm->mutex.
nvc0_fb_vram_new still uses the nouveau_mm->mutex, but nvc0 doesn't
have its own fb_vram_del function, using nv50_fb_vram_del instead.
Because of this, on nvc0 a different mutex ends up being used to protect
additions and deletions to the same list.

This patch is a -stable candidate for 3.7.

Signed-off-by: Aleksi Torhamo <aleksi@torhamo.net>
Reported-by: Roy Spliet <r.spliet@student.tudelft.nl>
Tested-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2013-01-13 18:07:46 +10:00
Aleksi Torhamo d19528a9e4 drm/nouveau/clock: fix support for more than 2 monitors on nve0
Fixes regression introduced in commit 70790f4f
"drm/nouveau/clock: pull in the implementation from all over the place"

When code was moved from nv50_crtc_set_clock to nvc0_clock_pll_set,
the PLLs it is used for got limited to only the first two VPLLs.

nv50_crtc_set_clock was only called to change VPLLs, so it didn't
limit what it was used for in any way. Since nvc0_clock_pll_set is
used for all PLLs, it has to specify which PLLs the code is used for,
and only listed the first two VPLLs.

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

This patch is a -stable candidate for 3.7.

Signed-off-by: Aleksi Torhamo <aleksi@torhamo.net>
Tested-by: Aleksi Torhamo <aleksi@torhamo.net>
Tested-by: Sean Santos <quantheory@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2013-01-13 18:07:46 +10:00
Marcin Slusarz c684cef795 drm/nv50/disp: fix selection of bios script for analog outputs
Analog output number was overwritten by value from digital output path.
Fix it.

Fixes resume from s2ram: https://bugs.freedesktop.org/show_bug.cgi?id=58729
(as stumbled on by J Binder, Pontus Fuchs and me)
Fixes blank screen on module load (reported by Sune Mølgaard).

Fixes regression from commit 186ecad21c
("drm/nv50/disp: move remaining interrupt handling into core").

Reported-by: J Binder <wheel@herr-der-mails.de>
Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Reported-by: Sune Mølgaard <sune@molgaard.org>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Sune Mølgaard <sune@molgaard.org>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-01-13 18:07:45 +10:00
Marcin Slusarz f20ebd034e drm/nv17-50: restore fence buffer on resume
Since commit 5e120f6e4b "drm/nouveau/fence:
convert to exec engine, and improve channel sync" nouveau fence sync
implementation for nv17-50 and nvc0+ started to rely on state of fence buffer
left by previous sync operation. But as pinned bo's (where fence state is
stored) are not saved+restored across suspend/resume, we need to do it
manually.

nvc0+ was fixed by commit d6ba6d215a
"drm/nvc0/fence: restore pre-suspend fence buffer context on resume".

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

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2013-01-13 18:07:45 +10:00
Marcin Slusarz 92441b2263 drm/nouveau: fix blank LVDS screen regression on pre-nv50 cards
Commit 2a44e499 ("drm/nouveau/disp: introduce proper init/fini, separate
from create/destroy") started to call display init routines on pre-nv50
hardware on module load. But LVDS init code sets driver state in a way
which prevents modesetting code from operating properly.

nv04_display_init calls nv04_dfp_restore, which sets encoder->last_dpms to
NV_DPMS_CLEARED.

drm_crtc_helper_set_mode
  nv04_dfp_prepare
    nv04_lvds_dpms(DRM_MODE_DPMS_OFF)

nv04_lvds_dpms checks last_dpms mode (which is NV_DPMS_CLEARED) and wrongly
assumes it's a "powersaving mode", the new one (DRM_MODE_DPMS_OFF) is too,
so it skips calling some crucial lvds scripts.

Reported-by: Chris Paulson-Ellis <chris@edesix.com>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2013-01-13 18:07:45 +10:00
Marcin Slusarz dd5700ea98 drm/nouveau: fix nouveau_client allocation failure path
Depending on the point of failure, freed object would be returned
or memory leak would happen.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-01-13 18:07:44 +10:00
Marcin Slusarz 82c805abb2 drm/nouveau: don't return freed object from nouveau_handle_create
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-01-13 18:07:41 +10:00
Marcin Slusarz cfd376b6bf drm/nouveau/vm: fix memory corruption when pgt allocation fails
If we return freed vm, nouveau_drm_open will happily call nouveau_cli_destroy,
which will try to free it again.

Reported-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-01-13 18:07:40 +10:00
Marcin Slusarz 4c4101d29f drm/nouveau: add locking around instobj list operations
Fixes memory corruptions, oopses, etc. when multiple gpuobjs are
simultaneously created or destroyed.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2013-01-13 18:07:40 +10:00
Ben Skeggs 1a1841d300 drm/nouveau: do not forcibly power on lvds panels
This fix was put in place to fix a bug where the eDP panel on certain
laptops fails to respond over the aux channel after suspend.

It appears that on some systems (Dell M6600, with LVDS panel) there's a
very bad interaction with the eDP init table that causes the SOR to get
very confused and not drive the panel correctly, leading to bleed.

A DPMS off/on cycle is enough to bring it back, but, this will avoid the
problem by not touching the panel GPIOs at times we're not meant to.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-01-13 18:07:32 +10:00
Ben Skeggs 4459146deb drm/nouveau/devinit: ensure legacy vga control is enabled during post
Fixes ACPI backlight control after suspend on some systems.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-01-13 17:59:29 +10:00
Jerome Glisse 9305ede6af radeon/kms: fix dma relocation checking
We were checking the index against the size of the relocation buffer
instead of against the last index. This fix kernel segfault when
userspace submit ill formated command stream/relocation buffer pair.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-10 17:05:38 -05:00
Jerome Glisse 51861d4eeb radeon/kms: force rn50 chip to always report connected on analog output
Those rn50 chip are often connected to console remoting hw and load
detection often fails with those. Just don't try to load detect and
report connect.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-01-10 17:05:37 -05:00
Ilija Hadzic 25d8999780 drm/radeon: fix error path in kpage allocation
Index into chunks[] array doesn't look right.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-10 17:05:36 -05:00
Ilija Hadzic a6b7e1a02b drm/radeon: fix a bogus kfree
parser->chunks[.].kpage[.] is not always kmalloc-ed
by the parser initialization, so parser_fini should
not try to kfree it if it didn't allocate it.

This patch fixes a kernel oops that can be provoked
in UMS mode.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-10 17:05:36 -05:00
Ilija Hadzic ff4bd08277 drm/radeon: fix NULL pointer dereference in UMS mode
In UMS mode parser->rdev is NULL, so dereferencing
will cause an oops.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-10 17:05:35 -05:00
Dave Airlie 82ba789f48 Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel
Daniel writes:
"Pretty much all just major fixes:
- 2 pieces of duct-tape for the ilk bug.
- Sprite regression fixes from Chris.
- OOPS fix for a div-by-zero from Chris, regression due to the modeset
  rework in 3.7, now brought to light by a benign change in 3.8.
- Fix interrupted bo pinning, used to work around CS coherency issues on
  i830/i845 (kernel also has a w/a newly in 3.8, but pinning is more efficient if
  possible)."
2013-01-11 07:52:48 +10:00
Daniel Vetter 93927ca52a drm/i915: Revert shrinker changes from "Track unbound pages"
This partially reverts

commit 6c085a728c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Aug 20 11:40:46 2012 +0200

    drm/i915: Track unbound pages

Closer inspection of that patch revealed a bunch of unrelated changes
in the shrinker:
- The shrinker count is now in pages instead of objects.
- For counting the shrinkable objects the old code only looked at the
  inactive list, the new code looks at all bounds objects (including
  pinned ones). That is obviously in addition to the new unbound list.
- The shrinker cound is no longer scaled with
  sysctl_vfs_cache_pressure. Note though that with the default tuning
  value of vfs_cache_pressue = 100 this doesn't affect the shrinker
  behaviour.
- When actually shrinking objects, the old code first dropped
  purgeable objects, then normal (inactive) objects. Only then did it,
  in a last-ditch effort idle the gpu and evict everything. The new
  code omits the intermediate step of evicting normal inactive
  objects.

Safe for the first change, which seems benign, and the shrinker count
scaling, which is a bit a different story, the endresult of all these
changes is that the shrinker is _much_ more likely to fall back to the
last-ditch resort of idling the gpu and evicting everything.  The old
code could only do that if something else evicted lots of objects
meanwhile (since without any other changes the nr_to_scan will be
smaller than the object count).

Reverting the vfs_cache_pressure behaviour itself is a bit bogus: Only
dentry/inode object caches should scale their shrinker counts with
vfs_cache_pressure. Originally I've had that change reverted, too. But
Chris Wilson insisted that it's too bogus and shouldn't again see the
light of day.

Hence revert all these other changes and restore the old shrinker
behaviour, with the minor adjustment that we now first scan the
unbound list, then the inactive list for each object category
(purgeable or normal).

A similar patch has been tested by a few people affected by the gen4/5
hangs which started to appear in 3.7, which some people bisected to
the "drm/i915: Track unbound pages" commit. But just disabling the
unbound logic alone didn't change things at all.

Note that this patch doesn't fix the referenced bugs, it only hides
the underlying bug(s) well enough to restore pre-3.7 behaviour. The
key to achieve that is to massively reduce the likelyhood of going
into a full gpu stall and evicting everything.

v2: Reword commit message a bit, taking Chris Wilson's comment into
account.

v3: On Chris Wilson's insistency, do not reinstate the rather bogus
vfs_cache_pressure change.

Tested-by: Greg KH <gregkh@linuxfoundation.org>
Tested-by: Dave Kleikamp <dave.kleikamp@oracle.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=55984
References: https://bugs.freedesktop.org/show_bug.cgi?id=57122
References: https://bugs.freedesktop.org/show_bug.cgi?id=56916
References: https://bugs.freedesktop.org/show_bug.cgi?id=57136
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-10 18:02:44 +01:00
Chris Wilson ca320ac456 drm/i915: Use pixel size for computing linear offsets into a sprite
This fixes an original bug in the sprite code that miscomputed the
source offset into a linear YUV packed framebuffer, that was magnified
into an oops with

commit 5a35e99e81
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Fri Oct 26 18:20:12 2012 +0100

    drm/i915: adjust sprite base address

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-09 14:20:24 +01:00
Linus Torvalds ca5c8a4c2a Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm update from Dave Airlie:
 "Exynos and Radeon mostly, with a dma-buf and ttm fix thrown in.

  It's a bit big but its mostly exynos license fix ups and I'd rather
  not hold those up since its legally stuff.

  Radeon has a couple of fixes from dma engine work, TTM is just a
  locking fix, and dma-buf fix has been hanging around and I finally got
  a chance to review it."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (30 commits)
  drm/ttm: fix fence locking in ttm_buffer_object_transfer
  drm/prime: drop reference on imported dma-buf come from gem
  drm/radeon: add quirk for d3 delay during switcheroo poweron for apple macbooks
  drm/exynos: move finish page flip to a common place
  drm/exynos: fimd: modify condition in fimd resume
  drm/radeon: fix DMA CS parser for r6xx linear copy packet
  drm/radeon: split r6xx and r7xx copy_dma functions
  drm/exynos: Use devm_clk_get in exynos_drm_gsc.c
  drm/exynos: Remove redundant NULL check in exynos_drm_gsc.c
  drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_gsc.c
  drm/exynos: Use devm_clk_get in exynos_drm_rotator.c
  drm/exynos: Remove redundant NULL check in exynos_drm_rotator.c
  drm/exynos: Remove unnecessary devm_* freeing APIs in exynos_drm_rotator.c
  drm/exynos: Use devm_clk_get in exynos_drm_fimc.c
  drm/exynos: Remove redundant NULL check
  drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_fimc.c
  drm/exynos: Use devm_kzalloc in exynos_drm_ipp.c
  drm/exynos: fix gem buffer allocation type checking
  drm/exynos: remove needless parenthesis.
  drm/exynos: fix incorrect interrupt induced by m2m operation.
  ...
2013-01-08 16:08:10 -08:00
Chris Wilson c16ed4be4c drm/i915: Add DEBUG messages to all intel_create_user_framebuffer error paths
This proves to be very useful when investigating why code suddenly
started failing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-08 17:55:41 +01:00
Chris Wilson cc7ebb2892 drm/i915: The sprite scaler on Ironlake also support YUV planes
This fixes a regression from

commit 57779d0636
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Wed Oct 31 17:50:14 2012 +0200

    drm/i915: Fix display pixel format handling

(which even says that they are supported on Ironlake, and then promptly
rejects then...)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-08 12:06:49 +01:00
Chris Wilson 901593f2bf drm: Only evict the blocks required to create the requested hole
Avoid clobbering adjacent blocks if they happen to expire earlier and
amalgamate together to form the requested hole.

In passing this fixes a regression from
commit ea7b1dd448
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Feb 18 17:59:12 2011 +0100

    drm: mm: track free areas implicitly

which swaps the end address for size (with a potential overflow) and
effectively causes the eviction code to clobber almost all earlier
buffers above the evictee.

v2: Check the original hole not the adjusted as the coloring may confuse
us when later searching for the overlapping nodes. Also make sure that
we do apply the range restriction and color adjustment in the same
order for both scanning, searching and insertion.

v3: Send the version that was actually tested.

Note that this seems to be ducttape of decent quality ot paper over
some of our unbind related gpu hangs reported since 3.7. It is not
fully effective though, and certainly doesn't fix the underlying bug.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
[danvet: Added note plus bugzilla link and tested-by.]
Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55984
Tested-by:  Norbert Preining <preining@logic.at>
Acked-by: Dave Airlie <airlied@gmail.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-08 11:52:02 +01:00
Daniel Vetter e8e89622ed drm/ttm: fix fence locking in ttm_buffer_object_transfer
Noticed while reviewing the fence locking in the radeon pageflip
handler.

v2: Instead of grabbing the bdev->fence_lock in object_transfer just
move the single callsite of that function a few lines, so that it is
protected by the fence_lock. Suggested by Jerome Glisse.

v3: Fix typo in commit message.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-08 18:35:31 +10:00
Dave Airlie c75be2592c Merge branch 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next
Alex writes:
 A few more fixes for DMA and a mac quirk.

* 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: add quirk for d3 delay during switcheroo poweron for apple macbooks
  drm/radeon: fix DMA CS parser for r6xx linear copy packet
  drm/radeon: split r6xx and r7xx copy_dma functions
2013-01-08 14:52:52 +10:00
Seung-Woo Kim be8a42ae60 drm/prime: drop reference on imported dma-buf come from gem
Increasing ref counts of both dma-buf and gem for imported dma-buf come from gem
makes memory leak. release function of dma-buf cannot be called because f_count
of dma-buf increased by importing gem and gem ref count cannot be decrease
because of exported dma-buf.

So I add dma_buf_put() for imported gem come from its own gem into each drivers
having prime_import and prime_export capabilities. With this, only gem ref
count is increased if importing gem exported from gem of same driver.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin.park <kyungmin.park@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rob Clark <rob.clark@linaro.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-08 14:41:53 +10:00
Chris Wilson 3490ea5de6 drm/i915: Treat crtc->mode.clock == 0 as disabled
Prevent a divide-by-zero by consistently treating an 'active' CRTC
without a mode set as actually disabled.

This looks to have been first introduced with

commit 2492935248
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Jul 2 20:28:59 2012 +0200

    drm/i915: read out the modeset hw state at load and resume time

but then combined with

commit b0a2658acb
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Dec 18 09:37:54 2012 +0100

    drm/i915: don't disable disconnected outputs

it finally started oopsing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-and-tested-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-07 17:40:19 +01:00
Maarten Lankhorst d1f9809ed1 drm/radeon: add quirk for d3 delay during switcheroo poweron for apple macbooks
vga-switcheroo with apple-gmux does not switch correctly on my system. The PCI
configuration space is not restored correctly, resulting in MSI not working after switch.

Only useful item in dmesg is:

[   33.922807] radeon 0000:01:00.0: Refused to change power state, currently in D3

I did some testing, dumping the difference in ms between first succesful switch
from D3 to D0, and it seems that there is slightly more than 20 ms difference when
the device is re-enabled through vga-switcheroo.

So bump the re-enable d3 delay to 20 ms to handle this, which fixes msi not working
on my system after switcheroo-ing. Default d3_delay value is PCI_PM_D3_WAIT, 10 ms.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-07 10:13:36 -05:00
Daniel Vetter 48e858340d Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13"
This reverts commit 9756fe38d1.

The bogus lvds output is actually a lvds->hdmi bridge, which we don't
really support. But unconditionally disabling it breaks some existing
setups.

Reported-by: John Tapsell <johnflux@gmail.com>
References: http://permalink.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/17237
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-07 10:30:54 +01:00
Chris Wilson 93be8788e6 drm/i915; Only increment the user-pin-count after successfully pinning the bo
As along the error path we do not correct the user pin-count for the
failure, we may end up with userspace believing that it has a pinned
object at offset 0 (when interrupted by a signal for example).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-07 10:30:53 +01:00
Rahul Sharma 663d876670 drm/exynos: move finish page flip to a common place
This patch implements the exynos_drm_crtc_finish_pageflip in
exynos_drm_crtc.c. This avoids the duplication of same code
in mixer, fimd and vidi.

Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Stephane Marchesin <marcheu@chromium.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-07 13:58:37 +09:00
Prathyush K 28998afa13 drm/exynos: fimd: modify condition in fimd resume
If fimd is runtime suspended (by DPMS OFF), fimd_suspend does not
call fimd_activate(false) and just returns. Similarily the check in
fimd_resume should not resume if previously runtime_suspended.
Instead the existing check does the opposite. So if fimd was not
runtime suspended, suspend will turn off fimd but resume will not turn
it on.  This patch fixes this issue by reversing the condition.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-07 13:49:02 +09:00
Linus Torvalds 256601421f Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull radeon and minor nouveau fixes from Dave Airlie:
 "Just a radeon pull from Alex, fixes a few regressions since 3.7 and
  reworks some of the reset handling, and two minor nouveau fixes I
  found on the list, Ben will be back next week to take care of the
  couple of larger nouveau patches that I see outstanding."

* 'drm-next' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau: fix init with agpgart-uninorth
  drm: nouveau: Fix build warning seen if HWMON is undefined
  drm/radeon: switch to a finer grained reset for SI (v2)
  drm/radeon: switch to a finer grained reset for cayman/TN
  drm/radeon: switch to a finer grained reset for evergreen
  drm/radeon: switch to a finer grained reset for r6xx/7xx
  drm/radeon: add GPU reset flags
  drm/radeon: fix typo in evergreen dma fence
  drm/radeon: Properly handle DDC probe for DP bridges
  drm/radeon: reset dma engine on gpu reset (v2)
  drm/radeon: print dma status reg on lockup (v2)
  drm/radeon: improve ring debugfs printing
  drm/radeon: add debugfs file for dma rings
  drm/radeon/r6xx: fix DMA engine for ttm bo transfers
  drm/radeon: add connector table for Mac G4 Silver
2013-01-04 10:29:01 -08:00
Alex Deucher a10fbb4224 drm/radeon: fix DMA CS parser for r6xx linear copy packet
Was using the r7xx format.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-04 12:25:46 -05:00
Alex Deucher 43fb778754 drm/radeon: split r6xx and r7xx copy_dma functions
- r6xx actually uses a slightly different packet format,
although both formats seem to work ok.
- r7xx doesn't have the count multiple of 2 limitation.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-04 09:29:54 -05:00
Sachin Kamat 5cbd419cc5 drm/exynos: Use devm_clk_get in exynos_drm_gsc.c
This eliminates the need for explicit clk_put and makes the
cleanup and exit path code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:35 +09:00
Sachin Kamat a8527cf5c3 drm/exynos: Remove redundant NULL check in exynos_drm_gsc.c
devm_request_and_ioremap API checks for NULL. Hence explicit
NULL check is not necessary. Saves some code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:35 +09:00
Sachin Kamat cfdee8f421 drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_gsc.c
devm_* APIs are device managed and get freed automatically when the
device detaches. Thus explicit freeing is not needed. This saves some
code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:35 +09:00
Sachin Kamat af8cd94613 drm/exynos: Use devm_clk_get in exynos_drm_rotator.c
This eliminates the need for explicit clk_put and makes the
cleanup and exit path code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:35 +09:00
Sachin Kamat df257a8db4 drm/exynos: Remove redundant NULL check in exynos_drm_rotator.c
devm_request_and_ioremap API checks for NULL. Hence explicit
NULL check is not necessary. Saves some code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:35 +09:00
Sachin Kamat 6eac74d1b1 drm/exynos: Remove unnecessary devm_* freeing APIs in exynos_drm_rotator.c
devm_* APIs are device managed and get freed automatically when the
device detaches. Thus explicit freeing is not needed. This saves some
code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:34 +09:00
Sachin Kamat 15b3263eb3 drm/exynos: Use devm_clk_get in exynos_drm_fimc.c
This eliminates the need for explicit clk_put and makes the
cleanup and exit path code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:34 +09:00
Sachin Kamat 3fb6922eae drm/exynos: Remove redundant NULL check
devm_request_and_ioremap API checks for NULL. Hence explicit
NULL check is not necessary. Saves some code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:34 +09:00
Sachin Kamat 87acdde56d drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_fimc.c
devm_* APIs are device managed and get freed automatically when the
device detaches. Thus explicit freeing is not needed. This saves some
code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:34 +09:00
Sachin Kamat bfb6ed2600 drm/exynos: Use devm_kzalloc in exynos_drm_ipp.c
devm_kzalloc makes the code simpler by eliminating the need for
explicit freeing.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:34 +09:00
Inki Dae 1dcfe2382a drm/exynos: fix gem buffer allocation type checking
This patch fixes gem buffer allocation type checking.
EXYNOS_BO_CONTIG has 0 so the checking should be fixed
to 'if (!(flags & EXYNOS_BO_NONCONTIG))'

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-01-04 15:54:34 +09:00
Eunchul Kim 13a32eb08d drm/exynos: remove needless parenthesis.
This patch removes needless parenthesis.
This was pointed out but in case of fimc side. we missed it.

Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:34 +09:00
Jinyoung Jeon e39d5ce132 drm/exynos: fix incorrect interrupt induced by m2m operation.
This patch fixes incorrect interrupt induced by m2m operation.
the m2m operation calls s/w reset every frame but there is the case that
the interrupt to m2m operation occures after s/w reset sometimes.
So this patch makes dma and capture operations stop at s/w reset
to avoid incorrect interrupt.

Signed-off-by: Jinyoung Jeon <jy0.jeon@samsung.com>
Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:33 +09:00
JoongMock Shin b5c0b5526a drm/exynos: remove color bar pattern operation.
This patch removes color bar pattern register because we don't use the register anymore.
because it doesn't support color bar feature for writeback operation.
camera driver only supports color bar feature. but IPP doesn't support camera driver.

Signed-off-by: JoongMock Shin <jmock.shin@samsung.com>
Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:33 +09:00
Eunchul Kim 6fe891f669 drm/exynos: correct some comments to abbreviation.
This patch cleanup corrects some comments to abbreviation.
We would like to prevent it stands misunderstood.

Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:33 +09:00
Eunchul Kim 5bbea0c41c drm/exynos: fix build warning.
This patch fixes erroneous register read.
reall function needs register base address + offset but
exynos_drm_gsc module used only offset to read a register.
so this patch uses gsc_read function instead of readl.

Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:33 +09:00
Eunchul Kim 4f21877cb8 drm/exynos: consider both case of vflip and hflip.
This patch considers both case of vflip and hflip.
If we want that the contents in buffer to be rotated to 180 degree,
then we can use h,vflip or 180 degree.

Changelog v2:
- added EXYNOS_DRM_FLIP_BOTH enum value to avoid build warnning.

Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:33 +09:00
Eunchul Kim 0ca824c7df drm/exynos: remove needless error handling to property.
This patch removes property error handling. because property couldn't be NULL.

Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:33 +09:00
Eunchul Kim 7259c3d6aa drm/exynos: change member variable name.
This patch change current command name from cmd to c_node.
because we are using the member name, 'cmd', for command control ioctl in another structure.
so, this patch changes it to c_node to avoid such confusing.

Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:33 +09:00
Inki Dae 694be45879 drm/exynos: consider buffer allocation without iommu
This patch fixes the issue that when buffer allocation is requested
without iommu, the allocation is failed.

Without iommu, dma_alloc_attrs function allocates some memory region
and returns cpu address so this patch makes the cpu address to be set
to buf->kvaddr correctly.

Changelog v2:
- fix buffer free
  . Without iommu, dma_free_attrs function requires kernel space address
    as argument. So it changes the argument, buf->pages to buf->kvaddr.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-01-04 15:54:32 +09:00
Inki Dae d81aecb5e6 drm/exynos: change file license to GPL
This patch changes file license to GPL

Most of exynos files had been copied from some random
file and not updated correctly. So this patch corrects
the file license.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-01-04 15:54:32 +09:00
Inki Dae c704f1b47d drm/exynos: consider no iommu support to console framebuffer
This patch considers no iommu support to kernel space mapping
of console framebuffer.

Without iommu, we get physical address instead of device address
after dma_alloc_attrs function is called. So we should consider
the case without iommu when it maps console framebuffer with
kernel space.

Changelog v2:
- calll vunmap function only with iommu support.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-01-04 15:54:32 +09:00
Seung-Woo Kim f4fd9bd486 drm/exynos: fix flags in dma buf exporting
This patch fixes flags passed to dma buf exporting.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin.park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-01-04 15:54:32 +09:00
Aaro Koskinen eda85d6ad4 drm/nouveau: fix init with agpgart-uninorth
Check that the AGP aperture can be mapped. This follows a similar change
done for Radeon (commit 365048ff, drm/radeon: AGP memory is only I/O if
the aperture can be mapped by the CPU.).

The patch fixes the following error seen on G5 iMac:

	nouveau E[     DRM] failed to create kernel channel, -12

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58806
Cc: stable@vger.kernel.org
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-04 16:04:33 +10:00
Guenter Roeck 57cdf82ce5 drm: nouveau: Fix build warning seen if HWMON is undefined
Fix:

nouveau_pm.c: In function ‘nouveau_hwmon_init’:
nouveau_pm.c:703:24: warning: unused variable ‘therm’ [-Wunused-variable]

Introduced by commit 095f979a (drm/nouveau/pm: fix build with HWMON off) which
fixed a build error but introduced a build warning.

Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-04 16:03:33 +10:00
Alex Deucher 06bc6df0df drm/radeon: switch to a finer grained reset for SI (v2)
No change in functionality as we currently set all the reset
flags.

v2: fix typo

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 21:29:35 -05:00
Alex Deucher 271d6fed65 drm/radeon: switch to a finer grained reset for cayman/TN
No change in functionality as we currently set all the reset
flags.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 21:29:14 -05:00
Alex Deucher 0ecebb9e0d drm/radeon: switch to a finer grained reset for evergreen
No change in functionality as we currently set all the reset
flags.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 21:28:49 -05:00
Alex Deucher 71e3d1578c drm/radeon: switch to a finer grained reset for r6xx/7xx
No change in functionality as we currently set all the reset
flags.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 21:28:24 -05:00
Alex Deucher ec46c76d50 drm/radeon: add GPU reset flags
The idea here is to move to a finer grained reset.
In some cases we may not need reset every block, and
in other cases we may not need to re-init the entire
asic.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 21:27:54 -05:00
Alex Deucher 4b681c2843 drm/radeon: fix typo in evergreen dma fence
SRBM write packet takes DW aligned registers.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 19:54:34 -05:00
Greg Kroah-Hartman 56550d94cb Drivers: gpu: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, and __devexit
from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03 15:57:15 -08:00
Niels Ole Salscheider 0a9069d349 drm/radeon: Properly handle DDC probe for DP bridges
DDC information can be accessed using AUX CH

Fixes failure to probe monitors on some systems with
DP bridge chips.

agd5f: minor fixes

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-01-03 15:04:38 -05:00
Jerome Glisse 64c56e8ce3 drm/radeon: reset dma engine on gpu reset (v2)
This try to reset the dma engine when performing gpu reset. Hopefully
bringing back the gpu dma engine in sane state.

v2: agd5f: fix dma reset on cayman/TN, add support for SI

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 13:18:41 -05:00
Jerome Glisse eaaa6983ab drm/radeon: print dma status reg on lockup (v2)
To help debug dma related lockup.

v2: agd5f: update SI as well

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 13:18:41 -05:00
Jerome Glisse 4d0091904c drm/radeon: improve ring debugfs printing
Print 32dword before last know rptr as problem most likely comes
from previous command. Also small cosmetic change to the printing.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 13:18:40 -05:00
Jerome Glisse 74795486b2 drm/radeon: add debugfs file for dma rings
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 13:18:39 -05:00
Alex Deucher 909d9eb67f drm/radeon/r6xx: fix DMA engine for ttm bo transfers
count must be a multiple of 2. Fixes crashes on
R6xx chips reported by a number of people.

Cc: Borislav Petkov <bp@alien8.de>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Tested-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-03 13:17:31 -05:00
Alex Deucher cafa59b901 drm/radeon: add connector table for Mac G4 Silver
Apple cards do not provide data tables in the vbios
so we have to hard code the connector parameters
in the driver.

Reported-by: Albrecht Dreß <albrecht.dress@arcor.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-01-03 10:16:11 -05:00
Dave Airlie d5757dbe79 Revert "drm: tegra: protect DC register access with mutex"
This reverts commit 83c0bcb694.

Lucas pointed out this was a mistake, and I missed the discussion,
so just revert it out to save a rebase.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-30 21:58:20 +10:00
Lucas Stach 500df2e5d8 drm: tegra: program only one window during modeset
The intention is to program exactly WIN_A, not WIN_A and possibly
others.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-30 14:01:35 +10:00
Lucas Stach e39250aa52 drm: tegra: clean out old gem prototypes
There is no gem.c anymore, those functions are implemented by the
drm_cma_helpers now.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-30 14:01:34 +10:00
Lucas Stach fa416ddc0a drm: tegra: remove redundant tegra2_tmds_config entry
The 720p and 1080p entries are completely redundant, as we are matching
the table entries against <=pclk.
Also generalize the comment, as we are using those table entries even
when driving other modes than the standard TV ones.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-30 14:01:33 +10:00
Lucas Stach 83c0bcb694 drm: tegra: protect DC register access with mutex
Window properties are programmed through a shared aperture and have to
happen atomically. Also we do the read-update-write dance on some of the
shared regs.
To make sure that different functions don't stumble over each other
protect the register access with a mutex.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-30 14:01:33 +10:00
Lucas Stach 4026bfb39a drm: tegra: don't leave clients host1x member uninitialized
No real problem for now, as nothing is using this, but leaving it
unitialized is asking for trouble later on.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-30 14:01:32 +10:00
Lucas Stach 4049508988 drm: tegra: fix front_porch <-> back_porch mixup
Fixes wrong picture offset observed when using HDMI output with a
Technisat HD TV.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Mark Zhang <markz@nvidia.com>
Tested-by: Mark Zhang <markz@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-30 14:01:31 +10:00
Dave Airlie 8be0e5c427 Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
Some fixes for 3.8:
- Watermark fixups from Chris Wilson (4 pieces).
- 2 snb workarounds, seem to be recently added to our internal DB.
- workaround for the infamous i830/i845 hang, seems now finally solid!
  Based on Chris' fix for SNA, now also for UXA/mesa&old SNA.
- Some more fixlets for shrinker-pulls-the-rug issues (Chris&me).
- Fix dma-buf flags when exporting (you).
- Disable the VGA plane if it's enabled on lid open - similar fix in
  spirit to the one I've sent you last weeek, BIOS' really like to mess
  with the display when closing the lid (awesome debug work from Krzysztof
  Mazur).

* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: disable shrinker lock stealing for create_mmap_offset
  drm/i915: optionally disable shrinker lock stealing
  drm/i915: fix flags in dma buf exporting
  i915: ensure that VGA plane is disabled
  drm/i915: Preallocate the drm_mm_node prior to manipulating the GTT drm_mm manager
  drm: Export routines for inserting preallocated nodes into the mm manager
  drm/i915: don't disable disconnected outputs
  drm/i915: Implement workaround for broken CS tlb on i830/845
  drm/i915: Implement WaSetupGtModeTdRowDispatch
  drm/i915: Implement WaDisableHiZPlanesWhenMSAAEnabled
  drm/i915: Prefer CRTC 'active' rather than 'enabled' during WM computations
  drm/i915: Clear self-refresh watermarks when disabled
  drm/i915: Double the cursor self-refresh latency on Valleyview
  drm/i915: Fixup cursor latency used for IVB lp3 watermarks
2012-12-30 13:54:12 +10:00
Dave Airlie b1d778b970 Merge branch 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next
Misc fixes for reset and new packets for userspace usage.

* 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: add WAIT_UNTIL to evergreen VM safe reg list
  drm/radeon: add support for MEM_WRITE packet
  drm/radeon: restore modeset late in GPU reset path
  drm/radeon: avoid deadlock in pm path when waiting for fence
  drm/radeon: don't leave fence blocked process on failed GPU reset
2012-12-30 13:02:48 +10:00
Ben Skeggs eca15296a9 drm/nve0/graph: fix fuc, and enable acceleration on all known chipsets
Also adds GK106 to chipsets known by ucode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:32 +10:00
Ben Skeggs 902530693e drm/nvc0/graph: fix fuc, and enable acceleration on GF119
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:31 +10:00
Ben Skeggs 5ddf4d4a54 drm/nouveau/bios: cache ramcfg strap on later chipsets
This fixes suspend/resume on at least Quadro 400.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:30 +10:00
Ben Skeggs 3d8ec27739 drm/nouveau/mxm: silence output if no bios data
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:29 +10:00
Ben Skeggs 0dd660d4ab drm/nouveau/bios: parse/display extra version component
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:28 +10:00
Ben Skeggs 1ed731668d drm/nouveau/bios: implement opcode 0xa9
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:28 +10:00
Ben Skeggs d2bcea686f drm/nouveau/bios: update gpio parsing apis to match current design
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:27 +10:00
Ben Skeggs caba557020 drm/nouveau: initial support for GK106
Modesetting seems to work alright, as does graphics (using binary driver
fuc from nve7...).

Lots to be done no doubt, but this'll get an image on the screen for
people.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-12-23 22:59:26 +10:00
Alex Deucher 668bbc81ba drm/radeon: add WAIT_UNTIL to evergreen VM safe reg list
It's used in a recent mesa commit:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=24b1206ab2dcd506aaac3ef656aebc8bc20cd27a
and there may be some other cases in the future where it's required.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Cc: stable@vger.kernel.org
2012-12-21 11:12:39 -05:00