Commit Graph

496422 Commits

Author SHA1 Message Date
Alex Deucher 09b6e85fc8 drm/radeon: fix voltage setup on hawaii
Missing parameter when fetching the real voltage values
from atom.  Fixes problems with dynamic clocking on
certain boards.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-02-13 10:03:48 -05:00
Alex Deucher 66c2b84ba6 drm/radeon/dp: Set EDP_CONFIGURATION_SET for bridge chips if necessary
Don't restrict it to just eDP panels.  Some LVDS bridge chips require
this.  Fixes blank panels on resume on certain laptops.  Noticed
by mrnuke on IRC.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2015-02-13 10:03:33 -05:00
Dave Airlie 96abd10ecc Merge branch 'drm-next-3.20' of git://people.freedesktop.org/~agd5f/linux into drm-next
Some radeon fixes for 3.20.

* 'drm-next-3.20' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: only enable kv/kb dpm interrupts once v3
  drm/radeon: workaround for CP HW bug on CIK
  drm/radeon: Don't try to enable write-combining without PAT
  drm/radeon: use 0-255 rather than 0-100 for pwm fan range
2015-02-12 10:01:51 +10:00
Dave Airlie 64aa7e342a Merge tag 'drm-intel-next-fixes-2015-02-11' of git://anongit.freedesktop.org/drm-intel into drm-next
Here's a batch of i915 fixes for drm-next, with more cc: stable material
than fixes specific to drm-next.

* tag 'drm-intel-next-fixes-2015-02-11' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Clamp efficient frequency to valid range
  drm/i915: Really ignore long HPD pulses on eDP
  drm/i915: Correct the base value while updating LP_OUTPUT_HOLD in MIPI_PORT_CTRL
  drm/i915: Insert a command barrier on BLT/BSD cache flushes
  drm/i915: Drop vblank wait from intel_dp_link_down
  drm/i915: Squelch overzealous uncore reset WARN_ON
  drm/i915: Take runtime pm reference on hangcheck_info
  drm/i915: Correct the IOSF Dev_FN field for IOSF transfers
  drm/i915: Prevent use-after-free in invalidate_range_start callback
2015-02-12 09:16:23 +10:00
Alex Deucher 410af8d728 drm/radeon: only enable kv/kb dpm interrupts once v3
Enable at init and disable on fini. Workaround for hardware problems.

v2 (chk): extend commit message
v3: add new function

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com> (v2)
Cc: stable@vger.kernel.org
2015-02-11 12:01:35 -05:00
Christian König a9c73a0e02 drm/radeon: workaround for CP HW bug on CIK
Emit the EOP twice to avoid cache flushing problems.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-11 12:01:34 -05:00
Michel Dänzer a53fa43873 drm/radeon: Don't try to enable write-combining without PAT
Doing so can cause things to become slow.

Print a warning at compile time and an informative message at runtime in
that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88758
Cc: stable@vger.kernel.org
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-11 12:01:33 -05:00
Alex Deucher 082452e125 drm/radeon: use 0-255 rather than 0-100 for pwm fan range
0-255 seems to be the preferred range for the pwm interface.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-11 12:01:33 -05:00
Tom O'Rourke 46efa4abe5 drm/i915: Clamp efficient frequency to valid range
The efficient frequency (RPe) should stay in the range
RPn <= RPe <= RP0.  The pcode clamps the returned value
internally on Broadwell but not on Haswell.

Fix for missing range check in
commit 93ee29203f
Author: Tom O'Rourke <Tom.O'Rourke@intel.com>
Date:   Wed Nov 19 14:21:52 2014 -0800

    drm/i915: Use efficient frequency for HSW/BDW

Reference: http://lists.freedesktop.org/archives/intel-gfx/2015-February/059802.html
Reported-by: Michael Auchter <a@phire.org>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org # v3.19
Signed-off-by: Tom O'Rourke <Tom.O'Rourke@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-11 14:09:51 +02:00
Ville Syrjälä a8b3d52f8b drm/i915: Really ignore long HPD pulses on eDP
Return IRQ_HANDLED from intel_dp_hpd_pulse() to properly
ignore the long HPD pulse on eDP to avoid the never ending
VDD off->HPD->VDD on->VDD off->HPD... cycle.

This fixes a regression intoduced by
 commit b2c5c181ed
 Author: Daniel Vetter <daniel.vetter@ffwll.ch>
 Date:   Fri Jan 23 06:00:31 2015 +0100

    drm/i915: Use symbolic irqreturn for ->hpd_pulse

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-11 14:09:51 +02:00
Dave Airlie 85840c76d8 imx-drm fixes for IPUv3 DC and i.MX5 IPUv3 IC and TVE
- Corrected handling of wait_for_completion_timeout return value
   when disabling IPUv3 DC channels
 - Fixed error return value propagation in TVE mode_set
 - Fixed IPUv3 register offsets for IC module on i.MX51 and i.MX53
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUyJYwAAoJEFDCiBxwnmDr4IsP/2ZoSigCq3vzanc2L15Eb+YQ
 P3Qsy3ZzT+isPoNyG9jblRcZb18mVTHhbC9uD4Nj0EA0C4OwUug6YXgJ4fvoqbD1
 RWhg07k52Adsmv9E87i5ib7MATqznQTvjSu8N19i+G0/zr8Fy7omgrzn5GlGFQby
 1ru3KjhZ7miVBxzKc/W4//V5zMBo2N6dbiHXoh8LA8Xi6fogcPtWLsrR0Eov/0Yi
 6hffPthlTKuXQ9zSmoR4TqEPeRbuBFucX3aS0FslH8JFaS/zcYjIy1H4jqv5tHLV
 JP2Xq1I3U2fEstms1473Qhloq3p74YbdrwchLGyDKacbJi2gOeLV3diogQnk7dXF
 8IphRi+EcV2wq22zBeLMzrizWShpRW/vsoZRwjGJ0ntP8nspSSwNT7ucF5PlAHxH
 Sv4vH6e3gwu+FxE2Q3xVHn8JDWCMMietFG/YyJEqLDBfhPWp716ME3FKEd1aQgVM
 WIuQbYzT0BrCJR9Gx6hHnVZehRaNxy+/gQ1A3Jo7hxyq1O7MmnMspRUOiunv1ZwM
 pOvit+7GYoXrdJ8DJ49+Fce2a3fjLv+z3TAab+LTgM6A4FIK7lfHyft6i8w9eHxp
 6Tf5iZ9i7zR/PJ6Zrglawmjre6C7OpbcgxL++SjD3Xo3uqPZespUMz72suJmEb5k
 80uP9AWX5C/uVIaynoP4
 =tRBf
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-fixes-2015-01-28' of git://git.pengutronix.de/git/pza/linux into drm-next

imx-drm fixes for IPUv3 DC and i.MX5 IPUv3 IC and TVE

- Corrected handling of wait_for_completion_timeout return value
  when disabling IPUv3 DC channels
- Fixed error return value propagation in TVE mode_set
- Fixed IPUv3 register offsets for IC module on i.MX51 and i.MX53

* tag 'imx-drm-fixes-2015-01-28' of git://git.pengutronix.de/git/pza/linux:
  gpu: ipu-v3: Fix IC control register offset
  drm: imx: imx-tve: Check and propagate the errors
  gpu: ipu-v3: wait_for_completion_timeout does not return negative status
2015-02-11 15:35:26 +10:00
Dave Airlie 79a44c16b1 Merge branch 'drm-sti-next-2015-02-04' of git://git.linaro.org/people/benjamin.gaignard/kernel into drm-next
Those patches improve audio info frame management, add pixel formats
support and fix minor issues.

* 'drm-sti-next-2015-02-04' of git://git.linaro.org/people/benjamin.gaignard/kernel:
  drm: sti: HDMI add audio infoframe
  drm: sti: add support of XBGR8888 for gdp plane
  drm: sti: add support of ABGR8888 for gdp plane
  drm: sti: fix static checker warning in sti_awg_utils
  drm: sti: fix check for clk_pix_main
2015-02-11 15:34:02 +10:00
Dave Airlie ae6d57d12a Merge tag 'topic/drm-misc-2015-02-06' of git://anongit.freedesktop.org/drm-intel into drm-next
Flushing out my drm-misc queue with a few oddball things all over.

* tag 'topic/drm-misc-2015-02-06' of git://anongit.freedesktop.org/drm-intel:
  drm: Use static attribute groups for managing connector sysfs entries
  drm: remove DRM_FORMAT_NV12MT
  drm/modes: Print the mode status in human readable form
  drm/irq: Don't disable vblank interrupts when already disabled
2015-02-11 15:33:02 +10:00
Shobhit Kumar 4ba7d93afe drm/i915: Correct the base value while updating LP_OUTPUT_HOLD in MIPI_PORT_CTRL
LP_OUTPUT_HOLD is only in MIPI_PORT_CTRL(PORT_A) even for PORT_C in case
of dual link. In the dual link implementation, the bit is correctly set
or unset for hardcoded PORT_A, but for bit update the register base value
is read by using MIPI_PORT_CTRL(port) in a loop. The second iteration will
read base value from PORT_C and program for PORT_A. Mostly in case of dual
link all other bit values should be same, but logically we should read from
PORT_A. So hardcode to read initial value from PORT_A as well.

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-09 20:21:08 +02:00
Chris Wilson f0a1fb10e5 drm/i915: Insert a command barrier on BLT/BSD cache flushes
This looked like an odd regression from

commit ec5cc0f9b0
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jun 12 10:28:55 2014 +0100

    drm/i915: Restrict GPU boost to the RCS engine

but in reality it undercovered a much older coherency bug. The issue that
boosting the GPU frequency on the BCS ring was masking was that we could
wake the CPU up after completion of a BCS batch and inspect memory prior
to the write cache being fully evicted. In order to serialise the
breadcrumb interrupt (and so ensure that the CPU's view of memory is
coherent) we need to perform a post-sync operation in the MI_FLUSH_DW.

v2: Fix all the MI_FLUSH_DW (bsd plus the duplication in execlists).

Also fix the invalidate_domains mask in gen8_emit_flush() for ring !=
VCS.

Testcase: gpuX-rcs-gpu-read-after-write
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-09 20:03:15 +02:00
Daniel Vetter 0ca0968554 drm/i915: Drop vblank wait from intel_dp_link_down
Nothing in Bspec seems to indicate that we actually needs this, and it
looks like can't work since by this point the pipe is off and so
vblanks won't really happen any more.

Note that Bspec mentions that it takes a vblank for this bit to
change, but _only_ when enabling.

Dropping this code quenches an annoying backtrace introduced by the
more anal checking since

commit 51e31d49c8
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Sep 15 12:36:02 2014 +0200

    drm/i915: Use generic vblank wait

Note: This fixes the fallout from the above commit, but does not address
the shortcomings of the IBX transcoder select workaround implementation
discussed during review [1].

[1] http://mid.gmane.org/87y4o7usxf.fsf@intel.com

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86095
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: stable@vger.kernel.org # 3.19
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-09 18:52:12 +02:00
Mika Kuoppala 3225b2f95d drm/i915: Squelch overzealous uncore reset WARN_ON
We added this WARN_ON to guard against using uninitialized
forcewake domains. But forgot blissfully that not all
gens have forcewake domains in the first place.

v2: Move WARN_ON to fw_domains_init (Chris)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88911
Tested-by: Ding Heng <hengx.ding@intel.com> (v1)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
[Jani: add comment above WARN_ON as suggested by Chris]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-09 14:35:49 +02:00
Mika Kuoppala ebbc7546d2 drm/i915: Take runtime pm reference on hangcheck_info
We read the coherent current seqno and actual head from ring.
For hardware access we need to take runtime_pm reference.

Get hardware specific values with runtime reference held
and print them first to emphasize hw state vs bookkeepping.

v2: Reorder output according to hw access (Chris)
    remove superfluous locking (Daniel)

Testcase: igt/pm_rpm/debugfs-read
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88910
Tested-by: Ding Heng <hengx.ding@intel.com> (v1)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-09 14:29:36 +02:00
Shobhit Kumar d180d2bbb6 drm/i915: Correct the IOSF Dev_FN field for IOSF transfers
As per the specififcation, the SB_DevFn is the PCI_DEVFN of the target
device and not the source. So PCI_DEVFN(2,0) is not correct. Further the
port ID should be enough to identify devices unless they are MFD. The
SB_DevFn was intended to remove ambiguity in case of these MFD devices.

For non MFD devices the recommendation for the target device IP was to
ignore these fields, but not all of them followed the recommendation.
Some like CCK ignore these fields and hence PCI_DEVFN(2, 0) works and so
does PCI_DEVFN(0, 0) as it works for DPIO. The issue came to light because
of GPIONC which was not getting programmed correctly with PCI_DEVFN(2, 0).
It turned out that this did not follow the recommendation and expected 0
in this field.

In general the recommendation is to use SB_DevFn as PCI_DEVFN(0, 0) for
all devices except target PCI devices.

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-09 14:26:19 +02:00
Arnaud Pouliquen cffe1e89dc drm: sti: HDMI add audio infoframe
Add a default audio infoframe for HDMI compliance

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2015-02-05 16:21:19 +01:00
Michał Winiarski 460822b0b1 drm/i915: Prevent use-after-free in invalidate_range_start callback
It's possible for invalidate_range_start mmu notifier callback to race
against userptr object release. If the gem object was released prior to
obtaining the spinlock in invalidate_range_start we're hitting null
pointer dereference.

Testcase: igt/gem_userptr_blits/stress-mm-invalidate-close
Testcase: igt/gem_userptr_blits/stress-mm-invalidate-close-overlap
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
[Jani: added code comment suggested by Chris]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-02-05 16:31:30 +02:00
Fabien Dessenne 8adb57763e drm: sti: add support of XBGR8888 for gdp plane
Use GDP capabilities to support DRM_FORMAT_XBGR8888 (XB24)

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
2015-02-05 10:27:32 +01:00
Dave Airlie 2f8997902e Merge tag 'drm-amdkfd-next-fixes-2015-02-03' of git://people.freedesktop.org/~gabbayo/linux into drm-next
- Fixing accounting of active queues
- Preserving a register internal state

* tag 'drm-amdkfd-next-fixes-2015-02-03' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: Preserve CP_MQD_IQ_RPTR internal state
  drm/amdkfd: Fix dqm->queue_count tracking
2015-02-05 10:40:10 +10:00
Dave Airlie 225963dd3e Merge branch 'drm-intel-next' of git://anongit.freedesktop.org/drm-intel into drm-next
drm-intel-next-2015-01-30:
- chv rps improvements from Ville
- atomic state handling prep work from Ander
- execlist request tracking refactoring from Nick Hoath
- forcewake code consolidation from Chris&Mika
- fastboot plane config refactoring and skl support from Damien
- some more skl pm patches all over (Damien)
- refactor dsi code to use drm dsi helpers and drm_panel infrastructure (Jani)
- first cut at experimental atomic plane updates (Matt Roper)
- piles of smaller things all over, as usual

* 'drm-intel-next' of git://anongit.freedesktop.org/drm-intel: (102 commits)
  drm/i915: Remove bogus locking check in the hangcheck code
  drm/i915: Update DRIVER_DATE to 20150130
  drm/i915: Use pipe_config's cpu_transcoder for reading encoder hw state
  drm/i915: Fix a use-after-free in intel_execlists_retire_requests
  drm/i915: Split shared dpll setup out of __intel_set_mode()
  drm/i915: Don't do posting reads on getting forcewake
  drm/i915: Do uncore early sanitize after domain init
  drm/i915: Handle CHV in vlv_set_rps_idle()
  drm/i915: Remove nested work in gpu error handling
  drm/i915/documentation: Add intel_uncore.c to drm.tmpl
  drm/i915/dsi: remove intel_dsi_cmd.c and the unused functions therein
  drm/i915/dsi: move dpi_send_cmd() to intel_dsi.c and make it static
  drm/i915/dsi: remove old read/write functions in favor of new stuff
  drm/i915/dsi: make the vbt panel driver use mipi_dsi_device for transfers
  drm/i915/dsi: add drm mipi dsi host support
  drm/i915/dsi: switch to drm_panel interface
  drm/i915/skl: Enabling PSR on Skylake
  Revert "drm/i915: Fix mutex->owner inspection race under DEBUG_MUTEXES"
  drm/i915: Be consistent on printing seqnos
  drm/i915: Display current hangcheck status in debugfs
  ...
2015-02-05 10:32:44 +10:00
Benjamin Gaignard 4af6b12ad5 drm: sti: add support of ABGR8888 for gdp plane
Use GDP capabilities to support DRM_FORMAT_ABGR8888 (AB24)

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
2015-02-04 17:58:11 +01:00
Vincent Abriou 17ba9810ec drm: sti: fix static checker warning in sti_awg_utils
The shift and the mask done on arg value is useless
since arg is null.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
2015-02-04 17:52:28 +01:00
Jassi Brar 6dfca6b37f drm: sti: fix check for clk_pix_main
copy-paste wasn't followed by editing, do it.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-02-04 17:52:07 +01:00
Takashi Iwai 335f1a62c5 drm: Use static attribute groups for managing connector sysfs entries
Instead of manual calls of device_create_file() and
device_remove_file(), assign the static attribute groups to the device
with device_create_with_groups().  The conditionally built sysfs
entries are handled via is_visible callback.

This simplifies the code and also avoids the possible races.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-04 15:02:00 +01:00
Daniel Vetter 083500baef drm: remove DRM_FORMAT_NV12MT
So this has been merged originally in

commit 83052d4d5c
Author: Seung-Woo Kim <sw0312.kim@samsung.com>
Date:   Thu Dec 15 15:40:55 2011 +0900

    drm: Add multi buffer plane pixel formats

which hasn't seen a lot of review really. The problem is that it's not
a real pixel format, but just a different way to lay out NV12 pixels
in macroblocks, i.e. a tiling format.

The new way of doing this is with the soon-to-be-merged fb modifiers.

This was brough up in some long irc discussion around the entire
topic, as an example of where things have gone wrong. Luckily we can
correct the mistake:
- The kms side support for NV12MT is all dead code because
  format_check in drm_crtc.c never accepted NV12MT.
- The gem side for the gsc support doesn't look better: The code
  forgets to set the pixel format and makes a big mess with the tiling
  mode bits, inadvertedly setting them all.

Conclusion: This never really worked (at least not in upstream) and
hence we can safely correct our mistake here.

Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-04 10:10:05 +01:00
Daniel Vetter b838cbee0d drm/i915: Remove bogus locking check in the hangcheck code
You can _never_ assert that a lock is not held, except in some very
restricted corner cases where it's guranteed that your code is running
single-threade (e.g. driver load before you've published any pointers
leading to that lock).

In addition the early return breaks a bunch of testcases since with
highly concurrent hangcheck stress tests the reset fails to work and
the test doesn't recover and time out.

This regression has been introduced in

commit b8d24a0656
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Wed Jan 28 17:03:14 2015 +0200

    drm/i915: Remove nested work in gpu error handling

Aside: It is possible to check whether a given task doesn't hold a
lock, but only when lockdep is enabled, using the lockdep_assert_held
stuff.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88908
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-03 17:13:04 +01:00
Ville Syrjälä f79d1548b0 drm/modes: Print the mode status in human readable form
Currently when a mode is rejected the reason is printed as a raw number.
Having to manually decode that to a enum drm_mode_status value is
tiresome. Have the code do the decoding instead and print the result
in a human readable format.

Just having an array of strings indexed with the mode status doesn't
work since the enum includes negative values. So we offset the status
by +3 which makes all the indexes non-negative. Also add a bit of
paranoia into the code to catch out of bounds accesses in case
someone adds more enum values but forgets to update the code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-03 09:09:22 +01:00
Ville Syrjälä e4bf44b3b5 drm/modes: Print the mode status in human readable form
Currently when a mode is rejected the reason is printed as a raw number.
Having to manually decode that to a enum drm_mode_status value is
tiresome. Have the code do the decoding instead and print the result
in a human readable format.

Just having an array of strings indexed with the mode status doesn't
work since the enum includes negative values. So we offset the status
by +3 which makes all the indexes non-negative. Also add a bit of
paranoia into the code to catch out of bounds accesses in case
someone adds more enum values but forgets to update the code.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-02-03 11:13:27 +10:00
Chen Gang S db88c8f4e7 drm: Kconfig: Let all DRM_GEM_CMA_HELPER related macros depend on HAVE_DMA_ATTRS
DRM_GEM_CMA_HELPER is depend on HAVE_DMA_ATTRS, or it will break the
building. The related error (with allmodconfig under xtensa):

    CC [M]  drivers/gpu/drm/drm_gem_cma_helper.o
  drivers/gpu/drm/drm_gem_cma_helper.c: In function 'drm_gem_cma_create':
  drivers/gpu/drm/drm_gem_cma_helper.c:110:19: error: implicit declaration of function 'dma_alloc_writecombine' [-Werror=implicit-function-declaration]
    cma_obj->vaddr = dma_alloc_writecombine(drm->dev, size,
                     ^
  drivers/gpu/drm/drm_gem_cma_helper.c:110:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
    cma_obj->vaddr = dma_alloc_writecombine(drm->dev, size,
                   ^
  drivers/gpu/drm/drm_gem_cma_helper.c: In function 'drm_gem_cma_free_object':
  drivers/gpu/drm/drm_gem_cma_helper.c:193:3: error: implicit declaration of function 'dma_free_writecombine' [-Werror=implicit-function-declaration]
     dma_free_writecombine(gem_obj->dev->dev, cma_obj->base.size,
     ^
  drivers/gpu/drm/drm_gem_cma_helper.c: In function 'drm_gem_cma_mmap_obj':
  drivers/gpu/drm/drm_gem_cma_helper.c:330:8: error: implicit declaration of function 'dma_mmap_writecombine' [-Werror=implicit-function-declaration]
    ret = dma_mmap_writecombine(cma_obj->base.dev->dev, vma,
          ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-02-03 11:12:37 +10:00
Dave Airlie 44df9c417d Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
Rebase of main pull for 3.20.  There was a mid-air collision between
the bridge changes and msm eDP support.  And atomic dpms support broke
msm somewhat, due to using prepare/commit hooks in a different way.
Compared to the initial pull req, this fixes up a memory leak caused
by the bridge changes, rebases the eDP support on the bridge changes,
and migrates to the atomic dpms hooks to fix the dpms breakage.

Highlights (from original pull req):

1) YUV support for mdp4 and mdp5
2) eDP support
3) hw cursor support for mdp5[*]
4) additional hdmi support for apq8084 (snapdragon 805)
5) few bug fixes

Note that I may have a later pull to enable hdmi hpd irqs.. but
(un)fortunately I seem to have a particularly troublesome monitor..  I
managed to figure out a workaround for spurious hpd disconnect irqs
that works with some of my boards but not others, so holding off on
that patch for now.  There are also patches for HDCP support, but
those are waiting on some scm patches outside of drm so I think
waiting until 3.21 at this point.

* 'msm-next' of git://people.freedesktop.org/~robclark/linux: (22 commits)
  drm/msm: add moduleparam to disable fbdev
  drm/msm: fix build error with W=1
  drm/msm/mdp5: Fix negative SMP block allocation
  drm/msm/hdmi: disallow interlaced
  drm/msm/atomic: fix issue with gnome-shell wayland
  drm/msm/mdp5: Add hardware cursor support
  drm/msm/hdmi: rework hdmi configurations, using dt_match[]
  drm/msm/hdmi: Add HDMI platform config for apq8084
  drm/msm/hdmi: use dynamic allocation for hdmi resources
  drm/msm/mdp5: fix parameter type for mdp5_ctl_set_intf()
  drm/msm/dp: use link power helpers
  drm/msm: Add the eDP connector in msm drm driver (V2)
  drm/msm: Initial add eDP support in msm drm driver (v5)
  drm/msm/mdp4: add YUV format support
  drm/msm/mdp5: add NV12 support for MDP5
  drm/msm/mdp: add common YUV information for MDP4/MDP5
  drm/msm: update generated headers
  drm/msm: Do not BUG_ON(!spin_is_locked()) on UP
  drm/msm/hdmi: fix memory leak after bridge changes
  drm/msm: fix fallout of atomic dpms changes
  ...
2015-02-02 10:53:23 +10:00
Rob Clark e90dfec78e drm/msm: add moduleparam to disable fbdev
Useful to avoid recompiling to disable fbdev.  Useful because otherwise
the first modeset happens under console_lock (ie. debugging sadness).

Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:34:04 -05:00
Rob Clark 1c19f98d2b drm/msm: fix build error with W=1
Combining -Werror with all the extra warning flags that W=1 adds doesn't
go so well.  Especially because some of the warnings triggered are from
included headers.  So just drop -Werror.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:48 -05:00
Stephane Viau 2559d19f76 drm/msm/mdp5: Fix negative SMP block allocation
In case we request a number of SMP blocks which is lower than
the already reserved blocks, we should not try to allocate a
negative number, but 0 blocks instead.

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:47 -05:00
Rob Clark cddfaebdf7 drm/msm/hdmi: disallow interlaced
So after clarification from qcom, it seems mdp4 and mdp5 support
*de*interlacing but not generating an interlaced signal.  Which would
explain why interlaced modes never worked properly.

So disable in the one connector which was claiming to support
interlaced.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:47 -05:00
Rob Clark be7a7b8997 drm/msm/atomic: fix issue with gnome-shell wayland
The gnome-shell wayland compositor triggers a setcrtc with an fb that is
still being rendered, triggering the call to _wait_fence_interruptable().
But a NULL timeout means "don't wait, return -EBUSY if not ready", which
in turn causes the setcrtc to fail.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:47 -05:00
Beeresh Gopal e172d10a9c drm/msm/mdp5: Add hardware cursor support
This patch implements the hardware accelarated cursor
support for MDP5 platforms.

Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
Signed-off-by: Wentao Xu <wentaox@codeaurora.org>
Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:46 -05:00
Stephane Viau 5eba5d870f drm/msm/hdmi: rework hdmi configurations, using dt_match[]
In the same idea mdp5_cfg was added, this change allows us to quickly
add new instances, such as apq8084's HDMI in this case.

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:46 -05:00
Stephane Viau efbd349aeb drm/msm/hdmi: Add HDMI platform config for apq8084
This change add the regulator/clock configuration for MDP5 v1.3.
This config is close to the one already existing for 8x74, except
that one more regulator is needed (hpd-5v-en).

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:45 -05:00
Stephane Viau 447fa5292f drm/msm/hdmi: use dynamic allocation for hdmi resources
Instead of reporting BUG_ON when resources arrays are not
dimensioned correctly, this patch does a dynamic allocation of
these arrays. This is needed for the following patches that add a
regulator for a new target.

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:45 -05:00
Stephane Viau 5cdde29bc9 drm/msm/mdp5: fix parameter type for mdp5_ctl_set_intf()
mdp5_ctl_set_intf()'s second argument should be "int", not "enum mdp5_intf".
The passed in value is "intf", not "intf_id".

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:44 -05:00
Rob Clark a5ec308ac1 drm/msm/dp: use link power helpers
Now that we have a helper for drm_dp_link_power_down(), use dp helpers
instead of rolling our own.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:44 -05:00
Hai Li 0045398131 drm/msm: Add the eDP connector in msm drm driver (V2)
Modified the hard-coded hdmi connector/encoder implementations in msm drm
driver to support both edp and hdmi.

V1: Initial change

V2: Address Thierry's change

Signed-off-by: Hai Li <hali@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:32:43 -05:00
Hai Li ab5b0107cc drm/msm: Initial add eDP support in msm drm driver (v5)
This change adds a new eDP connector in msm drm driver. With this
change, eDP panel can work with msm platform under drm framework.

v1: Initial change

v2: Address Rob's comments
    Use generated header file for register definitions
    Change to devm_* APIs

v3: Address Thierry's comments and rebase on top of atomic changes
    Remove edp_bridge_mode_fixup
    Remove backlight control code and rely on pwm-backlight
    Remove continuous splash screen support for now
    Change to gpiod_* APIs

v4: Fix kbuild test issue

Signed-off-by: Hai Li <hali@codeaurora.org>
[robclark: v5: rebase on drm_bridge changes in drm-next]
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:30:37 -05:00
Beeresh Gopal b1b1c74e36 drm/msm/mdp4: add YUV format support
The patch add support for YUV frame format
for MDP4 platform.

Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:30:35 -05:00
Stephane Viau f8d9b5156e drm/msm/mdp5: add NV12 support for MDP5
This change adds the NV12 format support for public planes.

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:30:35 -05:00
Stephane Viau 7ca12718b3 drm/msm/mdp: add common YUV information for MDP4/MDP5
Both MDP4 and MDP5 share some code as far as YUV support is
concerned. This change adds this information and will be followed
by the actual MDP4 and MDP5 YUV support patches.

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2015-02-01 15:30:34 -05:00