Commit graph

31635 commits

Author SHA1 Message Date
Dave Airlie 6320745596 drm/virtio: fix busid in a different way, allocate more vbufs.
drm/qxl: various bugfixes and cleanups,
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJYMzLfAAoJEEy22O7T6HE41rIQANAEl/o8cYUoyYTJlhmmnl2U
 K+QBdr7PACdbr8RZrGpwA5ad9ZJGijpZRd2gThrzNS0JBdZI48gPEzU7V206xlyD
 AriBeAu6IkoBTEl+GGx2DfvOdLR6+7KlIrDYIpl2vILgkqlHhneXdHR3R03byRHG
 2Jrxv2YQxCs8swtAb8FRkVNaUgrfkKOKFFlx1LoLFApYeP02oSxZp0Ve4nuRNj7x
 9DCivIw4NyQ9tY1fORapmrEPTerqZnzYdb9RFSv4xilx4Stq1UWdXfTSpwXZHZaG
 VroXZb1I0fZEk1aapIxuzLZFGNSM7wLET/nK02sSvzxJJv2PiyVAabIo70nUqsQK
 H/iGT2g4MZC1Yvz6evENtckbiA1p3F9jnd+Po9ivDY/RrTpND3hVC2WbcOXWxZkb
 m69muvXfrnZwoF9xWPG8aTrCATim++1Ty8/8LoKdVq1d0Dp/Gzk8KnklBPY2vRFt
 dpxqH3jLgED/QcO5W/yQdf0kPRsrNwKFNLqP9bCF2hMIw1VHHddZtnBBXDGATXYq
 hdFA8EEg3gh/kY7V8b+GyxjRKRbveG208hu+H4EirxHmRn5xJN1VoTLk9va+AJL1
 I30l4USLDkTgf1AjYmk7yFIUTemCtwjfa0lsuu4l3rRJ3k1eBrtZe2cpWv2BoQDU
 by0sNnDelzJTQ9/v1i3J
 =OYiT
 -----END PGP SIGNATURE-----

Merge tag 'drm-qemu-20161121' of git://git.kraxel.org/linux into drm-next

drm/virtio: fix busid in a different way, allocate more vbufs.
drm/qxl: various bugfixes and cleanups,

* tag 'drm-qemu-20161121' of git://git.kraxel.org/linux: (224 commits)
  drm/virtio: allocate some extra bufs
  qxl: Allow resolution which are not multiple of 8
  qxl: Don't notify userspace when monitors config is unchanged
  qxl: Remove qxl_bo_init() return value
  qxl: Call qxl_gem_{init, fini}
  qxl: Add missing '\n' to qxl_io_log() call
  qxl: Remove unused prototype
  qxl: Mark some internal functions as static
  Revert "drm: virtio: reinstate drm_virtio_set_busid()"
  drm/virtio: fix busid regression
  drm: re-export drm_dev_set_unique
  Linux 4.9-rc5
  gp8psk: Fix DVB frontend attach
  gp8psk: fix gp8psk_usb_in_op() logic
  dvb-usb: move data_mutex to struct dvb_usb_device
  iio: maxim_thermocouple: detect invalid storage size in read()
  aoe: fix crash in page count manipulation
  lightnvm: invalid offset calculation for lba_shift
  Kbuild: enable -Wmaybe-uninitialized warnings by default
  pcmcia: fix return value of soc_pcmcia_regulator_set
  ...
2016-11-30 14:18:51 +10:00
Dave Airlie 7625e05286 Merge branch 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next
These updates:
* improve the robustness of the driver wrt races
* improve the compliance for sending infoframes and audio
* re-organise the function order in the driver to group like functions
  together.  (This unfortunately causes a conflict with the change in
  drm-misc, but it should be trivial to solve, although it looks more
  scarey than it really is - sfr has already sent two reports about
  this, one earlier today.)
* simplify tda998x_audio_get_eld and DPMS handling
* power down sections of the chip that we never use
* add some initial preparation for supporting the CEC driver

* 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm:
  drm/i2c: tda998x: fix spelling mistake
  drm/i2c: tda998x: allow sharing of the CEC device accesses
  drm/i2c: tda998x: allow interrupt to be shared
  drm/i2c: tda998x: power down pre-filter and color conversion
  drm/i2c: tda998x: switch to boolean is_on
  drm/i2c: tda998x: remove complexity from tda998x_audio_get_eld()
  drm/i2c: tda998x: group audio functions together
  drm/i2c: tda998x: separate connector initialisation
  drm/i2c: tda998x: group connector functions and funcs together
  drm/i2c: tda998x: move and rename tda998x_encoder_set_config()
  drm/i2c: tda998x: correct function name in comments
  drm/i2c: tda998x: only enable audio if supported by sink
  drm/i2c: tda998x: only configure infoframes and audio if supported
  drm/i2c: tda998x: avoid race when programming audio
  drm/i2c: tda998x: avoid racy access to mode clock
  drm/i2c: tda998x: avoid race in tda998x_encoder_mode_set()
  drm/i2c: tda998x: move audio mutex initialisation
2016-11-25 09:55:33 +10:00
Dave Airlie 4d5304d870 Merge branch 'drm-armada-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next
Building on top of the MALI change previously merged, these changes:
* add tracing support for overlay updates
* refactor some of the plane support code
* de-midlayer the driver
* cleanups from other folk reviewing the code

* 'drm-armada-devel' of git://git.armlinux.org.uk/~rmk/linux-arm:
  drm/armada: fix NULL pointer comparison warning
  drm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
  drm/armada: remove some dead code
  drm/armada: mark symbols static where possible
  drm/armada: de-midlayer armada
  drm/armada: use common helper for plane base address
  drm/armada: move setting primary plane position to armada_drm_primary_set()
  drm/armada: split out primary plane update
  drm/armada: move plane state to struct armada_plane
  drm/armada: clean up armada_drm_plane_work_run()
  drm/armada: add tracing support
2016-11-25 09:03:27 +10:00
Dave Airlie 43167f6c7d Merge tag 'drm-hisilicon-next-2016-11-17' of http://github.com/zourongrong/linux into drm-next
hibmc drm driver for hisilicon.

* tag 'drm-hisilicon-next-2016-11-17' of http://github.com/zourongrong/linux:
  MAINTAINERS: Update HISILICON DRM entries
  drm/hisilicon/hibmc: Add support for vblank interrupt
  drm/hisilicon/hibmc: Add support for VDAC
  drm/hisilicon/hibmc: Add support for display engine
  drm/hisilicon/hibmc: Add support for frame buffer
  drm/hisilicon/hibmc: Add video memory management
  drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver
2016-11-21 11:42:17 +10:00
Colin Ian King 9b2502b6eb drm/i2c: tda998x: fix spelling mistake
Trivial fix to spelling mistake "configutation" to "configuration"
in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 14e5b5889d drm/i2c: tda998x: allow sharing of the CEC device accesses
cec_read() is non-atomic in the presence of other I2C bus transactions
to the same device.  This presents a problem when we add support for
the TDA9950 CEC engine part - both drivers can be trying to access the
device.

Avoid the inherent problems by switching to i2c_transfer() instead,
which allows us to perform more than one bus transaction atomically.

As this means we will be using I2C transactions rather than SMBUS, we
have to check that the host supports I2C functionality.

Tested-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King ae81553c30 drm/i2c: tda998x: allow interrupt to be shared
Some TDA998x contain several different I2C devices - there is the HDMI
encoder, and there is a TDA9950 CEC engine.  These two share the same
interrupt signal.

In order to allow a driver for the CEC engine to work, we need to be
able to share the interrupt with the CEC driver, so convert the handler
and registration to allow this to happen.

Tested-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 9476ed2e38 drm/i2c: tda998x: power down pre-filter and color conversion
Disabling the pre-filter block of the TDA998x saves 40mW and the colour
conversion block saves 15mW.  As we always disable these two blocks, we
can power these sections of the chip down to save 55mW of unnecessary
power consumption.

Tested-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 3cb43378d8 drm/i2c: tda998x: switch to boolean is_on
Rather than storing the DPMS mode (which will always be on or off) use a
boolean to store this instead.

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 02efac0fbf drm/i2c: tda998x: remove complexity from tda998x_audio_get_eld()
tda998x_audio_get_eld() is needlessly complex - the connector associated
with the encoder is always our own priv->connector.  Remove this
complexity, but ensure that there are no races when copying out the ELD.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King ad975f9364 drm/i2c: tda998x: group audio functions together
Group the TDA998x audio functions together rather than split between
two different locations in the file, keeping like code together.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King a2f75662b7 drm/i2c: tda998x: separate connector initialisation
Separate out the connector initialisation from the rest of the drivers
initialisation.

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 25576733ec drm/i2c: tda998x: group connector functions and funcs together
Group the TDA998x connector functions and funcs structures together
before the encoder support, rather than scattered amongst the rest of
the file.  This keeps like code together.

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 94579273b8 drm/i2c: tda998x: move and rename tda998x_encoder_set_config()
The naming of tda998x_encoder_set_config() is a left-over from when
TDA998x was a slave encoder.  Since this is part of the initialisation,
drop the _encoder from the name, and move it near tda998x_bind().

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 95a9b686d6 drm/i2c: tda998x: correct function name in comments
Correct two references to tda998x_connector_get_modes() which were
incorrectly referring to tda998x_encoder_get_modes().

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 8f3f21f63c drm/i2c: tda998x: only enable audio if supported by sink
Check for audio support by the attached sink by consulting the EDID
prior to enabling audio over the TMDS link.  We must consult the EDID
after calling drm_helper_probe_single_connector_modes(), as this can
use an override EDID, or load a replacement EDID.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 896a4130b8 drm/i2c: tda998x: only configure infoframes and audio if supported
The CEA 861B specification indicates the situations when we are able to
send each infoframe based on the version of the EDID's CEA extension.
Update the tda998x driver to follow the CEA specification wrt sending
of infoframes.

Since we only support the generation of AVI version 2, this limits us
to CEA extension version 3, so we treat CEA extension version 2 as
CEA 861 (no infoframes, no audio.)

Tested-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 2cae8e028e drm/i2c: tda998x: avoid race when programming audio
Avoid a race between programming audio and an in-progress mode set.
A mode set is complex, and disables the ability to send infoframes
to the sink, and is disruptive to audio - we have to mute the audio
FIFO while doing a mode set.

If an attempt is made to start up the audio side, we will undo the
audio FIFO mute before the mode set has completed.

Move the lock so that we prevent audio interfering with an in-progress
mode set.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 319e658c78 drm/i2c: tda998x: avoid racy access to mode clock
Avoid a racy access to the mode clock by storing the current mode clock
during a mode set under the audio mutex.  This allows us to access it
from the audio path in a safe way.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King 6d30c0f728 drm/i2c: tda998x: avoid race in tda998x_encoder_mode_set()
As priv->audio_params can now be changed at run time, we need to be more
careful about how we deal with a mode set.  We must take the audio lock
while checking if there's a valid audio configuration.

However, it's slightly worse than that - during mode set, we mute the
audio, and it must not be unmuted until we have finished the mode set.
It is possible that the audio side may start while a mode set is in
progress, so take the audio_mutex lock around the whole mode setting
procedure.

Tested-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Jon Medhurst <tixy@linaro.org>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-18 00:00:40 +00:00
Russell King ba300c1787 drm/i2c: tda998x: move audio mutex initialisation
We will need the audio mutex initialised in all cases, so lets move this
to be early, rather than only being initialised for the DT case.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-17 23:59:39 +00:00
Rongrong Zou 1d98b91611 drm/hisilicon/hibmc: Add support for vblank interrupt
Add vblank interrupt.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
2016-11-17 15:26:27 +08:00
Rongrong Zou 5294967f4a drm/hisilicon/hibmc: Add support for VDAC
VDAC(Video Digital-to-Analog converter) converts the RGB diaital data
stream from DE to VGA analog signals.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
2016-11-17 15:26:26 +08:00
Rongrong Zou da52605eea drm/hisilicon/hibmc: Add support for display engine
Add display engine function, crtc/plane is initialized here.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
2016-11-17 15:26:25 +08:00
Rongrong Zou d1667b8679 drm/hisilicon/hibmc: Add support for frame buffer
Add support for fbdev and kms fb management.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
2016-11-17 15:26:25 +08:00
Rongrong Zou e4daebc77e drm/hisilicon/hibmc: Add video memory management
Hibmc have 32m video memory which can be accessed through PCIe by host,
we use ttm to manage these memory.

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
2016-11-17 15:26:24 +08:00
Rongrong Zou 5e0df3a08f drm/hisilicon/hibmc: Add hisilicon hibmc drm master driver
Add DRM master driver for Hisilicon Hibmc SoC which used for
Out-of-band management. Blow is the general hardware connection,
both the Hibmc and the host CPU are on the same mother board.

+----------+       +----------+
|          | PCIe  |  Hibmc   |
|host CPU( |<----->| display  |
|arm64,x86)|       |subsystem |
+----------+       +----------+

Signed-off-by: Rongrong Zou <zourongrong@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Xinliang Liu <xinliang.liu@linaro.org>
Acked-by: Sean Paul <seanpaul@chromium.org>
2016-11-17 15:26:24 +08:00
Dave Airlie 08859ede42 Merge branch 'linux-4.10' of git://github.com/skeggsb/linux into drm-next
- GP102/GP104 devinit (suspend/resume, optimus) hang fix
- GP102/GP104 hardware cursor fix
- Fix for a regression on some non-MST monitors that was caused by the
MST work
- Workaround for certain laptops where ACPI sends display hotkey presses
on a modeset, causing gnome-settings-daemon to go into a continuous loop

* 'linux-4.10' of git://github.com/skeggsb/linux:
  drm/nouveau/disp/gp102: rename from gp104
  drm/nouveau/ce/gp102: rename from gp104
  drm/nouveau/fb/gp102: rename from gp104
  drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices
  drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes
  drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user
  drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE
  drm/nouveau/devinit/gm200: drop pmu reset sequence
  drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops
  drm/nouveau/pmu/gp102: initial implementation
  drm/nouveau/pmu/gp100: initial implementation
  drm/nouveau/pmu: execute reset before running devinit
  drm/nouveau/pmu: move ucode handling into gt215 implementation
  drm/nouveau/core: initial support for GP102
  drm/nouveau/device/pci: fix oops if no mmu subdev present
  drm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAP
2016-11-17 10:08:29 +10:00
Ravikant B Sharma e8e11817e2 drm/armada: fix NULL pointer comparison warning
Replace direct comparisons to NULL i.e.
'x == NULL' with '!x'. As per coding standard.

Signed-off-by: Ravikant B Sharma <ravikant.s2@samsung.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-17 00:02:50 +00:00
Stefan Christ 6f3723c15a drm/armada: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops
Signed-off-by: Stefan Christ <contact@stefanchrist.eu>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-17 00:02:50 +00:00
Christophe JAILLET 244a2419b6 drm/armada: remove some dead code
'dma_buf_map_attachment()' can not return NULL, so there is no need to
check for it.

Also add a space in order to improve layout.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-17 00:02:50 +00:00
Baoyou Xie 42b454590f drm/armada: mark symbols static where possible
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/armada/armada_gem.c:215:27: warning: no previous prototype for 'armada_gem_alloc_object' [-Wmissing-prototypes]
drivers/gpu/drm/armada/armada_gem.c:423:1: warning: no previous prototype for 'armada_gem_prime_map_dma_buf' [-Wmissing-prototypes]

In fact, both functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-17 00:02:50 +00:00
Russell King 917a3cbee0 drm/armada: de-midlayer armada
Now that the drm_connector_register() is gone from tda998x, we can
remove the mid-layer from armada-drm, eliminating the load, unload,
debugfs_init, and debugfs_cleanup callbacks from armada's drm_driver
structure.  No functional changes.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-11-17 00:02:50 +00:00
Ben Skeggs ed828666a7 drm/nouveau/disp/gp102: rename from gp104
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:39 +10:00
Ben Skeggs a4fa851c64 drm/nouveau/ce/gp102: rename from gp104
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:39 +10:00
Ben Skeggs eeea423c48 drm/nouveau/fb/gp102: rename from gp104
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:39 +10:00
Ben Skeggs e50fcff15f drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:38 +10:00
Ben Skeggs 2a32b9b186 drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:38 +10:00
Ben Skeggs 4391d7f5c7 drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user
GP102/GP104 make life difficult by redefining the channel indices for
some registers, but not others.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:38 +10:00
Hans de Goede 3a6536c51d drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBE
Various notebooks with nvidia GPUs generate an ACPI_VIDEO_NOTIFY_PROBE
acpi-video event when an external device gets plugged in (and again on
modesets on that connector), the default behavior in the acpi-video
driver for this is to send a KEY_SWITCHVIDEOMODE evdev event, which
causes e.g. gnome-settings-daemon to ask us to rescan the connectors
(good), but also causes g-s-d to switch to mirror mode on a newly plugged
monitor rather then using the monitor to extend the desktop (bad)
as KEY_SWITCHVIDEOMODE is supposed to switch between extend the desktop
vs mirror mode.

More troublesome are the repeated ACPI_VIDEO_NOTIFY_PROBE events on
changing the mode on the connector, which cause g-s-d to switch
between mirror/extend mode, which causes a new ACPI_VIDEO_NOTIFY_PROBE
event and we end up with an endless loop.

This commit fixes this by adding an acpi notifier block handler to
nouveau_display.c to intercept ACPI_VIDEO_NOTIFY_PROBE and:

1) Wake-up runtime suspended GPUs and call drm_helper_hpd_irq_event()
   on them, this is necessary in some cases for the GPU to detect connector
   hotplug events while runtime suspended
2) Return NOTIFY_BAD to stop acpi-video from emitting a bogus
   KEY_SWITCHVIDEOMODE key-press event

There already is another acpi notifier block handler registered in
drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.c, but that is not
suitable since that one gets unregistered on runtime suspend, and
we also want to intercept ACPI_VIDEO_NOTIFY_PROBE when runtime suspended.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs dc2b655928 drm/nouveau/devinit/gm200: drop pmu reset sequence
This sequence is incorrect for GP102/GP104 boards.  This is now being
handled correctly by the PMU subdev during preinit();

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs 920c58a711 drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops
It appears to be safe to access PTIMER on an unposted board with newer
chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs d91ccec631 drm/nouveau/pmu/gp102: initial implementation
GP102/GP104 require a harder reset of PMU prior to DEVINIT, or the IFR
image will hang.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:37 +10:00
Ben Skeggs 41c7be6913 drm/nouveau/pmu/gp100: initial implementation
Just enough to hookup preinit reset(), which DEVINIT will depend on later.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:36 +10:00
Ben Skeggs 2f524aa0b7 drm/nouveau/pmu: execute reset before running devinit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:36 +10:00
Ben Skeggs da7d2062fc drm/nouveau/pmu: move ucode handling into gt215 implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:36 +10:00
Ben Skeggs 17ff521d69 drm/nouveau/core: initial support for GP102
From visual inspection of traces, what we currently implement appears to
be identical to GP104.  Seems to work well enough too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:35 +10:00
Ben Skeggs 9e38b13ea5 drm/nouveau/device/pci: fix oops if no mmu subdev present
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:35 +10:00
Ben Skeggs 3ca03cac39 drm/nouveau/kms/nv50: avoid touching DP_MSTM_CTRL if !DP_MST_CAP
Fixes certain displays not being detected due to DPAUX errors.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-17 09:50:35 +10:00
Dave Airlie b7c0e47d98 This pull request brings in fragment shader threading and ETC1 support
for vc4.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCgAGBQJYLM74AAoJELXWKTbR/J7oMhoP/iXpvkEMm5tujsiXLSJwi2yZ
 Kt3h8lDIuF+p0i0lQDpUj9M5OfG8z0XJwLgmIJzh64uclG70tcfAuQ9WECC0h0ix
 ZvV+g8OaLURu/kRpLf4MDwxMAVnd0zOxmJ3PugLjmdrVtMR7keF/iedJpwzxNNWi
 PI0bZ8Vl2V8S5ayerDtDGTNs6yVP3/+SBKHsjPo2tj46FspMBWlzS7tI4YsyCdts
 gHI+0ICtAK2Aj0imo01UEIriO5AzHxkFk/c848knUYgrK51H0zmqXxWPo2I1NHFG
 wMHx/gUgasAv9EbSCjfyS/KP+YRKMeOER002/xSOuy3HFoAgOBHKZ54p3zPw9T44
 17eDpLU2LUwJYoMSWYGGjeeDsmHCqTDY84K9qqkwhLx8saODtk99P5zXdoMxYgyt
 a77ibarPAdJH1tC2WOo86yxQzcKaDzjzhhq4mqdBBDksZK0eVYfwDe1PssDZUQQe
 QAAs+DkygXYI+80rRdKFFeu4ApZZu151zdDKviXE2J7fYT9EQUgRJRlnZJNuYnok
 N7X0SVoqwGtxipZhIRlE348clEZ3abzdL6k1aUBL96O4tXu95n/BbbCXHXDYvOQf
 USyhrhTWVY2tSc3OAoXkZJ6bR7Mj+iXoQxV25tZohHoXUFaBu3Bgz5lBhDWBoMeN
 UK+TE4Wcfsr3EvA39plG
 =dFfc
 -----END PGP SIGNATURE-----

Merge tag 'drm-vc4-next-2016-11-16' of https://github.com/anholt/linux into drm-next

This pull request brings in fragment shader threading and ETC1 support
for vc4.
2016-11-17 09:43:56 +10:00