]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/log
mirror_ubuntu-eoan-kernel.git
9 years agoMerge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daein...
Dave Airlie [Tue, 23 Jun 2015 00:13:18 +0000 (10:13 +1000)]
Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Summary:
. Add atomic feature support
  - Exynos also now supports atomic feature. However, it doesn't
    guarantee atomic operation yet, and is required for more cleanups.
    This time we just modified for Exynos drm driver to use atomic
    interfaces instead of legacy ones. Next time, we will enhance
    Exynos drm driver to support the atomic operation.
. Add iommu support
  - This is a patch series according to below Exynos iommu integration
    work with DT and dma-mapping subsystem,
    http://lwn.net/Articles/607626/
. Consolidate Exynos drm driver initialization.
  - This patch sereis resolves the issue that only the first compoments
    was bound when happened deferred probing for other pipelines and
    also makes the driver to be more cleanned up by moving the dispered
    codes for registering kms drivers to one place.
. Add new MIC, DECON drivers, and MIPI-DSI support for Exynos5433.
  - Add MIC(Mobile image compressor) driver. MIC is a new IP for Exynos5433
    and later, which is used to transfer frame data to MIPI-DSI controller
    compressing the data to reduce memory bandwidth.
  - Add DECON driver for Exynos5433 SoC. This IP is a dislay controller
    similar to Exynos7's one but this controller has much different registers
    from Exynos7's ones so this driver has been implemented separately.
    We will implement a helper modules for FIMD and two DECON controllers
    to remove duplicated codes later.
  - Add Exynos5433 SoC support to MIPI-DSI driver, and device tree
    relevant patches.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (50 commits)
  ARM: dts: rename the clock of MIPI DSI 'pll_clk' to 'sclk_mipi'
  drm/exynos: dsi: do not set TE GPIO direction by input
  drm/exynos: dsi: add support for MIC driver as a bridge
  drm/exynos: dsi: add support for Exynos5433
  drm/exynos: dsi: make use of array for clock access
  drm/exynos: dsi: make use of driver data for static values
  drm/exynos: dsi: add macros for register access
  drm/exynos: dsi: rename pll_clk to sclk_clk
  drm/exynos: mic: add MIC driver
  of: add helper for getting endpoint node of specific identifiers
  drm/exynos: add Exynos5433 decon driver
  drm/exynos: fix the input prompt of Exynos7 DECON
  drm/exynos: add drm_iommu_attach_device_if_possible()
  drm/exynos: Add the dependency for DRM_EXYNOS to DPI/DSI/DP
  drm/exynos: remove the dependency of DP driver for ARCH_EXYNOS
  drm/exynos: do not wait for vblank at atomic operation
  drm/exynos: Remove unused vma field of exynos_drm_gem_obj
  drm/exynos: fimd: fix page fault issue with iommu
  drm/exynos: iommu: improve a check for non-iommu dma_ops
  drm/exynos: iommu: detach from default dma-mapping domain on init
  ...

9 years agoMerge tag 'topic/drm-misc-2015-06-22' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Tue, 23 Jun 2015 00:12:40 +0000 (10:12 +1000)]
Merge tag 'topic/drm-misc-2015-06-22' of git://anongit.freedesktop.org/drm-intel into drm-next

One more drm-misc pull for 4.2. The important one is the fix from Laurent
for Daniel Stone's mode_blob work.

* tag 'topic/drm-misc-2015-06-22' of git://anongit.freedesktop.org/drm-intel:
  drm/atomic: Don't set crtc_state->enable manually
  drm: prime: Document gem_prime_mmap
  drm: Avoid the double clflush on the last cache line in drm_clflush_virt_range()
  drm/atomic: Extract needs_modeset function
  drm/cma: Fix 64-bit size_t build warnings
  Documentation/drm: Update rotation property

9 years agoARM: dts: rename the clock of MIPI DSI 'pll_clk' to 'sclk_mipi'
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:10 +0000 (21:59 +0900)]
ARM: dts: rename the clock of MIPI DSI 'pll_clk' to 'sclk_mipi'

The clock which was named as 'pll_clk' is actually not the clock source
of PLL in MIPI DSI. This patch fixes this disagreement.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/atomic: Don't set crtc_state->enable manually
Laurent Pinchart [Mon, 22 Jun 2015 10:37:46 +0000 (13:37 +0300)]
drm/atomic: Don't set crtc_state->enable manually

The enable field needs to be kept in sync with the mode_blob field. Call
drm_atomic_set_mode_prop_for_crtc() instead of setting enable to false
in order to dereference the mode blob correctly.

v2:
- Check the return value of drm_atomic_set_mode_prop_for_crtc()
- Drop the num_connectors local variable

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/exynos: dsi: do not set TE GPIO direction by input
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:09 +0000 (21:59 +0900)]
drm/exynos: dsi: do not set TE GPIO direction by input

On some board, TE GPIO should be configured properly thoughout pinctrl driver
as an wakeup interrupt. So this gpio should be configurable in the board's DT,
not being requested as a input pin.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: dsi: add support for MIC driver as a bridge
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:08 +0000 (21:59 +0900)]
drm/exynos: dsi: add support for MIC driver as a bridge

MIC must be initilized by MIPI DSI when it is being bound.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: dsi: add support for Exynos5433
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:07 +0000 (21:59 +0900)]
drm/exynos: dsi: add support for Exynos5433

This patch adds support for Exynos5433 mipi dsi.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: dsi: make use of array for clock access
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:06 +0000 (21:59 +0900)]
drm/exynos: dsi: make use of array for clock access

This patch make the driver to use an array for clock access. The number
of clocks are different from the existing MIPI DSI driver and Exynos5433
MIPI DSI driver. So this patch is needed before adding support for
Exynos5433 MIPI DSI driver.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: dsi: make use of driver data for static values
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:05 +0000 (21:59 +0900)]
drm/exynos: dsi: make use of driver data for static values

Exynos MIPI DSI driver uses some static values such as address offsets,
register setting values, and etc. This patch makes the driver get those
values from the driver data.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: dsi: add macros for register access
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:04 +0000 (21:59 +0900)]
drm/exynos: dsi: add macros for register access

This patch adds macros for register writing/reading. This is needed for
adding support Exynos5433 MIPI DSI driver, not by using if statement, but
by using driver data.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: dsi: rename pll_clk to sclk_clk
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:03 +0000 (21:59 +0900)]
drm/exynos: dsi: rename pll_clk to sclk_clk

This patch renames pll_clk to sclk_clk. The clock referenced by pll_clk
is actually not the pll input clock for dsi. The pll input clock comes
from the board's oscillator directly. But for the backward
compatibility, the old clock name "pll_clk" is also OK.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: mic: add MIC driver
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:02 +0000 (21:59 +0900)]
drm/exynos: mic: add MIC driver

MIC(Mobile image compressor) is newly added IP in Exynos5433. MIC
resides between decon and mipi dsim, and compresses frame data by 50%.
With dsi, not display port, to send frame data to the panel, the
bandwidth is not enough. That is why this compressor is introduced.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agoof: add helper for getting endpoint node of specific identifiers
Hyungwon Hwang [Fri, 12 Jun 2015 12:59:01 +0000 (21:59 +0900)]
of: add helper for getting endpoint node of specific identifiers

When there are multiple ports or multiple endpoints in a port, they have to be
distinguished by the value of reg property. It is common. The drivers can get
the specific endpoint in the specific port via this function. Now the drivers
have to implement this code in themselves or have to force the order of dt nodes
to get the right node.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Acked-by: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: add Exynos5433 decon driver
Joonyoung Shim [Fri, 12 Jun 2015 12:59:00 +0000 (21:59 +0900)]
drm/exynos: add Exynos5433 decon driver

DECON(Display and Enhancement Controller) is new IP replacing FIMD in
Exynos5433. This patch adds Exynos5433 decon driver.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: fix the input prompt of Exynos7 DECON
Hyungwon Hwang [Fri, 12 Jun 2015 12:58:59 +0000 (21:58 +0900)]
drm/exynos: fix the input prompt of Exynos7 DECON

This patch is a preparation patch for adding support for Exynos5433
DECON. Exynos7 DECON have to be distinguished from Exynos5433 DECON.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: add drm_iommu_attach_device_if_possible()
Hyungwon Hwang [Mon, 22 Jun 2015 10:05:04 +0000 (19:05 +0900)]
drm/exynos: add drm_iommu_attach_device_if_possible()

Every CRTC drivers in Exynos DRM implements the code which checks
whether IOMMU is supported or not, and if supported enable it.
Making new helper for it generalize each CRTC drivers.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: Add the dependency for DRM_EXYNOS to DPI/DSI/DP
Hyungwon Hwang [Fri, 12 Jun 2015 12:58:57 +0000 (21:58 +0900)]
drm/exynos: Add the dependency for DRM_EXYNOS to DPI/DSI/DP

Without this dependency, Kbuild is confused and the configs below
them are not placed under Exynos DRM. This patch fixes it, so the
configs below them become to be placed under Exynos DRM.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: remove the dependency of DP driver for ARCH_EXYNOS
Hyungwon Hwang [Fri, 12 Jun 2015 12:58:56 +0000 (21:58 +0900)]
drm/exynos: remove the dependency of DP driver for ARCH_EXYNOS

This dependency is a historical thing. It is added when this DP driver is
under media subsystem. Now because it is under Exynos DRM, this dependency
is not needed anymore.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm: prime: Document gem_prime_mmap
Daniel Thompson [Fri, 19 Jun 2015 13:52:29 +0000 (14:52 +0100)]
drm: prime: Document gem_prime_mmap

gem_prime_map is not currently described in the DRM manual, lets document
it.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/exynos: do not wait for vblank at atomic operation
Inki Dae [Fri, 19 Jun 2015 11:53:03 +0000 (20:53 +0900)]
drm/exynos: do not wait for vblank at atomic operation

This patch resolves the issue that refresh rate got low
at extension mode test with fimd and vidi combination.

The problem was because atomic_commit callback waited
for the completion of vblank to gaurantee crtc relevant
registers are updated from shadow registers to real ones.

However, the waiting there is really unnecessary because
page flip operation does already it.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: Remove unused vma field of exynos_drm_gem_obj
Krzysztof Kozlowski [Fri, 19 Jun 2015 05:23:29 +0000 (14:23 +0900)]
drm/exynos: Remove unused vma field of exynos_drm_gem_obj

The field 'vma' of 'exynos_drm_gem_obj' structure was introduced in
2a3098ff6c21 ("drm/exynos: add userptr feature for g2d module") but is
not referenced anywhere.

One instance of 'exynos_drm_gem_obj' may be mapped to multiple
user-space VMAs so 'vma' field does not look useful anyway.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: fimd: fix page fault issue with iommu
Inki Dae [Fri, 12 Jun 2015 13:19:22 +0000 (22:19 +0900)]
drm/exynos: fimd: fix page fault issue with iommu

This patch resolves page fault issue with iommu and atomic feature
when modetest test application is terminated.

ENWIN_F field of WINCONx register enables or disable a dma channel to
each hardware overlay - the value of the field will be updated to real
register after vsync.

So this patch makes sure the dma channel is disabled by waiting for vsync
one time after clearing shadow registers to all dma channels.

Below shows the page fault issue:
setting mode 720x1280-60Hz@XR24 on connectors 31, crtc 29
freq: 59.99Hz

[   34.831025] PAGE FAULT occurred at 0x20400000 by 11e20000.sysmmu(Page
table base: 0x6e324000)
[   34.838072]  Lv1 entry: 0x6e92dc01
[   34.841489] ------------[ cut here ]------------
[   34.846058] kernel BUG at drivers/iommu/exynos-iommu.c:364!
[   34.851614] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[   34.857428] Modules linked in:
<--snip-->
[   35.210894] [<c02880d0>] (exynos_sysmmu_irq) from [<c00608f8>]
(handle_irq_event_percpu+0x78/0x134)
[   35.219914] [<c00608f8>] (handle_irq_event_percpu) from [<c00609f0>]
(handle_irq_event+0x3c/0x5c)
[   35.228768] [<c00609f0>] (handle_irq_event) from [<c0063698>]
(handle_level_irq+0xc4/0x13c)
[   35.237101] [<c0063698>] (handle_level_irq) from [<c005ff7c>]
(generic_handle_irq+0x2c/0x3c)
[   35.245521] [<c005ff7c>] (generic_handle_irq) from [<c02214ec>]
(combiner_handle_cascade_irq+0x94/0x100)
[   35.254980] [<c02214ec>] (combiner_handle_cascade_irq) from
[<c005ff7c>] (generic_handle_irq+0x2c/0x3c)
[   35.264353] [<c005ff7c>] (generic_handle_irq) from [<c0060248>]
(__handle_domain_irq+0x7c/0xec)
[   35.273034] [<c0060248>] (__handle_domain_irq) from [<c0009434>]
(gic_handle_irq+0x30/0x68)
[   35.281366] [<c0009434>] (gic_handle_irq) from [<c0012ec0>]
(__irq_svc+0x40/0x74)

Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: iommu: improve a check for non-iommu dma_ops
Marek Szyprowski [Wed, 3 Jun 2015 08:26:24 +0000 (10:26 +0200)]
drm/exynos: iommu: improve a check for non-iommu dma_ops

DRM Exynos driver is relying on dma-mapping internal structures when used
with IOMMU enabled. This patch partially hides dma-mapping internal things
by using proper get_dma_ops/set_dma_ops calls.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: iommu: detach from default dma-mapping domain on init
Marek Szyprowski [Wed, 3 Jun 2015 08:26:23 +0000 (10:26 +0200)]
drm/exynos: iommu: detach from default dma-mapping domain on init

This patch adds code, which detach sub-device nodes from default iommu
domain if such has been configured. This lets Exynos DRM driver to properly
attach sub-devices to its own, common for all sub-devices domain.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: fimd: ensure proper hw state in fimd_clear_channel()
Marek Szyprowski [Fri, 12 Jun 2015 09:07:17 +0000 (11:07 +0200)]
drm/exynos: fimd: ensure proper hw state in fimd_clear_channel()

One should not do any assumptions on the stare of the fimd hardware
during driver initialization, so to properly reset fimd before enabling
IOMMU, one should ensure that all power domains and clocks are really
enabled. This patch adds pm_runtime and clocks management in the
fimd_clear_channel() function to ensure that any access to fimd
registers will be performed with clocks and power domains enabled.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: initialize VIDCON0 when fimd is disabled
Joonyoung Shim [Fri, 12 Jun 2015 08:27:16 +0000 (17:27 +0900)]
drm/exynos: initialize VIDCON0 when fimd is disabled

When the fimd is disabled by fimd_disable(), enabled overlay layers also
are disabled. If clocks for fimd are enabled by fimd_enable() on this
case, it can lead IOMMU page fault. The reason is that VIDCON0_ENVID and
VIDCON0_ENVID_F bits of VIDCON0 register are set still even though fimd
is disabled, so it may continue display output of prior when clocks for
fimd are enabled again.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: remove chained calls to enable
Joonyoung Shim [Fri, 12 Jun 2015 11:34:28 +0000 (20:34 +0900)]
drm/exynos: remove chained calls to enable

With atomic modesetting all the control for CRTC, Planes, Encoders and
Connectors should come from DRM core, so the driver is not allowed to
enable or disable planes from inside the crtc_enable()/disable() call.

But it needs to disable planes with crtc_disable in exynos driver
internally. Because crtc is disabled before plane is disabled, it means
plane_disable just returns without any register changes, then we cannot
be sure setting register to disable plane when crtc is disable.

This patch removes this chainned calls to enable plane from exynos hw
drivers code letting only DRM core touch planes except to disable plane.
Also it leads eliminable enabled and resume of struct exynos_drm_plane.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: remove to call mixer_wait_for_vblank
Joonyoung Shim [Fri, 12 Jun 2015 08:27:14 +0000 (17:27 +0900)]
drm/exynos: remove to call mixer_wait_for_vblank

The reason waiting vblank is to be power gated and disabled clocks after
dma operation is completed. The dma operation is stopped already before
be power gated and clocks are disabled when mixer is disabled by commit
381be025ac1a6("drm/exynos: stop mixer before gating clocks during
poweroff"). Don't need to wait vblank anymore.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: ipp: validate a GEM handle with multiple planes
Hyungwon Hwang [Tue, 9 Jun 2015 03:45:15 +0000 (12:45 +0900)]
drm/exynos: ipp: validate a GEM handle with multiple planes

FIMC & GSC driver can calculate the offset of planes. So there are
use cases which IPP receives just one GEM handle of an image with
multiple plane. This patch extends ipp_validate_mem_node() to validate
this case.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: ipp: fix wrong index referencing a config element
Hyungwon Hwang [Tue, 9 Jun 2015 03:45:14 +0000 (12:45 +0900)]
drm/exynos: ipp: fix wrong index referencing a config element

Config depends on the opreation. So it must be referenced by an
operation id, not a property id.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: dsi: check whether dsi is enabled before sending data
Hyungwon Hwang [Thu, 11 Jun 2015 14:40:30 +0000 (23:40 +0900)]
drm/exynos: dsi: check whether dsi is enabled before sending data

exynos_dsi_host_transfer() can be called through a panel driver while
DSI is turning down. It is possible because the function checks only
whether DSI is initialized or not, and there is a moment which DSI is
set by uninitialized, but DSI is still turning down. To prevent it,
DSI must be set by disabled before starting to be turned down, and
exynos_dsi_host_transfer() must check whether DSI is enabled or not.

Kernel dump:
[ 4721.351448] Unhandled fault: synchronous external abort (0x96000210) at 0xffffff800015e018
[ 4721.351809] Internal error: : 96000210 [#1] PREEMPT SMP
[ 4721.352031] Modules linked in:
[ 4721.352173] CPU: 2 PID: 300 Comm: deviced Tainted: G        W       4.0.4-01017-g7964a87 #1
[ 4721.353989] Hardware name: Samsung DRACO board (DT)
[ 4721.358852] task: ffffffc0a0b70000 ti: ffffffc0a00ec000 task.ti: ffffffc0a00ec000
[ 4721.366327] PC is at exynos_dsi_enable_lane+0x14/0x5c
[ 4721.371353] LR is at exynos_dsi_host_transfer+0x834/0x8d8
[ 4721.376731] pc : [<ffffffc000432bcc>] lr : [<ffffffc000434590>] pstate: 60000145
[ 4721.384107] sp : ffffffc0a00efbe0
[ 4721.387405] x29: ffffffc0a00efbe0 x28: ffffffc0a00ec000
[ 4721.392699] x27: ffffffc000968000 x26: 0000000000000040
[ 4721.397994] x25: ffffffc000f74dc0 x24: ffffffc0a00efec8
[ 4721.403290] x23: ffffffc0a4815400 x22: ffffffc0009f2729
[ 4721.408584] x21: ffffffc0a00efcc8 x20: ffffffc0a4a2a848
[ 4721.413879] x19: ffffffc0a4a2a818 x18: 0000000000000004
[ 4721.419173] x17: 0000007faa5cddf0 x16: ffffffc0001a40a8
[ 4721.424469] x15: 0000000000000009 x14: 000000000000000d
[ 4721.429762] x13: 6e6e6f63206b726f x12: 0000000000000010
[ 4721.435058] x11: 0101010101010101 x10: 0000000000000000
[ 4721.440353] x9 : 000000000000000a x8 : 8386838282818381
[ 4721.445648] x7 : ffffffc0a201efe8 x6 : 0000000000000000
[ 4721.450943] x5 : 00000000fffffffa x4 : ffffffc0a201f170
[ 4721.456237] x3 : ffffff800015e000 x2 : ffffff800015e018
[ 4721.461531] x1 : 000000000000000f x0 : ffffffc0a4a2a818
[ 4721.466826]
[ 4721.468305] Process deviced (pid: 300, stack limit = 0xffffffc0a00ec028)
[ 4721.474989] Stack: (0xffffffc0a00efbe0 to 0xffffffc0a00f0000)
[ 4721.480720] fbe0: a00efca0 ffffffc0 0042c944 ffffffc0 a0f2d680 ffffffc0 00000024 00000000
[ 4721.488895] fc00: a4b6d000 ffffffc0 009f2729 ffffffc0 a4815400 ffffffc0 a00efec8 ffffffc0

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: remove SoC checking code
Andrzej Hajda [Mon, 8 Jun 2015 10:15:42 +0000 (12:15 +0200)]
drm/exynos: remove SoC checking code

SoC checking code is not necessary anymore, as exynos_drm_match_add and
exynos_drm_platform_probe already properly handles situation when there are
no Exynos DRM components.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Tested-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: fix broken component binding in case of multiple pipelines
Andrzej Hajda [Thu, 11 Jun 2015 14:23:37 +0000 (23:23 +0900)]
drm/exynos: fix broken component binding in case of multiple pipelines

In case there are multiple pipelines and deferred probe occurs, only components
of the first pipeline were bound. As a result only one pipeline was available.
The main cause of this issue was dynamic generation of component match table -
every component driver during probe registered itself on helper list, if there
was at least one pipeline present on this list component match table were
created without deferred components.
This patch removes this helper list, instead it creates match table from
existing devices requiring exynos_drm KMS drivers. This way match table do not
depend on probe/deferral order and contains all KMS components.
As a side effect patch makes the code cleaner and significantly smaller.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: consolidate driver/device initialization code
Andrzej Hajda [Thu, 11 Jun 2015 14:20:52 +0000 (23:20 +0900)]
drm/exynos: consolidate driver/device initialization code

Code registering different drivers and simple platform devices was dispersed
across multiple sub-modules. This patch moves it to one place. As a result
initialization code is shorter and cleaner and should simplify further
development.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: add error messages if clks failed to get enabled
Gustavo Padovan [Wed, 3 Jun 2015 20:17:16 +0000 (17:17 -0300)]
drm/exynos: add error messages if clks failed to get enabled

Check error and call DRM_ERROR if clk_prepare_enable() fails.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: add a dependency on FB_S3C to DECON driver
Inki Dae [Wed, 3 Jun 2015 02:31:23 +0000 (11:31 +0900)]
drm/exynos: add a dependency on FB_S3C to DECON driver

This patch makes one of Linux framebuffer and DRM CRTC drivers
to be enabled.

Display controllers, FIMD and DECON, can be controlled by Linux
framebuffer or DRM CRTC drivers so only one of them should be
enabled.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
9 years agodrm/exynos: vidi: remove unused varables
Inki Dae [Wed, 3 Jun 2015 02:25:00 +0000 (11:25 +0900)]
drm/exynos: vidi: remove unused varables

This patch removes unnsed varables in vidi_disable function.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
9 years agodrm/exynos: split exynos_crtc->dpms in enable() and disable()
Gustavo Padovan [Mon, 1 Jun 2015 15:04:55 +0000 (12:04 -0300)]
drm/exynos: split exynos_crtc->dpms in enable() and disable()

To follow more closely the new atomic API we split the dpms()
helper into the enable() and disable() helper to get exactly the
same semantics.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: remove unnecessary calls to disable_plane()
Gustavo Padovan [Mon, 1 Jun 2015 15:04:54 +0000 (12:04 -0300)]
drm/exynos: remove unnecessary calls to disable_plane()

The planes are already disabled by the drm_atomic_helper_commit() code
so we don't need to disable the in these two places.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic dpms support
Gustavo Padovan [Mon, 1 Jun 2015 15:04:53 +0000 (12:04 -0300)]
drm/exynos: atomic dpms support

Run dpms operations through the atomic intefaces. This basically removes
the .dpms() callback from econders and crtcs and use .disable() and
.enable() to turn the crtc on and off.

v2: Address comments by Joonyoung:
- make hdmi code call ->disable() instead of ->dpms()
- do not use WARN_ON on crtc enable/disable

v3: - Fix build failure after the hdmi change in v2
    - Change dpms helper of ptn3460 bridge

v4: - remove win_commit() call from .enable()

v5: - move .atomic_check() to the atomic PageFlip patch, and transform it
in .atomic_begin()

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: add exynos specific .atomic_commit()
Gustavo Padovan [Mon, 1 Jun 2015 15:04:52 +0000 (12:04 -0300)]
drm/exynos: add exynos specific .atomic_commit()

exynos needs to update planes with the crtc enabled (mainly for the FIMD
case) so this specific atomic commit changes the order of
drm_atomic_helper_commit_modeset_enables() and
drm_atomic_helper_commit_planes() to commit planes after we enable crtc
and encoders.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: move exynos_drm_crtc_disable()
Gustavo Padovan [Mon, 1 Jun 2015 15:04:51 +0000 (12:04 -0300)]
drm/exynos: move exynos_drm_crtc_disable()

This is a preparation commit to move exynos_drm_crtc_disable() together
with the future exynos_drm_crtc_enable() that will come from the split of
exynos_drm_crtc_dpms() callback.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: don't disable unused functions at init
Gustavo Padovan [Mon, 1 Jun 2015 15:04:50 +0000 (12:04 -0300)]
drm/exynos: don't disable unused functions at init

Everything starts disabled so we don't really need to disable anything.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: remove exported functions from exynos_drm_plane
Gustavo Padovan [Mon, 1 Jun 2015 15:04:49 +0000 (12:04 -0300)]
drm/exynos: remove exported functions from exynos_drm_plane

Now that no one is using the functions exported by exynos_drm_plane due
to the atomic conversion we can make remove some of the them or make them
static.

v2: remove unused exynos_drm_crtc

v3: fix checkpatch error (reported by Joonyoung)

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 3: convert page flips
Gustavo Padovan [Mon, 1 Jun 2015 15:04:48 +0000 (12:04 -0300)]
drm/exynos: atomic phase 3: convert page flips

PageFlips now use the atomic helper to work through the atomic modesetting
API. Async page flips are not supported yet.

v2: Add .atomic_begin() step to handle the vblank part we removed from
exynos page_flip code.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 3: use atomic .set_config helper
Gustavo Padovan [Mon, 1 Jun 2015 15:04:47 +0000 (12:04 -0300)]
drm/exynos: atomic phase 3: use atomic .set_config helper

Now that phase 1 and 2 are complete switch .set_config helper to
use the atomic one.

v2: also remove .prepare() callback

v3: remove .mode_set() and .mode_set_base() and encoder's
.prepare() callbacks

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 3: atomic updates of planes
Gustavo Padovan [Mon, 1 Jun 2015 15:04:46 +0000 (12:04 -0300)]
drm/exynos: atomic phase 3: atomic updates of planes

Now that phase 1 and 2 are complete we can switch the update/disable_plane
callbacks to their atomic version.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 2: keep track of framebuffer pointer
Gustavo Padovan [Mon, 1 Jun 2015 15:04:45 +0000 (12:04 -0300)]
drm/exynos: atomic phase 2: keep track of framebuffer pointer

Use drm_atomic_set_fb_for_plane() in the legacy page_flip path to keep
track of the framebuffer pointer and reference.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy()
Gustavo Padovan [Mon, 1 Jun 2015 15:04:44 +0000 (12:04 -0300)]
drm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy()

Set CRTC, planes and connectors to use the default implementations from
the atomic helper library. The helpers will work to keep track of state
for each DRM object.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: use adjusted_mode of crtc_state instead of mode
Joonyoung Shim [Tue, 2 Jun 2015 12:04:42 +0000 (21:04 +0900)]
drm/exynos: use adjusted_mode of crtc_state instead of mode

Handle changes by removing copy from adjusted_mode to mode as using
adjusted_mode of crtc_state.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 1: add .mode_set_nofb() callback
Gustavo Padovan [Mon, 1 Jun 2015 15:04:43 +0000 (12:04 -0300)]
drm/exynos: atomic phase 1: add .mode_set_nofb() callback

The new atomic infrastructure needs the .mode_set_nofb() callback to
update CRTC timings before setting any plane.

v2: remove WARN_ON(!crtc->state) from mode_set_nofb

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 1: use drm_plane_helper_disable()
Gustavo Padovan [Mon, 1 Jun 2015 15:04:42 +0000 (12:04 -0300)]
drm/exynos: atomic phase 1: use drm_plane_helper_disable()

The atomic helper to disable planes also uses the optional
.atomic_disable() helper. The unique operation it does is calling
.win_disable()

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: atomic phase 1: use drm_plane_helper_update()
Gustavo Padovan [Mon, 1 Jun 2015 15:04:41 +0000 (12:04 -0300)]
drm/exynos: atomic phase 1: use drm_plane_helper_update()

Rip out the check from exynos_update_plane() and create
exynos_check_plane() for the check phase enabling use to use
the atomic helpers to call our check and update phases when updating
planes.

Update all users of exynos_update_plane() accordingly to call
exynos_check_plane() before.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>y
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: fix source data argument for plane
Joonyoung Shim [Mon, 1 Jun 2015 15:04:39 +0000 (12:04 -0300)]
drm/exynos: fix source data argument for plane

The exynos_update_plane function needs 16.16 fixed point source data.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm: Avoid the double clflush on the last cache line in drm_clflush_virt_range()
Chris Wilson [Wed, 10 Jun 2015 14:58:01 +0000 (15:58 +0100)]
drm: Avoid the double clflush on the last cache line in drm_clflush_virt_range()

As the clflush operates on cache lines, and we can flush any byte
address, in order to flush all bytes given in the range we issue an
extra clflush on the last byte to ensure the last cacheline is flushed.
We can can the iteration to be over the actual cache lines to avoid this
double clflush on the last byte.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm/atomic: Extract needs_modeset function
Daniel Vetter [Thu, 18 Jun 2015 07:58:55 +0000 (09:58 +0200)]
drm/atomic: Extract needs_modeset function

We use the same check already in the atomic core, so might as well
make this official. And it's also reused in e.g. i915.

Motivated by Maarten's idea to extract a connector_changed state out
of mode_changed.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-By: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
9 years agoMerge tag 'drm-intel-next-fixes-2015-06-18' of git://anongit.freedesktop.org/drm...
Dave Airlie [Fri, 19 Jun 2015 02:01:39 +0000 (12:01 +1000)]
Merge tag 'drm-intel-next-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel into drm-next

i915 fixes for stuff in next

* tag 'drm-intel-next-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Don't set enabled value of all CRTCs when restoring the mode
  drm/i915: Don't update staged config during force restore modesets
  drm/i915: Don't check modeset state in the hw state force restore path
  drm/i915: Add SCRATCH1 and ROW_CHICKEN3 to the register whitelist.
  drm/i915: Extend the parser to check register writes against a mask/value pair.
  drm/i915: Fix command parser to validate multiple register access with the same command.
  drm/i915: Don't skip request retirement if the active list is empty

9 years agoMerge branch 'virtio-gpu-drm-next' of git://git.kraxel.org/linux into drm-next
Dave Airlie [Thu, 18 Jun 2015 03:01:04 +0000 (13:01 +1000)]
Merge branch 'virtio-gpu-drm-next' of git://git.kraxel.org/linux into drm-next

fixes and virtio-vga support.

* 'virtio-gpu-drm-next' of git://git.kraxel.org/linux:
  virtio-gpu: add locking for vbuf pool
  drm/virtgpu: initialise fbdev after getting initial display info
  Add virtio-vga bits.

9 years agoMerge tag 'drm/panel/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux into...
Dave Airlie [Thu, 18 Jun 2015 02:55:03 +0000 (12:55 +1000)]
Merge tag 'drm/panel/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/panel: Changes for v4.2-rc1

This contains fixes for the long-standing build issues that some of the
bridge drivers were exposing. Other than that it's mostly cleanup and a
couple of new simple panels that are supported.

* tag 'drm/panel/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux:
  drm/panel: simple: Add bus format for HannStar HSD100PXN1
  drm/panel: simple: Add display timing for HannStar HSD100PXN1
  drm/panel: ld9040: Remove useless padding
  drm/panel: Constify OF match tables
  drm/bridge: Remove stale ptn3460.h include
  drm/bridge: ps8622: Include linux/gpio/consumer.h
  drm/bridge: ptn3460: Include linux/gpio/consumer.h
  drm/bridge: dw-hdmi: Return number of EDID modes
  drm/panel: simple: Add support for LG LB070WV8 800x480 7" panel
  drm/bridge: ptn3460: Pass flags to devm_gpiod_get()
  drm/bridge: ps8622: Pass flags to devm_gpiod_get()
  drm/bridge: ptn3460: Fix I2C ID table to match the reported modalias
  drm/bridge: dw-hdmi: Staticize dw_hdmi_bridge_funcs

9 years agoMerge tag 'drm/tegra/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux into...
Dave Airlie [Thu, 18 Jun 2015 02:53:54 +0000 (12:53 +1000)]
Merge tag 'drm/tegra/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v4.2-rc1

This contains a couple of mostly fixes for issues that have crept up in
recent versions of linux-next. One issue is that DP AUX transactions of
more than 4 bytes will access the wrong FIFO registers and hence become
corrupt. Another fix is required to restore functionality of Tegra20 if
using the GART. The current code expects the IOMMU aperture to be the
complete 4 GiB address space, whereas the GART on Tegra20 only provides
a 128 MiB aperture. One more issue with IOMMU support is that on 64-bit
ARM, swiotlb is the default IOMMU implementation backing the DMA API. A
side-effect of that is that when dma_map_sg() is called to flush caches
(yes, this is a bit of a hack, but ARM does not provide a better API),
swiotlb will immediately run out of memory because its bounce buffer is
too small to make a framebuffer.

Finally I've included a mostly cosmetic fix that stores register values
in u32 rather than unsigned long to avoid sign-extension issues on 64-
bit ARM. This is only a precaution since it hasn't caused any issues
(yet).

* tag 'drm/tegra/for-4.2-rc1' of git://anongit.freedesktop.org/tegra/linux:
  drm/tegra: dpaux: Registers are 32-bit
  drm/tegra: gem: Flush pages after allocation
  drm/tegra: gem: Take into account IOMMU aperture
  drm/tegra: dpaux: Fix transfers larger than 4 bytes

9 years agoMerge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next
Dave Airlie [Thu, 18 Jun 2015 02:52:49 +0000 (12:52 +1000)]
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next

rcar-du fixes

* 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev:
  drm: rcar-du: Use the drm atomic state duplication helpers for planes
  drm: rcar-du: Clean up planes in the error paths of .atomic_commit()
  drm: rcar-du: Convert rcar_du_encoders_init_one() return value to 0/<0
  drm: rcar-du: Clarify error message when encoder initialization fails
  drm: rcar-du: Fix crash with groups that have less than 9 planes
  drm: rcar-du: Disable all planes when stopping the CRTC
  drm: rcar-du: Print the error value when DRM/KMS init fails

9 years agoMerge tag 'drm-amdkfd-next-fixes-2015-06-16' of git://people.freedesktop.org/~gabbayo...
Dave Airlie [Thu, 18 Jun 2015 02:51:20 +0000 (12:51 +1000)]
Merge tag 'drm-amdkfd-next-fixes-2015-06-16' of git://people.freedesktop.org/~gabbayo/linux into drm-next

- Dan fixed some range checks in the address watch ioctl impl.
- Remove obsolete member from radeon_device structure

* tag 'drm-amdkfd-next-fixes-2015-06-16' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: fix some range checks in address watch ioctl
  drm/radeon: remove obsolete kfd_bo from radeon_device

9 years agodrm/i915: Don't set enabled value of all CRTCs when restoring the mode
Ander Conselvan de Oliveira [Tue, 16 Jun 2015 08:49:45 +0000 (11:49 +0300)]
drm/i915: Don't set enabled value of all CRTCs when restoring the mode

The code in intel_crtc_restore_mode() sets the enabled value of all the
CRTCs when restoring the mode after a suspend/resume cycle. When more
than one CRTC is enabled, that causes drm_atomic_helper_check_modeset()
to fail if there is more than one pipe enabled, since all but one CRTC
has valid connector data. Instead, set only the enabled value for the
CRTC passed as an argument.

v2: Don't leak atomic state. (Matt)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90468
References: https://bugs.freedesktop.org/show_bug.cgi?id=90396
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
9 years agodrm/i915: Don't update staged config during force restore modesets
Ander Conselvan de Oliveira [Tue, 16 Jun 2015 08:49:44 +0000 (11:49 +0300)]
drm/i915: Don't update staged config during force restore modesets

The force restore path relies on the staged config to preserve the
configuration used before a suspend/resume cycle. The update done to it
in intel_modeset_fixup_state() would cause that information to be lost
after the first modeset, making it impossible to restore the modes for
pipes B and C.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90468
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/i915: Don't check modeset state in the hw state force restore path
Ander Conselvan de Oliveira [Tue, 16 Jun 2015 08:49:43 +0000 (11:49 +0300)]
drm/i915: Don't check modeset state in the hw state force restore path

Since the force restore logic will restore the CRTCs state one at a
time, it is possible that the state will be inconsistent until the whole
operation finishes. A call to intel_modeset_check_state() is done once
it's over, so don't check the state multiple times in between. This
regression was introduced in:

commit 7f27126ea3db6ade886f18fd39caf0ff0cd1d37f
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Nov 5 14:26:06 2014 -0800

    drm/i915: factor out compute_config from __intel_set_mode v3

v2: Rename check parameter to force_restore. (Matt)

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94431
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/amdkfd: fix some range checks in address watch ioctl
Dan Carpenter [Tue, 16 Jun 2015 10:49:32 +0000 (13:49 +0300)]
drm/amdkfd: fix some range checks in address watch ioctl

buf_size_in_bytes must be large enough to hold ->num_watch_points and
watch_mode so I have added a sizeof(int) * 2 to the minimum size.

Also we have to subtract sizeof(*args) from the max args_idx limit so
that it matches the allocation.  Also I changed a > to >= for the last
compare.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
9 years agodrm: rcar-du: Use the drm atomic state duplication helpers for planes
Laurent Pinchart [Wed, 27 May 2015 13:36:29 +0000 (16:36 +0300)]
drm: rcar-du: Use the drm atomic state duplication helpers for planes

Ensure that the duplicate and destroy plane state operations will always
be in sync with the DRM core implementation of the plane state by using
the __drm_atomic_helper_plane_duplicate_state() and
__drm_atomic_helper_plane_destroy_state() functions designed especially
for this purpose.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: rcar-du: Clean up planes in the error paths of .atomic_commit()
Laurent Pinchart [Tue, 26 May 2015 23:14:37 +0000 (02:14 +0300)]
drm: rcar-du: Clean up planes in the error paths of .atomic_commit()

When the .atomic_commit() handler fails, clean up planes previoulsy
prepared by drm_atomic_helper_prepare_planes() with a call to
drm_atomic_helper_cleanup_planes().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: rcar-du: Convert rcar_du_encoders_init_one() return value to 0/<0
Laurent Pinchart [Tue, 26 May 2015 12:07:56 +0000 (15:07 +0300)]
drm: rcar-du: Convert rcar_du_encoders_init_one() return value to 0/<0

The function returns 1 on success, and either 0 or a negative error code
on failure. As the 0 and negative values don't need to be differentiated
by the caller, convert it to the usual scheme of returning 0 on success
and a negative error code on failure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Clarify error message when encoder initialization fails
Laurent Pinchart [Tue, 26 May 2015 11:59:42 +0000 (14:59 +0300)]
drm: rcar-du: Clarify error message when encoder initialization fails

A failure to initialize an encoder currently prints an error message in
the kernel log without mentioning which encoder failed to initialize. To
help debugging initialization issues print the encoder DT node name.

This requires moving the error message to the rcar_du_encoders_init_one
function and refactoring it slightly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Fix crash with groups that have less than 9 planes
Laurent Pinchart [Mon, 25 May 2015 13:32:45 +0000 (16:32 +0300)]
drm: rcar-du: Fix crash with groups that have less than 9 planes

Commit 917de180379d ("drm: rcar-du: Implement universal plane support")
made the number of planes per group dynamic, but didn't update all loops
over the planes array, resulting in out-of-bound accesses on DU
instances that have an odd number of CRTCs (such as the R8A7790). Fix
it.

Fixes: 917de180379d ("drm: rcar-du: Implement universal plane support")
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Disable all planes when stopping the CRTC
Laurent Pinchart [Thu, 14 May 2015 12:01:47 +0000 (15:01 +0300)]
drm: rcar-du: Disable all planes when stopping the CRTC

The DSnPR plane configuration registers are updated on vblank, and no
vblank will occur once the CRTC is stopped. We thus can't only disable
planes right before starting the CRTC as it would start scanning out
immediately from old frame buffers until the next vblank.

Fix the problem by disabling all planes when stopping the CRTC and wait
for the change to take effect. This increases the CRTC stop delay,
especially when multiple CRTCs are stopped in one operation as we now
wait for one vblank per CRTC. Whether this can be improved needs to be
researched.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agodrm: rcar-du: Print the error value when DRM/KMS init fails
Laurent Pinchart [Wed, 13 May 2015 22:08:34 +0000 (01:08 +0300)]
drm: rcar-du: Print the error value when DRM/KMS init fails

This helps debugging probe failures.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
9 years agovirtio-gpu: add locking for vbuf pool
Dave Airlie [Tue, 16 Jun 2015 05:42:13 +0000 (15:42 +1000)]
virtio-gpu: add locking for vbuf pool

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agodrm/virtgpu: initialise fbdev after getting initial display info
Dave Airlie [Tue, 16 Jun 2015 04:25:34 +0000 (14:25 +1000)]
drm/virtgpu: initialise fbdev after getting initial display info

This should avoid issues with the fbdev path trying to render
before we've gotten the display info.

Signed-off-by: Dave Airlie <airlied@redhat.com>
[ kraxel: wait for display-info reply ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoAdd virtio-vga bits.
Gerd Hoffmann [Thu, 26 Mar 2015 15:29:29 +0000 (16:29 +0100)]
Add virtio-vga bits.

9 years agodrm/radeon: remove obsolete kfd_bo from radeon_device
Oded Gabbay [Fri, 12 Jun 2015 08:12:49 +0000 (11:12 +0300)]
drm/radeon: remove obsolete kfd_bo from radeon_device

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
9 years agoMerge tag 'omapdrm-4.2-atomic' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba...
Dave Airlie [Tue, 16 Jun 2015 01:16:02 +0000 (11:16 +1000)]
Merge tag 'omapdrm-4.2-atomic' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm atomic modesetting support

Atomic modesetting support for omapdrm.

" we've had issues with omapdrm for years,
which we've not been able to fix properly (like warnings/crashes when unloading
modules, page-flips tearing, race issues with fbs). All those problems seem to
be gone after this rewrite of omapdrm for atomic modesetting, and the resulting
code is much cleaner and more maintainable."

* tag 'omapdrm-4.2-atomic' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (43 commits)
  drm: omapdrm: new vblank and event handling
  drm: omapdrm: merge omap_crtc_flush and omap_crtc_atomic_flush
  drm: omapdrm: add lock for fb pinning
  drm: omapdrm: if omap_plane_atomic_update fails, disable plane
  drm: omapdrm: inline omap_plane_setup into update/disable
  drm: omapdrm: omap_plane_setup() cannot fail, use WARN
  drm: omapdrm: Don't setup planes manually from CRTC .enable()/.disable()
  drm: omapdrm: Don't flush CRTC when enabling or disabling it
  drm: omapdrm: Move encoder setup to encoder operations
  drm: omapdrm: Simplify DSS power management
  drm: omapdrm: Remove nested PM get/sync when configuring encoders
  drm: omapdrm: Support unlinking page flip events prematurely
  drm: omapdrm: omap_crtc_flush() isn't called with modeset locked
  drm: omapdrm: Don't get/put dispc in omap_crtc_flush()
  drm: omapdrm: Make the omap_crtc_flush function static
  drm: omapdrm: Remove omap_plane enabled field
  drm: omapdrm: Remove omap_crtc enabled field
  drm: omapdrm: Move crtc info out of the crtc structure
  drm: omapdrm: Move plane info and win out of the plane structure
  drm: omapdrm: Switch crtc and plane set_property to atomic helpers
  ...

9 years agodrm/i915: Add SCRATCH1 and ROW_CHICKEN3 to the register whitelist.
Francisco Jerez [Fri, 29 May 2015 13:44:15 +0000 (16:44 +0300)]
drm/i915: Add SCRATCH1 and ROW_CHICKEN3 to the register whitelist.

Only bit 27 of SCRATCH1 and bit 6 of ROW_CHICKEN3 are allowed to be
set because of security-sensitive bits we don't want userspace to mess
with.  On HSW hardware the whitelisted bits control whether atomic
read-modify-write operations are performed on L3 or on GTI, and when
set to L3 (which can be 10x-30x better performing than on GTI,
depending on the application) require great care to avoid a system
hang, so we currently program them to be handled on GTI by default.

Beignet can immediately start taking advantage of this change to
enable L3 atomics.  Mesa should eventually switch to L3 atomics too,
but a number of non-trivial changes are still required so it will
continue using GTI atomics for now.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/i915: Extend the parser to check register writes against a mask/value pair.
Francisco Jerez [Fri, 29 May 2015 13:44:14 +0000 (16:44 +0300)]
drm/i915: Extend the parser to check register writes against a mask/value pair.

In some cases it might be unnecessary or dangerous to give userspace
the right to write arbitrary values to some register, even though it
might be desirable to give it control of some of its bits.  This patch
extends the register whitelist entries to contain a mask/value pair in
addition to the register offset.  For registers with non-zero mask,
any LRM writes and LRI writes where the bits of the immediate given by
the mask don't match the specified value will be rejected.

This will be used in my next patch to grant userspace partial write
access to some sensitive registers.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/i915: Fix command parser to validate multiple register access with the same command.
Francisco Jerez [Fri, 29 May 2015 13:44:13 +0000 (16:44 +0300)]
drm/i915: Fix command parser to validate multiple register access with the same command.

Until now the software command checker assumed that commands could
read or write at most a single register per packet.  This is not
necessarily the case, MI_LOAD_REGISTER_IMM expects a variable-length
list of offset/value pairs and writes them in sequence.  The previous
code would only check whether the first entry was valid, effectively
allowing userspace to write unrestricted registers of the MMIO space
by sending a multi-register write with a legal first register, with
potential security implications on Gen6 and 7 hardware.

Fix it by extending the drm_i915_cmd_descriptor table to represent
multi-register access and making validate_cmd() iterate for all
register offsets present in the command packet.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/i915: Don't skip request retirement if the active list is empty
Ville Syrjälä [Thu, 28 May 2015 15:32:36 +0000 (18:32 +0300)]
drm/i915: Don't skip request retirement if the active list is empty

Apparently we can have requests even if though the active list is empty,
so do the request retirement regardless of whether there's anything
on the active list.

The way it happened here is that during suspend intel_ring_idle()
notices the olr hanging around and then proceeds to get rid of it by
adding a request. However since there was nothing on the active lists
i915_gem_retire_requests() didn't clean those up, and so the idle work
never runs, and we leave the GPU "busy" during suspend resulting in a
WARN later.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/cma: Fix 64-bit size_t build warnings
Magnus Damm [Mon, 4 May 2015 14:16:19 +0000 (16:16 +0200)]
drm/cma: Fix 64-bit size_t build warnings

Fix warnings related to size_t when building for 64-bit architectures:

drivers/gpu/drm/drm_gem_cma_helper.c: In function ‘drm_gem_cma_create’:
drivers/gpu/drm/drm_gem_cma_helper.c:114:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat=]
    size);
    ^
drivers/gpu/drm/drm_gem_cma_helper.c: In function ‘drm_gem_cma_describe’:
drivers/gpu/drm/drm_gem_cma_helper.c:393:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘size_t’ [-Wformat=]
    off, &cma_obj->paddr, cma_obj->vaddr, obj->size);

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agoDocumentation/drm: Update rotation property
Sonika Jindal [Thu, 28 May 2015 11:05:07 +0000 (16:35 +0530)]
Documentation/drm: Update rotation property

Moving rotation property to "Drm" and removing from i915 and omap.
Also, adding description to the property

Cc: DRI Development <dri-devel@lists.freedesktop.org>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
9 years agodrm: omapdrm: new vblank and event handling
Tomi Valkeinen [Fri, 29 May 2015 13:01:18 +0000 (16:01 +0300)]
drm: omapdrm: new vblank and event handling

Rework the crtc event/flip_wait system as follows:

- If we enable a crtc (full modeset), we set omap_crtc->pending and
  register vblank irq.

- If we need to set GO bit (page flip), we do the same but also set the
  GO bit.

- On vblank we unregister the irq, clear the 'pending' flag, send vblank
  event to userspace if crtc->state->event != NULL, and wake up
  'pending_wait' wq.

- In omap_atomic_complete() we wait for the 'pending' flag to get reset
  for all enabled crtcs  using 'pending_wait' wq.

The above ensures that we send the events to userspace in vblank, and
that after the wait in omap_atomic_complete() everything for the
affected crtcs has been completed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: omapdrm: merge omap_crtc_flush and omap_crtc_atomic_flush
Tomi Valkeinen [Mon, 8 Jun 2015 10:08:25 +0000 (13:08 +0300)]
drm: omapdrm: merge omap_crtc_flush and omap_crtc_atomic_flush

omap_crtc_atomic_flush() is the only user of omap_crtc_flush(), so just
move the code from omap_crtc_flush() to omap_crtc_atomic_flush().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: omapdrm: add lock for fb pinning
Tomi Valkeinen [Thu, 4 Jun 2015 07:56:33 +0000 (10:56 +0300)]
drm: omapdrm: add lock for fb pinning

Before atomic modesetting omap_framebuffer_pin() and
omap_framebuffer_unpin() were always called with modesetting locks
taken. With atomic modesetting support this is no longer the case, and
we need locking to protect the pin_count and the paddr, as multiple
threads may pin the same fb concurrently.

This patch adds a mutex to struct omap_framebuffer, and uses it in
omap_framebuffer_pin() and omap_framebuffer_unpin().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: omapdrm: if omap_plane_atomic_update fails, disable plane
Tomi Valkeinen [Fri, 29 May 2015 08:06:07 +0000 (11:06 +0300)]
drm: omapdrm: if omap_plane_atomic_update fails, disable plane

omap_plane_atomic_update() calls dispc_ovl_setup(), which can fail (but
shouldn't). To make the code a bit more robust, make sure the plane gets
disabled if dispc_ovl_setup() fails, as otherwise we might get illegal
HW configuration leading to error interrupts.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: omapdrm: inline omap_plane_setup into update/disable
Tomi Valkeinen [Fri, 29 May 2015 08:05:37 +0000 (11:05 +0300)]
drm: omapdrm: inline omap_plane_setup into update/disable

At the moment we have omap_plane_setup() function which handles both
enabling (and configuring) and disabling the plane. With atomic
modesetting we have separate hooks for plane enable/config and disable.

This patch moves the code from omap_plane_setup() to
omap_plane_atomic_update() and omap_plane_atomic_disable().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: omapdrm: omap_plane_setup() cannot fail, use WARN
Tomi Valkeinen [Fri, 29 May 2015 08:03:15 +0000 (11:03 +0300)]
drm: omapdrm: omap_plane_setup() cannot fail, use WARN

With atomic modesetting, omap_plane_setup()'s return value is ignored as
the functions using it cannot fail. dispc_ovl_setup(), called by
omap_plane_setup(), can fail (but shouldn't).

Instead of returning an error from omap_plane_setup() which gets
ignored, return void and use WARN if dispc_ovl_setup() fails.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 years agodrm: omapdrm: Don't setup planes manually from CRTC .enable()/.disable()
Laurent Pinchart [Wed, 27 May 2015 17:53:57 +0000 (20:53 +0300)]
drm: omapdrm: Don't setup planes manually from CRTC .enable()/.disable()

Planes setup is handled by the DRM core through the atomic helpers,
there's no need to duplicate the code in the CRTC .enable() and
.disable() operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Don't flush CRTC when enabling or disabling it
Laurent Pinchart [Wed, 27 May 2015 23:39:35 +0000 (02:39 +0300)]
drm: omapdrm: Don't flush CRTC when enabling or disabling it

The omap_crtc_flush() call in omap_crtc_enable() and omap_crtc_disable()
is a no-op, as the display manager is always disabled at this point. Just
remove the function call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Move encoder setup to encoder operations
Laurent Pinchart [Wed, 27 May 2015 23:34:05 +0000 (02:34 +0300)]
drm: omapdrm: Move encoder setup to encoder operations

Now that the driver is fully converted to atomic operations, and that
the atomic helpers call the operations in the right order, we can move
encoder setup to where it belongs, in the encoder operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Simplify DSS power management
Laurent Pinchart [Wed, 27 May 2015 23:09:56 +0000 (02:09 +0300)]
drm: omapdrm: Simplify DSS power management

Instead of sprinkling dispc_runtime_get() and dispc_runtime_put() calls
in various CRTC operations, move all power management code to the atomic
commit function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Remove nested PM get/sync when configuring encoders
Laurent Pinchart [Wed, 27 May 2015 22:58:02 +0000 (01:58 +0300)]
drm: omapdrm: Remove nested PM get/sync when configuring encoders

The omap_crtc_encoder_setup() function is always called with the DSS
enabled. Remove the dispc_runtime_get() and dispc_runtime_put() calls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Support unlinking page flip events prematurely
Laurent Pinchart [Thu, 16 Apr 2015 19:35:20 +0000 (22:35 +0300)]
drm: omapdrm: Support unlinking page flip events prematurely

DRM page flip vblank events requested by page flips or atomic commits
are created by the DRM core and then passed to driver through CRTC
states (for atomic commit) or directly to the page flip handler (for
legacy page flips). The events are then kept aside until the page flip
completes, at which point drivers queue them for delivery with a call to
drm_send_vblank_event().

When a DRM file handle is closed events pending for delivery are cleaned
up automatically by the DRM core. Events that have been passed to the
driver but haven't completed yet, however, are not handled by the DRM
core. Drivers are responsible for destroying them and must not attempt
to queue them for delivery. This is usually handled by drivers'
preclose() handlers that cancel and destroy page flip events that
reference the file handle being closed.

With asynchronous atomic updates the story becomes more complex. Several
asynchronous atomic updates can be pending, each of them carrying
per-CRTC events. As the atomic_commit() operation doesn't receive a file
handle context, drivers can't know which file handle a pending update
refers to, making it difficult to cancel or wait for completion of
updates related to the file handle being closed.

It should be noted that cancelling page flips or waiting for atomic
updates completion isn't required by the DRM core when closing a file
handle. The only requirement is that no event gets queued for delivery
after the preclose() operation returns. This can easily be achieved by
storing events for atomic commits in a list, unlinking events from the
file handle being closed by setting the file_priv field to NULL, and
skipping delivery of unlinked events.

This logic replaces the page flip cancellation completely.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: omap_crtc_flush() isn't called with modeset locked
Laurent Pinchart [Wed, 15 Apr 2015 19:47:45 +0000 (22:47 +0300)]
drm: omapdrm: omap_crtc_flush() isn't called with modeset locked

When performing asynchronous atomic updates the modeset lock isn't taken
around the callers of omap_crtc_flush(). This isn't an issue though, as
access to the CRTC is properly serialized. Just drop the warning.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Don't get/put dispc in omap_crtc_flush()
Laurent Pinchart [Wed, 15 Apr 2015 18:51:45 +0000 (21:51 +0300)]
drm: omapdrm: Don't get/put dispc in omap_crtc_flush()

The omap_crtc_flush() function is always called with a reference to the
dispc held. Remove unnecessary calls to dispc_runtime_get() and
dispc_runtime_put().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Make the omap_crtc_flush function static
Laurent Pinchart [Wed, 15 Apr 2015 18:47:34 +0000 (21:47 +0300)]
drm: omapdrm: Make the omap_crtc_flush function static

The function isn't used outside of its compilation unit, make it static.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agodrm: omapdrm: Remove omap_plane enabled field
Laurent Pinchart [Fri, 6 Mar 2015 17:18:56 +0000 (19:18 +0200)]
drm: omapdrm: Remove omap_plane enabled field

The field tracks the plane state to avoid double-enable or -disable.
This isn't required anymore, as

- the DRM atomic core guarantees that the plane atomic_update and
  atomic_disable functions will never be called on an enabled/disabled
  plane

- the CRTC enable/disable operations that enable/disable the plane are
  already guarded against double enable/disable

We can thus remove the enabled field completely. The
omap_plane_set_enable() function then becomes a wrapper around
omap_plane_setup() which can be called directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>