Commit Graph

590893 Commits

Author SHA1 Message Date
Riccardo Bortolato 4fc24ab3a1 drm/panel: simple: Add support for Innolux AT070TN92
Add support for the Innolux AT070TN92 panel.

Signed-off-by: Riccardo Bortolato <bortolato@navaltechitalia.it>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-05-12 11:32:14 +02:00
Boris Brezillon 844e2f5290 drm/panel: simple: Remove useless drm_mode_set_name()
drm_display_mode_from_videomode() already calls drm_mode_set_name() on
the provided mode.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
[treding@nvidia.com: slightly reword commit message]
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-05-12 11:32:14 +02:00
Boris Brezillon cda553725c drm/panel: simple: Set appropriate mode type
All modes exposed by simple panels should be tagged as driver defined
modes. Moreover, if a panel supports only one mode, this mode is
obviously the preferred one.

Doing this also fix a problem occurring when a 'video=' parameter is
passed on the kernel command line. In some cases the user provided mode
will be preferred over the simple panel ones, which might result in
unpredictable behavior.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
[treding@nvidia.com: reshuffle some code for consistency]
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-05-12 11:32:14 +02:00
Maxime Ripard cf5c9e6dc7 drm/panel: simple: Add timings for the Olimex LCD-OLinuXino-4.3TS
Add support for the Olimex LCD-OLinuXino-4.3TS panel to the DRM simple
panel driver.

It is a 480x272 panel connected through a 24-bits RGB interface.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-05-12 11:32:14 +02:00
Eric Anholt e8b6f561b2 drm/panel: simple: Add the 7" DPI panel from Adafruit
This is a basic TFT panel with a 40-pin FPC connector on it.  The
specification doesn't define timings, but the Adafruit instructions
were setting up 800x480 CVT.

v2: Add .bus_format and vsync/hsync flags.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Rob Herring <robh@kernel.org>
[treding@nvidia.com: keep entries properly sorted]
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-05-12 11:32:14 +02:00
Eric Anholt 686cfbd186 of: Add vendor prefix for On Tat Industrial Company.
This is the vendor for a 7" DPI panel sold by Adafruit which I'd like
to describe in DT.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-05-12 11:32:14 +02:00
Dave Airlie 95306975e9 drm/tegra: Changes for v4.7-rc1
Two small changes, one getting rid of the bogus gamma table size and
 another removing Terje from the MAINTAINERS file since he no longer does
 any work on host1x or display.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJXMfTkAAoJEN0jrNd/PrOhiVcQAJp0swGB6ZrwQqY543FuSTVW
 aAjKEjg7F7xbMol1wK5T48Ajn9IKmzinxYo6dS7SqrWltOhWdbrp6p+CvhdHy1EI
 lCtCcbymbvJBSzCAmGVk1YjfzfjpsKAQUlb7tM/7FdYPTK76LR2H2BUNK+zfdVLh
 Qje2+uKdy+jGDLXmnMbxTk5EjQI2Tw4CqAZkdQksGAt1AcI694smTo/JXLP8pRON
 xjg0OINVjFXtUrVeqSZUAdIWhewMApDwBT2+7yrZnL+RCwHjJzeqgjbT+9z56nar
 aEb2pcW2Gz9AWds2Z1CcB2ZTK1MwL3YohhoNFnVy20eK6UuMEnoj505KWWdOuuHr
 BvYuF8fTwU190vGVciwnezGEDqSe0fcNXcrNXf3eIqzypdBvU6h7XkqBZ5X7r1nc
 pWeANtwXo25CbOCHVTzhPkp7eEeNlmaHtqvDkqefGD5yS+Bn8Sz0SKi3kU51ZyOp
 25OxZ3WCAhqZVewTUSqe19IUubANhzf2QDz5LJDxtIAjDa2a2gJ5mNUCjPLmbojK
 NyYGSz9FrQRsyAjHOu+0zcbYnhM2JDM1yu5f3Vc4wlTcoiV/EJ4lmrP5/wNATsDM
 RliOxcNFsWzdnetw0dI20seoyQUd0OVV9qmYv0toI34D6cL4Csh6FWVgTlwNnQYK
 iuittjCP9r1uc+jYEVe1
 =CG36
 -----END PGP SIGNATURE-----

Merge tag 'drm/tegra/for-4.7-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v4.7-rc1

Two small changes, one getting rid of the bogus gamma table size and
another removing Terje from the MAINTAINERS file since he no longer does
any work on host1x or display.

* tag 'drm/tegra/for-4.7-rc1' of git://anongit.freedesktop.org/tegra/linux:
  MAINTAINERS: Remove Terje Bergström as Tegra DRM maintainer
  drm/tegra: Don't set a gamma table size
2016-05-12 11:15:18 +10:00
Dave Airlie 93f517c4a7 Merge branch 'drm-hisilicon-next' of github.com:xin3liang/linux into drm-next
misc hisilicon cleanups.

* 'drm-hisilicon-next' of github.com:xin3liang/linux:
  drm/hisilicon: Fix DRM_INFO printed issue
  drm/hisilicon: Make kirin_drm_unbind sufficient
  drm/hisilicon: Use drm_connector_register_all
2016-05-12 11:11:03 +10:00
Dave Airlie 6d23abf58a Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
Summary:
   - expose HDMI-PHY clock to other drivers.
     . this patch was included in below patch series but I missed.
             http://www.spinics.net/lists/dri-devel/msg103097.html
   - some fixups about DECON5433 driver
     . this patch corrects vblank handling and fixes up trigger
       configuration.
   - use generic functions - gem_prime_mmap and dma_buf_mmap.
   - use DMA-Mapping API instead of specific one.
   - some code cleanups and fixeups.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos/decon5433: fix trigger configuration
  drm/exynos/dsi: use of_graph_get_endpoint_by_regs helper
  drm/exynos/dpi: use of_graph_get_endpoint_by_regs helper
  drm/exynos: Nuke dummy fb->dirty callback
  drm/exynos: use directly DMA mapping APIs on g2d
  drm/exynos/hdmi: Don't print error on deferral due to regulators
  drm/exynos: fix imported dma-buf to be mapped
  drm/exynos: support gem_prime_mmap
  drm/exynos: fimd: harden fimd_calc_clkdiv()
  drm/exynos: fix cancel page flip code
  drm/exynos/decon5433: do not use unnecessary software trigger
  drm/exynos/decon5433: handle vblank in vblank interrupt
  drm/exynos/hdmi: expose HDMI-PHY clock as pipeline clock
2016-05-12 10:10:53 +10:00
Xinliang Liu 165cccc843 drm/hisilicon: Fix DRM_INFO printed issue
This patch fixed the bellow no DRM_INFO is printed issue:

if (!delay_count)
	DRM_INFO("phylock and phystopstateclklane is not ready.\n");

There will some printed issues with above info, under certain
circumstances:

If ((BIT(0) | BIT(2)) & val) is never true, break will not happen and
delay_count will be max u32 value (?), and no DRM_INFO is printed.

Also if ((BIT(0) | BIT(2)) & val) is true at the last possible
loop round, break happens, but now delay_count is already zero
( because of earlier delay_count-- ) and DRM_INFO is erroneously
printed.

Thanks to Juha Leppänen, he reports to me this issue.

Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reported-by: Juha Leppänen <juha_efku@dnainternet.net>
2016-05-11 19:05:36 +08:00
Xinliang Liu 12cb4c87aa drm/hisilicon: Make kirin_drm_unbind sufficient
Remove deprecated drm_put_dev.
Clean up everything needed in unbind.
Thanks to Daniel Vetter, this issue is reported by him.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reported-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
2016-05-11 19:05:36 +08:00
Daniel Vetter b93c846273 drm/hisilicon: Use drm_connector_register_all
Use drm_connector_register_all helper to register connectors.

Cc: Xinliang Liu <xinliang.liu@linaro.org>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-05-11 19:05:35 +08:00
Andrzej Hajda dd65a68674 drm/exynos/decon5433: fix trigger configuration
It seems trigger cannot be configured too early, otherwise it does not work in
case of panel. The patch fixes also trigger flag logic, previously HW-TRIGGER
flag was cleared in case of panel - as a result panel used always software
trigger.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:46 +09:00
Philipp Zabel 17ef49bd23 drm/exynos/dsi: use of_graph_get_endpoint_by_regs helper
This allows to remove the local of_graph_get_port_by_reg(),
of_graph_get_endpoint_by_reg(), and of_get_child_by_name_reg()
functions.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:45 +09:00
Philipp Zabel fb38b1f608 drm/exynos/dpi: use of_graph_get_endpoint_by_regs helper
This allows to remove the local of_graph_get_port_by_reg(),
of_graph_get_endpoint_by_reg(), of_get_child_by_name_reg(),
and of_graph_get_remote_port_parent() functions.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:45 +09:00
Daniel Vetter 562d54567f drm/exynos: Nuke dummy fb->dirty callback
It's an optional hook. Might be needed for frontbuffer rendering on
manual upload displays, but a simple TODO doesn't explain at all what
needs to be done or why.

Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:44 +09:00
Joonyoung Shim 6aa5e85d7c drm/exynos: use directly DMA mapping APIs on g2d
There is no reason to be wapper functions to use DMA mapping APIs. Use
directly DMA mapping APIs and remove the wapper functions.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:44 +09:00
Javier Martinez Canillas b85881ddf2 drm/exynos/hdmi: Don't print error on deferral due to regulators
The regulators may not be available just because their driver's probe
function was just not executed and so the regulators not registered.

So, in this case the Exynos HDMI driver should not print logs since
a -EPROBE_DEFER is not really an error and that will just pollute
the kernel log and confuse users.

This patch prevents the following misleading messages to be printed:

[    1.443638] [drm:hdmi_probe] *ERROR* failed to get regulators
[    1.449326] [drm:hdmi_probe] *ERROR* hdmi_resources_init failed

Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:44 +09:00
Joonyoung Shim 55b19fc75f drm/exynos: fix imported dma-buf to be mapped
The imported dma-buf should be mapped by sub-system exporting it.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:43 +09:00
Joonyoung Shim 5a0202f758 drm/exynos: support gem_prime_mmap
This allows exported dma-bufs to be mapped using gem_prime_mmap.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:42 +09:00
Tobias Jakobi fa9971d62a drm/exynos: fimd: harden fimd_calc_clkdiv()
Don't use the vrefresh field of the DRM mode since this
one is supposed to only be used for debug purpose.
Instead use the clock field which should also provide
much more precise information.

Also sanitize the case in which the clock value
should be zero. We then just default to the maximum
clock divisor.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:42 +09:00
Andrzej Hajda fc173ae6dd drm/exynos: fix cancel page flip code
Driver code did not remove event from the list of pending events before destroy.
As a result drm core later tried to inspect invalid memory location.
The patch replaces removal code with call to core helper.

The bug was detected using KASAN:

[   10.107249] ==================================================================
[   10.107518] BUG: KASAN: use-after-free in drm_release+0xe9c/0x1000 at addr ffffffc089154a18
[   10.107784] Read of size 8 by task modetest/103
[   10.107931] =============================================================================
[   10.113191] BUG kmalloc-128 (Not tainted): kasan: bad access detected
[   10.119608] -----------------------------------------------------------------------------
[   10.119608]
[   10.129243] Disabling lock debugging due to kernel taint
[   10.134551] INFO: Allocated in drm_mode_page_flip_ioctl+0x500/0xa98 age=4 cpu=0 pid=103
[   10.142532] 	alloc_debug_processing+0x18c/0x198
[   10.147043] 	___slab_alloc.constprop.28+0x360/0x380
[   10.151906] 	__slab_alloc.isra.25.constprop.27+0x54/0xa0
[   10.157197] 	kmem_cache_alloc_trace+0x370/0x3b0
[   10.161709] 	drm_mode_page_flip_ioctl+0x500/0xa98
[   10.166400] 	drm_ioctl+0x4c4/0xb68
[   10.169787] 	do_vfs_ioctl+0x16c/0xeb8
[   10.173429] 	SyS_ioctl+0x8c/0xa0
[   10.176642] 	el0_svc_naked+0x24/0x28
[   10.180204] INFO: Freed in exynos_drm_crtc_cancel_page_flip+0xe0/0x160 age=0 cpu=0 pid=103
[   10.188447] 	free_debug_processing+0x174/0x388
[   10.192871] 	__slab_free+0x2e8/0x438
[   10.196431] 	kfree+0x350/0x360
[   10.199469] 	exynos_drm_crtc_cancel_page_flip+0xe0/0x160
[   10.204762] 	exynos_drm_preclose+0x58/0xa0
[   10.208844] 	drm_release+0x1f0/0x1000
[   10.212491] 	__fput+0x1c4/0x5b8
[   10.215613] 	____fput+0xc/0x18
[   10.218654] 	task_work_run+0x130/0x198
[   10.222385] 	do_exit+0x700/0x2278
[   10.225681] 	do_group_exit+0xe4/0x2c8
[   10.229327] 	SyS_exit_group+0x1c/0x20
[   10.232973] 	el0_svc_naked+0x24/0x28
[   10.236532] INFO: Slab 0xffffffbdc2a45500 objects=32 used=10 fp=0xffffffc089154a00 flags=0x4080
[   10.245210] INFO: Object 0xffffffc089154a00 @offset=2560 fp=0xffffffc089157600
[   10.245210]
...
[   10.384532] CPU: 0 PID: 103 Comm: modetest Tainted: G    B           4.5.0-rc3-00748-gd5e2881 #271
[   10.398325] Call trace:
[   10.400764] [<ffffffc000091428>] dump_backtrace+0x0/0x328
[   10.406141] [<ffffffc000091764>] show_stack+0x14/0x20
[   10.411176] [<ffffffc00089c550>] dump_stack+0xb0/0xe8
[   10.416210] [<ffffffc000395778>] print_trailer+0xf8/0x160
[   10.421592] [<ffffffc00039b5cc>] object_err+0x3c/0x50
[   10.426626] [<ffffffc00039d630>] kasan_report_error+0x248/0x550
[   10.432527] [<ffffffc00039da50>] __asan_report_load8_noabort+0x40/0x48
[   10.439039] [<ffffffc000b5b724>] drm_release+0xe9c/0x1000
[   10.444419] [<ffffffc0003d340c>] __fput+0x1c4/0x5b8
[   10.449280] [<ffffffc0003d3884>] ____fput+0xc/0x18
[   10.454055] [<ffffffc000101aa8>] task_work_run+0x130/0x198
[   10.459522] [<ffffffc0000bc058>] do_exit+0x700/0x2278
[   10.464557] [<ffffffc0000bdcfc>] do_group_exit+0xe4/0x2c8
[   10.469939] [<ffffffc0000bdefc>] SyS_exit_group+0x1c/0x20
[   10.475320] [<ffffffc000087530>] el0_svc_naked+0x24/0x28

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:41 +09:00
Andrzej Hajda 3f4c8e5c28 drm/exynos/decon5433: do not use unnecessary software trigger
Software trigger should not be used if hardware trigger is configured.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:40 +09:00
Andrzej Hajda b0bb3d0775 drm/exynos/decon5433: handle vblank in vblank interrupt
vblank should be signaled to userspace after reading framebuffers not before,
signaling it in TE interrupt looks wrong. TE triggers reading framebuffers
so it is the worst moment. Tearing is not observable because hardware prevents
it, but there are frequently skipped vblank events.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:39 +09:00
Andrzej Hajda 59b62d3c8b drm/exynos/hdmi: expose HDMI-PHY clock as pipeline clock
HDMI-PHY clock should be accessible from other components in the pipeline.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-05-10 23:11:38 +09:00
Dave Airlie 19ea5da07a Merge branch 'drm-etnaviv-next' of git://git.pengutronix.de:/git/lst/linux into drm-next
not much new stuff this time. A (micro-)optimization to allow the
hangcheck timer to be coalesced with other wakeups in the system and a
fix to handle mmaping of prime imported and userptr buffers correctly. I
don't think we have seen any actual issues going back to this yet, so I
figured it's safer to get this in via drm-next rather than smashing it
into fixes.

* 'drm-etnaviv-next' of git://git.pengutronix.de:/git/lst/linux:
  drm/etnaviv: fix mmap operations for userptr and dma-buf objects
  drm/etnaviv: take etnaviv_gem_obj in etnaviv_gem_mmap_obj
  drm/etnaviv: use deferrable timer for hangcheck handler
  timer: add setup_deferrable_timer macro
2016-05-10 15:07:50 +10:00
Dave Airlie 2e726dc4b4 MT8173 DRM support
- device tree binding documentation for all MT8173 display
   subsystem components
 - basic mediatek-drm driver for MT8173 with two optional,
   currently fixed output paths:
 - DSI encoder support for DSI and (via bridge) eDP panels
 - DPI encoder support for output to HDMI bridge
 - necessary clock tree changes for the DPI->HDMI path
 - export mtk-smi functions used by mediatek-drm
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXMDw/AAoJEFDCiBxwnmDrw7oP/iIJNcj24JokDlRIFmVQIA+A
 /mLpvZcTgfCx3mZLSFG4N5VfB8CTg0/o2tj3e0C+GcVFWBbLpPemXR8gFxxdjeL2
 TfmO73TVZjdcf3u6kSqBRLxEn1nbzYeZwcWKzsxgjts5Vo0vHnC3R2l2VCGPl8ay
 9drqbFhOxGlGpkIia35z0mLb5dIJLQF6qkC5gFkTwY6ZKIV623/W8MQRbAU0wwwf
 NSAPwjEszFtFHDM2YIbROpEbFtmCpz6yZdblDARUbnK6mw6PW1g+FOrV+BiJWtzE
 A6c9FEKfSD3tExjH1DbsXx6jEIPjZ/wM979IrPU5kxOm6CuRAHa8KaRT6HraM8K4
 CPYolbkg1rPOERIG5EOV0Cu7Fcpx6hB9eyp8m4cINw907+govMc1kDdsYv+U19tz
 ALkZ9qs3py4tv0Zo12LoXfLUfqGLzMPwP/BTgGpeL8sJiq4KYpXlp5IIDCYbis9d
 UBuozAzrF8pDsE9XHZ98LEE+mlsVVbItavY3+2JqlRcfZS5THTUoBDCVLGPtSR9g
 IS9giTOQeEX/8vXCrz6rAQNHwCWo+7gwBPCMH0Drak+1WsetYbC+Xe8q3bCYQqXg
 4/z2AgE5O4vqVxWSuGGn8FsLmdu9wiNNND+k22Igq1hkBNGFjMthvDeIcIDNUYsX
 jWJtVZuK1jn6cbFhOmUe
 =vcoi
 -----END PGP SIGNATURE-----

Merge tag 'mediatek-drm-2016-05-09' of git://git.pengutronix.de/git/pza/linux into drm-next

MT8173 DRM support

- device tree binding documentation for all MT8173 display
  subsystem components
- basic mediatek-drm driver for MT8173 with two optional,
  currently fixed output paths:
- DSI encoder support for DSI and (via bridge) eDP panels
- DPI encoder support for output to HDMI bridge
- necessary clock tree changes for the DPI->HDMI path
- export mtk-smi functions used by mediatek-drm

* tag 'mediatek-drm-2016-05-09' of git://git.pengutronix.de/git/pza/linux:
  clk: mediatek: remove hdmitx_dig_cts from TOP clocks
  clk: mediatek: Add hdmi_ref HDMI PHY PLL reference clock output
  clk: mediatek: make dpi0_sel propagate rate changes
  drm/mediatek: Add DPI sub driver
  drm/mediatek: Add DSI sub driver
  drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.
  dt-bindings: drm/mediatek: Add Mediatek display subsystem dts binding
  memory: mtk-smi: export mtk_smi_larb_get/put
2016-05-10 15:01:47 +10:00
Dave Airlie bafb86f5bc Linux 4.6-rc7
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXL7HfAAoJEHm+PkMAQRiGYe8IAJBGaPUq38EJh2YOV+AQf9v6
 t/alhwB3DUE1E0zjLy7I7JJ+xDXtKjZh9fS6OFuIS8Q3RIrBteIJ/oH8TPpt7yZ/
 SnP6rYPvYD6CImTyrh7+ORL/udEwJX8+YqFYAgUAq167gvpDjYj8r26VzdIaIN4/
 oBbL8NrQNWfODieywYyhUoitVhwMz09zmBfLtGVks4vd2jUJk2Fdd9cOtGV5tRfk
 DPndPgyQtbr8W0mKovV8sT9WkQeV5TsUr4MLgf7hjnAGYQ8+0KamkzzVVLBeBiiw
 uazyrOCFkddZp+N7KbmbOmazV/yULRuLGgDjVKazoCsOaKOvoGCzrCk7daOPy6Q=
 =CegX
 -----END PGP SIGNATURE-----

Merge tag 'v4.6-rc7' into drm-next

Merge this back as we've built up a fair few conflicts, and I have
some newer trees to pull in.
2016-05-09 13:49:56 +10:00
Dave Airlie ba391646d0 drm/amdgpu: fix build on aarch64.
Same fix went in previously for some other files.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-09 10:30:42 +10:00
Dave Airlie 2c3d68abe2 Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
Mostly cleanups, fixes, and 'struct fence' conversion this time
around, with one reservation patch which is a-b Sumit (which the fence
conversion patches depend on).

* 'msm-next' of git://people.freedesktop.org/~robclark/linux: (25 commits)
  drm/msm: Drop load/unload drm_driver ops
  drm/msm: Centralize connector registration/unregistration
  drm/msm/hdmi: Prevent gpio_free related kernel warnings
  drm/msm: print offender task name on hangcheck recovery
  drm/msm: fix leak in failed submit path
  drm/msm: de-indent submit_create()
  drm/msm: drop return from gpu->submit()
  drm/msm/mdp4: Don't manage DSI PLL regulators in MDP driver
  drm/msm/edp: Drop regulator_set_voltage call
  drm/msm/dsi: Fix regulator API abuse
  drm/msm: Move call to PTR_ERR_OR_ZERO after reassignment
  drm/msm/mdp: Add support for more RGBX formats
  drm: msm: remove unused variable
  drm/msm: fix ->last_fence() after recover
  drm/msm: 'struct fence' conversion
  drm/msm: remove fence_cbs
  drm/msm: introduce msm_fence_context
  drm/msm: split locking and pinning BO's
  drm/msm/gpu: simplify tracking in-flight bo's
  drm/msm: split out timeout_to_jiffies helper
  ...
2016-05-09 10:19:38 +10:00
Dave Airlie 2958cf0ee2 Merge tag 'topic/drm-misc-2016-05-08' of git://anongit.freedesktop.org/drm-intel into drm-next
Refcounting is hard, so here's a quick pull request with the one-liner to
fix up i915. Otherwise just a few other small things I picked up. Plus the
regression fix from Marten for rmfb behaviour that lingered around forever
since no testers. Feel free to cherry-pick that over to drm-fixes, but
given that there's not many who seemed to have cared, meh.

* tag 'topic/drm-misc-2016-05-08' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Correctly refcount connectors in hw state readou
  drm/panel: Flesh out kerneldoc
  drm: Add gpu.tmpl docbook to MAINTAINERS entry
  drm/core: Do not preserve framebuffer on rmfb, v4.
  drm: Fix up markup fumble
  drm/fb_helper: Fix a few typos
2016-05-09 10:16:50 +10:00
Linus Torvalds 44549e8f5e Linux 4.6-rc7 2016-05-08 14:38:32 -07:00
Archit Taneja 2b66987533 drm/msm: Drop load/unload drm_driver ops
The load/unload drm_driver ops are deprecated. They should be removed as
they result in creation of devices visible to userspace even before
the drm_device is registered.

Drop these ops and use drm_dev_alloc/register and drm_dev_unregister/unref
to explicitly create and destroy the drm device in the msm platform
driver's bind and unbind ops. With this in use, the drm connectors are
only registered once the drm_device is registered.

It also fixes the issue of stray debugfs files after the msm module is
removed. With this, all the debugfs files are removed, and allows
successive module insertions/removals.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
2016-05-08 10:22:19 -04:00
Archit Taneja 8208ed931e drm/msm: Centralize connector registration/unregistration
Move the drm_connector registration from the encoder(HDMI/DSI etc) drivers
to the msm platform driver. This will simplify the task of ensuring that
the connectors are registered only after the drm_device itself is
registered.

The connectors' destroy ops are made to use kzalloc instead of
devm_kzalloc to ensure that that the connectors can be successfully
unregistered when the msm driver module is removed. The memory for the
connectors is unallocated when drm_mode_config_cleanup() is called
during either during an error or during driver remove.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:19 -04:00
Archit Taneja c899f93584 drm/msm/hdmi: Prevent gpio_free related kernel warnings
Calling the legacy gpio_free on an invalid GPIO (a GPIO numbered -1)
results in kernel warnings. This causes a lot of backtraces when
we try to unload the drm/msm module.

Call gpio_free only on valid GPIOs.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:19 -04:00
Rob Clark 4816b6267c drm/msm: print offender task name on hangcheck recovery
Track the pid per submit, so we can print the name of the task which
submitted the batch that caused the gpu to hang.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:18 -04:00
Rob Clark 40e6815bba drm/msm: fix leak in failed submit path
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:18 -04:00
Rob Clark 6860b56c4b drm/msm: de-indent submit_create()
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:18 -04:00
Rob Clark 1193c3bcb5 drm/msm: drop return from gpu->submit()
At this point, there is nothing left to fail.  And submit already has a
fence assigned and is added to the submit_list.  Any problems from here
on out are asynchronous (ie. hangcheck/recovery).

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:18 -04:00
Archit Taneja ed19075be1 drm/msm/mdp4: Don't manage DSI PLL regulators in MDP driver
The MDP4 driver tries to request and set voltages for regulators required
by the DSI PLLs.

Firstly, the MDP4 driver shouldn't manage the DSI regulators, this should
be handled in the DSI driver. Secondly, it shouldn't try to set a fixed
voltage for regulators. Voltage constraints should be specified on the
regulator via DT and managed by the regulator core.

Remove all the DSI PLL regulator related code from the MDP4 driver. It's
managed in the DSI driver for MSM8960/APQ8064 already.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:18 -04:00
Archit Taneja 1d15c1654f drm/msm/edp: Drop regulator_set_voltage call
The eDP driver tries to set a fixed voltage for one of its regulators(vdda)
before enabling it. This shouldn't be done by the driver, the voltage
constraints should be specified on the regulator via DT and managed by
the regulator core. A driver should call regulator_set_voltage only if
it needs to change the voltage during runtime. Drop the
regulator_set_voltage call. Mention in a comment the voltage that the
regulator expects.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:17 -04:00
Archit Taneja f377d59729 drm/msm/dsi: Fix regulator API abuse
The voltage changing code in this driver is broken and should be
removed.  The driver sets a single, exact voltage on probe.  Unless
there is a very good reason for this (which should be documented in
comments) constraints like this need to be set via the machine
constraints, voltage setting in a driver is expected to be used in cases
where the voltage varies at runtime.

In addition client drivers should almost never be calling
regulator_can_set_voltage(), if the device needs to set a voltage it
needs to set the voltage and the regulator core will handle the case
where the regulator is fixed voltage.  If the driver simply skips
setting the voltage if it doesn't have permission then it should just
not bother in the first place.

Originally authored by Mark Brown <broonie@kernel.org>

Remove the min/max voltage data entries per SoC managed by the driver.
These aren't needed as we don't try to set voltages any more. Mention in
comments the voltages that each regulator expects.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:17 -04:00
Vaishali Thakkar d6c925cada drm/msm: Move call to PTR_ERR_OR_ZERO after reassignment
Here, a location is reset to NULL before being passed to PTR_ERR.
So, PTR_ERR should be called before its argument is reassigned
to NULL. Further to simplify things use PTR_ERR_OR_ZERO instead
of PTR_ERR and IS_ERR.

Problem found using Coccinelle.

Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[fixed fmt string warning (s/%ld/%d/)]
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:16 -04:00
Rob Herring 30c6bfe8ab drm/msm/mdp: Add support for more RGBX formats
Android needs XBGR8888 format. Add all the missing 32-bpp formats
without alpha for completeness.

Cc: Archit Taneja <architt@codeaurora.org>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Archit Taneja  <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:16 -04:00
Arnd Bergmann 6979cd54c0 drm: msm: remove unused variable
A recent cleanup removed the only user of the 'kms' variable in
msm_preclose(), causing a harmless compiler warning:

drivers/gpu/drm/msm/msm_drv.c: In function 'msm_preclose':
drivers/gpu/drm/msm/msm_drv.c:468:18: error: unused variable 'kms' [-Werror=unused-variable]

This removes the variable as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 4016260ba4 ("drm/msm: fix bug after preclose removal")
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:16 -04:00
Rob Clark 2755734390 drm/msm: fix ->last_fence() after recover
It is no longer true that we discard all in-flight submits on recover
(these days we only discard the first one that hung).  After the first
re-submitted batch completes it would overwrite the fence with a correct
value, but there would be a window of time which showed all re-submitted
batches as already complete.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:15 -04:00
Rob Clark b6295f9a38 drm/msm: 'struct fence' conversion
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:15 -04:00
Rob Clark ba00c3f2f0 drm/msm: remove fence_cbs
This was only used for atomic commit these days.  So instead just give
atomic it's own work-queue where we can do a block on each bo in turn.
Simplifies things a whole bunch and makes the 'struct fence' conversion
easier.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:22:14 -04:00
Rob Clark ca762a8ae7 drm/msm: introduce msm_fence_context
Better encapsulate the per-timeline stuff into fence-context.  For now
there is just a single fence-context, but eventually we'll also have one
per-CRTC to enable fully explicit fencing.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:19:51 -04:00
Rob Clark 340faef241 drm/msm: split locking and pinning BO's
Split up locking and pinning buffers in the submit path.  This is needed
because we'll want to insert fencing in between the two steps.

This makes things end up looking more similar to etnaviv submit code
(which was originally modelled on the msm code but has already added
'struct fence' support).

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-05-08 10:16:03 -04:00