2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 17:23:55 +08:00
Commit Graph

635213 Commits

Author SHA1 Message Date
Ben Skeggs
c4e6812c1c drm/nouveau/kms/nv50: separate out viewport commit
This commit separates the calculation of EVO state from the commit, in
order to make the same code useful for atomic modesetting.

The legacy interfaces have been wrapped on top of them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:54 +10:00
Ben Skeggs
6bbab3b6b6 drm/nouveau/kms/nv50: separate out base/ovly channel usage bounds commit
This commit separates the calculation of EVO state from the commit, in
order to make the same code useful for atomic modesetting.

The legacy interfaces have been wrapped on top of them.

We're no longer touching the overlay channel usage bounds as of this
commit.  The code to do so is in place for when overlay planes are
added.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:53 +10:00
Ben Skeggs
ea8ee39002 drm/nouveau/kms/nv50: separate out cursor surface commit
This commit separates the calculation of EVO state from the commit, in
order to make the same code useful for atomic modesetting.

The legacy interfaces have been wrapped on top of them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:53 +10:00
Ben Skeggs
a7ae156190 drm/nouveau/kms/nv50: separate out lut commit
This commit separates the calculation of EVO state from the commit, in
order to make the same code useful for atomic modesetting.

The legacy interfaces have been wrapped on top of them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:52 +10:00
Ben Skeggs
ad63361953 drm/nouveau/kms/nv50: separate out core surface commit
This commit separates the calculation of EVO state from the commit, in
order to make the same code useful for atomic modesetting.

The legacy interfaces have been wrapped on top of them.

As of this commit, we're no longer bothering to point the core surface
at a valid framebuffer.  Prior to this, we'd initially point the core
channel to the framebuffer passed in a mode_set()/mode_set_base(), and
then use the base channel for any page-flip updates, leaving the core
channel pointing at stale information.

The important thing here is to configure the core surface parameters in
such a way that EVO's error checking is satisfied.

TL;DR: The situation isn't too much different to before.

There may be brief periods of times during modesets where the (garbage)
core surface will be showing.  This issue will be resolved once support
for atomic commits has been implemented and we're able to interlock the
updates that involve multiple channels.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:52 +10:00
Ben Skeggs
3dbd036b84 drm/nouveau/kms/nv50: separate out mode commit
This commit separates the calculation of EVO state from the commit, in
order to make the same code useful for atomic modesetting.

The legacy interfaces have been wrapped on top of them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:51 +10:00
Ben Skeggs
5a223daccb drm/nouveau/kms/nv50: give more useful names to encoders
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:51 +10:00
Ben Skeggs
7f55a07293 drm/nouveau/kms/nv50: control evo trace output with DRM_UT_KMS
Will be useful in debugging the transition to atomic.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:50 +10:00
Ben Skeggs
52aa30f252 drm/nouveau/kms/nv50: switch mst sink back into sst mode
Sometimes we load with a sink already in MST mode.  If, however, we can't
or don't want to use MST, we need to be able to switch it back to SST.

This commit instantiates a stub topology manager for any output path that
we believe (the detection of this could use some improvement) has support
for MST, and adds the connector detect() logic for detecting sink support
and switching between modes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:50 +10:00
Ben Skeggs
fc21a4a099 drm/nouveau/kms: never call drm_helper_disable_unused_functions() with atomic
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:49 +10:00
Ben Skeggs
b167db0e68 drm/nouveau/kms: prepare to support suspend/resume of display state with atomic
This is different from the equivilant functions in the atomic helpers in
that we fully disable the pipe instead of just setting it to inactive.

We do this (primarily) to ensure the framebuffer cleanup paths are hit,
allowing buffers to be un-pinned from memory so they can be evicted to
system memory and not lose their contents while suspended.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:49 +10:00
Ben Skeggs
986edb91b2 drm/nouveau/kms: prepare to support vbl timestamp calculation with atomic
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:48 +10:00
Ben Skeggs
d6455379a9 drm/nouveau/kms: prepare to support legacy connector set_property with atomic
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:48 +10:00
Ben Skeggs
b2b75eea57 drm/nouveau/kms: prepare to support legacy connector dpms with atomic
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:47 +10:00
Ben Skeggs
56182b8bd1 drm/nouveau/kms: separate connector property attach from nouveau_connector
These will also be used by MST connectors.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:47 +10:00
Ben Skeggs
616915ec76 drm/nouveau/kms: subclass atomic connector state
This commit implements the atomic property hooks for a connector, and
wraps the legacy interface handling on top of those.

For the moment, a full modeset will be done after any property change
in order to ease subsequent changes.  The optimised behaviour will be
restored for Tesla and later (earlier boards always do full modesets)
once atomic commits are implemented.

Some functions are put under the "nouveau_conn" namespace now, rather
than "nouveau_connector", to distinguish functions that will work for
(upcoming) MST connectors too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:46 +10:00
Ben Skeggs
07193f7051 drm/nouveau/kms: execute drm_mode_config_reset() after constructing display
This will ensure we have some kind of initial atomic state for all objects
after initialisation.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:46 +10:00
Ben Skeggs
3b4c0abb1b drm/nouveau/kms: move drm_crtc_force_disable_all() earlier
nouveau_display_fini() is responsible for quiescing the hardware, so
this is where such actions belong.

More than that, nouveau_display_fini() switches off the receiving of
sink irqs, which MST will require while shutting down an active head.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:45 +10:00
Ben Skeggs
d000edd360 drm/nouveau/kms: drop dpms off/on in response to hotplug
This primarily existed to ensure the DP link got retrained, and is
now unnecessary as that's handled by NVKM already.

For anything beyond that, we send an event to userspace and let it
decide on an appropriate action to take.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:45 +10:00
Ben Skeggs
1608a0fbb6 drm/nouveau/fbcon: refcount the drm_framebuffer
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:44 +10:00
Ben Skeggs
595b61cc13 drm/nouveau/fbcon: make use of drm_fb_helper.fb
Transitional step towards properly refcounting the fbcon fb.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:44 +10:00
Ben Skeggs
9dec928052 drm/nouveau/fbcon: make use of drm_fb_helper.dev
No need to store the pointer ourselves when it's already present in
the base struct.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:43 +10:00
Ben Skeggs
725fa3ac39 drm/nouveau/disp/g94-: stop listening for dp (sst) retrain irq when disabling link
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:43 +10:00
Ben Skeggs
4cddeb9b31 drm/nouveau/disp/sor/gf119-: add method to program mst payload information
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:42 +10:00
Ben Skeggs
f2a4051379 drm/nouveau/disp/sor/gf119-: add method to control mst enable
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:42 +10:00
Ben Skeggs
1f8711bafe drm/nouveau/disp/dp: remove workqueue for link training
There haven't been any callers from an atomic context for a while now,
so let's remove the extra complexity.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:41 +10:00
Ben Skeggs
a3f8a41fd2 drm/nouveau/nvif: helper to match against supported class list
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:41 +10:00
Ben Skeggs
f3a8b6645d drm/nouveau: silence sparse warnings about symbols not being marked static
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:40 +10:00
Christophe JAILLET
91cf301f6f drm/nouveau/tegra: Fix error handling
'iommu_domain_alloc()' returns NULL in case of error, not an error pointer.
So test it accordingly.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:40 +10:00
Alexandre Courbot
770b06e8cb drm/nouveau/fb: add gm20b device
gm20b's FB has the same capabilities as gm200, minus the ability to
allocate RAM. Create a device that reflects this instead of re-using the
gk20a device which may be incorrect.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-By: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:39 +10:00
Alexandre Courbot
60958b8f29 drm/nouveau/fb/gk20a: use regular gf100's functions
gk20a's FB is not special compared to other Kepler chips, besides the
fact it does not have VRAM. Use the regular gf100 hooks instead of the
incomplete versions we rewrote.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-By: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:39 +10:00
Alexandre Courbot
635cb7da57 drm/nouveau/fb/gk20a: fix constructor call
The gf100 constructor should be called, otherwise we will allocate a
smaller object than expected. This was without effect so far because
gk20a did not allocate a page, but with gf100's page allocation moved
to the oneinit() hook this problem has become apparent.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:38 +10:00
Alexandre Courbot
ed7acfae2a drm/nouveau/pmu: remove reset() hook
The reset hook of pmu_func is never called, and gt215 was the only chip
to implement. Remove this dead code.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:38 +10:00
Lucas Stach
8423d75d8f drm/nouveau: fix notify data leak
There is no reason to not free the notify data if the NTFY_DEL ioctl
failed. As nvif_notify_fini() is also called from the cleanup path of
nvif_notify_init(), the notifier may not have been successfully created
at that point. But it should also be the right thing to just free the
data in the regular fini calls, as there is nothing much we can do if
the ioctl fails, so better not leak memory.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:37 +10:00
Lucas Stach
9a47a657bd drm/nouveau: fix nv84 fence context leak
uevent based fences hold a reference to the fence context,
just like the legacy ones. So they need to drop this reference
in the same way.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:37 +10:00
Arnd Bergmann
b74c0a9969 drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
gcc-4.9 notices that the validate_init() function returns unintialized
data when called with a zero 'nr_buffers' argument, when called with the
-Wmaybe-uninitialized flag:

drivers/gpu/drm/nouveau/nouveau_gem.c: In function ‘validate_init.isra.6’:
drivers/gpu/drm/nouveau/nouveau_gem.c:457:5: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

However, the only caller of this function always passes a nonzero
argument, and gcc-6 is clever enough to take this into account and
not warn about it any more.

Adding an explicit initialization to -EINVAL here is correct even if
the caller changed, and it avoids the warning on gcc-4.9 as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-By: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:36 +10:00
Baoyou Xie
e08a1d97d3 drm/nouveau: mark symbols static where possible
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c:29:1: warning: no previous prototype for 'nvbios_fan_table' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c:56:1: warning: no previous prototype for 'nvbios_fan_entry' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c:184:1: warning: no previous prototype for 'gt215_clk_info' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:99:1: warning: no previous prototype for 'gt215_link_train_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:153:1: warning: no previous prototype for 'gt215_link_train' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c:271:1: warning: no previous prototype for 'gt215_link_train_init' [-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: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:36 +10:00
Baoyou Xie
e8390eb260 drm/nouveau: add missing header dependencies
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:34:1: warning: no previous prototype for 'nvkm_firmware_get' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/core/firmware.c:58:1: warning: no previous prototype for 'nvkm_firmware_put' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c:69:1: warning: no previous prototype for 'nvkm_sddr3_calc' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c:60:1: warning: no previous prototype for 'nvkm_sddr2_calc' [-Wmissing-prototypes]
....

In fact, these functions are declared in
drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h
drivers/gpu/drm/nouveau/dispnv04/disp.h.
So this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:35 +10:00
Ben Skeggs
5b3800a6b7 drm/nouveau/i2c/gk110b,gm10x: use the correct implementation
DPAUX registers moved on Kepler, these chipsets were still using the
Fermi implementation for some reason.

This fixes detection of hotplug/sink IRQs on DP connectors.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2016-11-07 14:04:31 +10:00
Ben Skeggs
f1963a47c0 drm/nouveau/i2c/aux/g94-: retry transactions after hw reports an error
This fixes (works around?) link training failures seen on (at least)
the Lenovo P50's internal panel.

It's also an important fix on the same system for MST support on the
dock.  Sometimes, right after receiving an IRQ from the sink, there's
an error bit (SINKSTAT_ERR) set in the DPAUX registers before we've
even attempted a transaction.

v2. Fixed regression on passive DP->DVI adapters.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:30 +10:00
Ben Skeggs
768e847759 drm/nouveau/kms: lvds panel strap moved again on maxwell
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2016-11-07 14:04:14 +10:00
Ben Skeggs
4d98773081 drm/nouveau/mxm: add some extra debug output
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2016-11-07 14:04:13 +10:00
Ben Skeggs
5dc7f4aa9d drm/nouveau/bios: require checksum to match for fast acpi shadow method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
2016-11-07 14:03:36 +10:00
Shawn Guo
dbb0103767 MAINTAINERS: add an entry for ZTE ZX DRM driver
Add myself as the maintainer of ZTE ZX DRM driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2016-11-07 11:02:31 +08:00
Shawn Guo
0a886f5952 drm: zte: add initial vou drm driver
It adds the initial ZTE VOU display controller DRM driver.  There are
still some features to be added, like overlay plane, scaling, and more
output devices support.  But it's already useful with dual CRTCs and
HDMI monitor working.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2016-11-07 11:02:31 +08:00
Shawn Guo
f78dd2c210 dt-bindings: add bindings doc for ZTE VOU display controller
It adds initial bindings doc for ZTE VOU display controller.  HDMI is
the only supported output device right now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
2016-11-07 11:02:31 +08:00
Dave Airlie
7b624ad8fe Linux 4.9-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJYHmoCAAoJEHm+PkMAQRiG7RMIAI2i7Y5hpL5yCxK5AFaL4u/G
 KxXfp1B1UanUTgjOmd7zGqtDYcFX9t7GTTUFixQ7/9Opr4PD9qbnatoDGSc3xjbT
 msDgA1B78F1/Q3kHWfeGq32MihQ4mj5NwUCo+igUcUvvWG7mHgzErj/Nh5RoobQX
 p/izdpTbrw3GX6xXB8olbG7XWHaVye/+TT3q6+gmgm8I/QEujcLeGoycE0zlhPN8
 FG/JX76At/+ZM2Py7Oxo3k+oKL9CHrtOQYDp/wN0uslV5eYvvkZz0/M1HMOGZt+c
 gZU5jzM17K7C4Nzo06WAuBU9wUBGc25m+cPicLlOmljnzfU+f50SKaDjZq3p7QI=
 =2KUF
 -----END PGP SIGNATURE-----

Backmerge tag 'v4.9-rc4' into drm-next

Linux 4.9-rc4

This is needed for nouveau development.
2016-11-07 09:37:09 +10:00
Dave Airlie
dc345c4677 omapdrm changes for v4.10
The main change here is the big refactoring to remove omapdrm's own
 'omap_video_timings', and use the standard display timings.
 
 Besides that, a few minor fixes and cleanups.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJYGa8jAAoJEPo9qoy8lh711FoQAKf47RNXWcvRNyUa2D+ybeyh
 Vt/V4Dx/jv1VoQMEbaBuxzBw2bX7IkalvDqUO8y7puBl5ROXsSA9Miz4FLCHpZnB
 8SmOPHnrdSfwsS4dmjiTWFyyDAINq2GtG25T4n3ch9PAN+4rOGOP/mJJhz1iBSnn
 qAQD9mC6x+8bSSlWS13ZK5IxqQL+0s9Grp3gbo/9A3p4ZEGdQCahJI/X3ZdF8aPD
 5CCZSDEMA784jsoOQGp1CLBv1Gz9HbxB1za4AlyOWLn55aaolVy7a+4Fezq3IDe1
 1V1f/B0b883HxcRG34TSPqiIciqeF1luLWrGvovQKkSP8o/DvKDuLUNE5NMhgJbm
 nOacdlDBcynpRWuPI+sQS7EuQHjegEPiuOhDKy/wG1v0yfiTbwBnJ3klybYzSLbB
 1VikSHyXkCowqnKxc3WkpBR05yxC9E0hivcGp2Y8Uq+8EwE6ejAEoWXXjPD5Cu0w
 O5sbU6wl79hdEefwF8KQTuVmy0DXFiMPa8kviBPWQw1Q3VoQpDSrccSJZq+w2njD
 8F0VVnEhAftLFy5YaHI6SnDQeIy3aO0VuXwFYG+xRSCTv9a99/HFAUtl5chQygjn
 5CYyQ/x2D/pwcertdx0CmWg4QmfXIkMI3+jPrlawK7mIlnY2Xj9otcZDHEpWoKat
 1dD6Jn5lnd8QvjJV7f7B
 =PA44
 -----END PGP SIGNATURE-----

Merge tag 'omapdrm-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm changes for v4.10

The main change here is the big refactoring to remove omapdrm's own
'omap_video_timings', and use the standard display timings.

Besides that, a few minor fixes and cleanups.
2016-11-07 09:19:23 +10:00
Linus Torvalds
bc33b0ca11 Linux 4.9-rc4 2016-11-05 16:23:36 -07:00
Linus Torvalds
bd060ac0f6 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fix from Wolfram Sang:
 "A bugfix for the I2C core fixing a (rare) race condition"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: core: fix NULL pointer dereference under race condition
2016-11-05 15:30:12 -07:00