linux-2.6-microblaze.git
7 years agoMerge tag 'drm/panel/for-4.10-rc1' of git://anongit.freedesktop.org/tegra/linux into...
Dave Airlie [Tue, 13 Dec 2016 04:26:28 +0000 (14:26 +1000)]
Merge tag 'drm/panel/for-4.10-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/panel: Changes for v4.10-rc1

This adds support for a couple more panels to the simple-panel driver.
There is also a fix for a long-standing bug, but it's not critical since
no code will currently trigger it.

* tag 'drm/panel/for-4.10-rc1' of git://anongit.freedesktop.org/tegra/linux:
  drm/panel: simple: Add support for AUO G185HAN01
  drm/panel: simple: Add support for AUO G133HAN01
  drm/panel: simple: Add more properties to Innolux G121I1-L01
  drm/panel: simple: Add bits-per-component for Sharp LQ123P1JX31
  drm/panel: simple: Check against num_timings when setting preferred for timing
  drm/panel: Add support for Chunghwa CLAA070WP03XG panel
  drm/panel: simple: Add NVD9128 as a simple panel
  drm/panel: simple: Add support for AUO T215HVN01
  drm/panel: simple: Add support for Sharp LQ150X1LG11 panels
  dt-bindings: display: Add Sharp LQ150X1LG11 panel binding

7 years agoMerge tag 'drm-misc-next-fixes-2016-12-10' of git://anongit.freedesktop.org/git/drm...
Dave Airlie [Tue, 13 Dec 2016 04:24:25 +0000 (14:24 +1000)]
Merge tag 'drm-misc-next-fixes-2016-12-10' of git://anongit.freedesktop.org/git/drm-misc into drm-next

single fix for backwards compat.

* tag 'drm-misc-next-fixes-2016-12-10' of git://anongit.freedesktop.org/git/drm-misc:
  drm: Add fake controlD* symlinks for backwards compat

7 years agoMerge tag 'drm-vc4-next-2016-12-09' of https://github.com/anholt/linux into drm-next
Dave Airlie [Tue, 13 Dec 2016 02:05:12 +0000 (12:05 +1000)]
Merge tag 'drm-vc4-next-2016-12-09' of https://github.com/anholt/linux into drm-next

This pull request brings in VEC (TV-out) support for vc4, along with a
pageflipping race fix.

* tag 'drm-vc4-next-2016-12-09' of https://github.com/anholt/linux:
  drm/vc4: Don't use drm_put_dev
  drm/vc4: Document VEC DT binding
  drm/vc4: Add support for the VEC (Video Encoder) IP
  drm: Add TV connector states to drm_connector_state
  drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum
  drm/vc4: Fix ->clock_select setting for the VEC encoder
  drm/vc4: Fix race between page flip completion event and clean-up

7 years agodrm: Add fake controlD* symlinks for backwards compat
Daniel Vetter [Fri, 9 Dec 2016 13:56:56 +0000 (14:56 +0100)]
drm: Add fake controlD* symlinks for backwards compat

We thought that no userspace is using them, but oops libdrm is using
them to figure out whether a driver supports modesetting. Check out
drmCheckModesettingSupported but maybe don't because it's horrible and
totally runs counter to where we want to go with libdrm device
handling. The function looks in the device hierarchy for whether
controlD* exist using the following format string:

/sys/bus/pci/devices/%04x:%02x:%02x.%d/drm/controlD%d

The "/drm" subdirectory is the glue directory from the sysfs class
stuff, and the only way to get at it seems to through
kdev->kobj.parent (when kdev is represents e.g. the card0 chardev
instance in sysfs). Git grep says we're not the only ones touching
that, so I hope it's ok we dig into such internals - I couldn't find a
proper interface for getting at the glue directory.

Quick git grep shows that at least -amdgpu, -ati are using this.
-modesetting do not, and on -intel it's only about the 4th fallback
path for device lookup, which is why this didn't blow up earlier.

Oh well, we need to keep it working, and the simplest way is to add a
symlink at the right place in sysfs from controlD* to card*.

v2:
- Fix error path handling by adding if (!minor) return checks (David)
- Fix the controlD* numbers to match what's been there (David)
- Add a comment what exactly userspace minimally needs.
- Correct the analysis for -intel (Chris).

Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes")
Cc: Dave Airlie <airlied@gmail.com>
Reported-and-tested-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161209135656.14881-1-daniel.vetter@ffwll.ch
7 years agodrm/vc4: Don't use drm_put_dev
Daniel Vetter [Thu, 8 Dec 2016 11:07:39 +0000 (12:07 +0100)]
drm/vc4: Don't use drm_put_dev

vc4 already has a proper load sequence, but the unload one needed some
fixups: First unregister, and last drop the final ref.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
7 years agodrm/vc4: Document VEC DT binding
Boris Brezillon [Fri, 2 Dec 2016 13:48:11 +0000 (14:48 +0100)]
drm/vc4: Document VEC DT binding

Document the DT binding for the VEC (Video EnCoder) IP.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Rob Herring <robh@kernel.org>
7 years agodrm/vc4: Add support for the VEC (Video Encoder) IP
Boris Brezillon [Fri, 2 Dec 2016 13:48:10 +0000 (14:48 +0100)]
drm/vc4: Add support for the VEC (Video Encoder) IP

The VEC IP is a TV DAC, providing support for PAL and NTSC standards.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
7 years agodrm: Add TV connector states to drm_connector_state
Boris Brezillon [Fri, 2 Dec 2016 13:48:09 +0000 (14:48 +0100)]
drm: Add TV connector states to drm_connector_state

Some generic TV connector properties are exposed in drm_mode_config, but
they are currently handled independently in each DRM encoder driver.

Extend the drm_connector_state to store TV related states, and modify the
drm_atomic_connector_{set,get}_property() helpers to fill the connector
state accordingly.

Each driver is then responsible for checking and applying the new config
in its ->atomic_mode_{check,set}() operations.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
7 years agodrm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum
Boris Brezillon [Fri, 2 Dec 2016 13:48:08 +0000 (14:48 +0100)]
drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum

List of values like the DRM_MODE_SUBCONNECTOR_xx ones are better
represented with enums.

Turn the DRM_MODE_SUBCONNECTOR_xx macros into an enum.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
7 years agodrm/vc4: Fix ->clock_select setting for the VEC encoder
Boris Brezillon [Fri, 2 Dec 2016 13:48:07 +0000 (14:48 +0100)]
drm/vc4: Fix ->clock_select setting for the VEC encoder

PV_CONTROL_CLK_SELECT_VEC is actually 2 and not 0. Fix the definition and
rework the vc4_set_crtc_possible_masks() to cover the full range of the
PV_CONTROL_CLK_SELECT field.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
7 years agoMerge tag 'drm-fsl-dcu-for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into...
Dave Airlie [Fri, 9 Dec 2016 02:43:17 +0000 (12:43 +1000)]
Merge tag 'drm-fsl-dcu-for-next' of git.agner.ch/git/linux-drm-fsl-dcu into drm-next

Some fixes and cleanup, mainly around fbdev emulation. It also adds a
new module parameter which allows to specify the color depth/bpp for
the fbdev emulation (like the IMX DRM driver).

* tag 'drm-fsl-dcu-for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu:
  drm/fsl-dcu: introduce kernel parameter to specify fbdev depth
  drm/fsl-dcu: remove separate compilation unit for fbdev emulation
  drm/fsl-dcu: Propagate the real error code
  drm/fsl-dcu: Remove unneeded NULL check
  drm/fsl-dcu: disable outputs before unloading driver
  drm/fsl-dcu: unload driver before disabling clocks

7 years agoMerge tag 'drm-misc-next-2016-12-08' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Fri, 9 Dec 2016 02:29:10 +0000 (12:29 +1000)]
Merge tag 'drm-misc-next-2016-12-08' of git://anongit.freedesktop.org/git/drm-misc into drm-next

Another pile of misc stuff, final one for 4.10. If there's some serious
bugfix still I'll send you a pull for drm-misc-next-fixes (like we do with
intel), otherwise this is it and next pull next year for 4.11.

Most interesting bits are probably Chris' fb helper fixes against mst
hotplug oopses.

* tag 'drm-misc-next-2016-12-08' of git://anongit.freedesktop.org/git/drm-misc: (22 commits)
  drm: Take ownership of the dmabuf->obj when exporting
  drm: Allow CAP_PRIME on !MODESET
  drm/fence: add drm_crtc_create_fence()
  drm/bridge: analogix: Don't return -EINVAL when panel doesn't support PSR
  drm/atomic: doc: remove old comment about nonblocking commits
  drm: Don't block the kworker waiting for mode_config.mutex in output_poll()
  drm: Return -ENOTSUPP when called for KMS cap with a non-KMS driver
  drm/amdgpu: don't add files at control minor debugfs directory
  drm: allow changing DPMS mode
  drm/qxl: fix use of uninitialized variable
  drm/qxl: Don't register debugfs for control minors
  drm/radeon: don't add files at control minor debugfs directory
  drm/vmwgfx: Switch to mode_cmd2
  drm/vgem: Use ww_mutex_(un)lock even with a NULL context
  drm: Make the connector .detect() callback optional
  drm/bridge: tc358767: don't warn if display side ASSR enable fails
  drm: Initialise drm_mm.head_node.allocated
  drm: Fix locking cargo-cult in encoder/plane init/cleanup
  drm/doc: Fix indenting in drm_modeset_lock.c comment
  drm: Protect fb_helper list manipulation with a mutex
  ...

7 years agoMerge branch 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Fri, 9 Dec 2016 02:28:16 +0000 (12:28 +1000)]
Merge branch 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux into drm-next

Misc fixes and cleanups for 4.10. Highlights:
- Cursor fixes for radeon and amdgpu
- DPM fixes for some new SI variants
- Powerplay fixes
- Clock and powergating fixes

* 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux: (39 commits)
  drm/amdgpu/dce6: Set MASTER_UPDATE_MODE to 0 in resume_mc_access as well
  drm/amdgpu: use pin rather than pin_restricted in a few cases
  drm/amd/powerplay: use pr_debug to print function not implemented message
  drm/amd/amdgpu: Add gpr reading for GFX v7
  drm/amd/amdgpu: Add gpr reading for GFX v6
  drm/amd/amdgpu: Add debugfs support for reading GPRs (v2)
  drm/amd/amdgpu: export vbios information (v2)
  drm/amd/amdgpu: stored bios_size
  drm/amdgpu: update golden setting of tonga
  drm/amdgpu/si: load the proper firmware on 0x87 oland boards
  drm/amdgpu: add additional pci revision to dpm workaround
  drm/radeon/si: load the proper firmware on 0x87 oland boards
  drm/radeon: add additional pci revision to dpm workaround
  drm/amd/powerplay: Fix potential NULL pointer issue
  drm/amdgpu: Don't touch GFX hw during HW fini
  drm/amd/powerplay: Adjust the position of data size initial
  drm/amd/powerplay: Ignore smu buffer usage
  drm/amd/powerplay: cut digest part
  drm/amdgpu: drop redundant vi_mqd define
  drm/amdgpu: fix gtt available page num accounting
  ...

7 years agoMerge tag 'omapdrm-4.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba...
Dave Airlie [Fri, 9 Dec 2016 02:27:54 +0000 (12:27 +1000)]
Merge tag 'omapdrm-4.10-fixes' of git://git./linux/kernel/git/tomba/linux into drm-next

omapdrm fixes for v4.10

* fix tpd12s015's error handling, which causes omap5 uevm HDMI to fail
* fix omapdrm primary plane allocation bug, which makes the display to fail to
  come up

* tag 'omapdrm-4.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  drm/omap: tpd12s015: fix error handling
  drm/omap: fix primary-plane's possible_crtcs
  drm: fix possible_crtc's type

7 years agodrm/amdgpu/dce6: Set MASTER_UPDATE_MODE to 0 in resume_mc_access as well
Michel Dänzer [Tue, 6 Dec 2016 09:33:03 +0000 (18:33 +0900)]
drm/amdgpu/dce6: Set MASTER_UPDATE_MODE to 0 in resume_mc_access as well

Looks like this was missed when dce_v6_0.c was added.

Fixes: e2cdf640cbb5 ("drm/amdgpu: add display controller implementation for si v10")
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amdgpu: use pin rather than pin_restricted in a few cases
Alex Deucher [Wed, 7 Dec 2016 21:14:38 +0000 (16:14 -0500)]
drm/amdgpu: use pin rather than pin_restricted in a few cases

We don't require a resticted pinning in these cases, so just
use plain pin.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: use pr_debug to print function not implemented message
Arindam Nath [Tue, 6 Dec 2016 07:58:12 +0000 (13:28 +0530)]
drm/amd/powerplay: use pr_debug to print function not implemented message

For CZ, some function pointers like display_configuration_changed
are not set. So when HW manager tries to configure display, we
end up with messages like

"[ powerplay ] this function not implement!"

in the logs. This message is informational, but lacks details
on which function is not implemented and why.

Rather than using KERN_INFO to print the message everytime the
system boots, we rather use pr_debug so that it is only printed
when debug prints are enabled at runtime.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Add gpr reading for GFX v7
Tom St Denis [Mon, 5 Dec 2016 18:24:49 +0000 (13:24 -0500)]
drm/amd/amdgpu: Add gpr reading for GFX v7

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Add gpr reading for GFX v6
Tom St Denis [Mon, 5 Dec 2016 18:24:07 +0000 (13:24 -0500)]
drm/amd/amdgpu: Add gpr reading for GFX v6

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: Add debugfs support for reading GPRs (v2)
Tom St Denis [Mon, 5 Dec 2016 16:39:19 +0000 (11:39 -0500)]
drm/amd/amdgpu: Add debugfs support for reading GPRs (v2)

Implemented for SGPRs for GFX v8 initially.

(v2) cleanup minor whitespace and remove sanity check and
     addressing is in dwords not bytes

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: export vbios information (v2)
Evan Quan [Wed, 7 Dec 2016 02:05:09 +0000 (10:05 +0800)]
drm/amd/amdgpu: export vbios information (v2)

Allows userspace components to fetch information
from the vbios image.

v2: agd: fix warning

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian Koenig <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: stored bios_size
Evan Quan [Wed, 7 Dec 2016 01:56:46 +0000 (09:56 +0800)]
drm/amd/amdgpu: stored bios_size

It's necessary if we want to export vbios image out.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian Koenig <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/omap: tpd12s015: fix error handling
Tomi Valkeinen [Tue, 22 Nov 2016 08:11:07 +0000 (10:11 +0200)]
drm/omap: tpd12s015: fix error handling

tpd12s015 driver is missing error value handling for gpio
initialization, causing 0 to be returned as an error if gpiod_get_*
fails. This may cause deferred probing to fail.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
7 years agodrm/omap: fix primary-plane's possible_crtcs
Tomi Valkeinen [Fri, 2 Dec 2016 14:07:11 +0000 (16:07 +0200)]
drm/omap: fix primary-plane's possible_crtcs

We set the possible_crtc for all planes to "(1 << priv->num_crtcs) - 1",
which is fine as the HW planes can be used fro all crtcs. However, when
we're doing that, we are still incrementing 'num_crtcs', and we'll end
up with bad possible_crtcs, preventing the use of the primary planes.

This patch passes a possible_crtcs mask to plane init function so that
we get correct possible_crtc.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
7 years agodrm: fix possible_crtc's type
Tomi Valkeinen [Fri, 2 Dec 2016 13:45:35 +0000 (15:45 +0200)]
drm: fix possible_crtc's type

drm_universal_plane_init() and drm_plane_init() take "unsigned long
possible_crtcs" parameter, but then stuff it into uint32_t. Change the
parameter to uint32_t.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
7 years agodrm: Take ownership of the dmabuf->obj when exporting
Chris Wilson [Wed, 7 Dec 2016 21:45:27 +0000 (21:45 +0000)]
drm: Take ownership of the dmabuf->obj when exporting

Currently the reference for the dmabuf->obj is incremented for the
dmabuf in drm_gem_prime_handle_to_fd() (at the high level userspace
interface), but is released in drm_gem_dmabuf_release() (the lowlevel
handler). Improve the symmetry of the dmabuf->obj ownership by acquiring
the reference in drm_gem_dmabuf_export(). This makes it easier to use
the prime functions directly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Update kerneldoc.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161207214527.22533-1-chris@chris-wilson.co.uk
7 years agodrm: Allow CAP_PRIME on !MODESET
Daniel Vetter [Wed, 7 Dec 2016 14:49:39 +0000 (15:49 +0100)]
drm: Allow CAP_PRIME on !MODESET

vgem (and our igt tests using vgem) need this. I suspect etnaviv will
fare similarly.

v2. Make it build. Oops.

Fixes: d5264ed3823a ("drm: Return -ENOTSUPP when called for KMS cap with a non-KMS driver")
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161207144939.22756-1-daniel.vetter@ffwll.ch
7 years agoMerge tag 'meson-drm-for-4.10' of github.com:superna9999/linux into drm-next
Dave Airlie [Thu, 8 Dec 2016 00:35:52 +0000 (10:35 +1000)]
Merge tag 'meson-drm-for-4.10' of github.com:superna9999/linux into drm-next

Add support for the Amlogic Meson Video Processing Unit
- Only CVBS/Composite output for Amlogic Meson GXBB/GXL/GXM SoCs
- Add MAINTAINERS entry
- Add DT bindings documentation

* tag 'meson-drm-for-4.10' of github.com:superna9999/linux:
  MAINTAINERS: add entry for Amlogic DRM drivers
  dt-bindings: display: add Amlogic Meson DRM Bindings
  drm: Add support for Amlogic Meson Graphic Controller

7 years agoMerge tag 'drm-intel-next-fixes-2016-12-07' of git://anongit.freedesktop.org/git...
Dave Airlie [Thu, 8 Dec 2016 00:33:26 +0000 (10:33 +1000)]
Merge tag 'drm-intel-next-fixes-2016-12-07' of git://anongit.freedesktop.org/git/drm-intel into drm-next

first set of fixes for -next.

* tag 'drm-intel-next-fixes-2016-12-07' of git://anongit.freedesktop.org/git/drm-intel:
  drm/i915: Move priority bumping for flips earlier
  drm/i915: Hold a reference on the request for its fence chain
  drm/i915/audio: fix hdmi audio noise issue
  drm/i915/debugfs: Increment return value of gt.next_seqno
  drm/i915/debugfs: Drop i915_hws_info
  drm/i915: Initialize dev_priv->atomic_cdclk_freq at init time
  drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things
  drm/i915: Make skl_write_{plane,cursor}_wm() static
  drm/i915: Complete requests in nop_submit_request
  drm/i915/gvt: fix lock not released bug for dispatch_workload() err path
  drm/i915/gvt: fix getting 64bit bar size error
  drm/i915/gvt: fix missing init param.primary

7 years agodrm: mxsfb: Select DRM_PANEL
Marek Vasut [Wed, 7 Dec 2016 21:23:29 +0000 (22:23 +0100)]
drm: mxsfb: Select DRM_PANEL

Select DRM_PANEL, since the MXSFB driver depends on it. Otherwise,
we get the following error when compiling:

drivers/built-in.o: In function `mxsfb_probe':
core.c:(.text+0x9ce9c): undefined reference to `drm_panel_attach'
core.c:(.text+0x9cff0): undefined reference to `drm_panel_detach'
drivers/built-in.o: In function `mxsfb_panel_connector_destroy':
core.c:(.text+0x9d614): undefined reference to `drm_panel_detach'
drivers/built-in.o: In function `mxsfb_create_output':
core.c:(.text+0x9d68c): undefined reference to `of_drm_find_panel'
make: *** [Makefile:962: vmlinux] Error 1

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Reported-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agodrm/fence: add drm_crtc_create_fence()
Gustavo Padovan [Tue, 6 Dec 2016 17:47:17 +0000 (15:47 -0200)]
drm/fence: add drm_crtc_create_fence()

Instead of dealing with crtc details inside drm_atomic.c we should
just export a function that creates a new crtc fence for us and
use that.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1481046437-18778-1-git-send-email-gustavo@padovan.org
7 years agodrm/bridge: analogix: Don't return -EINVAL when panel doesn't support PSR
zain wang [Wed, 7 Dec 2016 00:57:33 +0000 (08:57 +0800)]
drm/bridge: analogix: Don't return -EINVAL when panel doesn't support PSR

We will ignored PSR setting if panel not support it. So, in this case,
we should return from analogix_dp_enable/disable_psr() without any
error code. Let's retrun 0 instead of -EINVAL when panel not support PSR
in analogix_dp_enable/disable_psr().

Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1481072253-8917-1-git-send-email-wzz@rock-chips.com
7 years agodrm/amdgpu: update golden setting of tonga
Huang Rui [Tue, 2 Aug 2016 03:17:56 +0000 (11:17 +0800)]
drm/amdgpu: update golden setting of tonga

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/si: load the proper firmware on 0x87 oland boards
Alex Deucher [Mon, 5 Dec 2016 17:31:14 +0000 (12:31 -0500)]
drm/amdgpu/si: load the proper firmware on 0x87 oland boards

New variant.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amdgpu: add additional pci revision to dpm workaround
Alex Deucher [Mon, 5 Dec 2016 17:27:52 +0000 (12:27 -0500)]
drm/amdgpu: add additional pci revision to dpm workaround

New variant.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/radeon/si: load the proper firmware on 0x87 oland boards
Alex Deucher [Fri, 2 Dec 2016 05:23:35 +0000 (00:23 -0500)]
drm/radeon/si: load the proper firmware on 0x87 oland boards

New variant.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/radeon: add additional pci revision to dpm workaround
Alex Deucher [Fri, 2 Dec 2016 05:21:48 +0000 (00:21 -0500)]
drm/radeon: add additional pci revision to dpm workaround

New variant.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amd/powerplay: Fix potential NULL pointer issue
Xiangliang Yu [Wed, 30 Nov 2016 06:07:16 +0000 (14:07 +0800)]
drm/amd/powerplay: Fix potential NULL pointer issue

If doesn't enable dpm, the powerplay will not allocate memory for
hw management. So, hw_init_power_state_table function will reference
NULL pointer when resetting.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amdgpu: Don't touch GFX hw during HW fini
Xiangliang Yu [Wed, 30 Nov 2016 02:54:18 +0000 (10:54 +0800)]
drm/amdgpu: Don't touch GFX hw during HW fini

For SR-IOV client, driver shouldn't touch the GFX hw during HW
fini, otherwise, gfx will fail to start after rebooting guest os.

Signed-off-by: shaoyunl <Shaoyun.Liu@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: Adjust the position of data size initial
Xiangliang Yu [Fri, 2 Dec 2016 03:21:28 +0000 (11:21 +0800)]
drm/amd/powerplay: Adjust the position of data size initial

Put the initial part close to memory allocate, it will make code
more clear.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: Ignore smu buffer usage
Xiangliang Yu [Fri, 2 Dec 2016 03:15:41 +0000 (11:15 +0800)]
drm/amd/powerplay: Ignore smu buffer usage

SMU buffer is used for power feature, but for virtualization, the
power is controlled by hypervisor. Ignore it.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: cut digest part
Xiangliang Yu [Tue, 29 Nov 2016 08:53:52 +0000 (16:53 +0800)]
drm/amd/powerplay: cut digest part

For virtualization, FW size need to cut its digest part.

Signed-off-by: Frank Min <Frank.Min@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: drop redundant vi_mqd define
Xiangliang Yu [Tue, 29 Nov 2016 08:57:32 +0000 (16:57 +0800)]
drm/amdgpu: drop redundant vi_mqd define

Vi_structs.h has defined vi_mqd, drop redundant vi_mqd define.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix gtt available page num accounting
Flora Cui [Fri, 2 Dec 2016 08:51:20 +0000 (16:51 +0800)]
drm/amdgpu: fix gtt available page num accounting

Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: bypass fan table setup if no fan connected
Hawking Zhang [Thu, 1 Dec 2016 09:14:45 +0000 (17:14 +0800)]
drm/amd/powerplay: bypass fan table setup if no fan connected

If vBIOS noFan bit is set, the fan table parameters in thermal controller
will not get initialized. The driver should avoid to use these uninitialized
parameter to do calculation. Otherwise, it may trigger divide 0 error.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amd/amdgpu: validate the shadow BO.
Alex Xie [Wed, 30 Nov 2016 22:19:40 +0000 (17:19 -0500)]
drm/amd/amdgpu: validate the shadow BO.

Fixes a rare NULL pointer dereference in amdgpu_ttm_bind.

The issue was found by Nicolai Haehnle.
The patch was tested by Nicolai Haehnle.

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amd/powerplay: disable cg pg task when pp uninitialize.
Rex Zhu [Tue, 29 Nov 2016 10:33:19 +0000 (18:33 +0800)]
drm/amd/powerplay: disable cg pg task when pp uninitialize.

fix bug on uvd pg enabled, when reboot vm in pass through case,
we need to notify smu power up uvd/vce if they were power down.
otherwise, the vbios post will fail.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: no need to ungate uvd/vce clock when fini.
Rex Zhu [Thu, 24 Nov 2016 13:44:44 +0000 (21:44 +0800)]
drm/amdgpu: no need to ungate uvd/vce clock when fini.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/radeon: Hide the HW cursor while it's out of bounds
Michel Dänzer [Thu, 27 Oct 2016 05:54:31 +0000 (14:54 +0900)]
drm/radeon: Hide the HW cursor while it's out of bounds

Fixes hangs in that case under some circumstances.

v2:
* Only use non-0 x/yorigin if the cursor is (partially) outside of the
  top/left edge of the total surface with AVIVO/DCE

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1000433
Cc: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/radeon: Always store CRTC relative radeon_crtc->cursor_x/y values
Michel Dänzer [Thu, 27 Oct 2016 06:37:44 +0000 (15:37 +0900)]
drm/radeon: Always store CRTC relative radeon_crtc->cursor_x/y values

We were storing viewport relative coordinates for AVIVO/DCE display
engines. However, radeon_crtc_cursor_set2 and radeon_cursor_reset pass
radeon_crtc->cursor_x/y as the x/y parameters of
radeon_cursor_move_locked, which would break if the CRTC isn't located
at (0, 0).

Cc: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/radeon: Also call cursor_move_locked when the cursor size changes
Michel Dänzer [Thu, 27 Oct 2016 04:03:23 +0000 (13:03 +0900)]
drm/radeon: Also call cursor_move_locked when the cursor size changes

The cursor size also affects the register programming.

Cc: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: Only update the CUR_SIZE register when necessary
Michel Dänzer [Thu, 27 Oct 2016 08:44:07 +0000 (17:44 +0900)]
drm/amdgpu: Only update the CUR_SIZE register when necessary

Normally only necessary when the cursor size changes.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: Also call cursor_move_locked when the cursor size changes
Michel Dänzer [Thu, 27 Oct 2016 08:01:26 +0000 (17:01 +0900)]
drm/amdgpu: Also call cursor_move_locked when the cursor size changes

The cursor size also affects the register programming.

Cc: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: Store CRTC relative amdgpu_crtc->cursor_x/y values
Michel Dänzer [Thu, 27 Oct 2016 08:11:43 +0000 (17:11 +0900)]
drm/amdgpu: Store CRTC relative amdgpu_crtc->cursor_x/y values

We were storing viewport relative coordinates. However, crtc_cursor_set2
and cursor_reset pass amdgpu_crtc->cursor_x/y as the x/y parameters of
cursor_move_locked, which would break if the CRTC isn't located at
(0, 0).

Cc: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: enable GUI idle INT after enabling CGCG
Arindam Nath [Fri, 25 Nov 2016 11:25:16 +0000 (16:55 +0530)]
drm/amd/amdgpu: enable GUI idle INT after enabling CGCG

GUI idle interrupts should be enabled only after we
have enabled coarse grain clock gating (CGCG). This
prevents GFX engine generating idle interrupt even
though CGCG is not completely enabled.

Most of the time this goes un-noticed, but on some
Stoney ASICs this results in GFX engine hang after
system resumes from suspend. The issue is not
particular to Stoney though and could have occured
on any ASIC. The patch fixes this issue.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: Sunil Uttarwar <Sunil.Uttarwar1@amd.com>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amdgpu: enable VCE clockgating in Polaris-10/11
Maruthi Srinivas Bayyavarapu [Thu, 17 Nov 2016 11:59:50 +0000 (17:29 +0530)]
drm/amdgpu: enable VCE clockgating in Polaris-10/11

VCE clocks are set to be disabled, when not in use.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix CI bug uvd status not true in debugfs.
Rex Zhu [Fri, 25 Nov 2016 11:23:06 +0000 (19:23 +0800)]
drm/amdgpu: fix CI bug uvd status not true in debugfs.

can't get uvd's state by uvd_enabled. uvd_enabled
is used for request higher mclk.
in multi-display case, mclk has been in highest clock,
no matter uvd's state changed, uvd_enabled will not
be changed.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: remove error message when loading driver
Xiangliang Yu [Thu, 24 Nov 2016 08:28:46 +0000 (16:28 +0800)]
drm/amdgpu: remove error message when loading driver

Forget to check UCODE_ID_STORAGE case and will cause to print error
message when loading driver, correct it.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/powerplay: fix firmware loading failure
Xiangliang Yu [Sun, 20 Nov 2016 15:00:26 +0000 (23:00 +0800)]
drm/amd/powerplay: fix firmware loading failure

For virtualization, firmware loading need the firmware version info,
and will load the right firmware. So, transfer fw_version to toc.

Signed-off-by: Frank Min <Frank.Min@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: fix bug mclk can't change on Polaris
Rex Zhu [Wed, 23 Nov 2016 10:09:22 +0000 (18:09 +0800)]
drm/amdgpu: fix bug mclk can't change on Polaris

the root cause is we gate the clock to uvd vcpu.
mclk's change should need the response from uvd if
it is power on.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: refine uvd 6.0 clock gate feature.
Rex Zhu [Wed, 9 Nov 2016 06:26:16 +0000 (14:26 +0800)]
drm/amdgpu: refine uvd 6.0 clock gate feature.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu/gfx8: move eop programming per queue
Alex Deucher [Tue, 15 Nov 2016 22:33:09 +0000 (17:33 -0500)]
drm/amdgpu/gfx8: move eop programming per queue

It's per queue not per pipe.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoRevert "drm/amdgpu: use the kernel zone memory size as the max remote memory in amdgpu"
Alex Deucher [Tue, 15 Nov 2016 21:55:53 +0000 (16:55 -0500)]
Revert "drm/amdgpu: use the kernel zone memory size as the max remote memory in amdgpu"

This reverts commit a693e050edfe794fea81d7cfe72429a406aa380b.

This breaks on systems with huge amounts of system memory as we do not have
enough vram to store the page tables.  Additionally, this is less of an issue
with the recent gtt manager changes.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/atomic: doc: remove old comment about nonblocking commits
Gustavo Padovan [Mon, 5 Dec 2016 14:03:46 +0000 (12:03 -0200)]
drm/atomic: doc: remove old comment about nonblocking commits

We now support nonblocking commits on drm_atomic_helper_commit()
so the comment is not valid anymore.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1480946626-30917-1-git-send-email-gustavo@padovan.org
7 years agodrm/panel: simple: Add support for AUO G185HAN01
Lucas Stach [Wed, 30 Nov 2016 13:09:56 +0000 (14:09 +0100)]
drm/panel: simple: Add support for AUO G185HAN01

This adds support for the AU Optronics G185HAN01 18.5" LVDS FullHD TFT
LCD panel, which can be supported by the simple panel driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/panel: simple: Add support for AUO G133HAN01
Lucas Stach [Wed, 30 Nov 2016 13:09:55 +0000 (14:09 +0100)]
drm/panel: simple: Add support for AUO G133HAN01

This adds support for the AU Optronics G133HAN01 13.3" LVDS FullHD TFT
LCD panel, which can be supported by the simple panel driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/panel: simple: Add more properties to Innolux G121I1-L01
Lucas Stach [Wed, 30 Nov 2016 13:09:54 +0000 (14:09 +0100)]
drm/panel: simple: Add more properties to Innolux G121I1-L01

Convert from a single mode to display timings, which allow to describe
the minimum/maximium blanking and clock rates, add enable/disable delays
and provide the bus format.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/panel: simple: Add bits-per-component for Sharp LQ123P1JX31
zain wang [Sat, 19 Nov 2016 02:27:16 +0000 (10:27 +0800)]
drm/panel: simple: Add bits-per-component for Sharp LQ123P1JX31

The Sharp LQ123P1JX31 panel support 8 bits per component.

Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/panel: simple: Check against num_timings when setting preferred for timing
Chen-Yu Tsai [Mon, 24 Oct 2016 13:21:15 +0000 (21:21 +0800)]
drm/panel: simple: Check against num_timings when setting preferred for timing

In the loop on .timings, we should check .num_timings to see if it's the
only mode specified, not .num_modes, which should be used with .modes.

Fixes: cda553725c92 ("drm/panel: simple: Set appropriate mode type")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/panel: Add support for Chunghwa CLAA070WP03XG panel
Randy Li [Mon, 19 Sep 2016 19:02:51 +0000 (03:02 +0800)]
drm/panel: Add support for Chunghwa CLAA070WP03XG panel

The Chunghwa CLAA070WP03XG is a 7" 1280x800 panel, which can be
supported by the simple panel driver.

Signed-off-by: Randy Li <ayaka@soulik.info>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm: Don't block the kworker waiting for mode_config.mutex in output_poll()
Chris Wilson [Tue, 6 Dec 2016 11:37:15 +0000 (11:37 +0000)]
drm: Don't block the kworker waiting for mode_config.mutex in output_poll()

If we cannot acquire the mode_config.mutex immediately, just back off and
queue a new attempt after the poll interval. This is mostly to stop the
hung task spam when the system is deadlocked, but it will also lessen
the load (in such extreme cases).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[danvet:s/lock/mutex/ per Eric's comment.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161206113715.30382-1-chris@chris-wilson.co.uk
7 years agodrm: Return -ENOTSUPP when called for KMS cap with a non-KMS driver
Michel Dänzer [Thu, 1 Dec 2016 07:37:31 +0000 (16:37 +0900)]
drm: Return -ENOTSUPP when called for KMS cap with a non-KMS driver

This is an attempt to make the previous fix a bit more robust going
forward.

v2:
* Only allow DRM_CAP_TIMESTAMP_MONOTONIC with UMS drivers (Daniel
  Vetter, Alex Deucher)
* Different logic to keep DRM_CAP_TIMESTAMP_MONOTONIC separate from
  the other caps (Daniel Vetter)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161201073731.5716-1-michel@daenzer.net
7 years agoMerge remote-tracking branch 'airlied/drm-next' into drm-misc-next
Daniel Vetter [Tue, 6 Dec 2016 09:26:30 +0000 (10:26 +0100)]
Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next

Backmerge v4.9-rc8 to get at

commit e94bd1736f1f60e916a85a80c0b0ebeaae36cce5
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed Nov 30 17:30:01 2016 +0900

drm: Don't call drm_for_each_crtc with a non-KMS driver

so I can apply Michel's follow-up patch.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
7 years agodrm/amdgpu: don't add files at control minor debugfs directory
Nicolai Stange [Mon, 5 Dec 2016 20:30:22 +0000 (21:30 +0100)]
drm/amdgpu: don't add files at control minor debugfs directory

Since commit 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"), a
struct drm_device's ->control member is always NULL.

In the case of CONFIG_DEBUG_FS=y, amdgpu_debugfs_add_files() accesses
->control->debugfs_root though. This results in a NULL pointer
dereference.

Fix this by omitting the drm_debugfs_create_files() call for the
control minor debugfs directory which is now non-existent anyway.

Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes")
Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98915
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161205203022.11671-1-nicstange@gmail.com
7 years agodrm: allow changing DPMS mode
Marta Lofstedt [Mon, 5 Dec 2016 12:04:08 +0000 (14:04 +0200)]
drm: allow changing DPMS mode

The drm_atomic_helper_connector_dpms
will set the connector back the old DPMS state
before returning. This makes it impossible to change
DPMS state of the connector.

Fixes: 0853695c3ba46f97dfc0b5885f7b7e640ca212dd
v2: edit of commit message
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: dri-devel@lists.freedesktop.org
Cc: <drm-intel-fixes@lists.freedesktop.org>
Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161205120408.13056-1-marta.lofstedt@intel.com
7 years agoMAINTAINERS: add entry for Amlogic DRM drivers
Neil Armstrong [Mon, 28 Nov 2016 09:39:45 +0000 (10:39 +0100)]
MAINTAINERS: add entry for Amlogic DRM drivers

Add myself as maintainer for Amlogic DRM drivers.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
7 years agodt-bindings: display: add Amlogic Meson DRM Bindings
Neil Armstrong [Fri, 25 Nov 2016 15:10:56 +0000 (16:10 +0100)]
dt-bindings: display: add Amlogic Meson DRM Bindings

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
7 years agoMerge branch 'drm-next/mxsfb' of git://git.kernel.org/pub/scm/linux/kernel/git/marex...
Dave Airlie [Tue, 6 Dec 2016 04:40:50 +0000 (14:40 +1000)]
Merge branch 'drm-next/mxsfb' of git://git./linux/kernel/git/marex/linux-2.6 into drm-next

Add new driver for MXSFB.

* 'drm-next/mxsfb' of git://git.kernel.org/pub/scm/linux/kernel/git/marex/linux-2.6:
  drm: Add new driver for MXSFB controller
  dt-bindings: mxsfb: Add new bindings for the MXSFB driver
  dt-bindings: mxsfb: Indentation cleanup

7 years agodrm: Add new driver for MXSFB controller
Marek Vasut [Thu, 18 Aug 2016 18:23:01 +0000 (20:23 +0200)]
drm: Add new driver for MXSFB controller

Add new driver for the MXSFB controller found in i.MX23/28/6SX .
The MXSFB controller is a simple framebuffer controller with one
parallel LCD output. Unlike the MXSFB fbdev driver that is used
on these systems now, this driver uses the DRM/KMS framework.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
7 years agodt-bindings: mxsfb: Add new bindings for the MXSFB driver
Marek Vasut [Tue, 23 Aug 2016 12:56:12 +0000 (14:56 +0200)]
dt-bindings: mxsfb: Add new bindings for the MXSFB driver

Add new DT bindings for new MXSFB driver that is using the
OF graph to parse the video output structure instead of
hard-coding the display properties into the MXSFB node.
The old MXSFB fbdev driver bindings are preserved in the
same file in the "Old bindings" section.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Rob Herring <robh@kernel.org>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
7 years agodt-bindings: mxsfb: Indentation cleanup
Marek Vasut [Sun, 25 Sep 2016 18:52:54 +0000 (20:52 +0200)]
dt-bindings: mxsfb: Indentation cleanup

Clean up the ad-hoc indentation in the documentation, no functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
7 years agoMerge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daein...
Dave Airlie [Tue, 6 Dec 2016 01:09:21 +0000 (11:09 +1000)]
Merge branch 'exynos-drm-next' of git://git./linux/kernel/git/daeinki/drm-exynos into drm-next

Just refactoring HDMI driver by using infoframe helper
function, fixing GSC Kconfig dependency issue and including trivial
cleanups.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos: Use VIDEO_SAMSUNG_EXYNOS_GSC=n as GSC Kconfig dependency
  drm/exynos: gsc: fix spelling mistakes
  exynos-drm: Fix error messages to print flags and size
  drm/exynos/hdmi: refactor infoframe code

7 years agoMerge branch 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Tue, 6 Dec 2016 01:01:33 +0000 (11:01 +1000)]
Merge branch 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux into drm-next

- lots of code cleanup
- lots of bug fixes
- expose rpm based fan info via hwmon
- lots of clock and powergating fixes
- SI register header cleanup and conversion to common format used by newer asics

* 'drm-next-4.10' of git://people.freedesktop.org/~agd5f/linux: (54 commits)
  drm/amdgpu: drop is_display_hung from display funcs
  drm/amdgpu/uvd: reduce IB parsing overhead on UVD5+ (v2)
  drm/amdgpu/uvd: consolidate code for fetching addr from ctx
  drm/amdgpu: Disable DPM in virtualization
  drm/amdgpu: use AMDGPU_GEM_CREATE_VRAM_CLEARED for VM PD/PTs (v2)
  drm/amdgpu: improve AMDGPU_GEM_CREATE_VRAM_CLEARED handling (v2)
  drm/amdgpu: fix error handling in amdgpu_bo_create_restricted
  drm/amdgpu: fix amdgpu_fill_buffer (v2)
  drm/amdgpu: remove amdgpu_irq_get_delayed
  amdgpu: Wrap dev_err() calls on vm faults with printk_ratelimit()
  amdgpu: Use dev_err() over vanilla printk() in vm_decode_fault()
  drm/amd/amdgpu: port of DCE v6 to new headers (v3)
  drm/amdgpu: cleanup unused iterator members for sdma v2.4
  drm/amdgpu: cleanup unused iterator members for sdma v3
  drm/amdgpu:impl vgt_flush for VI(V5)
  drm/amdgpu: enable uvd mgcg for Fiji.
  drm/amdgpu: refine cz uvd clock gate logic.
  drm/amdgpu: change log level to KERN_INFO in ci_dpm.c
  drm/amdgpu: always un-gate UVD REGS path.
  drm/amdgpu/sdma: fix typo in packet setup
  ...

7 years agoMerge branch 'drm-etnaviv-next' of git://git.pengutronix.de/lst/linux into drm-next
Dave Airlie [Tue, 6 Dec 2016 01:00:16 +0000 (11:00 +1000)]
Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de/lst/linux into drm-next

- fix dma-buf export path to return correct SG table
- trivially implement direct dma-buf mapping
- allow DRAW_INSTANCED commands in validator
- make the driver work on i.MX6SX, yielding a working 2D/3D stack
together with Mareks MXS DRM driver

* 'drm-etnaviv-next' of git://git.pengutronix.de/lst/linux:
  MAINTAINERS: add etnaviv mailinglist
  drm/etnaviv: move linear window on MC1.0 parts if necessary
  drm/etnaviv: don't invoke OOM killer from dump code
  drm/etnaviv: fix gem_prime_get_sg_table to return new SG table
  drm/etnaviv: Allow DRAW_INSTANCED commands
  drm/etnaviv: implement dma-buf mmap

7 years agoMerge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next
Dave Airlie [Mon, 5 Dec 2016 23:34:43 +0000 (09:34 +1000)]
Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next

- BIT_PERF_PTRS uses 32-bit pointers to its subtables, we were parsing
them as 16-bit, causing various issues on newer boards.
- Support for MXM on GM20x and up.
- More display-related fixes.

* 'linux-4.10' of git://github.com/skeggsb/linux:
  drm/nouveau/mxm: warn more loudly on unsupported DCB version
  drm/nouveau/mxm: handle DCB 4.1 modification
  drm/nouveau/bios/mxm: handle digital connector table 1.1
  drm/nouveau: Queue hpd_work on (runtime) resume
  drm/nouveau: Rename acpi_work to hpd_work
  drm/nouveau/kms/nv50: Fix atomic pageflip events.
  drm/nouveau/fb/ram/gp100-: fix memory detection where FBP_NUM != FBPA_NUM
  drm/nouveau/bios/volt: pointers are 32-bit
  drm/nouveau/bios/vmap: pointers are 32-bit
  drm/nouveau/bios/timing: pointers are 32-bit
  drm/nouveau/bios/therm: pointers are 32-bit
  drm/nouveau/bios/perf: pointers are 32-bit
  drm/nouveau/bios/iccsense: pointers are 32-bit
  drm/nouveau/bios/fan: pointers are 32-bit
  drm/nouveau/bios/cstep: pointers are 32-bit
  drm/nouveau/bios/boost: pointers are 32-bit

7 years agodrm/nouveau/mxm: warn more loudly on unsupported DCB version
Ben Skeggs [Mon, 5 Dec 2016 23:03:59 +0000 (09:03 +1000)]
drm/nouveau/mxm: warn more loudly on unsupported DCB version

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/mxm: handle DCB 4.1 modification
Ben Skeggs [Mon, 5 Dec 2016 23:03:04 +0000 (09:03 +1000)]
drm/nouveau/mxm: handle DCB 4.1 modification

Allows MXM DCB modification to be handled on GM20x and newer boards.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/bios/mxm: handle digital connector table 1.1
Ben Skeggs [Mon, 5 Dec 2016 22:59:31 +0000 (08:59 +1000)]
drm/nouveau/bios/mxm: handle digital connector table 1.1

I suspect the version bump is just to signify that the table now specifies
pad macro/links instead of SOR/sublinks.

For our usage of the table, just recognising the new version is enough.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/qxl: fix use of uninitialized variable
Pan Bian [Sat, 3 Dec 2016 15:11:42 +0000 (23:11 +0800)]
drm/qxl: fix use of uninitialized variable

In function qxl_release_alloc(), when kmalloc() returns a NULL pointer,
it returns value 0 and parameter *ret is uninitialized. 0 means no error
to the callers of qxl_release_alloc(). The callers keep going and will
try to reference the uninitialized variable. This patch fixes the bug,
returning "-ENOMEM" when kmalloc() fails.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188911

Signed-off-by: Pan Bian <bianpan2016@163.com>
[seanpaul fixed up subject prefix]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1480777902-7648-1-git-send-email-bianpan2016@163.com
7 years agodrm/exynos: Use VIDEO_SAMSUNG_EXYNOS_GSC=n as GSC Kconfig dependency
Javier Martinez Canillas [Tue, 29 Nov 2016 14:40:51 +0000 (11:40 -0300)]
drm/exynos: Use VIDEO_SAMSUNG_EXYNOS_GSC=n as GSC Kconfig dependency

Commit aeefb36832e5 ("drm/exynos: gsc: add device tree support and remove
usage of static mappings") made the DRM_EXYNOS_GSC Kconfig symbol to only
be selectable if the exynos-gsc V4L2 driver isn't enabled, since both use
the same HW IP block.

But added the dependency as depends on !VIDEO_SAMSUNG_EXYNOS_GSC which is
not correct since Kconfig expressions are not boolean but tristate. So it
will only evaluate to 'n' if VIDEO_SAMSUNG_EXYNOS_GSC=y but will evaluate
to 'm' if VIDEO_SAMSUNG_EXYNOS_GSC=m.

This means that both the V4L2 and DRM drivers can be enabled if the former
is enabled as a module, which isn't what we want since otherwise 2 drivers
could attempt to use the hardware at the same time.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos: gsc: fix spelling mistakes
Colin Ian King [Wed, 2 Nov 2016 02:23:36 +0000 (20:23 -0600)]
drm/exynos: gsc: fix spelling mistakes

Trivial fixes to spelling mistakes "precalser" to "prescaler"
in dev_err messages

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agoexynos-drm: Fix error messages to print flags and size
Shuah Khan [Wed, 10 Aug 2016 17:30:36 +0000 (11:30 -0600)]
exynos-drm: Fix error messages to print flags and size

Fix exynos_drm_gem_create() error messages to include flags and size when
flags and size are invalid.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/exynos/hdmi: refactor infoframe code
Andrzej Hajda [Mon, 7 Nov 2016 15:04:43 +0000 (16:04 +0100)]
drm/exynos/hdmi: refactor infoframe code

Use core helpers to generate infoframes and generate vendor frame if necessary.

Changelog:
- changed 'ret >= 0' checks to '!ret'

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agodrm/i915: Move priority bumping for flips earlier
Chris Wilson [Mon, 28 Nov 2016 14:36:48 +0000 (14:36 +0000)]
drm/i915: Move priority bumping for flips earlier

David found another issue with priority bumping from mmioflips, where we
are accessing the requests concurrently to them being retired and freed.
Whilst we are skipping the dependency if has been submitted, that is not
sufficient to stop the dependency from disappearing if another thread
retires that request. To prevent we can either employ the struct_mutex (or a
request mutex in the future) to serialise retiring before it is freed.
Alternatively, we need to keep the dependencies alive using RCU whilst
they are being accessed via the DFS.

[ 1746.698111] general protection fault: 0000 [#1] PREEMPT SMP
[ 1746.698305] Modules linked in: snd_hda_intel snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core coretemp crct10dif_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei i915 e1000e ptp pps_core i2c_hid
[ 1746.698750] CPU: 1 PID: 6716 Comm: kworker/u8:2 Not tainted 4.9.0-rc6-CI-Nightly_816+ #1
[ 1746.698871] Hardware name: GIGABYTE GB-BKi7A-7500/MFLP7AP-00, BIOS F1 07/27/2016
[ 1746.699125] Workqueue: events_unbound intel_mmio_flip_work_func [i915]
[ 1746.699266] task: ffff880260a5e800 task.stack: ffffc90000f6c000
[ 1746.699361] RIP: 0010:[<ffffffffa006595d>]  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
[ 1746.699632] RSP: 0018:ffffc90000f6fcd8  EFLAGS: 00010206
[ 1746.699724] RAX: dead0000000000f8 RBX: ffff8801f64b2bf0 RCX: ffff8801f64b2c10
[ 1746.699842] RDX: dead000000000100 RSI: 0000000000000000 RDI: ffff8801f64b0458
[ 1746.699972] RBP: ffffc90000f6fd68 R08: ffff88026488dc00 R09: 0000000000000002
[ 1746.700090] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000400
[ 1746.700195] R13: ffffc90000f6fcf0 R14: ffff88020955aa40 R15: ffff88020955aa68
[ 1746.700307] FS:  0000000000000000(0000) GS:ffff88026dc80000(0000) knlGS:0000000000000000
[ 1746.700435] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1746.700532] CR2: 0000000002a69e90 CR3: 0000000002c07000 CR4: 00000000003406e0
[ 1746.700635] Stack:
[ 1746.700682]  ffff880260a5e880 ffffc90000f6fd50 ffffffff810af69a ffffc90000f6fd28
[ 1746.700827]  ffff88020955a628 ffff8801e1eaebf0 0000000000000020 0000000000000000
[ 1746.700947]  00000196af1edc96 ffff88025dfa4000 ffff8801f0b030a8 ffffc90000f6fcf0
[ 1746.701071] Call Trace:
[ 1746.701117]  [<ffffffff810af69a>] ? dequeue_entity+0x25a/0xb50
[ 1746.701260]  [<ffffffffa00516be>] fence_set_priority+0x7e/0x80 [i915]
[ 1746.701406]  [<ffffffffa0051a15>] i915_gem_object_wait_priority+0x85/0x160 [i915]
[ 1746.701599]  [<ffffffffa008ccd7>] intel_mmio_flip_work_func+0x47/0x2b0 [i915]
[ 1746.701717]  [<ffffffff81094c4d>] process_one_work+0x14d/0x470
[ 1746.701809]  [<ffffffff81094fb3>] worker_thread+0x43/0x4e0
[ 1746.701888]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
[ 1746.701969]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
[ 1746.702072]  [<ffffffff8109a4d5>] kthread+0xc5/0xe0
[ 1746.702152]  [<ffffffff81771c59>] ? _raw_spin_unlock_irq+0x9/0x10
[ 1746.702234]  [<ffffffff8109a410>] ? kthread_park+0x60/0x60
[ 1746.702318]  [<ffffffff81772272>] ret_from_fork+0x22/0x30
[ 1746.702387] Code: 89 42 08 48 8b 45 88 48 89 55 c0 4c 89 6d c8 4c 8d 70 d8 4d 8d 7e 28 4d 39 ef 74 72 49 8b 1e 48 8b 13 48 39 d3 48 8d 42 f8 74 3e <48> 8b 10 8b 52 38 41 39 d4 7e 26 48 8b 50 30 48 8b 78 28 48 8d
[ 1746.702921] RIP  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.703027]  RSP <ffffc90000f6fcd8>

Fixes: 27745e829a5c ("drm/i915/execlists: Use a local lock for dfs_link access")
Fixes: 9a151987d709 ("drm/i915: Add execution priority boosting for mmioflips")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Weinehall <david.weinehall@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161128143649.4289-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 92117f0bce64268b841261774e45462cc7ff80af)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
7 years agodrm/i915: Hold a reference on the request for its fence chain
Chris Wilson [Fri, 25 Nov 2016 13:17:17 +0000 (13:17 +0000)]
drm/i915: Hold a reference on the request for its fence chain

Currently, we have an active reference for the request until it is
retired. Though it cannot be retired before it has been executed by
hardware, the request may be completed before we have finished
processing the execute fence, i.e. we may continue to process that fence
as we free the request.

Fixes: 5590af3e115a ("drm/i915: Drive request submission through fence callbacks")
Fixes: 23902e49c999 ("drm/i915: Split request submit/execute phase into two")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161125131718.20978-3-chris@chris-wilson.co.uk
(cherry picked from commit 48bc2a4a427ad81578f887d71d45794619a77211)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
7 years agodrm/i915/audio: fix hdmi audio noise issue
Libin Yang [Fri, 11 Nov 2016 08:46:28 +0000 (16:46 +0800)]
drm/i915/audio: fix hdmi audio noise issue

Some monitors will have noise or even no sound after
applying the patch 6014ac12.

In patch 6014ac12, it will reset the cts value to 0 for HDMI.
However, we need to disable Enable CTS or M Prog bit. This is
the initial setting after HW reset.

Fixes: 6014ac122ed0 ("drm/i915/audio: set proper N/M in modeset")
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1478853988-139842-1-git-send-email-libin.yang@intel.com
(cherry picked from commit 60abfbb86a8d51576f90c5adcbb4f547a2952782)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
7 years agodrm/i915/debugfs: Increment return value of gt.next_seqno
Chris Wilson [Thu, 24 Nov 2016 09:47:52 +0000 (09:47 +0000)]
drm/i915/debugfs: Increment return value of gt.next_seqno

The i915_next_seqno read value is to be the next seqno used by the
kernel. However, in the conversion to atomics ops for gt.next_seqno, in
commit 28176ef4cfa5 ("drm/i915: Reserve space in the global seqno during
request allocation"), this was changed from a post-increment to a
pre-increment. This increment was missed from the value reported by
debugfs, so in effect it was reporting the current seqno (last
assigned), not the next seqno.

Fixes: 28176ef4cfa5 ("drm/i915: Reserve space in the global seqno during request allocation")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81209
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161124094752.19129-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit 9607ae79710afb453173b90d5bf564788a6e09b1)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
7 years agodrm/i915/debugfs: Drop i915_hws_info
Chris Wilson [Thu, 24 Nov 2016 09:34:01 +0000 (09:34 +0000)]
drm/i915/debugfs: Drop i915_hws_info

i915_hws_info() has not been kept upto date (missing new engines) and so
I consider it to be unused. HWS is included in the error state, which
would be an avenue to retrieving it if required in future (possibly via
i915_engine_info). As it is currently oopsing with an rpm testcase, just
remove it.

Fixes: 3b3f1650b1ca ("drm/i915: Allocate intel_engine_cs structure only for the enabled engines")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98838
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161124093401.18852-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 30576a2c462d9658508c3de67601aa565f973064)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
7 years agodrm/i915: Initialize dev_priv->atomic_cdclk_freq at init time
Ville Syrjälä [Tue, 29 Nov 2016 14:13:57 +0000 (16:13 +0200)]
drm/i915: Initialize dev_priv->atomic_cdclk_freq at init time

Looks like we're only initializing dev_priv->atomic_cdclk_freq
at resume and commit times, not at init time. Let's do that as
well.

We're now hitting the 'WARN_ON(intel_state->cdclk == 0)' in
hsw_compute_linetime_wm() on account of populating
intel_state->cdclk from dev_priv->atomic_cdclk_freq.
Previously we were mispopulating intel_state->cdclk with
dev_priv->cdclk_freq which always had a proper value at init
time and hence the WARN_ON() didn't trigger.

Cc: <stable@vger.kernel.org> # 4.6+: 14676ec6b1a6 drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things
Cc: <stable@vger.kernel.org> # 4.6+
Cc: Matthew Auld <matthew.auld@intel.com>
Reported-by: Matthew Auld <matthew.auld@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98902
Fixes: 14676ec6b1a6 ("drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1480428837-4207-1-git-send-email-ville.syrjala@linux.intel.com
Tested-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
(cherry picked from commit 6a259b1f8a9e99b1ed114f8bf8b0cfccee130e54)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
7 years agodrm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things
Ville Syrjälä [Mon, 14 Nov 2016 16:35:09 +0000 (18:35 +0200)]
drm/i915: Fix cdclk vs. dev_cdclk mess when not recomputing things

When we end up not recomputing the cdclk, we need to populate
intel_state->cdclk with the "atomic_cdclk_freq" instead of the
current cdclk_freq. When no pipes are active, the actual cdclk_freq
may be lower than what the configuration of the planes and
pipes would require from the point of view of the software state.

This fixes bogus WARNS from skl_max_scale() which is trying to check
the plane software state against the cdclk frequency. So any time
it got called during DPMS off for instance, we might have tripped
the warn if the current mode would have required a higher than
minimum cdclk.

v2: Drop the dev_cdclk stuff (Maarten)

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: bruno.pagani@ens-lyon.org
Cc: Daniel J Blueman <daniel.blueman@gmail.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Joseph Yasi <joe.yasi@gmail.com>
Tested-by: Paul Bolle <pebolle@tiscali.nl>
Tested-by: Joseph Yasi <joe.yasi@gmail.com> (v1)
Cc: <stable@vger.kernel.org> # v4.6+
Fixes: 1a617b77658e ("drm/i915: Keep track of the cdclk as if all crtc's were active.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98214
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479141311-11904-2-git-send-email-ville.syrjala@linux.intel.com
(cherry picked from commit e0ca7a6be38ce603d26df5707c22e53870a623e0)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>