Commit graph

335893 commits

Author SHA1 Message Date
Marcin Slusarz d432a2db7d drm/nv50: decode PGRAPH status registers on TLB flush fail
SIgned-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:35 +10:00
Viktor Novotný 1f2285d462 drm/nouveau/clk: fix crystal frequency retrieval on nv25
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:35 +10:00
Marcin Slusarz fced4b2211 drm/nouveau: remove unused variable from nouveau_bios_shadow_of
drivers/gpu/drm/nouveau/core/subdev/bios/base.c: warning: unused variable 'i'

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:34 +10:00
Ben Skeggs 7ef19e454e drm/nv40/fb: use an actual compressed zeta format
SPLIT is apparently just that, and only splits Z and S components.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:34 +10:00
Ben Skeggs d7da62845b drm/nv30/fb: enable z compression
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:33 +10:00
Ben Skeggs 2f1cb96d65 drm/nv40/fb: enable z compression
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:33 +10:00
Ben Skeggs fd3a522586 drm/nv20/fb: fixup compression tag allocation size
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:32 +10:00
Ben Skeggs fafa0cb37e drm/nv30-nv40/graph: poke zcomp regs from tile_prog hook
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:32 +10:00
Ben Skeggs e1344412ae drm/nv30-nv40/fb: call zcomp setup hook from tiling setup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:31 +10:00
Ben Skeggs dac1558d49 drm/nouveau/fb: create tag heap from common code for all relevant chipsets
A nv2x bug wrt hardcoded tag counts is now also fixed as a side-effect.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:31 +10:00
Ben Skeggs 268d5a3017 drm/nv30/fb: start bashing zcomp registers with 'disabled' (for now)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:30 +10:00
Ben Skeggs 7e0f992b79 drm/nouveau: replace some open-coded mm_initialised checks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:30 +10:00
Ben Skeggs 6d338081a6 drm/nouveau/fb: read TILE_BASE after writing it to avoid a hardware race
Apparently needed for turbocache nv4x chips at least, we'll just do it
everywhere...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:29 +10:00
Ben Skeggs 5f8e256704 drm/nv40/fb: start bashing zcomp registers on relevant chipsets
Always bashing "disabled" for now, actual compressing coming up...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:29 +10:00
Ben Skeggs 150ccf161f drm/nv30-nv40/fb: make use of bankoff for zeta buffers, where supported
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:28 +10:00
Ben Skeggs d33db63b37 drm/nv20/fb: fix zcomp register calculation on big-endian systems
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:28 +10:00
Ben Skeggs 4ae207453e drm/nv40/fb: split implementation into nv40/nv41/nv44/nv46/nv47/nv49/nv4e pieces
Wow, this is a nice complicated mess of build-your-own-mc blocks...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:27 +10:00
Ben Skeggs 11bac40708 drm/nv30/fb: split implementation into nv34(nv10)/nv30/nv35 pieces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:27 +10:00
Ben Skeggs a8749af1a0 drm/nv20/fb: split implementation into nv20/nv25 pieces
There's more stuff that can be shared in the constructor, will be merged
together again later.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:27 +10:00
Ben Skeggs 67e9e9f6ca drm/nouveau/fb: split tile and compression region handling
This is in preparation for extending the support to the remaining
chipsets, to allow for sharing more functions.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:26 +10:00
Ben Skeggs de2b8b8bbb drm/nouveau/bios: attempt to fetch entire acpi rom image in one shot
v2: fdo#55948 - the _ROM method silently truncates size to 4KiB, perform
    a checksum test and fall back to slow _ROM access on failure.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-11-29 09:56:26 +10:00
Daniel Vetter 28164fdad8 drm/doc: add new dp helpers into drm DocBook
I didn't bother with documenting the really trivial new "extract
something from dpcd" helpers, but the i2c over aux ch is now
documented a bit.

v2: Clarify the comment for i2c_dp_aux_add_bus a bit.

v3: Fix more spelling fail spotted by Laurent Pinchart.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:26:53 +10:00
Daniel Vetter d0ddc0338a drm/doc: integrate fb helper reference into docs
Again only minimal changes to make kerneldoc no longer shout. Plus a
little introduction in the form of a inline DOC: section to quickly
explain what this is all about.

v2: Fixup spelling fail.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:26:52 +10:00
Daniel Vetter 0d4ed4c8f9 drm/doc: integrate crtc helper api into docbook
- Add the missing doc for drm_helper_move_panel_connectors_to_head.
- Fixup any outdated stuff in existing sections. I've only looked at
  those kerneldoc headers that actually resulted in a complaint from
  the kerneldoc parser tool.

v2:
- Actually include the docbook snippet in the right patch.
- Fix spelling fail.

v3: It's now called drm_crtc_helper_set_mode, spotted by Laurent
Pinchart.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:19:58 +10:00
Daniel Vetter e4949f2974 drm/doc: Helpers are not a Midlayer!
I'm devoting all my wrath to that fight, so don't misname it ;-)

v2: Make it clear that this section talks about kms helpers.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:17:07 +10:00
Daniel Vetter 670c1ef650 drm/edid: tune down debug message in parse_hdmi_vsdb
Those tend to be totally not interesting for end-users, and for
debugging we tend to dump the entire noise anyway by enabling all
debug messages.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57388
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:15:12 +10:00
James Hogan dff98e529e drm: only build ati_pcigart if PCI enabled
Prevent ati_pcigart.c being built unless PCI is enabled. The exported
functions in this file are only used by drivers which depend on PCI
(namely r128 and radeon), and it tries to use PCI specific functions
(pci_unmap_page, pci_map_page, and pci_dma_mapping_error) that cause
compiler errors when PCI is disabled.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:12:29 +10:00
Thomas Hellstrom d08a9b9cd8 drm/vmwgfx: Tighten the security around buffer maps
Make sure that other DRM clients can't map the contents of
non-shareable buffer objects.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:09:08 +10:00
Thierry Reding 219e81536c drm: tegra: Add Tegra30 support
Add support for host1x, the display controllers and HDMI on the Tegra30
SoC.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Mark Zhang <markz@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:07:02 +10:00
Thierry Reding ac8f7c4894 drm: tegra: Use framebuffer pitch as line stride
Instead of using the stride derived from the display mode, use the pitch
associated with the currently active framebuffer. This fixes a bug where
the LCD display content would be skewed when enabling HDMI with a video
mode different from that of the LCD.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Mark Zhang <markz@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 20:05:46 +10:00
Thomas Hellstrom 82fe50bcc8 drm/ttm: Optimize vm locking using kref_get_unless_zero v3
Removes the need for a write lock each time we call ttm_bo_unref().

v2: Remove an unused variable.
v3: Really remove the unused variable.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 18:37:59 +10:00
Thomas Hellstrom 5293908afa drm/ttm: Use the hashtab _rcu interface for ttm_objects
Also move a kref_init() out of spinlocked region

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 18:36:15 +10:00
Thomas Hellstrom ae8df2ae8a drm/ttm: Fix locking in an error path
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 18:36:14 +10:00
Thomas Hellstrom 35f62a5829 drm/vmwgfx: Free user-space fence objects correctly
They need to be freed after an rcu grace period.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 18:36:12 +10:00
Thomas Hellstrom a82b8db02f kref: Add kref_get_unless_zero documentation
Document how kref_get_unless_zero should be used and how it helps
solve a typical kref / locking problem.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 18:36:06 +10:00
Thomas Hellstrom 384cc2f968 drm: Add a hash-tab rcu-safe API
While hashtab should now be RCU-safe, Add a drm_ht_xxx_api for consumers
to use to make it obvious what locking mechanism is used.

Document the way the rcu-safe interface should be used.

Don't use rcu-safe list traversal in modify operations where we should use
a spinlock / mutex anyway.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-28 18:36:05 +10:00
Paulo Zanoni 70b12bb415 drm/i915: promote Haswell to full support
Since it should be working a little bit better now.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-23 19:40:14 +01:00
Chris Wilson 6a9d51b768 drm/i915: Report the origin of the LVDS fixed panel mode
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
[danvet: resolve conflict around the call to intel_crtc_mode_get. And
add the missing NULL check Chris spotted while at it.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-22 22:16:03 +01:00
Chris Wilson 2aa4f09917 drm/i915: LVDS fallback to fixed-mode if EDID not present
Use the recorded panel fixed-mode to populate the get_modes() request in
the absence of an EDID.

Fixes regression from
commit 9cd300e038
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Fri Oct 19 14:51:52 2012 +0300

    drm/i915: Move cached EDID to intel_connector

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
[danvet: Drop the retval-changing hunk, as suggested by Jani in his
review and acked by Chris.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-22 22:06:31 +01:00
Jani Nikula 4b745b1e54 drm/i915/sdvo: kfree the intel_sdvo_connector, not drm_connector, on destroy
Since the base fields in both struct intel_connector and struct
intel_sdvo_connector are at the beginning of the enclosing struct, the
pointers are essentially the same, but there is no requirement or guarantee
that this is always the case. Kfree the enclosing intel_sdvo_connector
pointer that was originally allocated, not the enclosed drm_connector, in
case someone ever rearranges the structs.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-22 14:10:19 +01:00
Rob Clark 662595df9f drm/i915: drm_connector_property -> drm_object_property
v2: Rebased.

Signed-off-by: Rob Clark <rob@ti.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com> (v1)
[danvet: Pimp commit message a bit.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 22:12:26 +01:00
Rob Clark 45a066eba4 drm/i915: use drm_send_vblank_event() helper
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:48:03 +01:00
Ben Widawsky b5c621584b drm/i915: Use pci_resource functions for BARs.
This was leftover crap from kill-agp. The current code is theoretically
broken for 64b bars. (I resist removing theoretically because I am too
lazy to test).

We still need to ioremap things ourselves because we want to ioremap_wc
the PTEs.

v2: Forgot to kill the tmp variable in v1

CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:14 +01:00
Chris Wilson 5774506f15 drm/i915: Borrow our struct_mutex for the direct reclaim
If we have hit oom whilst holding our struct_mutex, then currently we
cannot reap our own GPU buffers which likely pin most of memory, making
an outright OOM more likely. So if we are running in direct reclaim and
already hold the mutex, attempt to free buffers knowing that the
original function can not continue until we return.

v2: Add a note explaining that the mutex may be stolen due to
pre-emption, and that is bad.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:14 +01:00
Chris Wilson 8742267af4 drm/i915: Defer assignment of obj->gtt_space until after all possible mallocs
As we may invoke the shrinker whilst trying to allocate memory to hold
the gtt_space for this object, we need to be careful not to mark the
drm_mm_node as activated (by assigning it to this object) before we
have finished our sequence of allocations.

Note: We also need to move the binding of the object into the actual
pagetables down a bit. The best way seems to be to move it out into
the callsites.

Reported-by: Imre Deak <imre.deak@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Added small note to commit message to summarize review
discussion.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:13 +01:00
Chris Wilson 776ca7cf5b drm/i915: Apply the IBX transcoder A w/a for HDMI to SDVO as well
As the SDVO/HDMI registers are multiplex, it is safe to assume that the
w/a required for HDMI on IbexPoint, namely that the SDVO register cannot
both be disabled and have selected transcoder B, is also required for
SDVO. At least the modeset state checker detects that the transcoder
selection is left in the undefined state, and so it appears sensible to
apply the w/a:

[ 1814.480052] WARNING: at drivers/gpu/drm/i915/intel_display.c:1487 assert_pch_hdmi_disabled+0xad/0xb5()
[ 1814.480053] Hardware name: Libretto W100
[ 1814.480054] IBX PCH hdmi port still using transcoder B

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57066
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:12 +01:00
Paulo Zanoni b3bf076697 drm/i915: implement WaMbcDriverBootEnable on Haswell
Also document the WA name for the previous gens that implement it.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:11 +01:00
Paulo Zanoni d567b07fce drm/i915: fix intel_ddi_get_cdclk_freq for ULT machines
For now, this code is just used by the eDP AUX channel frequency.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:11 +01:00
Paulo Zanoni 54075a7d75 drm/i915: make the panel fitter work on pipes B and C on Haswell
This goes on a separate patch since it won't apply on the stable
trees and there's nothing using panel fitter on HSW on the older
Kernels.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:10 +01:00
Paulo Zanoni 13888d78c6 drm/i915: make the panel fitter work on pipes B and C on IVB
I actually found this problem on Haswell, but then discovered Ivy
Bridge also has it by reading the spec.

I don't have the hardware to test this.

Cc: stable@vger.kernel.org
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-21 17:47:09 +01:00