openwrt/staging/blogic.git
7 years agodrm/vmwgfx: Bump the version for fence FD support
Sinclair Yeh [Wed, 5 Jul 2017 08:51:42 +0000 (01:51 -0700)]
drm/vmwgfx: Bump the version for fence FD support

Minor version bump to indicate support for fence FD

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Singh Rawat <drawat@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
7 years agodrm/vmwgfx: Add export fence to file descriptor support
Sinclair Yeh [Wed, 5 Jul 2017 08:49:32 +0000 (01:49 -0700)]
drm/vmwgfx: Add export fence to file descriptor support

Added code to link a fence to a out_fence_fd file descriptor and
thread out_fence_fd down to vmw_execbuf_copy_fence_user() so it can be
copied into the IOCTL reply and be passed back up the the user.

v2:
Make sure to sync and clean up in case of failure

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Singh Rawat <drawat@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
7 years agodrm/vmwgfx: Add support for imported Fence File Descriptor
Sinclair Yeh [Wed, 5 Jul 2017 08:45:40 +0000 (01:45 -0700)]
drm/vmwgfx: Add support for imported Fence File Descriptor

This allows vmwgfx to wait on a fence created by another
device.

v2:
* Remove special handling for vmwgfx fence and just use dma_fence_wait()
* Use interruptible waits
* Added function documentation

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Singh Rawat <drawat@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
7 years agodrm/vmwgfx: Prepare to support fence fd
Sinclair Yeh [Wed, 5 Jul 2017 08:37:55 +0000 (01:37 -0700)]
drm/vmwgfx: Prepare to support fence fd

Make the fields and flags available.

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Singh Rawat <drawat@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
7 years agodrm/vmwgfx: Fix incorrect command header offset at restart
Thomas Hellstrom [Thu, 24 Aug 2017 06:06:31 +0000 (08:06 +0200)]
drm/vmwgfx: Fix incorrect command header offset at restart

Sometimes it appears like the device modifies the command header offset
member. So explicitly clear it when restarting after an error.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
7 years agodrm/vmwgfx: Support the NOP_ERROR command
Thomas Hellstrom [Thu, 24 Aug 2017 06:06:30 +0000 (08:06 +0200)]
drm/vmwgfx: Support the NOP_ERROR command

Can be used by user-space applications to test and verify the kernel
command buffer error recovery functionality.

Malicious user-space apps could potentially use this command to slow down
graphics processing somewhat, but they could also accomplish the same thing
using a random malformed command so this should be considered safe.
At least as safe as it gets.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
7 years agodrm/vmwgfx: Restart command buffers after errors
Thomas Hellstrom [Thu, 24 Aug 2017 06:06:29 +0000 (08:06 +0200)]
drm/vmwgfx: Restart command buffers after errors

Previously we skipped the command buffer and added an extra fence to
avoid hangs due to skipped fence commands.
Now we instead restart the command buffer after the failing command,
if there are any commands left.
In addition we print out some information about the failing command
and its location in the command buffer.

Testing Done: ran glxgears using mesa modified to send the NOP_ERROR
command before each 10th clear and verified that we detected the device
error properly and that there were no other device errors caused by
incorrectly ordered command buffers. Also ran the piglit "quick" test
suite which generates a couple of device errors and verified that
they were handled as intended.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
7 years agodrm/vmwgfx: Move irq bottom half processing to threads
Thomas Hellstrom [Thu, 24 Aug 2017 06:06:28 +0000 (08:06 +0200)]
drm/vmwgfx: Move irq bottom half processing to threads

This gets rid of the irq bottom half tasklets and instead performs the
work needed in process context. We also convert irq-disabling spinlocks to
ordinary spinlocks.

This should decrease system latency for other system components, like
sound for example but has the potential to increase latency for processes
that wait on the GPU.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
7 years agodrm/vmwgfx: Don't use drm_irq_[un]install
Thomas Hellstrom [Thu, 24 Aug 2017 06:06:27 +0000 (08:06 +0200)]
drm/vmwgfx: Don't use drm_irq_[un]install

We're not allowed to change the upstream version of the drm_irq_install
function to be able to incorporate threaded irqs. So roll our own irq
install- and uninstall functions instead of relying on the drm core ones.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
7 years agoMerge branch 'linux-4.14' of git://github.com/skeggsb/linux into drm-next
Dave Airlie [Tue, 22 Aug 2017 19:32:26 +0000 (05:32 +1000)]
Merge branch 'linux-4.14' of git://github.com/skeggsb/linux into drm-next

Not a lot that's ready to be included this round for Nouveau.  GP108
modesetting support, and misc other fixes.

* 'linux-4.14' of git://github.com/skeggsb/linux:
  drm/nouveau/kms/nv50: perform null check on msto[i] rathern than msto
  drm/nouveau/pci/msi: disable MSI on big-endian platforms by default
  drm/nouveau: silence suspend/resume debugging messages
  drm/nouveau/kms/nv04-nv4x: fix exposed format list
  drm/nouveau/kms/nv10-nv40: add NV21 support to overlay
  drm/nouveau/kms/nv04-nv40: improve overlay error detection, fix pitch setting
  drm/nouveau/kms/nv04-nv40: prevent undisplayable framebuffers from creation
  drm/nouveau/mpeg: print more debug info when rejecting dma objects
  drm/nouveau/fb/gf100-: zero mmu debug buffers
  drm/nouveau/bar/gf100: add config option to limit BAR2 to 16MiB
  initial support (display-only) for GP108
  drm/nouveau/falcon: use a more reasonable msgqueue timeout value
  drm/nouveau/disp: Silence DCB warnings.
  drm/nouveau/bios: Demote missing fp table message to NV_DEBUG.
  drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed
  drm/nouveau/pmu/gt215: fix reset
  drm/nouveau/mc/gf100: add pmu to reset mask
  drm/nouveau/disp/gf119-: avoid creating non-existent heads
  drm/nouveau/therm/gm200: Added
  drm/nouveau/therm: fix spelling mistake on array thresolds

7 years agodrm/nouveau/kms/nv50: perform null check on msto[i] rathern than msto
Colin Ian King [Thu, 17 Aug 2017 22:03:23 +0000 (23:03 +0100)]
drm/nouveau/kms/nv50: perform null check on msto[i] rathern than msto

The null check on the array msto is incorrect since msto is never
null. The null check should be instead on msto[i] since this is
being dereferenced in the call to drm_mode_connector_attach_encoder.

Thanks to Emil Velikov for pointing out the mistake in my original
fix and for suggesting the correct fix.

Detected by CoverityScan, CID#1375915 ("Array compared against 0")

Fixes: f479c0ba4a17 ("drm/nouveau/kms/nv50: initial support for DP 1.2 multi-stream")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/pci/msi: disable MSI on big-endian platforms by default
Ilia Mirkin [Thu, 10 Aug 2017 16:13:40 +0000 (12:13 -0400)]
drm/nouveau/pci/msi: disable MSI on big-endian platforms by default

It appears that MSI does not work on either G5 PPC nor on a E5500-based
platform, where other hardware is reported to work fine with MSI.

Both tests were conducted with NV4x hardware, so perhaps other (or even
this) hardware can be made to work. It's still possible to force-enable
with config=NvMSI=1 on load.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau: silence suspend/resume debugging messages
Ben Skeggs [Sun, 13 Aug 2017 22:40:55 +0000 (08:40 +1000)]
drm/nouveau: silence suspend/resume debugging messages

These are particularly annoying on Optimus systems where these paths can
be called regularly.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/kms/nv04-nv4x: fix exposed format list
Ilia Mirkin [Sun, 6 Aug 2017 02:25:05 +0000 (22:25 -0400)]
drm/nouveau/kms/nv04-nv4x: fix exposed format list

drm_crtc_init exposes the XRGB8888 and ARGB8888 formats. In actuality,
ARGB8888's 32-bit depth messes up some formulas that weren't meant for
it, and the alpha is fairly meaningless for the primary plane.

The modesetting logic appears to be fully prepared for RGB565 as well as
XRGB1555 however, as tested with modetest.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/kms/nv10-nv40: add NV21 support to overlay
Ilia Mirkin [Sun, 6 Aug 2017 02:25:04 +0000 (22:25 -0400)]
drm/nouveau/kms/nv10-nv40: add NV21 support to overlay

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/kms/nv04-nv40: improve overlay error detection, fix pitch setting
Ilia Mirkin [Sun, 6 Aug 2017 02:25:03 +0000 (22:25 -0400)]
drm/nouveau/kms/nv04-nv40: improve overlay error detection, fix pitch setting

We were previously setting the pitch based on a perfectly packed buffer.
This does not necessarily happen. Either modetest started generating
such buffers recently, or earlier testing only happened with well-picked
overlay sizes.

While we're at it, beef up and refactor the error state detection.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/kms/nv04-nv40: prevent undisplayable framebuffers from creation
Ilia Mirkin [Sun, 6 Aug 2017 02:25:02 +0000 (22:25 -0400)]
drm/nouveau/kms/nv04-nv40: prevent undisplayable framebuffers from creation

Pre-nv50 YUV overlays have stringent requirements for working with the
internal machinery. Instead of rejecting these at update_plane time, we
should instead prevent the framebuffers from being created in the first
place.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/mpeg: print more debug info when rejecting dma objects
Ilia Mirkin [Sun, 6 Aug 2017 02:19:53 +0000 (22:19 -0400)]
drm/nouveau/mpeg: print more debug info when rejecting dma objects

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/fb/gf100-: zero mmu debug buffers
Ben Skeggs [Mon, 7 Aug 2017 03:27:31 +0000 (13:27 +1000)]
drm/nouveau/fb/gf100-: zero mmu debug buffers

These are used for accesses to sparse mappings, and we want reads of
such mappings to return 0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/bar/gf100: add config option to limit BAR2 to 16MiB
Ben Skeggs [Fri, 4 Aug 2017 00:44:34 +0000 (10:44 +1000)]
drm/nouveau/bar/gf100: add config option to limit BAR2 to 16MiB

Useful for testing, and for the userspace build where we can't kick
a framebuffer driver off the device.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agoinitial support (display-only) for GP108
Ilia Mirkin [Mon, 3 Jul 2017 18:46:21 +0000 (14:46 -0400)]
initial support (display-only) for GP108

Forked from GP107 implementation. Secboot/gr left out as we don't have
signed blobs from NVIDIA in linux-firmware.

(Ben): Was unable to mmiotrace the binary driver for unknown reasons,
       so not able to 100% confirm that no other changes from GP107
       are needed.  Quick testing shows it seems to work well enough
       for display.  Due to NVIDIA dragging their heels on getting
       signed firmware to us, this is the best we can do for now.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101601
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/falcon: use a more reasonable msgqueue timeout value
Ben Skeggs [Tue, 1 Aug 2017 06:15:46 +0000 (16:15 +1000)]
drm/nouveau/falcon: use a more reasonable msgqueue timeout value

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp: Silence DCB warnings.
Rosen Penev [Wed, 26 Jul 2017 00:21:43 +0000 (17:21 -0700)]
drm/nouveau/disp: Silence DCB warnings.

Most of these errors seem to be WFD related. Official documentation
says dcb type 8 is reserved. It's probably used for WFD. Silence
the warning in either case.

Connector type 70 is stated to be a virtual connector for WiFi
display. Since we know this, don't warn that we don't.

Signed-off by: Rosen Penev <rosenp@gmail.com>

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/bios: Demote missing fp table message to NV_DEBUG.
Rosen Penev [Tue, 25 Jul 2017 21:08:56 +0000 (14:08 -0700)]
drm/nouveau/bios: Demote missing fp table message to NV_DEBUG.

This warning seems to pop up mainly in laptop cards. Silence it as
it is expected behavior.

Signed-off by: Rosen Penev <rosenp@gmail.com>

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/pmu/gt215-: abstract detection of whether reset is needed
Ben Skeggs [Fri, 21 Jul 2017 00:45:32 +0000 (10:45 +1000)]
drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed

GT215, GF100-GP100, and GP10x are all different.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/pmu/gt215: fix reset
Ben Skeggs [Fri, 21 Jul 2017 00:33:52 +0000 (10:33 +1000)]
drm/nouveau/pmu/gt215: fix reset

The NV_PMC_ENABLE bit for PMU did not appear until GF100, and some other
unknown register needs to be poked instead.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/mc/gf100: add pmu to reset mask
Ben Skeggs [Thu, 20 Jul 2017 04:04:42 +0000 (14:04 +1000)]
drm/nouveau/mc/gf100: add pmu to reset mask

An upcoming commit will replace direct NV_PMC register bashing from PMU
with a call to the proper function.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/disp/gf119-: avoid creating non-existent heads
Ilia Mirkin [Mon, 3 Jul 2017 17:06:26 +0000 (13:06 -0400)]
drm/nouveau/disp/gf119-: avoid creating non-existent heads

We assume that each board has 4 heads for GF119+. However this is not
necessarily true - in the case of a GP108 board, the register indicated
that there were only 2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101601
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/therm/gm200: Added
Karol Herbst [Mon, 3 Jul 2017 18:02:51 +0000 (20:02 +0200)]
drm/nouveau/therm/gm200: Added

This allows temperature readouts on maxwell2 GPUs.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agodrm/nouveau/therm: fix spelling mistake on array thresolds
Colin Ian King [Tue, 27 Jun 2017 08:08:58 +0000 (09:08 +0100)]
drm/nouveau/therm: fix spelling mistake on array thresolds

Array thresolds should be named thresholds, rename it. Also make it static
static const char * const

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7 years agoMerge tag 'imx-drm-next-2017-07-18' of git://git.pengutronix.de/git/pza/linux into...
Dave Airlie [Tue, 22 Aug 2017 06:51:11 +0000 (16:51 +1000)]
Merge tag 'imx-drm-next-2017-07-18' of git://git.pengutronix.de/git/pza/linux into drm-next

imx-drm: lock scanout transfers for consecutive bursts

- Lock the IDMAC scanout channel for multiple back-to-back bursts if possible,
  to improve memory bandwidth utilisation.
- Replace a few occurences of state->fb with the already existing local fb
  variable in ipu_plane_atomic_update

* tag 'imx-drm-next-2017-07-18' of git://git.pengutronix.de/git/pza/linux:
  drm/imx: lock scanout transfers for consecutive bursts
  drm/imx: ipuv3-plane: use fb local variable instead of state->fb

7 years agoMerge tag 'drm-intel-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-intel...
Dave Airlie [Tue, 22 Aug 2017 00:03:07 +0000 (10:03 +1000)]
Merge tag 'drm-intel-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-intel into drm-next

Final pile of features for 4.14

- New ioctl to change NOA configurations, plus prep (Lionel)
- CCS (color compression) scanout support, based on the fancy new
  modifier additions (Ville&Ben)
- Document i915 register macro style (Jani)
- Many more gen10/cnl patches (Rodrigo, Pualo, ...)
- More gpu reset vs. modeset duct-tape to restore the old way.
- prep work for cnl: hpd_pin reorg (Rodrigo), support for more power
  wells (Imre), i2c pin reorg (Anusha)
- drm_syncobj support (Jason Ekstrand)
- forcewake vs gpu reset fix (Chris)
- execbuf speedup for the no-relocs fastpath, anv/vk low-overhead ftw (Chris)
- switch to idr/radixtree instead of the resizing ht for execbuf id->vma
  lookups (Chris)

gvt:
- MMIO save/restore optimization (Changbin)
- Split workload scan vs. dispatch for more parallel exec (Ping)
- vGPU full 48bit ppgtt support (Joonas, Tina)
- vGPU hw id expose for perf (Zhenyu)

Bunch of work all over to make the igt CI runs more complete/stable.
Watch https://intel-gfx-ci.01.org/tree/drm-tip/shards-all.html for
progress in getting this ready. Next week we're going into production
mode (i.e. will send results to intel-gfx) on hsw, more platforms to
come.

Also, a new maintainer tram, I'm stepping out. Huge thanks to Jani for
being an awesome co-maintainer the past few years, and all the best
for Jani, Joonas&Rodrigo as the new maintainers!

* tag 'drm-intel-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-intel: (179 commits)
  drm/i915: Update DRIVER_DATE to 20170818
  drm/i915/bxt: use NULL for GPIO connection ID
  drm/i915: Mark the GT as busy before idling the previous request
  drm/i915: Trivial grammar fix s/opt of/opt out of/ in comment
  drm/i915: Replace execbuf vma ht with an idr
  drm/i915: Simplify eb_lookup_vmas()
  drm/i915: Convert execbuf to use struct-of-array packing for critical fields
  drm/i915: Check context status before looking up our obj/vma
  drm/i915: Don't use MI_STORE_DWORD_IMM on Sandybridge/vcs
  drm/i915: Stop touching forcewake following a gen6+ engine reset
  MAINTAINERS: drm/i915 has a new maintainer team
  drm/i915: Split pin mapping into per platform functions
  drm/i915/opregion: let user specify override VBT via firmware load
  drm/i915/cnl: Reuse skl_wm_get_hw_state on Cannonlake.
  drm/i915/gen10: implement gen 10 watermarks calculations
  drm/i915/cnl: Fix LSPCON support.
  drm/i915/vbt: ignore extraneous child devices for a port
  drm/i915/cnl: Setup PAT Index.
  drm/i915/edp: Allow alternate fixed mode for eDP if available.
  drm/i915: Add support for drm syncobjs
  ...

7 years agoMerge tag 'drm/tegra/for-4.14-rc1' of git://anongit.freedesktop.org/tegra/linux into...
Dave Airlie [Mon, 21 Aug 2017 07:37:33 +0000 (17:37 +1000)]
Merge tag 'drm/tegra/for-4.14-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v4.14-rc1

This contains a couple of fixes and improvements for host1x, with some
preparatory work for Tegra186 support.

The remainder is cleanup and minor bugfixes for Tegra DRM along with
enhancements to debuggability.

There have also been some enhancements to the kernel interfaces for
host1x job submissions and support for mmap'ing PRIME buffers directly,
all of which get the interfaces very close to ready for serious work.

* tag 'drm/tegra/for-4.14-rc1' of git://anongit.freedesktop.org/tegra/linux: (21 commits)
  drm/tegra: Prevent BOs from being freed during job submission
  drm/tegra: gem: Implement mmap() for PRIME buffers
  drm/tegra: Support render node
  drm/tegra: sor: Trace register accesses
  drm/tegra: dpaux: Trace register accesses
  drm/tegra: dsi: Trace register accesses
  drm/tegra: hdmi: Trace register accesses
  drm/tegra: dc: Trace register accesses
  drm/tegra: sor: Use unsigned int for register offsets
  drm/tegra: hdmi: Use unsigned int for register offsets
  drm/tegra: dsi: Use unsigned int for register offsets
  drm/tegra: dpaux: Use unsigned int for register offsets
  drm/tegra: dc: Use unsigned int for register offsets
  drm/tegra: Fix NULL deref in debugfs/iova
  drm/tegra: switch to drm_*_get(), drm_*_put() helpers
  drm/tegra: Set MODULE_FIRMWARE for the VIC
  drm/tegra: Add CONFIG_OF dependency
  gpu: host1x: Support sub-devices recursively
  gpu: host1x: fix error return code in host1x_probe()
  gpu: host1x: Fix bitshift/mask multipliers
  ...

7 years agoMerge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm...
Dave Airlie [Mon, 21 Aug 2017 04:34:15 +0000 (14:34 +1000)]
Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next

this cycle has been fairly calm in etnaviv land with most of the action
happening on the userspace side.

Notable changes:
- Improvements to CONFIG option handling to make it harder for users to
shoot themselves in the foot due to kernel misconfiguration.
- Tweaked GEM object population, so that userspace can take considerate
action when memory allocation fails, rather than waking the raging OOM
killer beast.

* 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux:
  drm/etnaviv: switch GEM allocations to __GFP_RETRY_MAYFAIL
  drm/etnaviv: don't fail GPU bind when CONFIG_THERMAL isn't enabled
  drm/etnaviv: switch to drm_*{get,put} helpers
  drm/etnaviv: select CMA and DMA_CMA if available
  drm/etnaviv: populate GEM objects on cpu_prep
  drm/etnaviv: reduce allocation failure message severity
  drm/etnaviv: don't trigger OOM killer when page allocation fails

7 years agoMerge tag 'drm-amdkfd-next-2017-08-18' of git://people.freedesktop.org/~gabbayo/linux...
Dave Airlie [Mon, 21 Aug 2017 00:49:48 +0000 (10:49 +1000)]
Merge tag 'drm-amdkfd-next-2017-08-18' of git://people.freedesktop.org/~gabbayo/linux into drm-next

This is the amdkfd pull request for 4.14 merge window.
AMD has started cleaning the pipe and sending patches from their internal
development to the upstream community.

The plan as I understand it is to first get all the non-dGPU patches to
upstream and then move to upstream dGPU support.

The patches here are relevant only for Kaveri and Carrizo.

The following is a summary of the changes:
- Add new IOCTL to set a Scratch memory VA
- Update PM4 headers for new firmware that support scratch memory
- Support image tiling mode
- Remove all uses of BUG_ON
- Various Bug fixes and coding style fixes

* tag 'drm-amdkfd-next-2017-08-18' of git://people.freedesktop.org/~gabbayo/linux: (24 commits)
  drm/amdkfd: Implement image tiling mode support v2
  drm/amdgpu: Add kgd kfd interface get_tile_config() v2
  drm/amdkfd: Adding new IOCTL for scratch memory v2
  drm/amdgpu: Add kgd/kfd interface to support scratch memory v2
  drm/amdgpu: Program SH_STATIC_MEM_CONFIG globally, not per-VMID
  drm/amd: Update MEC HQD loading code for KFD
  drm/amdgpu: Disable GFX PG on CZ
  drm/amdkfd: Update PM4 packet headers
  drm/amdkfd: Clamp EOP queue size correctly on Gfx8
  drm/amdkfd: Add more error printing to help bringup v2
  drm/amdkfd: Handle remaining BUG_ONs more gracefully v2
  drm/amdkfd: Allocate gtt_sa_bitmap in long units
  drm/amdkfd: Fix doorbell initialization and finalization
  drm/amdkfd: Remove BUG_ONs for NULL pointer arguments
  drm/amdkfd: Remove usage of alloc(sizeof(struct...
  drm/amdkfd: Fix goto usage v2
  drm/amdkfd: Change x==NULL/false references to !x
  drm/amdkfd: Consolidate and clean up log commands
  drm/amdkfd: Clean up KFD style errors and warnings v2
  drm/amdgpu: Remove hard-coded assumptions about compute pipes
  ...

7 years agoMerge tag 'sunxi-drm-for-4.14' of https://git.kernel.org/pub/scm/linux/kernel/git...
Dave Airlie [Sun, 20 Aug 2017 23:05:01 +0000 (09:05 +1000)]
Merge tag 'sunxi-drm-for-4.14' of https://git./linux/kernel/git/mripard/linux into drm-next

Allwinner DRM changes for 4.14

A few changes, but most notably improving the HDMI support merged in 4.13,
by reporting the DDC adapter as an i2c bus, and by adding CEC support
through the CEC framework.

* tag 'sunxi-drm-for-4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
  sun4i_hdmi: add CEC support
  dt-bindings: display: sunxi: Improve endpoint ID scheme readability
  drm/sun4i: tcon: remove unused function
  drm/sun4i: Remove useless atomic_check
  drm/sun4i: Add if statement instead of depends on
  drm/sun4i: hdmi: Implement I2C adapter for A10s DDC bus
  drm/sun4i: constify drm_plane_helper_funcs

7 years agoMerge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Sun, 20 Aug 2017 20:22:17 +0000 (06:22 +1000)]
Merge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm-next

More changes for 4.14.  Highlights:
- command submission overhead improvements
- Huge page support for vega10
- physical mode support for mjpeg for asics that don't support UVD vm
- improve ttm_mem_type_manager_func debug
- misc ttm fixes, cleanups
- misc gpuvm cleanups

* 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux: (26 commits)
  drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2
  drm/amdgpu: fix vega10 graphic hang issue in S3 test
  drm/amdgpu: bump version for support of UVD MJPEG decode
  drm/amdgpu: add MJPEG check for UVD physical mode msg buffer
  drm/ttm: Fix accounting error when fail to get pages for pool
  drm/amd/amdgpu: expose fragment size as module parameter (v2)
  drm/amd/amdgpu: store fragment_size in vm_manager
  drm/amdgpu: rename VM invalidated to moved
  drm/amdgpu: separate bo_va structure
  drm/amdgpu: drop the extra VM huge page flag v2
  drm/amdgpu: remove superflous amdgpu_bo_kmap in the VM
  drm/amdgpu: cleanup static CSA handling
  drm/amdgpu: SHADOW and VRAM_CONTIGUOUS flags shouldn't be used by userspace
  drm/amdgpu: save list length when fence is signaled
  drm/amdgpu: move vram usage tracking into the vram manager v2
  drm/amdgpu: move gtt usage tracking into the gtt manager v2
  drm/amdgpu: move debug print into the MM managers
  drm/amdgpu: fix incorrect use of the lru_lock
  drm/radeon: fix incorrect use of the lru_lock
  drm/ttm: make ttm_mem_type_manager_func debug more useful
  ...

7 years agoMerge tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Sun, 20 Aug 2017 19:52:26 +0000 (05:52 +1000)]
Merge tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc into drm-next

Cross-subsystem Changes:
- Add tinydrm to MAINTAINERS using -misc tree and Noralf as maintainer (Noralf)

Core Changes:
- Finish dumb_mmap_offset cleanup by removing gem_cma_dumb_map_offset() (Noralf)
- Add gem_framebuffer helper to facilitate removal of fb_cma cargo cult (Noralf)

Driver Changes:
- Various trivial patches

Cc: Noralf Trønnes <noralf@tronnes.org>
* tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc:
  drm: udl: constify usb_device_id
  drm/gma500: fix potential NULL pointer dereference dereference
  drm/tinydrm: make function st7586_pipe_enable static
  MAINTAINERS: Add drm/tinydrm maintainer entry
  drm/vc4: Use drm_gem_fb_create()
  drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
  drm/fb-cma-helper: Use drm_gem_framebuffer_helper
  drm: Add GEM backed framebuffer library

7 years agodrm/i915: Update DRIVER_DATE to 20170818
Daniel Vetter [Fri, 18 Aug 2017 20:40:45 +0000 (22:40 +0200)]
drm/i915: Update DRIVER_DATE to 20170818

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
7 years agodrm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2
Christian König [Thu, 17 Aug 2017 10:23:51 +0000 (12:23 +0200)]
drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2

Fixes a false positive from might_sleep(). The reservation object is freshly
initialized, so nobody else can hold the mutex but the function is
called from atomic context.

v2: Correctly invert the check as well.

Signed-off-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: fix vega10 graphic hang issue in S3 test
Ken Wang [Tue, 15 Aug 2017 09:16:08 +0000 (17:16 +0800)]
drm/amdgpu: fix vega10 graphic hang issue in S3 test

mmVGT_INDEX_TYPE has no default value, need to make sure
it's initialized when gfx is initialized.

Signed-off-by: Ken Wang <Ken.Wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoMerge airlied/drm-next into drm-misc-next
Sean Paul [Fri, 18 Aug 2017 14:52:44 +0000 (10:52 -0400)]
Merge airlied/drm-next into drm-misc-next

Archit requested this backmerge to facilitate merging some patches
depending on changes between -rc2 & -rc5

Signed-off-by: Sean Paul <seanpaul@chromium.org>
7 years agodrm/i915/bxt: use NULL for GPIO connection ID
Andy Shevchenko [Thu, 17 Aug 2017 10:55:41 +0000 (13:55 +0300)]
drm/i915/bxt: use NULL for GPIO connection ID

The commit 213e08ad60ba
("drm/i915/bxt: add bxt dsi gpio element support")
enables GPIO support for Broxton based platforms.

While using that API we might get into troubles in the future, because
we can't rely on label name in the driver since vendor firmware might
provide any GPIO pin there, e.g. "reset", and even mark it in _DSD (in
which case the request will fail).

To avoid inconsistency and potential issues we have two options:
a) generate GPIO ACPI mapping table and supply it via
   acpi_dev_add_driver_gpios(), or
b) just pass NULL as connection ID.

The b) approach is much simpler and would work since the driver relies
on GPIO indices only. Moreover, the _CRS fallback mechanism, when
requesting GPIO, has been made stricter, and supplying non-NULL
connection ID when neither _DSD, nor GPIO ACPI mapping is present, is
making request fail.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101921
Fixes: f10e4bf6632b ("gpio: acpi: Even more tighten up ACPI GPIO lookups")
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Tested-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170817105541.63914-1-andriy.shevchenko@linux.intel.com
7 years agodrm/i915: Mark the GT as busy before idling the previous request
Chris Wilson [Thu, 17 Aug 2017 14:47:19 +0000 (15:47 +0100)]
drm/i915: Mark the GT as busy before idling the previous request

In a synchronous setup, we may retire the last request before we
complete allocating the next request. As the last request is retired, we
queue a timer to mark the device as idle, and promptly have to execute
ad cancel that timer once we complete allocating the request and need to
keep the device awake. If we rearrange the mark_busy() to occur before
we retire the previous request, we can skip this ping-pong.

v2: Joonas pointed out that unreserve_seqno() was now doing more than
doing seqno handling and should be renamed to reflect its wider purpose.
That also highlighted the new asymmetry with reserve_seqno(), so fixup
that and rename both to [un]reserve_engine().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170817144719.10968-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
7 years agodrm/i915: Trivial grammar fix s/opt of/opt out of/ in comment
Chris Wilson [Wed, 16 Aug 2017 08:52:09 +0000 (09:52 +0100)]
drm/i915: Trivial grammar fix s/opt of/opt out of/ in comment

The word out was dropped from the sentence across the line break, put it
back.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816085210.4199-6-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
7 years agodrm/i915: Replace execbuf vma ht with an idr
Chris Wilson [Wed, 16 Aug 2017 08:52:08 +0000 (09:52 +0100)]
drm/i915: Replace execbuf vma ht with an idr

This was the competing idea long ago, but it was only with the rewrite
of the idr as an radixtree and using the radixtree directly ourselves,
along with the realisation that we can store the vma directly in the
radixtree and only need a list for the reverse mapping, that made the
patch performant enough to displace using a hashtable. Though the vma ht
is fast and doesn't require any extra allocation (as we can embed the node
inside the vma), it does require a thread for resizing and serialization
and will have the occasional slow lookup. That is hairy enough to
investigate alternatives and favour them if equivalent in peak performance.
One advantage of allocating an indirection entry is that we can support a
single shared bo between many clients, something that was done on a
first-come first-serve basis for shared GGTT vma previously. To offset
the extra allocations, we create yet another kmem_cache for them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816085210.4199-5-chris@chris-wilson.co.uk
7 years agodrm/i915: Simplify eb_lookup_vmas()
Chris Wilson [Wed, 16 Aug 2017 08:52:07 +0000 (09:52 +0100)]
drm/i915: Simplify eb_lookup_vmas()

Since the introduction of being able to perform a lockless lookup of an
object (i915_gem_object_get_rcu() in fbbd37b36fa5 ("drm/i915: Move object
release to a freelist + worker") we no longer need to split the
object/vma lookup into 3 phases and so combine them into a much simpler
single loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816085210.4199-4-chris@chris-wilson.co.uk
7 years agodrm/i915: Convert execbuf to use struct-of-array packing for critical fields
Chris Wilson [Wed, 16 Aug 2017 08:52:06 +0000 (09:52 +0100)]
drm/i915: Convert execbuf to use struct-of-array packing for critical fields

When userspace is doing most of the work, avoiding relocs (using
NO_RELOC) and opting out of implicit synchronisation (using ASYNC), we
still spend a lot of time processing the arrays in execbuf, even though
we now should have nothing to do most of the time. One issue that
becomes readily apparent in profiling anv is that iterating over the
large execobj[] is unfriendly to the loop prefetchers of the CPU and it
much prefers iterating over a pair of arrays rather than one big array.

v2: Clear vma[] on construction to handle errors during vma lookup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816085210.4199-3-chris@chris-wilson.co.uk
7 years agodrm/i915: Check context status before looking up our obj/vma
Chris Wilson [Wed, 16 Aug 2017 08:52:05 +0000 (09:52 +0100)]
drm/i915: Check context status before looking up our obj/vma

Since we keep the context around across the slow lookup where we may
drop the struct_mutex, we should double check that the context is still
valid upon reacquisition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816085210.4199-2-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
7 years agodrm/i915: Don't use MI_STORE_DWORD_IMM on Sandybridge/vcs
Chris Wilson [Wed, 16 Aug 2017 08:52:04 +0000 (09:52 +0100)]
drm/i915: Don't use MI_STORE_DWORD_IMM on Sandybridge/vcs

MI_STORE_DWORD_IMM just doesn't work on the video decode engine under
Sandybridge, so refrain from using it. Then switch the selftests over to
using the now common test prior to using MI_STORE_DWORD_IMM.

Fixes: 7dd4f6729f92 ("drm/i915: Async GPU relocation processing")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.13-rc1+
Link: https://patchwork.freedesktop.org/patch/msgid/20170816085210.4199-1-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
7 years agodrm/i915: Stop touching forcewake following a gen6+ engine reset
Chris Wilson [Thu, 17 Aug 2017 17:32:29 +0000 (18:32 +0100)]
drm/i915: Stop touching forcewake following a gen6+ engine reset

Forcewake is not affected by the engine reset on gen6+. Indeed the
reason why we added intel_uncore_forcewake_reset() to
gen6_reset_engines() was to keep the bookkeeping intact because the
reset did not touch the forcewake bit (yet we cancelled the forcewake
consumers)!  This was done in commit 521198a2e7095:
    Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
    Date:   Fri Aug 23 16:52:30 2013 +0300

drm/i915: sanitize forcewake registers on reset

In reset we try to restore the forcewake state to
pre reset state, using forcewake_count. The reset
doesn't seem to clear the forcewake bits so we
get warn on forcewake ack register not clearing.

That futzing of the forcewake bookkeeping was dropped in commit
0294ae7b44bb ("drm/i915: Consolidate forcewake resetting to a single
function"), but it did not make the realisation that the remaining
intel_uncore_forcewake_reset() was redundant.

The new danger with using intel_uncore_forcewake_reset() with per-engine
resets is that the driver and hw are still in an active state as we
perform the reset. We may be using the forcewake to read protected
registers elsewhere and those results may be clobbered by the concurrent
dropping of forcewake.

Reported-by: Michel Thierry <michel.thierry@intel.com>
Fixes: 142bc7d99bcf ("drm/i915: Modify error handler for per engine hang recovery")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170817173229.20324-1-chris@chris-wilson.co.uk
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
7 years agoMAINTAINERS: drm/i915 has a new maintainer team
Daniel Vetter [Tue, 15 Aug 2017 16:01:01 +0000 (18:01 +0200)]
MAINTAINERS: drm/i915 has a new maintainer team

For a bunch of reasons[1] I've decided to step down as maintainer and
let some other folks enjoy the reputation and hang out in the
spotlight.

Jani is going to stick around with his expertise in kms and having
done the fixes flow for a long time now. Joonas will join and bring in
his knowledge on all things GEM. Rodrigo has been less visible because
he's been doing tons of work taking care of the internal branch, and
it'd be good to have more continuity between these two worlds also on
the maintainer side.

1: They all boil down to: This is going to happen sooner or later
anyway, we have a great team, with the process improvements over the
last few years things work rather well, now is as good as any time to
do this. With that change I'll have more time for other aspects of the
stack development than maintainership.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Dave Airlie <airlied@gmail.com>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Acked-by: Jani Nikula <jani.nikula@linux.intel.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170815160101.1683-1-daniel.vetter@ffwll.ch
7 years agodrm: udl: constify usb_device_id
Arvind Yadav [Sat, 12 Aug 2017 08:35:19 +0000 (14:05 +0530)]
drm: udl: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/22fa8ca67a6d4a59997f463bf241ed56596fbcfa.1502526524.git.arvind.yadav.cs@gmail.com
7 years agodrm/gma500: fix potential NULL pointer dereference dereference
Gustavo A. R. Silva [Sat, 12 Aug 2017 01:55:15 +0000 (20:55 -0500)]
drm/gma500: fix potential NULL pointer dereference dereference

NULL check at line 528: if (!sender || !data_out || !len_out) {, implies
that pointer _sender_ might be NULL.

Move pointer _sender_ dereference after NULL check in order to avoid a
potential NULL pointer dereference.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170812015515.GA8360@embeddedgus
7 years agodrm/i915: Split pin mapping into per platform functions
Anusha Srivatsa [Wed, 16 Aug 2017 23:45:14 +0000 (16:45 -0700)]
drm/i915: Split pin mapping into per platform functions

Cleanup the code. Map the pins in accordance to
individual platforms rather than according to ports.
Create separate functions for platforms.

v2:
 - Add missing condition for CoffeeLake. Make platform
 specific functions static. Add function
 i915_ddc_pin_mapping().

v3:
 - Rename functions to x_port_to_ddc_pin() which directly
   indicates the purpose. Correct default return values on CNP
   and BXT. Rename i915_port_to_ to g4x_port_to since that was
   the first platform to run this. Correct code style. (Paulo)

Sugested-by Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Clinton Taylor <clinton.a.taylor@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1502927114-24012-1-git-send-email-anusha.srivatsa@intel.com
7 years agodrm/amdgpu: bump version for support of UVD MJPEG decode
Leo Liu [Wed, 16 Aug 2017 14:18:28 +0000 (10:18 -0400)]
drm/amdgpu: bump version for support of UVD MJPEG decode

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: add MJPEG check for UVD physical mode msg buffer
Leo Liu [Tue, 15 Aug 2017 14:57:34 +0000 (10:57 -0400)]
drm/amdgpu: add MJPEG check for UVD physical mode msg buffer

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/ttm: Fix accounting error when fail to get pages for pool
Xiangliang.Yu [Wed, 16 Aug 2017 06:25:51 +0000 (14:25 +0800)]
drm/ttm: Fix accounting error when fail to get pages for pool

When fail to get needed page for pool, need to put allocated pages
into pool. But current code has a miscalculation of allocated pages,
correct it.

Signed-off-by: Xiangliang.Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
7 years agodrm/amd/amdgpu: expose fragment size as module parameter (v2)
Roger He [Tue, 15 Aug 2017 08:05:59 +0000 (16:05 +0800)]
drm/amd/amdgpu: expose fragment size as module parameter (v2)

Allow overrides on the command line.

v2: agd: sqaush in spelling fix and bogus default value warning

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amd/amdgpu: store fragment_size in vm_manager
Roger He [Fri, 11 Aug 2017 12:00:41 +0000 (20:00 +0800)]
drm/amd/amdgpu: store fragment_size in vm_manager

adds fragment_size in the vm_manager structure and
implements hardware setup for it.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: rename VM invalidated to moved
Christian König [Tue, 1 Aug 2017 09:27:36 +0000 (11:27 +0200)]
drm/amdgpu: rename VM invalidated to moved

That better describes what happens here with the BO.

Signed-off-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: separate bo_va structure
Christian König [Tue, 1 Aug 2017 08:51:43 +0000 (10:51 +0200)]
drm/amdgpu: separate bo_va structure

Split that into vm_bo_base and bo_va to allow other uses as well.

Signed-off-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: drop the extra VM huge page flag v2
Christian König [Thu, 3 Aug 2017 18:30:50 +0000 (20:30 +0200)]
drm/amdgpu: drop the extra VM huge page flag v2

Just add the flags to the addr field as well.

v2: add some more comments that the flag is for huge pages.

Signed-off-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: remove superflous amdgpu_bo_kmap in the VM
Christian König [Thu, 3 Aug 2017 17:24:06 +0000 (19:24 +0200)]
drm/amdgpu: remove superflous amdgpu_bo_kmap in the VM

We now properly kmap all BOs after validation.

Signed-off-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: cleanup static CSA handling
Christian König [Mon, 31 Jul 2017 13:32:40 +0000 (15:32 +0200)]
drm/amdgpu: cleanup static CSA handling

Move the CSA bo_va from the VM to the fpriv structure.

Signed-off-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: SHADOW and VRAM_CONTIGUOUS flags shouldn't be used by userspace
Christian König [Wed, 9 Aug 2017 13:33:49 +0000 (15:33 +0200)]
drm/amdgpu: SHADOW and VRAM_CONTIGUOUS flags shouldn't be used by userspace

The shadow handling isn't implemented completely for userspace BOs and
the kernel sets the VRAM_CONTIGUOUS as necessary.

Signed-off-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: save list length when fence is signaled
Chunming Zhou [Fri, 11 Aug 2017 01:34:33 +0000 (09:34 +0800)]
drm/amdgpu: save list length when fence is signaled

update the list first to avoid redundant checks.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-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>
Cc: stable@vger.kernel.org
7 years agodrm/amdgpu: move vram usage tracking into the vram manager v2
Christian König [Mon, 7 Aug 2017 15:46:49 +0000 (17:46 +0200)]
drm/amdgpu: move vram usage tracking into the vram manager v2

Looks like a better place for this.

v2: use atomic64_t members instead

Signed-off-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: move gtt usage tracking into the gtt manager v2
Christian König [Mon, 7 Aug 2017 15:11:33 +0000 (17:11 +0200)]
drm/amdgpu: move gtt usage tracking into the gtt manager v2

It doesn't make much sense to count those numbers twice.

v2: use and atomic64_t instead

Signed-off-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: move debug print into the MM managers
Christian König [Mon, 7 Aug 2017 13:47:51 +0000 (15:47 +0200)]
drm/amdgpu: move debug print into the MM managers

Instead of the separate switch/case in the calling function.

Signed-off-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: fix incorrect use of the lru_lock
Christian König [Mon, 7 Aug 2017 12:07:43 +0000 (14:07 +0200)]
drm/amdgpu: fix incorrect use of the lru_lock

The BO manager has its own lock and doesn't use the lru_lock.

Signed-off-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/radeon: fix incorrect use of the lru_lock
Christian König [Mon, 7 Aug 2017 12:03:54 +0000 (14:03 +0200)]
drm/radeon: fix incorrect use of the lru_lock

The BO manager has its own lock and doesn't use the lru_lock.

Signed-off-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/ttm: make ttm_mem_type_manager_func debug more useful
Christian König [Mon, 7 Aug 2017 09:13:41 +0000 (11:13 +0200)]
drm/ttm: make ttm_mem_type_manager_func debug more useful

Provide the drm printer directly instead of just the callback.

Signed-off-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/amd/amdgpu: Add tracepoint for DMA page mapping (v4)
Tom St Denis [Mon, 31 Jul 2017 13:35:24 +0000 (09:35 -0400)]
drm/amd/amdgpu: Add tracepoint for DMA page mapping (v4)

This helps map DMA addresses back to physical addresses.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(v2):  Added tracepoints for USERPTR, SG mappings, and
     SWIOTBL mappings.  Reformatted trace call perform
     PCI decoding internal to the trace.

(v3):  Add unmap tracepoints as well

(v4):  Move traces into separate functions

7 years agodrm/amdgpu: fix Vega10 HW config for 2MB pages
Christian König [Sat, 29 Jul 2017 11:28:55 +0000 (13:28 +0200)]
drm/amdgpu: fix Vega10 HW config for 2MB pages

Those values weren't correct. This should result in quite some speedup.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: only bind VM shadows after validation v2
Christian König [Thu, 13 Jul 2017 10:51:31 +0000 (12:51 +0200)]
drm/amdgpu: only bind VM shadows after validation v2

No need to do this on every CS.

v2: remove all other bind, reorder code

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/amdgpu: only move VM BOs in the LRU during validation v2
Christian König [Thu, 3 Aug 2017 15:44:01 +0000 (11:44 -0400)]
drm/amdgpu: only move VM BOs in the LRU during validation v2

This should save us a bunch of command submission overhead.

v2: move the LRU move to the right place to avoid the move for the root BO
    and handle the shadow BOs as well. This turned out to be a bug fix because
    the move needs to happen before the kmap.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agodrm/ttm: individualize BO reservation obj when they are freed
Christian König [Thu, 20 Jul 2017 18:55:06 +0000 (20:55 +0200)]
drm/ttm: individualize BO reservation obj when they are freed

Use the BOs reservation object when it is put on the ddelete list. This way we
avoid delaying freeing up the BO because of new fences on the reservation object.

This is used by dma-buf and amdgpu's VM page tables.

Signed-off-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/ttm: remove nonsense wait in ttm_bo_cleanup_refs_and_unlock
Christian König [Wed, 26 Jul 2017 12:59:10 +0000 (14:59 +0200)]
drm/ttm: remove nonsense wait in ttm_bo_cleanup_refs_and_unlock

With shared reservation objects the assumption that no fence
could have been added isn't true any more.

Additional to that the BO is about to be destroyed, so removing the
fences now has no advantage whatsoever.

Signed-off-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 agoMerge tag 'omapdrm-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux...
Dave Airlie [Thu, 17 Aug 2017 19:41:32 +0000 (05:41 +1000)]
Merge tag 'omapdrm-4.14' of git://git./linux/kernel/git/tomba/linux into drm-next

omapdrm changes for v4.14

* HDMI hot plug IRQ support (instead of polling)
* Big driver cleanup from Laurent (no functional changes)
* OMAP5 DSI support (only the pinmuxing was missing)

* tag 'omapdrm-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (60 commits)
  drm/omap: Potential NULL deref in omap_crtc_duplicate_state()
  drm/omap: remove no-op cleanup code
  drm/omap: rename omapdrm device back
  drm: omapdrm: Remove omapdrm platform data
  ARM: OMAP2+: Don't register omapdss device for omapdrm
  ARM: OMAP2+: Remove unused omapdrm platform device
  drm: omapdrm: Remove the omapdss driver
  drm: omapdrm: Register omapdrm platform device in omapdss driver
  drm: omapdrm: hdmi: Don't allocate PHY features dynamically
  drm: omapdrm: hdmi: Configure the PHY from the HDMI core version
  drm: omapdrm: hdmi: Configure the PLL from the HDMI core version
  drm: omapdrm: hdmi: Pass HDMI core version as integer to HDMI audio
  drm: omapdrm: hdmi: Replace OMAP SoC model check with HDMI xmit version
  drm: omapdrm: hdmi: Rename functions and structures to use hdmi_ prefix
  drm/omap: add OMAP5 DSIPHY lane-enable support
  drm/omap: use regmap_update_bit() when muxing DSI pads
  drm: omapdrm: Remove dss_features.h
  drm: omapdrm: Move supported outputs feature to dss driver
  drm: omapdrm: Move DSS_FCK feature to dss driver
  drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driver
  ...

7 years agoMerge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Thu, 17 Aug 2017 19:30:53 +0000 (05:30 +1000)]
Merge branch 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux into drm-next

More features for 4.14.  Nothing too major here.  I have a few more additional
patches for large page support in vega10 among other things, but they require
some resevation object patches from drm-misc-next, so I'll send that request
once you've pulled the latest drm-misc-next.  Highlights:
- Fixes for ACP audio on stoney
- SR-IOV fixes for vega10
- various powerplay fixes
- lots of code clean up

* 'drm-next-4.14' of git://people.freedesktop.org/~agd5f/linux: (62 commits)
  drm/amdgpu/gfx7: fix function name
  drm/amd/amdgpu: Disabling Power Gating for Stoney platform
  drm/amd/amdgpu: Added a quirk for Stoney platform
  drm/amdgpu: jt_size was wrongly counted twice
  drm/amdgpu: fix missing endian-safe guard
  drm/amdgpu: ignore digest_size when loading sdma fw for raven
  drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()
  drm/amd/powerplay: fix coding style in hwmgr.c
  drm/amd/powerplay: refine dmesg info under powerplay.
  drm/amdgpu: don't finish the ring if not initialized
  drm/radeon: Fix preferred typo
  drm/amdgpu: Fix preferred typo
  drm/radeon: Fix stolen typo
  drm/amdgpu: Fix stolen typo
  drm/amd/powerplay: fix coccinelle warnings in vega10_hwmgr.c
  drm/amdgpu: set gfx_v9_0_ip_funcs as static
  drm/radeon: switch to drm_*{get,put} helpers
  drm/amdgpu: switch to drm_*{get,put} helpers
  drm/amd/powerplay: add CZ profile support
  drm/amd/powerplay: fix PSI not enabled by kmd
  ...

7 years agodrm/tegra: Prevent BOs from being freed during job submission
Dmitry Osipenko [Fri, 11 Aug 2017 17:54:56 +0000 (19:54 +0200)]
drm/tegra: Prevent BOs from being freed during job submission

Since DRM IOCTL's are lockless, there is a chance that BOs could be
released while a job submission is in progress. To avoid that, keep the
GEM reference until the job has been pinned, part of which will be to
take another reference.

v2: remove redundant check and avoid memory leak

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: gem: Implement mmap() for PRIME buffers
Thierry Reding [Tue, 15 Aug 2017 13:42:40 +0000 (15:42 +0200)]
drm/tegra: gem: Implement mmap() for PRIME buffers

The mapping of PRIME buffers can reuse much of the GEM mapping code, so
extract the common bits into a new tegra_gem_mmap() helper.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: Support render node
Thierry Reding [Tue, 15 Aug 2017 13:42:39 +0000 (15:42 +0200)]
drm/tegra: Support render node

None of the driver-specific IOCTLs are privileged, so mark them as such
and advertise that the driver supports render nodes.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: sor: Trace register accesses
Thierry Reding [Tue, 15 Aug 2017 13:41:14 +0000 (15:41 +0200)]
drm/tegra: sor: Trace register accesses

Add tracepoint events for SOR controller register accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: dpaux: Trace register accesses
Thierry Reding [Tue, 15 Aug 2017 13:41:13 +0000 (15:41 +0200)]
drm/tegra: dpaux: Trace register accesses

Add tracepoint events for DPAUX controller register accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: dsi: Trace register accesses
Thierry Reding [Tue, 15 Aug 2017 13:41:12 +0000 (15:41 +0200)]
drm/tegra: dsi: Trace register accesses

Add tracepoint events for DSI controller register accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: hdmi: Trace register accesses
Thierry Reding [Tue, 15 Aug 2017 13:41:11 +0000 (15:41 +0200)]
drm/tegra: hdmi: Trace register accesses

Add tracepoint events for HDMI controller register accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: dc: Trace register accesses
Thierry Reding [Tue, 15 Aug 2017 13:41:10 +0000 (15:41 +0200)]
drm/tegra: dc: Trace register accesses

Add tracepoint events for display controller register accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: sor: Use unsigned int for register offsets
Thierry Reding [Tue, 15 Aug 2017 13:41:09 +0000 (15:41 +0200)]
drm/tegra: sor: Use unsigned int for register offsets

Register offsets are usually fairly small numbers, so an unsigned int is
more than enough to represent them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: hdmi: Use unsigned int for register offsets
Thierry Reding [Tue, 15 Aug 2017 13:41:08 +0000 (15:41 +0200)]
drm/tegra: hdmi: Use unsigned int for register offsets

Register offsets are usually fairly small numbers, so an unsigned int is
more than enough to represent them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: dsi: Use unsigned int for register offsets
Thierry Reding [Tue, 15 Aug 2017 13:41:07 +0000 (15:41 +0200)]
drm/tegra: dsi: Use unsigned int for register offsets

Register offsets are usually fairly small numbers, so an unsigned int is
more than enough to represent them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: dpaux: Use unsigned int for register offsets
Thierry Reding [Tue, 15 Aug 2017 13:41:06 +0000 (15:41 +0200)]
drm/tegra: dpaux: Use unsigned int for register offsets

Register offsets are usually fairly small numbers, so an unsigned int is
more than enough to represent them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: dc: Use unsigned int for register offsets
Thierry Reding [Tue, 15 Aug 2017 13:41:05 +0000 (15:41 +0200)]
drm/tegra: dc: Use unsigned int for register offsets

Register offsets are usually fairly small numbers, so an unsigned int is
more than enough to represent them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: Fix NULL deref in debugfs/iova
Michał Mirosław [Mon, 14 Aug 2017 21:53:45 +0000 (23:53 +0200)]
drm/tegra: Fix NULL deref in debugfs/iova

When IOMMU is off, ->mm_lock is not initialized and ->mm is NULL.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: switch to drm_*_get(), drm_*_put() helpers
Cihangir Akturk [Fri, 11 Aug 2017 12:33:07 +0000 (15:33 +0300)]
drm/tegra: switch to drm_*_get(), drm_*_put() helpers

Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference()
and drm_*_unreference() helpers.

drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() and should not be
used by new code. So convert all users of compatibility functions to
use the new APIs.

Generated by: scripts/coccinelle/api/drm-get-put.cocci

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: Set MODULE_FIRMWARE for the VIC
Nicolas Chauvet [Tue, 11 Jul 2017 08:39:04 +0000 (10:39 +0200)]
drm/tegra: Set MODULE_FIRMWARE for the VIC

The defines are set anyway to prevent an empty string. The test for the
SoC is the same as for Nouveau for the Tegra GPU firmware (see
drivers/gpu/drm/nouveau/nouveau_platform.c)

v2:
 - Place the defines above each chip's vic_config struct
 - MODULE_FIRMWARE() at the end of the file

Fixes: 0ae797a8ba05 ("drm/tegra: Add VIC support")
Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agodrm/tegra: Add CONFIG_OF dependency
Arnd Bergmann [Fri, 21 Jul 2017 16:13:23 +0000 (18:13 +0200)]
drm/tegra: Add CONFIG_OF dependency

Without CONFIG_OF, we can run into a build error:

drivers/gpu/drm/tegra/dpaux.c:378:20: error: 'pinconf_generic_dt_node_to_map_group' undeclared here (not in a function); did you mean 'pinconf_generic_params'?
  .dt_node_to_map = pinconf_generic_dt_node_to_map_group,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    pinconf_generic_params
drivers/gpu/drm/tegra/dpaux.c:379:17: error: 'pinconf_generic_dt_free_map' undeclared here (not in a function); did you mean 'pinconf_generic_params'?

This adds an explicit dependency.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agogpu: host1x: Support sub-devices recursively
Thierry Reding [Tue, 15 Aug 2017 13:46:22 +0000 (15:46 +0200)]
gpu: host1x: Support sub-devices recursively

The display architecture in Tegra186 changes slightly compared to
earlier Tegra generations, which requires that we recursively scan
host1x sub-devices from device tree.

Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agogpu: host1x: fix error return code in host1x_probe()
Gustavo A. R. Silva [Tue, 8 Aug 2017 05:08:06 +0000 (00:08 -0500)]
gpu: host1x: fix error return code in host1x_probe()

platform_get_irq() returns an error code, but the host1x driver
ignores it and always returns -ENXIO. This is not correct and,
prevents -EPROBE_DEFER from being propagated properly.

Notice that platform_get_irq() no longer returns 0 on error:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af

Print and propagate the return value of platform_get_irq on failure.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>