Commit Graph

25387 Commits

Author SHA1 Message Date
Dave Airlie
912b330c20 Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
Big ticket items are hdmi support for 8996 (aka snapdragon 820), and
adreno 430 support.  Also one more small uapi addition to support
timestamp queries.

* 'msm-next' of git://people.freedesktop.org/~robclark/linux: (29 commits)
  drm/msm: rename hdmi symbols
  drm/msm/adreno: remove duplicate adreno_hw_init() call
  drm/msm: add timestamp param
  drm/msm: fix small typo
  drm/msm: grab struct_mutex after allocating submit
  drm/msm: reject submit ioctl if no gpu
  drm/msm/adreno: print details in case of a protect fault interrupt
  drm/msm/adreno: get CP_RPTR from register instead of shadow memory
  drm/msm/adreno: add adreno430 power control
  drm/msm/adreno: support for adreno 430.
  drm/msm: update generated headers
  drm/msm/dsi: fix definition of msm_dsi_pll_28nm_8960_init()
  drm/msm/dsi: Parse DSI lanes via DT
  drm/msm/dsi: Drop VDD regulator for MSM8916
  drm/msm/dsi: Remove incorrect warning on host attach
  drm/msm: Free fb helper resources in msm_unload
  drm/msm/mdp: Detach iommu in mdp4_destroy
  drm/msm: make iommu port names const'ier
  drm/msm/mdp: Use atomic helper to set crtc property
  dt-bindings: msm/hdmi: Add HDMI PHY bindings
  ...
2016-03-04 13:37:39 +10:00
Arnd Bergmann
fcda50c8f4 drm/msm: rename hdmi symbols
Global symbols in the kernel should be prefixed by the name
of the subsystem and/or driver to avoid conflicts when all
code is built-in.

In this case, function names like 'hdmi_register' or 'hdmi_set_mode'
are way too generic for an MSM specific DRM driver, so I'm renaming
them all to msm_hdmi_* here.

I also rename a lot of the 'static' symbols along with the global
names for consistency, even though those are relatively harmless;
they might only be slightly confusing when they show up in
backtraces.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:33 -05:00
Rob Clark
7977f4426c drm/msm/adreno: remove duplicate adreno_hw_init() call
Not sure where it came from, but seem unintentional.  And also not
needed on a420, so let's just drop it.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:32 -05:00
Rob Clark
6c77d1abe6 drm/msm: add timestamp param
We need this for GL_TIMESTAMP queries.

Note: currently only supported on a4xx.. a3xx doesn't have this
always-on counter.  I think we could emulate it with the one CP
counter that is available, but for now it is of limited usefulness
on a3xx (since we can't seem to do time-elapsed queries in any sane
way with the existing firmware on a3xx, and if you are trying to do
profiling on a tiler you want time-elapsed).  We can add that later
if it becomes useful.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:32 -05:00
Rob Clark
4313c744d9 drm/msm: fix small typo
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:31 -05:00
Rob Clark
687f084a3b drm/msm: grab struct_mutex after allocating submit
No real need to hold the lock over allocation, and simplifies things
slightly if we change the order.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:30 -05:00
Rob Clark
c01a958eca drm/msm: reject submit ioctl if no gpu
Existing userspace wouldn't get this far, since getparam ioctl would
have failed and it would have bailed out creating a screen/context.

But all the same, we shouldn't let evil or confused userspace cause a
null ptr deref.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:30 -05:00
Craig Stout
1e2c8e7a2f drm/msm/adreno: print details in case of a protect fault interrupt
Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:29 -05:00
Craig Stout
7d0c5ee9f0 drm/msm/adreno: get CP_RPTR from register instead of shadow memory
As described in the downstream/kgsl driver:
Sometimes the RPTR shadow memory is unreliable causing timeouts
in adreno_idle().  Read it directly from the register instead.

Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:28 -05:00
Craig Stout
38bbc55ef5 drm/msm/adreno: add adreno430 power control
Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:28 -05:00
Craig Stout
357ff00b08 drm/msm/adreno: support for adreno 430.
Signed-off-by: Craig Stout <cstout@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:27 -05:00
Rob Clark
a2272e48ee drm/msm: update generated headers
Pull in additional regs needed for a430, etc.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:27 -05:00
Luis Henriques
61965d3d57 drm/msm/dsi: fix definition of msm_dsi_pll_28nm_8960_init()
This fixes the following build failure:

drivers/gpu/drm/msm/dsi/pll/dsi_pll_28nm.o: In function `msm_dsi_pll_28nm_8960_init':
dsi_pll_28nm.c:(.text+0x1198): multiple definition of `msm_dsi_pll_28nm_8960_init'
drivers/gpu/drm/msm/dsi/pll/dsi_pll.o:dsi_pll.c:(.text+0x0): first defined here

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-03 11:55:26 -05:00
Archit Taneja
26f7d1f4d9 drm/msm/dsi: Parse DSI lanes via DT
The DSI driver is currently unaware of how the DSI physical data lanes
are mapped to the logical lanes provided by the DSI controller.

Create a DT binding "qcom,data-lane-map" that provides this information
on a given platform.

The MSM DSI controller is restricted in terms of what all mappings
it can support. The lane polarity is fixed for all the lanes, the clock
lanes are fixed, and the data lanes can be swapped among each other only
for a few combinations. Apply these restrictions when we parse the DT
data.

Cc: devicetree@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
2016-03-03 11:55:20 -05:00
Archit Taneja
52cde8dc8f drm/msm/dsi: Drop VDD regulator for MSM8916
VDD regulator input was specified for MSM8916. It turns our that this
regulator is used for the display panels used on MSM8916 platforms, but
not the DSI controller itself. Drop this regulator from the list.

Reported-by: Vinay Simha <vinaysimha@inforcecomputing.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-02 16:19:47 -05:00
Archit Taneja
06cfdc0ba5 drm/msm/dsi: Remove incorrect warning on host attach
With the implementation of of_graph parsing, it isn't any longer
necessary for msm_host->device node to be same as dsi->dev.of_node. This
only holds true when the connected device is also a child of the dsi_host.

In the case of external bridge chips belonging to a different control
bus, these are guaranteed to be different.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-02 16:19:46 -05:00
Archit Taneja
1aaa57f5d4 drm/msm: Free fb helper resources in msm_unload
We have a msm_fbev_free function to uninit fb_helper stuff, but we aren't
using it. Call it in msm_unload.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-02 16:19:45 -05:00
Sricharan R
f759020530 drm/msm/mdp: Detach iommu in mdp4_destroy
attach_dev gets called in mdp4_kms_init, but there is no corresponding
detach_dev called in the error path or in the kms driver unload path.

Detach and destroy mmu in mdp4_destroy.

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-02 16:19:44 -05:00
Rob Clark
d72ab59931 drm/msm: make iommu port names const'ier
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-02 16:19:43 -05:00
Archit Taneja
4103eef98c drm/msm/mdp: Use atomic helper to set crtc property
Assign drm_atomic_helper_crtc_set_property helper to MDP4 and MDP5
crtcs' set_property ops. This replaces the custom funcs that
returned an error even for standard crtc properties.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-03-02 16:19:41 -05:00
Dave Airlie
42e8560678 imx-drm vblank IRQ control, fence support, and of endpoint helpers
- Add and make use of drm_of_active_endpoint helpers
 - Silence a noisy dev_info into a dev_dbg
 - Stop touching primary fb on pageflips
 - Track flip state explicitly
 - Keep GEM buffer objects referenced while scanout is active
 - Implement fence sync by deferring flips to a workqueue for
   dma-bufs with pending fences
 - Actually disable vblank IRQs while they are not needed
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJW1UXsAAoJEFDCiBxwnmDrcLAP/RSK97JkP35sgPT4+YCuGtsD
 ToXzJaJnKwSMaXQif1IN7xwcX+sYhhivzTYVM5Cj9/CGwAME9fkqirFxC4ZZ4b5B
 0tx/XcRWoyl7zuxTpAPTFxtr7aDQ5cQ2gHMjqasNDXtvQS3h+vjmYuRfNI2PmdLO
 9Bnj7zrun3kW3V05RE2W+3VsFZALQ64tMAuZPnTEI8/F/DH4lyH7q6V9d+jBZiR6
 rYRw4jWn5J37xu84jhjYxISokBB46Ldb1ccLQ9910Whuj6vVnvSd0mufL+MLPYot
 /ZSlcNrjIN6QmeHxWcO17MogW3l94Yp5xvRih9hjO9wc/tgoWNkOw7wcnvE7GW3z
 P5YzlDgRy/MrIxsqIjSTu9yzv6GjDpZCqu/qib9TKWTcsnvz1O23r3Q/CjmILwdk
 Tb0DBHZL2RM01YgunAcuvUQmKoz4MwAk0nqhKGJzkHUUQoXDyk+EJTVFw5liOoOP
 Qb8enNfGhoLVLCKM1sdX5hdrc2WGOiZSXQWK6rsFfK5vuuTFOQC84nH/jj5LasEk
 x07tXnwHEUFEOCLNPjPRrvv6K1juB3n5wmwnmCiaNlnp2alIjRb0ZBGH95egKrGL
 vKuBzwz/FfR2uUDM/fiblwaGV8htmZ0cCWoKckOmyZvTWA/96qEVbvcgOoHDMN6R
 lsv2qUwrkhMQOE9Nr90a
 =ufbY
 -----END PGP SIGNATURE-----

Merge tag 'imx-drm-next-20160301' of git://git.pengutronix.de/git/pza/linux into drm-next

imx-drm vblank IRQ control, fence support, and of endpoint helpers

- Add and make use of drm_of_active_endpoint helpers
- Silence a noisy dev_info into a dev_dbg
- Stop touching primary fb on pageflips
- Track flip state explicitly
- Keep GEM buffer objects referenced while scanout is active
- Implement fence sync by deferring flips to a workqueue for
  dma-bufs with pending fences
- Actually disable vblank IRQs while they are not needed

* tag 'imx-drm-next-20160301' of git://git.pengutronix.de/git/pza/linux:
  drm/imx: only enable vblank IRQs when needed
  drm/imx: implement fence sync
  drm/imx: keep GEM object referenced as long as scanout is active
  drm/imx: track flip state explicitly
  drm/imx: don't touch primary fb on pageflip
  drm/imx: ipuv3 plane: Replace dev_info with dev_dbg if a plane's CRTC changes
  gpu: ipu-v3: ipu-dc: Simplify display controller microcode setup
  drm/rockchip: remove rockchip_drm_encoder_get_mux_id
  drm/imx: remove imx_drm_encoder_get_mux_id
  drm: add drm_of_encoder_active_endpoint helpers
2016-03-02 17:52:51 +10:00
Andrzej Hajda
6c81e96d4b drm/exynos/dsi: use core helper to create DSI packet
Core provides generic helper to create DSI packet, use it instead of
custom code.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-02 00:21:37 +09:00
Marek Szyprowski
f43c35966a drm/exynos: use real device for DMA-mapping operations
This patch changes device pointer provided to all calls to DMA-mapping
subsystem from the virtual exynos-drm 'device' to the real device pointer
of one of the CRTC devices (decon, fimd or mixer). This way no more hacks
will be needed to configure proper DMA-mapping address space on the common
virtual exynos-drm device. This change also removes the need for some
hacks in IOMMU related code. It also finally solves the problem of Exynos
DRM driver not working on ARM64 architecture, which provides noop-based
DMA-mapping operations for virtual platform devices.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:53:47 +09:00
Marek Szyprowski
a5fb26cdaa drm/exynos: refactor driver and device registration code
This patch refactors driver and device registration by moving all drivers
to the common array. This way additional flags can be added later for
new features. #ifdef-based code has been replaced by IS_ENABLED() macro
usage.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:25 +09:00
Andrzej Hajda
3e8a4738f9 drm/exynos/fimc: remove unused camera interface polarization code
Polarization was never configured for DRM-FIMC device, so fimc_set_polarity
function did nothing. In fact DRM does not use camera interface so there
is no point in configuring it.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:23 +09:00
Andrzej Hajda
27d60e3d28 drm/exynos: remove struct exynos_drm_panel_info
struct exynos_drm_panel_info is not used anymore, except exynos_dp,
which can integrate useful fields directly into its context.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:22 +09:00
Chanho Park
1feafd3afd drm/exynos: add exynos5420 support for fimd
This patch adds a exynos5420 driver data to support mic_bypass
option to bypass the mic from display out path.
The mic(Mobile image compressor) compresses RGB data from fimd
and send the compressed data to the mipi dsi.
The bypass option can be founded from system register and the bit
is 11. The option bit has been introduced since exynos5420. The
only difference between exynos5250 and exynos5420/exynos5422 is
existence of the bit. Until the MIC is defined and enabled from
device tree, the bypass mic will be default option.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:21 +09:00
Chanho Park
217fb00a79 drm/exynos: use DIV_ROUND_CLOSEST to find the closest div
This patch uses DIV_ROUND_CLOSEST instead of DIV_ROUND_UP
The DIV_ROUND_CLOSEST can be used to find the closest integer
value when we divide some integers.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:21 +09:00
Andrzej Hajda
4e6319cd52 drm/exynos: remove incorrect ccflags from Makefile
Include directories are provided by core already, adding them in driver
is redundand and causes warnings in case of out-of-tree build.

v2:
    - fixed include in exynos_drm_iommu.c
    - typo in commit message

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:20 +09:00
Andrzej Hajda
9844d6ebb1 drm/exynos/decon: make irq handler static
The function is used only locally.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:20 +09:00
Andrzej Hajda
9c2580cf1a drm/exynos/hdmi: remove unused variable
The variable is unused for long time.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:20 +09:00
Andrzej Hajda
b115361ec3 drm/exynos/dsi: constify read only structures
All global variables are read only.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:19 +09:00
Andrzej Hajda
bb32e4088c drm/exynos/dsi: replace registry access macros with functions
Functions are preferred over macros as more type-safe.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:18 +09:00
Chanho Park
fdc2e10893 drm/exynos: support exynos5422 mipi-dsi
This patch supports mipi dsi for exynos5422. The dsi register
offsets of the exynos5422 are similar with exynos5433. However,
the values of the registers are quite different from the
exynos5433. For example, the exynos5422 uses sw reset like
previous chips.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:18 +09:00
Andrzej Hajda
92c96ff82b drm/exynos/decon: fix disable clocks order
Decon requires that clocks should be disabled in reverse order. Otherwise
system hangs.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:15 +09:00
Marek Szyprowski
9aa3821bb2 drm/exynos: fix incorrect cpu address for dma_mmap_attrs()
dma_mmap_attrs() should be called with cpu address returned by
dma_alloc_attrs(). Existing code however passed pages array base as cpu
address. This worked only by a pure luck on ARM architecture. This patch
fixes this issue.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:15 +09:00
Marek Szyprowski
f3fb3d8237 drm/exynos: exynos5433_decon: fix wrong state in decon_vblank_enable
BIT_IRQS_ENABLED was never set because of incorrect test in
decon_vlank_enable() function, what resulted in lack of enabling vblank
support. This patch fixes this issue.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:14 +09:00
Marek Szyprowski
6d3f3b6755 drm/exynos: exynos5433_decon: fix wrong state assignment in decon_enable
Patch ebf3fd403b ("drm/exynos: add
pm_runtime to DECON 5433") removed some code from decon_enable()
function, but it left set_bit(BIT_SUSPENDED, &ctx->flags) call, which
was earlier called only in error path. This patch removes it, what
finally lets driver to go out of suspended state.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:14 +09:00
Marek Szyprowski
6fe9dbf767 drm/exynos: dsi: restore support for drm bridge
This patch fixes issue introduced by commit
cf67cc9a29 ("drm/exynos: remove struct
exynos_drm_display"), which removed assigning of drm bridge to drm
encoder. Lack of it caused that no bridge callbacks were called on
encoder enable/disable actions.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:13 +09:00
Marek Szyprowski
2aa8a2562d drm/exynos: mic: make all functions static
There is no point exposing all internal functions to global kernel name
space, so make all internals functions static.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:12 +09:00
Marek Szyprowski
dc3484f4a1 drm/exynos: mic: convert to component framework
MIC is SoC component and important part of kms pipeline on Exynos5433,
so convert it to use component framework like other KMS/CRTC drivers.
MIC driver is already listed on KMS component driver list in Exynos DRM
core, so without this conversion, initialization of Exynos DRM core
fails on Exynos 5433 SoC.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:11 +09:00
Marek Szyprowski
930b42c49a drm/exynos: mic: use devm_clk interface
Drivers should use devm_clk* interface instead of of_clk* functions.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:10 +09:00
Marek Szyprowski
c5f2f0c41e drm/exynos: fix types for compilation on 64bit architectures
This patch fixes compilation warnings (on 64bit architectures) and bugs
related to casting pointers through 32bit integers.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:09 +09:00
Marek Szyprowski
3b35678538 drm/exynos: ipp: fix incorrect format specifiers in debug messages
Drivers should use %p for printing pointers instead of hardcoding them
as hexadecimal integers. This patch fixes compilation warnings on 64bit
architectures.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:08 +09:00
Joonyoung Shim
dbbc925bb8 drm/exynos: depend on ARCH_EXYNOS for DRM_EXYNOS
Because PLAT_SAMSUNG isn't include exynos SoCs for arm64, but
ARCH_EXYNOS can do it. And it also needs to add ARCH_S3C64XX instead of
PLAT_SAMSUNG.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01 23:37:08 +09:00
Lucas Stach
411b0336cf drm/imx: only enable vblank IRQs when needed
The vblank IRQ is only needed to trigger page flip work, so we
might as well disable it when there is no work to do.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-01 08:33:41 +01:00
Lucas Stach
17a8d08df1 drm/imx: implement fence sync
If the FB is backed by a GEM object with an dma-buf attached
we need to wait for any pending fences to signal before executing
the page flip.

The implementation is straight forward by deferring the flip to
a workqueue in that case.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-01 08:33:40 +01:00
Lucas Stach
0a7ad343c8 drm/imx: keep GEM object referenced as long as scanout is active
The DRM core only references the currently queued/active framebuffer.
So there is a period of time where the flip is not completed, but
the GEM object backing the FB is already unreferenced and could be
destroyed if userspace closes its handle.

Make sure to keep a reference to the GEM object until the flip is
actually executed clean things up in a worker running behind the
flip execution.

Also move the page flip event into the context of this worker, so
it gets cleaned up automatically.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-01 08:33:40 +01:00
Lucas Stach
0bfc2b3d01 drm/imx: track flip state explicitly
Start tracking the flip state explicitly, as opposed to inferring
it from the presence if a new FB. This is a preparatory step to
introduce an new immediate state, where we can wait for a fence to
signal.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-01 08:33:40 +01:00
Lucas Stach
f5dca1608b drm/imx: don't touch primary fb on pageflip
The core already does the correct replacemet if the driver
page flip function returns without an error, so there is no
need to do it here.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-01 08:33:39 +01:00