Commit Graph
19278 Commits
Author SHA1 Message Date
Ben Skeggs f60b6e7a60 drm/nv50/kms: prevent lockdep false-positive in page flipping path
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-19 15:26:38 +10:00
Ben Skeggs 4fa133954e drm/nouveau/core: fix return value of nouveau_object_del()
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-19 15:26:30 +10:00
Masanari Iida cf2fbdd26f treewide: Fix typos in printk and comment
Signed-off-by: Masanari Iida <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
2013-03-18 14:57:53 +01:00
Zhang Yanfei c031175747 driver: gpu: drm: i915: remove cast for kzalloc return value
remove cast for kzalloc return value.

Signed-off-by: Zhang Yanfei <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: David Airlie <[email protected]>
Cc: [email protected]
Signed-off-by: Jiri Kosina <[email protected]>
2013-03-18 14:15:58 +01:00
Takashi Iwai 9d1a455b0c drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n()
The eDP output on HP Z1 is still broken when X is started even after
fixing the infinite link-train loop.  The regression was introduced in
3.6 kernel for cleaning up the mode clock handling code in intel_dp.c
by the commit [71244653: drm/i915: adjusted_mode->clock in the dp
mode_fix].

In the past, the clock of the reference mode was modified in
intel_dp_mode_fixup() in the case of eDP fixed clock, and this clock was
used for calculating in intel_dp_set_m_n().  This override was removed,
thus the wrong mode clock is used for the calculation, resulting in a
psychedelic smoking output in the end.

This patch corrects the clock to be used in the place.

v1->v2: Use intel_edp_target_clock() for checking eDP fixed clock
instead of open code as in ironlake_set_m_n().

Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-18 11:25:36 +01:00
Ben Widawsky 41fda59682 drm/i915: Remove unneeded dev argument
Signed-off-by: Ben Widawsky <[email protected]>
Acked-by: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-18 03:03:19 +01:00
Ben Widawsky cf144969d5 drm/i915: Remove unused file arg from execbuf
Signed-off-by: Ben Widawsky <[email protected]>
Acked-by: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-18 03:02:53 +01:00
Martin Peres 804ca90f3f drm/nouveau/hwmon: do not expose a buggy temperature if it is unavailable
Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:27 +10:00
Martin Peres 0b3ee3772e drm/nouveau/therm: display the availability of the internal sensor
Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:27 +10:00
Martin Peres bf55eb843d drm/nouveau/therm: disable temperature management if the sensor isn't readable
Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:27 +10:00
Martin Peres 98ee7c7c63 drm/nouveau/therm: disable auto fan management if temperature is not available
Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:27 +10:00
Martin Peres 76c0295c38 drm/nv40/therm: reserve negative temperatures for errors
Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:27 +10:00
Martin Peres ad40d73ef5 drm/nv40/therm: disable temperature reading if the bios misses some parameters
Reported-by: Konrad Rzeszutek Wilk <[email protected]>
Tested-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:27 +10:00
Martin Peres 13506e2ab4 drm/nouveau/therm-ic: the temperature is off by sensor_constant, warn the user
Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:26 +10:00
Martin Peres c4ce9246ca drm/nouveau/therm: remove some confusion introduced by therm_mode
The kernel message "[  PTHERM][0000:01:00.0] Thermal management: disabled"
is misleading as it actually means "fan management: disabled".

This patch fixes both the source and the message to improve readability.

Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:26 +10:00
Martin Peres 7591782b9f drm/nouveau/therm: do not make assumptions on temperature
In nouveau_therm_sensor_event, temperature is stored as an uint8_t
even though the original interface returns an int.

This change should make it more obvious when the sensor is either
very-ill-calibrated or when we selected the wrong sensor style
on the nv40 family.

Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:26 +10:00
Martin Peres eea4eb14a0 drm/nv40/therm: increase the sensor's settling delay to 20ms
Based on my experience, 10ms wasn't always enough. Let's bump that
to a little more.

If this turns out to be insufficient-enough again, then an approach
based on letting the sensor settle for several seconds before starting
polling on the temperature would be better suited. This way, boot time
wouldn't be impacted by those waits too much.

Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:26 +10:00
Martin Peres 7ae9712c60 drm/nv40/therm: improve selection between the old and the new style
The condition to select between the old and new style was a thinko
as rnndb orders chipsets based on their release date (or general
chronologie hw-wise) and not based on their chipset number.

As the nv40 family is a mess when it comes to numbers, this patch
introduces a switch-based selection between the old and new style.

Signed-off-by: Martin Peres <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
2013-03-18 11:15:26 +10:00
Takashi Iwai 3b4f819d5e Revert "drm/i915: try to train DP even harder"
This reverts commit 0d71068835.

Not only that the commit introduces a bogus check (voltage_tries == 5
will never meet at the inserted code path), it brings the i915 driver
into an endless dp-train loop on HP Z1 desktop machine with IVY+eDP.

At least reverting this commit recovers the framebuffer (but X is
still broken by other reasons...)

Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 22:57:46 +01:00
Chris Wilson a24a11e6b4 drm/i915: Resurrect ring kicking for semaphores, selectively
Once we thought we got semaphores working, we disabled kicking the ring
if hangcheck fired whilst waiting upon a ring as it was doing more harm
than good:

commit 4e0e90dcb8
Author: Daniel Vetter <[email protected]>
Date:   Wed Dec 14 13:56:58 2011 +0100

    drm/i915: kicking rings stuck on semaphores considered harmful

However, life is never that easy and semaphores are still causing
problems whereby the value written by one ring (bcs) is not being
propagated to the waiter (rcs). Thus the waiter never wakes up and we
declare the GPU hung, which often has unfortunate consequences, even if
we successfully reset the GPU.

But the GPU is idle as it has completed the work, just didn't notify its
clients. So we can detect the incomplete wait during hang check and
probe the target ring to see if has indeed emitted the breadcrumb seqno
following the work and then and only then kick the waiter.

Based on a suggestion by Ben Widawsky.

v2: cross-check wait with iphdr. fix signaller calculation.

References: https://bugs.freedesktop.org/show_bug.cgi?id=54226
Signed-off-by: Chris Wilson <[email protected]>
Signed-off-by: Mika Kuoppala <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Ben Widawsky <[email protected]>
Acked-by: Ben Widawsky <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 22:52:51 +01:00
Paulo Zanoni 5d83d2947e drm/i915: add missing space in error message
To avoid this:
[  256.798060] [drm] capturing error event; look for more information
in/sys/kernel/debug/dri/0/i915_error_state

Ben Widawsky identified that this regression has been introduced in

commit 2f86f19165
Author: Ben Widawsky <[email protected]>
Date:   Mon Jan 28 15:32:15 2013 -0800

    drm/i915: Error state should print /sys/kernel/debug
        ...
    [danvet: split up long line.] <----- he did it
    Signed-off-by: Daniel Vetter <[email protected]>

Signed-off-by: Paulo Zanoni <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
[danvet: Pimp commit message with the regression note. Also, order
more brown paper bags, I've run out.]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:55:26 +01:00
Paulo Zanoni 4deb88a699 drm/i915: don't save/restore PCH_LVDS on LPT
Because the register does not exist on LPT. The interesting fact is
that reading/writing PCH_LVDS on LPT does *not* give us "unclaimed
register" messages, but the register value is always 0.

Signed-off-by: Paulo Zanoni <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:53:10 +01:00
Paulo Zanoni 311e359c0b drm/i915: reorganize intel_lvds_supported
Now it returns false for all platforms unless they're explicitly
listed on the function. There should be no real difference, except for
the fact that it now returns false on Haswell.

Signed-off-by: Paulo Zanoni <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:52:19 +01:00
Paulo Zanoni 86d52df633 drm/i915: add HAS_POWER_WELL
We're starting to add many IS_HASWELL checks for the power well code,
so add a HAS_POWER_WELL macro to properly document that we're checking
for hardware that has the power down well.

Signed-off-by: Paulo Zanoni <[email protected]>
[danvet: Resolve conflicts since some converted code was added by
not-yet merged patches.]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:49:23 +01:00
Paulo Zanoni ca291363cc drm/i915: there's no DSPADDR register on Haswell
So don't read it when we hang the GPU. This solves "unclaimed
register" messages.

Signed-off-by: Paulo Zanoni <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
[danvet: Future-proof by adding a gen >= 7 check in addition to the
!IS_HSW check from Paulo's original patch, suggested by Ben.]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:32:14 +01:00
Paulo Zanoni 51889b3522 drm/i915: there's no DSPSIZE register on gen4+
So don't read it when capturing the error state. This solves some
"unclaimed register" messages on Haswell when we hang the GPU.

Signed-off-by: Paulo Zanoni <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:29:10 +01:00
Paulo Zanoni a18c4c3d8f drm/i915: capture the correct cursor registers on IVB
This solves some "unclaimed register" messages when there's a GPU hang
on Haswell.

Signed-off-by: Paulo Zanoni <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
[danvet: Add missing IS_VLV check as spotted by Ville Syrjälä.]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:26:04 +01:00
Paulo Zanoni 2831d8427c drm/i915: disable sound first on intel_disable_ddi
Our mode set sequence documentation says audio must be disabled first.

Signed-off-by: Paulo Zanoni <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
[danvet: Resolve conflict since the first patch in this series isn't
applied yet. Also bikeshed commit message as suggested by Ben.]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-17 21:18:06 +01:00
Patrik Jakobsson 9e8e463609 drm/gma500: Clean up various defines
Remove unused defines that we'll never use and fix naming in some include guards

Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-17 18:32:56 +01:00
Patrik Jakobsson 49ad8f54c0 drm/gma500: Remove unnecessary function exposure
psb_intel_crtc_gamma_set() and psb_intel_crtc_destroy() aren't used outside of
psb_intel_display.c right now so no need to expose them.

Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-17 18:32:56 +01:00
Patrik Jakobsson 06da4912eb drm/gma500: Type clock limits directly into array and remove defines
This makes it easier to read. We do the same for cdv so it becomes more
consistent as well.

Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-17 18:32:55 +01:00
Patrik Jakobsson 1548060f48 drm/gma500: Calculate clock in one function instead of three identical
i9xx_clock() and i8xx_clock() did the same calc and psb_intel_clock() just
called i9xx_clock() so just move it all into psb_intel_clock().

The same calculation is duplicated in cdv_intel_display.c as well so maybe we
can share it later on.

Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-17 18:32:55 +01:00
Patrik Jakobsson 4e6bb70d7b drm/gma500: Remove unused i8xx clock limits
Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-17 18:32:55 +01:00
Alex Deucher e4d170633f drm/radeon: add support for Richland APUs
Richland APUs are a new version of the Trinity APUs
with performance and power management improvements.

Reviewed-by: Jerome Glisse <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
2013-03-15 18:47:19 -04:00
Alex Deucher 271e53dcff drm/radeon/benchmark: allow same domains for dma copy
Remove old comment and allow benchmarking moves within the
same memory domain for both dma and blit methods.

Reviewed-by: Michel Dänzer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2013-03-15 18:47:18 -04:00
Alex Deucher fa8d387dc3 drm/radeon/benchmark: make sure bo blit copy exists before using it
Fixes a segfault on asics without a blit callback.

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

Reviewed-by: Michel Dänzer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
2013-03-15 18:47:17 -04:00
Alex Deucher 8f612b23a1 drm/radeon: fix backend map setup on 1 RB trinity boards
Need to adjust the backend map depending on which RB is
enabled.  This is the trinity equivalent of:
f7eb973008

May fix:
https://bugs.freedesktop.org/show_bug.cgi?id=57919

Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
2013-03-15 18:47:17 -04:00
Alex Deucher fa3daf9aa7 drm/radeon: fix S/R on VM systems (cayman/TN/SI)
We weren't properly tearing down the VM sub-alloctor
on suspend leading to bogus VM PTs on resume.

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

Reviewed-by: Christian König <[email protected]>
Tested-by: Dmitry Cherkasov <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
2013-03-15 18:47:16 -04:00
Syam Sidhardhan 22ccb2a146 gma500: medfield: Fix possible NULL pointer dereference
The use of pointer sender should be after the NULL check.

Signed-off-by: Syam Sidhardhan <[email protected]>
Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-13 22:37:32 +01:00
Alexandru Gheorghiu bc6a541941 drivers: gpu: drm: gma500: Replaced calls kzalloc & memcpy with kmemdup
Replaced calls kzalloc followed by memcpy with call to kmemdup.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <[email protected]>
Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-13 22:37:32 +01:00
Wang YanQing 72c0493ceb gma500: remove unused drm_psb_no_fb
commit f9f23a77f07506a32d9dc1d925bf85c0e7507b66(gma500: remove no_fb bits)
remove all the drm_psb_no_fb relations code in gma500 except this line code,
so remove it also.

Signed-off-by: Wang YanQing <[email protected]>
Signed-off-by: Patrik Jakobsson <[email protected]>
2013-03-13 22:37:31 +01:00
Kees Cook 3118a4f652 drm/i915: bounds check execbuffer relocation count
It is possible to wrap the counter used to allocate the buffer for
relocation copies. This could lead to heap writing overflows.

CVE-2013-0913

v3: collapse test, improve comment
v2: move check into validate_exec_list

Signed-off-by: Kees Cook <[email protected]>
Reported-by: Pinkie Pie
Cc: [email protected]
Reviewed-by: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-13 21:31:03 +01:00
Kees Cook 2563a4524f drm/i915: restrict kernel address leak in debugfs
Masks kernel address info-leak in object dumps with the %pK suffix,
so they cannot be used to target kernel memory corruption attacks if
the kptr_restrict sysctl is set.

Signed-off-by: Kees Cook <[email protected]>
Cc: [email protected]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-13 21:31:02 +01:00
Jani Nikula def27a5829 drm/i915: reduce power in the ilk rc6 enable error message
Even if "power power" is good for grepping.

Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-13 21:17:28 +01:00
Kees Cook 3058753583 drm/i915: clarify reasoning for the access_ok call
This clarifies the comment above the access_ok check so a missing
VERIFY_READ doesn't alarm anyone.

v2:
 - rewrote comment, thanks to Chris Wilson

Signed-off-by: Kees Cook <[email protected]>
Cc: Daniel Vetter <[email protected]>
[danvet: add patch history log to commit message.]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-13 21:17:28 +01:00
Kees Cook 647416f9ee drm/i915: use simple attribute in debugfs routines
This replaces the manual read/write routines in debugfs with the common
simple attribute helpers. Doing this gets rid of repeated copy/pasting
of copy_from_user and value formatting code.

Signed-off-by: Kees Cook <[email protected]>
Cc: Daniel Vetter <[email protected]>
[danvet: Squash in follow-up fix from Kees Cook to fix u64 divides on
32bit platforms.]
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-13 21:16:45 +01:00
Tomi Valkeinen 06a3307975 videomode: combine videomode dmt_flags and data_flags
Both videomode and display_timing contain flags describing the modes.
These are stored in dmt_flags and data_flags. There's no need to
separate these flags, and having separate fields just makes the flags
more difficult to use.

This patch combines the fields and renames VESA_DMT_* flags to
DISPLAY_FLAGS_*.

Signed-off-by: Tomi Valkeinen <[email protected]>
Cc: Steffen Trumtrar <[email protected]>
2013-03-12 15:46:52 +02:00
Tomi Valkeinen a38884f681 videomode: simplify videomode Kconfig and Makefile
This patch simplifies videomode related Kconfig and Makefile. After this
patch, there's only one non-user selectable Kconfig option left,
VIDEOMODE_HELPERS. The reasons for the change:

* Videomode helper functions are not something that should be shown in
  the kernel configuration options. The related code should just be
  included if it's needed, i.e. selected by drivers using videomode.

* There's no need to have separate Kconfig options for videomode and
  display_timing. First of all, the amount of code for both is quite
  small. Second, videomode depends on display_timing, and display_timing
  in itself is not really useful, so both would be included in any case.

* CONFIG_VIDEOMODE is a bit vague name, and CONFIG_VIDEOMODE_HELPERS
  describes better what's included.

Signed-off-by: Tomi Valkeinen <[email protected]>
Cc: Steffen Trumtrar <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
2013-03-12 15:46:41 +02:00
Mihnea Dobrescu-Balaur 5c67eeb6bf gpu: don't cast kzalloc() return value
Signed-off-by: Mihnea Dobrescu-Balaur <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
2013-03-11 23:51:54 +01:00
Dave Airlie 8698080ee0 Merge branch 'drm-nouveau-fixes-3.9' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
Regression fixes and oops fixes for nouveau.

* 'drm-nouveau-fixes-3.9' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
  drm/nv50: use correct tiling methods for m2mf buffer moves
  drm/nouveau: idle channel before releasing notify object
  drm/nouveau: fix regression in vblanking
  drm/nv50: encoder creation failure doesn't mean full init failure
2013-03-11 13:53:58 +10:00