]> Git Repo - linux.git/log
linux.git
7 years agodrm/vc4: switch to drm_*{get,put} helpers
Cihangir Akturk [Thu, 3 Aug 2017 11:58:40 +0000 (14:58 +0300)]
drm/vc4: switch to drm_*{get,put} helpers

drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() adn should not be
used by new code. So convert all users of compatibility functions to use
the new APIs.

Signed-off-by: Cihangir Akturk <[email protected]>
Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Eric Anholt <[email protected]>
7 years agodrm/vc4: Fix errant drm_bridge_remove() in DSI.
Eric Anholt [Wed, 2 Aug 2017 20:32:42 +0000 (13:32 -0700)]
drm/vc4: Fix errant drm_bridge_remove() in DSI.

drm_bridge_remove() is for unregistering a bridge driver, not for
detaching a bridge from its consumer.

Fixes: 656fa22f9cea ("drm/vc4: Switch DSI to the panel-bridge layer, and support bridges.")
Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Acked-by: Noralf Trønnes <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
7 years agodrm/vc4: Don't disable DSI clocks on component unload.
Eric Anholt [Wed, 2 Aug 2017 20:32:41 +0000 (13:32 -0700)]
drm/vc4: Don't disable DSI clocks on component unload.

The clocks are enabled/disabled at encoder enable/disable time, not at
component load.  Fixes a WARN_ON at boot if V3D fails to probe.

Fixes: 4078f5757144 ("drm/vc4: Add DSI driver")
Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Acked-by: Noralf Trønnes <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
7 years agodrm/vc4: Fix double destroy of the BO cache on teardown.
Eric Anholt [Wed, 2 Aug 2017 20:32:40 +0000 (13:32 -0700)]
drm/vc4: Fix double destroy of the BO cache on teardown.

It's also destroyed from the top level vc4_drv.c initialization, which
is where the cache was actually initialized from.

This used to just involve duplicate del_timer() and cancel_work_sync()
being called, but it started causing kmalloc issues once we
double-freed the new BO label array.

Fixes: 1908a876f909 ("drm/vc4: Add an ioctl for labeling GEM BOs for summary stats")
Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Tested-by: Noralf Trønnes <[email protected]>
Acked-by: Noralf Trønnes <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
7 years agodrm: Nuke drm_atomic_legacy_backoff
Daniel Vetter [Tue, 25 Jul 2017 08:01:22 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_legacy_backoff

Finally all users are gone!

Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Nuke drm_atomic_helper_connector_dpms
Daniel Vetter [Tue, 25 Jul 2017 08:01:21 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_connector_dpms

It's dead code, the core handles all this directly now.

The only special case is nouveau and tda988x which used one function
for both legacy modeset code and -nv50 atomic world instead of 2
vtables. But amounts to exactly the same.

v2: Rebase over the panel/brideg refactorings in stm/ltdc.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Peter Senna Tschudin <[email protected]>
Cc: Martin Donnelly <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Joonyoung Shim <[email protected]>
Cc: Seung-Woo Kim <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Alison Wang <[email protected]>
Cc: Russell King <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: CK Hu <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Carlo Caione <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: Mark Yao <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Chen-Yu Tsai <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: Jeffy Chen <[email protected]>
Cc: Tomeu Vizoso <[email protected]>
Cc: Yakir Yang <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: Romain Perier <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Xinliang Liu <[email protected]>
Cc: Alexey Brodkin <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Rongrong Zou <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Hai Li <[email protected]>
Cc: "Noralf Trønnes" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: zain wang <[email protected]>
Cc: Baoyou Xie <[email protected]>
Cc: Boris Brezillon <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Acked-by: Neil Armstrong <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Acked-by: Archit Taneja <[email protected]>
Tested-by: Philippe Cornu <[email protected]> (on stm)
Reviewed-by: Laurent Pinchart <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Acked-by: Noralf Trønnes <[email protected]>
Acked-by: Vincent Abriou <[email protected]>
7 years agodrm: Nuke drm_atomic_helper_connector_set_property
Daniel Vetter [Tue, 25 Jul 2017 08:01:20 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_connector_set_property

It's dead code, the core handles all this directly now. This also
allows us to unexport drm_atomic_helper_connector_set_property.

The only special case is nouveau which used one function for both
pre-nv50 legacy modeset code and post-nv50 atomic world instead of 2
vtables. But amounts to exactly the same.

What is rather strange here is how few drivers set this up, I suspect
the earlier patch to handle properties in the core did end up fixing a
pile of possible issues.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Acked-by: Vincent Abriou <[email protected]>
7 years agodrm: Nuke drm_atomic_helper_plane_set_property
Daniel Vetter [Tue, 25 Jul 2017 08:01:19 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_plane_set_property

It's dead code, the core handles all this directly now. This also
allows us to unexport drm_atomic_plane_set_property.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Liviu Dudau <[email protected]>
Cc: Brian Starkey <[email protected]>
Cc: Mali DP Maintainers <[email protected]>
Cc: Boris Brezillon <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Joonyoung Shim <[email protected]>
Cc: Seung-Woo Kim <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: "Ville Syrjälä" <[email protected]>
Cc: Rongrong Zou <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Alexey Brodkin <[email protected]>
Cc: Eric Engestrom <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Thomas Hellstrom <[email protected]>
Cc: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Archit Taneja <[email protected]>
Acked-by: Philippe Cornu <[email protected]>
Tested-by: Philippe Cornu <[email protected]>
Acked-by: Liviu Dudau <[email protected]>
Acked-by: Vincent Abriou <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
7 years agodrm: Nuke drm_atomic_helper_crtc_set_property
Daniel Vetter [Tue, 25 Jul 2017 08:01:18 +0000 (10:01 +0200)]
drm: Nuke drm_atomic_helper_crtc_set_property

It's dead code because this is now handled in the core.

Signed-off-by: Daniel Vetter <[email protected]>
Cc: Boris Brezillon <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Alexey Brodkin <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Eric Engestrom <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: "Ville Syrjälä" <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Sushmita Susheelendra <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Philipp Zabel <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Hellstrom <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Archit Taneja <[email protected]>
Acked-by: Philippe Cornu <[email protected]>
Tested-by: Philippe Cornu <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Acked-by: Thomas Hellstrom <[email protected]>
7 years agodrm: Handle properties in the core for atomic drivers
Daniel Vetter [Tue, 25 Jul 2017 12:02:04 +0000 (14:02 +0200)]
drm: Handle properties in the core for atomic drivers

The reason behind the original indirection through the helper
functions was to allow existing drivers to overwrite how they handle
properties. For example when a vendor-specific userspace had
expectations that didn't match atomic. That seemed likely, since
atomic is standardizing a _lot_ more of the behaviour of a kms driver.

But 20 drivers later there's no such need at all. Worse, this forces
all drivers to hook up the default behaviour, breaking userspace if
they forget to do that. And it forces us to export a bunch of core
function just for those helpers.

And finally, these helpers are the last places using
drm_atomic_legacy_backoff() and the implicit acquire_ctx.

This patch here just implements the new behaviour and updates the
docs. Follow-up patches will garbage-collect all the dead code.

v2: Fixup docs even better!

v3: Make it actually work ...

v4: Drop the uses_atomic_modeset() checks from the previous patch
again, since they're now moved up in the callchain.

Cc: Maarten Lankhorst <[email protected]>
Reviewed-by: Archit Taneja <[email protected]> (v3)
Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Don't update property values for atomic drivers
Daniel Vetter [Tue, 25 Jul 2017 12:01:37 +0000 (14:01 +0200)]
drm: Don't update property values for atomic drivers

Atomic drivers only use the property value store for immutable (i.e.
can't be set by userspace, but the kernel can still adjust it)
properties. The only tricky part is the removal of the update in
drm_atomic_helper_update_legacy_modeset_state().

This was added in

commit 8c10342cb48f3140d9abeadcfd2fa6625d447282 (tag: topic/drm-misc-2015-07-28)
Author: Maarten Lankhorst <[email protected]>
Date:   Mon Jul 27 13:24:29 2015 +0200

    drm/atomic: Update legacy DPMS state during modesets, v3.

by copying it from the i915 code, where it was originally added in

commit 68d3472047a572936551f8ff0b6f4016c5a1fdef
Author: Daniel Vetter <[email protected]>
Date:   Thu Sep 6 22:08:35 2012 +0200

    drm/i915: update dpms property in set_mode

for the legacy modeset code. The reason we needed this hack was that
i915 didn't yet set DRIVER_ATOMIC, and we checked for that instead of
the newer-ish drm_drv_uses_atomic_modeset(), which avoids such
troubles. With the correct feature checks this isn't needed anymore at
all.

Also make sure that drivers don't accidentally get this wrong by
making the exported version of drm_object_property_get_value() only
work for legacy drivers. Only gma500 uses it anyway.

v2: Fixup the uses_atomic_modeset() checks (Maarten)

Cc: Maarten Lankhorst <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/omap: Rework the rotation-on-crtc hack
Maarten Lankhorst [Mon, 7 Aug 2017 10:20:06 +0000 (12:20 +0200)]
drm/omap: Rework the rotation-on-crtc hack

I want/need to rework the core property handling, and this hack is
getting in the way. But since it's a non-standard propety only used by
legacy userspace we know that this will only every be called from
ioctl code. And never on some other free-standing state struct, where
this old hack wouldn't work either.

v2: don't forget zorder and get_property!

v3: Shadow the legacy state to avoid locking issues in get_property
(Maarten).

v4: Review from Laurent
- Move struct omap_crtc_state into omap_crtc.c
- Clean up comments.
- Don't forget to copy the shadowed state over on duplicate.

v5: Don't forget to update the reset handler (Maarten).
v6: Update omap_crtc_state shadow values in omap_crtc_atomic_check (Maarten).
v7:
- Fix get_property to return 0 and set value in *val (Maarten).
- Update comment in set_property for changes in v6 (Maarten).

Reviewed-by: Laurent Pinchart <[email protected]> (v4)
Cc: Maarten Lankhorst <[email protected]>
Cc: Tomi Valkeinen <[email protected]
Cc: Laurent Pinchart <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]> (v4)
Signed-off-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/radeon: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:04 +0000 (17:41 +0200)]
drm/radeon: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/i915: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 6 Aug 2017 15:41:00 +0000 (17:41 +0200)]
drm/i915: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/sti: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 6 Aug 2017 15:40:53 +0000 (17:40 +0200)]
drm/sti: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Vincent Abriou <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: bridge: synopsys/dw-hdmi: Provide default configuration function for HDMI 2...
Jose Abreu [Fri, 23 Jun 2017 09:36:44 +0000 (10:36 +0100)]
drm: bridge: synopsys/dw-hdmi: Provide default configuration function for HDMI 2.0 PHY

Currently HDMI 2.0 PHYs do not have a default configuration function.

As *some* of the HDMI 2.0 PHYs have the same register layout as the 3D
PHYs we can provide the same default configuration function for both
and still let user overwrite this with custom configuration function
if needed.

If, for some reason, the PHY is custom or has a register different
register layout then custom configuration function *must* be provided
in order for the system to work correctly. As we prefer the pdata
provided configuration function over the internal one this change
will not make any impact in custom platforms.

Signed-off-by: Jose Abreu <[email protected]>
Tested-by: Mark Yao <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Mark Yao <[email protected]>
Cc: Carlos Palminha <[email protected]>
Cc: Heiko Stübner <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/185ccf7d4473fa557044732402ca20b3d4007952.1498209896.git.joabreu@synopsys.com
7 years agodrm/fb-helper: pass physical dimensions to fbdev
David Lechner [Fri, 4 Aug 2017 16:25:24 +0000 (11:25 -0500)]
drm/fb-helper: pass physical dimensions to fbdev

The fbdev subsystem has a place for physical dimensions (width and height
in mm) that is readable by userspace. Since DRM also knows these
dimensions, pass this information to the fbdev device.

This has to be done in drm_setup_crtcs_fb() instead of drm_setup_crtcs()
because fb_helper->fbdev may be NULL in drm_setup_crtcs().

Signed-off-by: David Lechner <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agouapi drm/armada_drm.h: use __u32 and __u64 instead of uint32_t and uint64_t
Mikko Rapeli [Sun, 6 Aug 2017 16:44:23 +0000 (18:44 +0200)]
uapi drm/armada_drm.h: use __u32 and __u64 instead of uint32_t and uint64_t

These are defined in linux/types.h or drm/drm.h. Fixes
user space compilation errors like:

drm/armada_drm.h:26:2: error: unknown type name ‘uint32_t’
  uint32_t handle;
  ^~~~~~~~

Signed-off-by: Mikko Rapeli <[email protected]>
Cc: Emil Velikov <[email protected]>
Cc: Gabriel Laskar <[email protected]>
Cc: Russell King <[email protected]>
Cc: Rob Clark <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: remove CEC engine register definitions
Russell King [Wed, 2 Aug 2017 18:41:08 +0000 (20:41 +0200)]
drm/bridge: dw-hdmi: remove CEC engine register definitions

We don't need the CEC engine register definitions, so let's remove them.

Signed-off-by: Russell King <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Tested-by: Hans Verkuil <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: add cec driver
Russell King [Wed, 2 Aug 2017 18:41:07 +0000 (20:41 +0200)]
drm/bridge: dw-hdmi: add cec driver

Add a CEC driver for the dw-hdmi hardware.

Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Russell King <[email protected]>
[hans.verkuil: unsigned -> unsigned int]
[hans.verkuil: cec_transmit_done -> cec_transmit_attempt_done]
[hans.verkuil: add missing CEC_CAP_PASSTHROUGH]
Acked-by: Hans Verkuil <[email protected]>
Tested-by: Hans Verkuil <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: add missing cec_notifier_put
Hans Verkuil [Mon, 7 Aug 2017 07:20:35 +0000 (09:20 +0200)]
drm/bridge: dw-hdmi: add missing cec_notifier_put

The __dw_hdmi_remove() function was missing a call to cec_notifier_put
to balance the cec_notifier_get in the probe function.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: remove unused and redundant callbacks
Peter Rosin [Thu, 13 Jul 2017 16:25:38 +0000 (18:25 +0200)]
drm: remove unused and redundant callbacks

Drivers no longer have any need for these callbacks, and there are no
users. Zap. Zap-zap-zzzap-p-pp-p.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agostaging: vboxvideo: remove dead gamma lut code
Peter Rosin [Fri, 4 Aug 2017 10:45:06 +0000 (12:45 +0200)]
staging: vboxvideo: remove dead gamma lut code

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code that was not doing anything
sensible anyway.

Signed-off-by: Peter Rosin <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: dw-hdmi-i2s: add missing company name on Copyright
Kuninori Morimoto [Mon, 7 Aug 2017 04:09:41 +0000 (04:09 +0000)]
drm: dw-hdmi-i2s: add missing company name on Copyright

This driver's Copyright is under Renesas Solutions Corp.
This patch updates the year, because this driver was moved
into synopsys folder in 2017.

Signed-off-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/87tw1khvnq.wl%[email protected]
7 years agodrm/bridge: dw-hdmi: add better clock disable control
Russell King [Mon, 31 Jul 2017 14:29:46 +0000 (15:29 +0100)]
drm/bridge: dw-hdmi: add better clock disable control

The video setup path aways sets the clock disable register to a specific
value, which has the effect of disabling the CEC engine.  When we add the
CEC driver, this becomes a problem.

Fix this by only setting/clearing the bits that the video path needs to.

Reviewed-by: Jose Abreu <[email protected]>
Signed-off-by: Russell King <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/bridge: dw-hdmi: add cec notifier support
Russell King [Mon, 31 Jul 2017 14:29:41 +0000 (15:29 +0100)]
drm/bridge: dw-hdmi: add cec notifier support

Add CEC notifier support to the HDMI bridge driver, so that the CEC
part of the IP can receive its physical address.

Signed-off-by: Russell King <[email protected]>
Tested-by: Neil Armstrong <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()
David Lechner [Thu, 3 Aug 2017 22:33:45 +0000 (17:33 -0500)]
drm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()

This removes the call to mipi_dbi_init() from mipi_dbi_spi_init() so that
drivers can have a driver-specific implementation if needed.

Suggested-by: Noralf Trønnes <[email protected]>
Signed-off-by: David Lechner <[email protected]>
Reviewed-by: Noralf Trønnes <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:23 +0000 (21:16 +0200)]
drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Stefan Agner <[email protected]>
Cc: Alison Wang <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Stefan Agner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: stm: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:37 +0000 (18:25 +0200)]
drm: stm: remove dead code and pointless local lut storage

The redundant fb helper .load_lut is no longer used, and can not
work right without also providing the fb helpers .gamma_set and
.gamma_get thus rendering the code in this driver suspect.

Just remove the dead code.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: radeon: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:36 +0000 (18:25 +0200)]
drm: radeon: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: nouveau: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:35 +0000 (18:25 +0200)]
drm: nouveau: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: mgag200: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:34 +0000 (18:25 +0200)]
drm: mgag200: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: i915: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:33 +0000 (18:25 +0200)]
drm: i915: remove dead code and pointless local lut storage

The driver stores lut values from the fbdev interface, and is able
to give them back, but does not appear to do anything with these
lut values. The generic fb helpers have replaced this function,
and may even have made the driver work for the C8 mode from the
fbdev interface. But that is untested.

Since the fb helpers .gamma_set and .gamma_get are obsolete,
remove the dead code.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: gma500: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:32 +0000 (18:25 +0200)]
drm: gma500: remove dead code and pointless local lut storage

The redundant fb helpers .gamma_set and .gamma_get are no longer
used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: cirrus: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:31 +0000 (18:25 +0200)]
drm: cirrus: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: ast: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:30 +0000 (18:25 +0200)]
drm: ast: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: armada: remove dead empty functions
Peter Rosin [Thu, 13 Jul 2017 16:25:29 +0000 (18:25 +0200)]
drm: armada: remove dead empty functions

The redundant fb helpers .gamma_set and .gamma_get are no longer used.
Remove the dead code.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: amd: remove dead code and pointless local lut storage
Peter Rosin [Thu, 13 Jul 2017 16:25:28 +0000 (18:25 +0200)]
drm: amd: remove dead code and pointless local lut storage

The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.

Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Peter Rosin <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: fix race with kms hotplug and fbdev
Mark yao [Tue, 1 Aug 2017 08:11:43 +0000 (16:11 +0800)]
drm/rockchip: fix race with kms hotplug and fbdev

According to the kerneldoc[0], should do fbdev setup before calling
drm_kms_helper_poll_init(), otherwise, Kms hotplug event may race
into fbdev helper initial, and fb_helper->dev may be NULL pointer,
that would cause the bug:
[    0.735411] [00000200] *pgd=00000000f6ffe003, *pud=00000000f6ffe003, *pmd=0000000000000000
[    0.736156] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[    0.736648] Modules linked in:
[    0.736930] CPU: 2 PID: 20 Comm: kworker/2:0 Not tainted 4.4.41 #20
[    0.737480] Hardware name: Rockchip RK3399 Board rev2 (BOX) (DT)
[    0.738020] Workqueue: events cdn_dp_pd_event_work
[    0.738447] task: ffffffc0f21f3100 ti: ffffffc0f2218000 task.ti: ffffffc0f2218000
[    0.739109] PC is at mutex_lock+0x14/0x44
[    0.739469] LR is at drm_fb_helper_hotplug_event+0x30/0x114
[    0.756253] [<ffffff8008a344f4>] mutex_lock+0x14/0x44
[    0.756260] [<ffffff8008445708>] drm_fb_helper_hotplug_event+0x30/0x114
[    0.756271] [<ffffff8008473c84>] rockchip_drm_output_poll_changed+0x18/0x20
[    0.756280] [<ffffff8008439fcc>] drm_kms_helper_hotplug_event+0x28/0x34
[    0.756286] [<ffffff800846c444>] cdn_dp_pd_event_work+0x394/0x3c4
[    0.756295] [<ffffff80080b2b38>] process_one_work+0x218/0x3e0
[    0.756302] [<ffffff80080b3538>] worker_thread+0x2e8/0x404
[    0.756308] [<ffffff80080b7e70>] kthread+0xe8/0xf0
[    0.756316] [<ffffff8008082690>] ret_from_fork+0x10/0x40

[0]: https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms-helpers.html

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: report error when check resource error
Mark yao [Mon, 31 Jul 2017 09:49:55 +0000 (17:49 +0800)]
drm/rockchip: vop: report error when check resource error

The user would be confused while facing a error commit without
any error report.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: round_up pitches to word align
Mark yao [Mon, 31 Jul 2017 09:49:50 +0000 (17:49 +0800)]
drm/rockchip: vop: round_up pitches to word align

VOP pitch register is word align, need align to word.

VOP_WIN0_VIR:
  bit[31:16] win0_vir_stride_uv
    Number of words of Win0 uv Virtual width
  bit[15:0] win0_vir_width
    Number of words of Win0 yrgb Virtual width
    ARGB888 : win0_vir_width
    RGB888 : (win0_vir_width*3/4) + (win0_vir_width%3)
    RGB565 : ceil(win0_vir_width/2)
    YUV : ceil(win0_vir_width/4)

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: fix NV12 video display error
Mark yao [Mon, 31 Jul 2017 09:49:46 +0000 (17:49 +0800)]
drm/rockchip: vop: fix NV12 video display error

fixup the scale calculation formula on the case
src_height == (dst_height/2).

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: fix iommu page fault when resume
Mark yao [Mon, 31 Jul 2017 09:49:42 +0000 (17:49 +0800)]
drm/rockchip: vop: fix iommu page fault when resume

Iommu would get page fault with following path:
   vop_disable:
      1, disable all windows and set vop config done
      2, vop enter to standy, all windows not works, but their registers
         are not clean, when you read window's enable bit, may found the
         window is enable.

   vop_enable:
      1, memcpy(vop->regsbak, vop->regs, len)
         save current vop registers to vop->regsbak, then you can found
         window is enable on regsbak.
      2, VOP_WIN_SET(vop, win, gate, 1);
         force enable window gate, but gate and enable are on same
         hardware register, then window enable bit rewrite to vop hardware.
      3, vop power on, and vop might try to scan destroyed buffer,
         then iommu get page fault.

Move windows disable after vop regsbak restore, then vop regsbak mechanism
would keep tracing the modify, everything would be safe.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: no need wait vblank on crtc enable
Mark yao [Mon, 31 Jul 2017 09:49:37 +0000 (17:49 +0800)]
drm/rockchip: vop: no need wait vblank on crtc enable

Since atomic framework, crtc enable and disable are in pairs,
no need to wait vblank.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sandy huang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/fb-helper: add new drm_setup_crtcs_fb() function
David Lechner [Thu, 3 Aug 2017 16:19:08 +0000 (11:19 -0500)]
drm/fb-helper: add new drm_setup_crtcs_fb() function

This adds a new drm_setup_crtcs_fb() function to handle the parts of
drm_setup_crtcs() that touch fb_helper->fb and fb_helper->fbdev. When
drm_setup_crtcs() is called during initialization, these fields are NULL
because they have not been allocated yet.

There is currently a hack at the end of drm_fb_helper_single_fb_probe()
that sets fb_helper->fb, so it is moved to the new drm_setup_crtcs_fb()
function.

This is also done in preparation for addition setup that requires access
to fb_helper->fbdev.

Signed-off-by: David Lechner <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/atmel-hlcdc: switch to drm_*{get,put} helpers
Cihangir Akturk [Thu, 3 Aug 2017 11:58:20 +0000 (14:58 +0300)]
drm/atmel-hlcdc: switch to drm_*{get,put} helpers

drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() and should not be
used by new code. So convert all users of compatibility functions to use
the new APIs.

Signed-off-by: Cihangir Akturk <[email protected]>
Acked-by: Boris Brezillon <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs.
Arvind Yadav [Mon, 3 Jul 2017 16:23:54 +0000 (21:53 +0530)]
drm/atmel-hlcdc : constify drm_plane_helper_funcs and drm_plane_funcs.

drm_plane_helper_funcs and drm_plane_funcsare not supposed to change
at runtime. All functions working with drm_plane_helper_funcs and
drm_plane_funcs work with const. So mark the non-const structs as const.

File size before:
   text    data     bss     dec     hex filename
   6072     596       0    6668    1a0c atmel_hlcdc_plane.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   6218     436       0    6654    19fe atmel_hlcdc_plane.o

Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/646415a3b2e62182f85254115e8491e5caf4b2c7.1499098826.git.arvind.yadav.cs@gmail.com
7 years agodrm/fb: Fix pointer dereference before null check.
David Lechner [Wed, 2 Aug 2017 18:00:13 +0000 (13:00 -0500)]
drm/fb: Fix pointer dereference before null check.

fb_crtc is used before a null check, so move the use after the null check.

This was just identified by inspection. I haven't actually observed a crash
here, so it is possible that the null check could be unnecessary.

Signed-off-by: David Lechner <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Create a format/modifier blob
Ben Widawsky [Mon, 24 Jul 2017 03:46:39 +0000 (20:46 -0700)]
drm: Create a format/modifier blob

Updated blob layout (Rob, Daniel, Kristian, xerpi)

v2:
* Removed __packed, and alignment (.+)
* Fix indent in drm_format_modifier fields (Liviu)
* Remove duplicated modifier > 64 check (Liviu)
* Change comment about modifier (Liviu)
* Remove arguments to blob creation, use plane instead (Liviu)
* Fix data types (Ben)
* Make the blob part of uapi (Daniel)

v3:
Remove unused ret field.
Change i, and j to unsigned int (Emil)

v4:
Use plane->modifier_count instead of recounting (Daniel)

v5:
Rename modifiers to modifiers_property (Ville)
Use sizeof(__u32) instead to reflect UAPI nature (Ville)
Make BUILD_BUG_ON for blob header size

Cc: Rob Clark <[email protected]>
Cc: Kristian H. Kristensen <[email protected]>
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Daniel Stone <[email protected]> (v2)
Reviewed-by: Liviu Dudau <[email protected]> (v2)
Reviewed-by: Emil Velikov <[email protected]> (v3)
Signed-off-by: Daniel Stone <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Plumb modifiers through plane init
Ben Widawsky [Mon, 24 Jul 2017 03:46:38 +0000 (20:46 -0700)]
drm: Plumb modifiers through plane init

This is the plumbing for supporting fb modifiers on planes. Modifiers
have already been introduced to some extent, but this series will extend
this to allow querying modifiers per plane. Based on this, the client to
enable optimal modifications for framebuffers.

This patch simply allows the DRM drivers to initialize their list of
supported modifiers upon initializing the plane.

v2: A minor addition from Daniel

v3:
* Updated commit message
* s/INVALID/DRM_FORMAT_MOD_INVALID (Liviu)
* Remove some excess newlines (Liviu)
* Update comment for > 64 modifiers (Liviu)

v4: Minor comment adjustments (Liviu)

v5: Some new platforms added due to rebase

v6: Add some missed plane inits (or maybe they're new - who knows at
this point) (Daniel)

Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Daniel Stone <[email protected]> (v2)
Reviewed-by: Liviu Dudau <[email protected]>
Signed-off-by: Daniel Stone <[email protected]>
7 years agodrm/msm: Convert to use new iterator macros, v2.
Maarten Lankhorst [Wed, 19 Jul 2017 14:39:18 +0000 (16:39 +0200)]
drm/msm: Convert to use new iterator macros, v2.

for_each_obj_in_state is about to be removed, so convert
to the new iterator macros.

Just like in omap, use crtc_state->active instead of
crtc_state->enable when waiting for completion.

Changes since v1:
- Fix compilation.

Signed-off-by: Maarten Lankhorst <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: Vincent Abriou <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Russell King <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Markus Elfring <[email protected]>
Cc: Sushmita Susheelendra <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Daniel Vetter <[email protected]>
Tested-by: Archit Taneja <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/nouveau: Convert nouveau to use new iterator macros, v2.
Maarten Lankhorst [Wed, 19 Jul 2017 14:39:19 +0000 (16:39 +0200)]
drm/nouveau: Convert nouveau to use new iterator macros, v2.

Use the new atomic iterator macros, the old ones are about to be
removed. With the new macros, it's more easy to get old and new state so
get them from the macros instead of from obj->state.

Changes since v1:
- Don't mix up old and new state. (danvet)
- Rebase on top of interruptible swap_state changes.

Signed-off-by: Maarten Lankhorst <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Daniel Vetter <[email protected]>
7 years agodrm/omapdrm: Fix omap_atomic_wait_for_completion
Maarten Lankhorst [Wed, 19 Jul 2017 14:39:17 +0000 (16:39 +0200)]
drm/omapdrm: Fix omap_atomic_wait_for_completion

Use the new iterator macro and look for crtc_state->active instead of
enable, only crtc_state->active implies that vblanks will happen.

Signed-off-by: Maarten Lankhorst <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/atomic: Use new iterator macros in drm_atomic_helper_wait_for_flip_done, again.
Maarten Lankhorst [Wed, 19 Jul 2017 14:39:14 +0000 (16:39 +0200)]
drm/atomic: Use new iterator macros in drm_atomic_helper_wait_for_flip_done, again.

for_each_obj_in_state is about to be removed, so use the correct new
iterator macro.

I renamed the variable to 'unused', but forgot to convert
drm_atomic_helper_wait_for_flip_done to the new iterator macro,
so make it work this time.

Signed-off-by: Maarten Lankhorst <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Daniel Vetter <[email protected]>
7 years agodma-buf/sw_sync: clean up list before signaling the fence
Gustavo Padovan [Sat, 29 Jul 2017 15:22:16 +0000 (12:22 -0300)]
dma-buf/sw_sync: clean up list before signaling the fence

If userspace already dropped its own reference by closing the sw_sync
fence fd we might end up in a deadlock where
dma_fence_is_signaled_locked() will trigger the release of the fence and
thus try to hold the lock to remove the fence from the list.

dma_fence_is_signaled_locked() tries to release/free the fence and hold
the lock in the process.

We fix that by changing the order operation and clean up the list and
rb-tree first.

v2: Drop fence get/put dance and manipulate the list first (Chris Wilson)

Cc: Chris Wilson <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodma-buf/sw_sync: move timeline_fence_ops around
Gustavo Padovan [Sat, 29 Jul 2017 15:22:15 +0000 (12:22 -0300)]
dma-buf/sw_sync: move timeline_fence_ops around

We are going to use timeline_fence_signaled() in a internal function in
the next commit.

Cc: Chris Wilson <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: todo: Avoid accidental crossreferences
Thierry Reding [Mon, 31 Jul 2017 12:42:59 +0000 (14:42 +0200)]
drm: todo: Avoid accidental crossreferences

RST uses underscores at the end of words to create crossreferences and
it will accidentally try to link to tinydrm_ and drm_fb_ targets from
the TODO, which is clearly not the intention in this context.

Use backslashes to escape the special meaning of the underscore.

Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Add a few missing descriptions in drm_driver docs
Sean Paul [Thu, 20 Jul 2017 17:47:43 +0000 (13:47 -0400)]
drm: Add a few missing descriptions in drm_driver docs

Fixes the following warnings when building docs:
../include/drm/drm_drv.h:553: warning: No description found for parameter 'debugfs_init'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_open_object'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_close_object'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'prime_handle_to_fd'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'prime_fd_to_handle'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_export'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_prime_import'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'gem_vm_ops'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'major'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'minor'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'patchlevel'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'name'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'desc'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'date'
../include/drm/drm_drv.h:553: warning: No description found for parameter 'driver_features'

There are still a couple more warnings for prime helpers that are
documented elsewhere.

Signed-off-by: Sean Paul <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agogpu/host1x: Remove excess parameter in host1x_subdev_add docs
Sean Paul [Thu, 20 Jul 2017 17:47:42 +0000 (13:47 -0400)]
gpu/host1x: Remove excess parameter in host1x_subdev_add docs

Fixes the following warning when building docs:
../drivers/gpu/host1x/bus.c:50: warning: Excess function parameter 'driver' description in 'host1x_subdev_add'

Signed-off-by: Sean Paul <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Fix warning when building docs for scdc_helper
Sean Paul [Thu, 20 Jul 2017 20:09:14 +0000 (16:09 -0400)]
drm: Fix warning when building docs for scdc_helper

Fixes:
../drivers/gpu/drm/drm_scdc_helper.c:203: ERROR: Unexpected indentation.
../drivers/gpu/drm/drm_scdc_helper.c:204: WARNING: Block quote ends without a blank line; unexpected unindent.

Changes in v2:
 - Property blockquote TMDS calculations so they look pretty (Daniel)
 - Remove duplicate documentation from the header file

Signed-off-by: Sean Paul <[email protected]>
Reviewed-by: Shashank Sharma <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/modes: Fix drm_mode_is_420_only() comment
Sean Paul [Thu, 20 Jul 2017 17:47:40 +0000 (13:47 -0400)]
drm/modes: Fix drm_mode_is_420_only() comment

Fixes the following warnings when building docs:
../drivers/gpu/drm/drm_modes.c:1623: warning: No description found for parameter 'display'
../drivers/gpu/drm/drm_modes.c:1623: warning: Excess function parameter 'connector' description in 'drm_mode_is_420_only'

Signed-off-by: Sean Paul <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm: Fix kerneldoc for atomic_async_update
Daniel Vetter [Mon, 31 Jul 2017 11:17:33 +0000 (13:17 +0200)]
drm: Fix kerneldoc for atomic_async_update

The enumeration of FIXMEs wasn't indented properly.

Fixes: fef9df8b5945 ("drm/atomic: initial support for asynchronous plane update")
Cc: Gustavo Padovan <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/atomic: Update comment to match the code
Thierry Reding [Mon, 31 Jul 2017 09:13:43 +0000 (11:13 +0200)]
drm/atomic: Update comment to match the code

The kerneldoc for drm_atomic_crtc_needs_modeset() is outdated and no
longer reflects the actual code. Fix that up to remove confusion.

Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: rk3328: fix overlay abnormal
Mark yao [Wed, 26 Jul 2017 06:19:39 +0000 (14:19 +0800)]
drm/rockchip: vop: rk3328: fix overlay abnormal

It's a hardware bug, all window's overlay channel reset
value is same, hardware overlay would be die.

so we must initial difference id for each overlay channel.

The Channel register is supported on all vop will full design.
Following is the details for this register
VOP_WIN0_CTRL2
  bit[7:4] win_rid_win0_cbr
       axi read id of win0 cbr channel
  bit[3:0] win_rid_win0_yrgb
       axi read id of win0 yrgb channel

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Jeffy Chen <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodt-bindings: display: rockchip: fill Documents for vop series
Mark yao [Wed, 26 Jul 2017 06:19:35 +0000 (14:19 +0800)]
dt-bindings: display: rockchip: fill Documents for vop series

Signed-off-by: Mark Yao <[email protected]>
Acked-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: add a series of vop support
Mark yao [Wed, 26 Jul 2017 06:19:30 +0000 (14:19 +0800)]
drm/rockchip: vop: add a series of vop support

Vop Full framework now has following vops:
IP version    chipname
  3.1           rk3288
  3.2           rk3368
  3.4           rk3366
  3.5           rk3399 big
  3.6           rk3399 lit
  3.7           rk3228
  3.8           rk3328

The above IP version is from H/W define, some of vop support get
the IP version from VERSION_INFO register, some are not.
hardcode the IP version for each vop to identify them.

major version: used for IP structure, Vop full framework is 3,
               vop little framework is 2.
minor version: on same structure, newer design vop will bigger
               then old one.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Jeffy Chen <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: group vop registers
Mark yao [Fri, 28 Jul 2017 06:06:25 +0000 (14:06 +0800)]
drm/rockchip: vop: group vop registers

Grouping the vop registers facilitates make register
definition clearer, and also is useful for different vop
reuse the same group register.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Jeffy Chen <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: move line_flag_num to interrupt registers
Mark yao [Wed, 26 Jul 2017 06:19:19 +0000 (14:19 +0800)]
drm/rockchip: vop: move line_flag_num to interrupt registers

In the hardware design process, the design of line flags
register is associated with the interrupt register,
placing the line flags in the interrupt definition is
more reasonable, and it would make multi-vop define easilier.

Signed-off-by: Mark Yao <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: move write_relaxed flags to vop register
Mark yao [Wed, 26 Jul 2017 06:19:12 +0000 (14:19 +0800)]
drm/rockchip: vop: move write_relaxed flags to vop register

Since the drm atomic framework, only a small part of the vop
register needs sync write, Currently seems only following registers
need sync write:
   cfg_done, standby and interrupt related register.

All ctrl registers are using the sync write method that is
inefficient, hardcode the write_relaxed flags to vop registers,
then can only do synchronize write for those actual needed register.

Signed-off-by: Mark Yao <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Reviewed-by: Jeffy Chen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: vop: initialize registers directly
Mark yao [Wed, 26 Jul 2017 06:19:05 +0000 (14:19 +0800)]
drm/rockchip: vop: initialize registers directly

At present we are using init_table to initialize some
registers, but the Register init table use un-document define,
it is unreadable, and sometimes we only want to update tiny
bits, init table method is not friendly, it's diffcult to
reuse for difference chips.

To make it clean, initialize registers directly, and drops
init_table mechanism out.

Signed-off-by: Mark Yao <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Reviewed-by: Jeffy Chen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodma-buf/sync_file: Allow multiple sync_files to wrap a single dma-fence
Chris Wilson [Fri, 28 Jul 2017 21:29:51 +0000 (22:29 +0100)]
dma-buf/sync_file: Allow multiple sync_files to wrap a single dma-fence

Up until recently sync_file were create to export a single dma-fence to
userspace, and so we could canabalise a bit insie dma-fence to mark
whether or not we had enable polling for the sync_file itself. However,
with the advent of syncobj, we do allow userspace to create multiple
sync_files for a single dma-fence. (Similarly, that the sw-sync
validation framework also started returning multiple sync-files wrapping
a single dma-fence for a syncpt also triggering the problem.)

This patch reverts my suggestion in commit e24165537312
("dma-buf/sync_file: only enable fence signalling on poll()") to use a
single bit in the shared dma-fence and restores the sync_file->flags for
tracking the bits individually.

Reported-by: Gustavo Padovan <[email protected]>
Fixes: f1e8c67123cf ("dma-buf/sw-sync: Use an rbtree to sort fences in the timeline")
Fixes: e9083420bbac ("drm: introduce sync objects (v4)")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: Gustavo Padovan <[email protected]>
Cc: [email protected]
Cc: <[email protected]> # v4.13-rc1+
Signed-off-by: Gustavo Padovan <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agotinydrm: repaper: add CONFIG_THERMAL dependency
Arnd Bergmann [Thu, 27 Jul 2017 09:58:58 +0000 (11:58 +0200)]
tinydrm: repaper: add CONFIG_THERMAL dependency

The new RePaper driver uses the thermal subsystem, and fails to link
when it is built-in but thermal is a loadable module:

drivers/gpu/drm/tinydrm/repaper.o: In function `repaper_probe':
repaper.c:(.text+0x540): undefined reference to `thermal_zone_get_zone_by_name'
drivers/gpu/drm/tinydrm/repaper.o: In function `repaper_fb_dirty':
repaper.c:(.text+0xff4): undefined reference to `thermal_zone_get_temp'

This adds another Kconfig dependency to prevent the broken configuration,
forcing repaper to be a module too.

Fixes: 3589211e9b03 ("drm/tinydrm: Add RePaper e-ink driver")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 23 Jul 2017 19:16:52 +0000 (21:16 +0200)]
drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Chen Feng <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/nouveau: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 23 Jul 2017 19:16:48 +0000 (21:16 +0200)]
drm/nouveau: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Ben Skeggs <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/omapdrm: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 23 Jul 2017 19:16:46 +0000 (21:16 +0200)]
drm/omapdrm: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Tomi Valkeinen <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/amdgpu: Use the drm_driver.dumb_destroy default
Noralf Trønnes [Sun, 23 Jul 2017 19:16:45 +0000 (21:16 +0200)]
drm/amdgpu: Use the drm_driver.dumb_destroy default

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.

Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:40 +0000 (21:16 +0200)]
drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Mark Yao <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:38 +0000 (21:16 +0200)]
drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: CK Hu <[email protected]>
Cc: Philipp Zabel <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:37 +0000 (21:16 +0200)]
drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults

tinydrm can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/zte: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:36 +0000 (21:16 +0200)]
drm/zte: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Shawn Guo <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/vc4: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:35 +0000 (21:16 +0200)]
drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Eric Anholt <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:34 +0000 (21:16 +0200)]
drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Jyri Sarha <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Jyri Sarha <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:33 +0000 (21:16 +0200)]
drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Maxime Ripard <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/stm: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:32 +0000 (21:16 +0200)]
drm/stm: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Yannick Fertre <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Benjamin Gaignard <[email protected]>
Cc: Vincent Abriou <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Tested-by: Philippe Cornu <[email protected]>
Acked-by: Philippe Cornu <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:30 +0000 (21:16 +0200)]
drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Laurent Pinchart <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:29 +0000 (21:16 +0200)]
drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Laurent Pinchart <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/pl111: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:28 +0000 (21:16 +0200)]
drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Eric Anholt <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/imx: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:25 +0000 (21:16 +0200)]
drm/imx: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Philipp Zabel <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:22 +0000 (21:16 +0200)]
drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Boris Brezillon <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:21 +0000 (21:16 +0200)]
drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Liviu Dudau <[email protected]>
Cc: Brian Starkey <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Brian Starkey <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:20 +0000 (21:16 +0200)]
drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Liviu Dudau <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Brian Starkey <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/arc: Use .dumb_map_offset and .dumb_destroy defaults
Noralf Trønnes [Sun, 23 Jul 2017 19:16:19 +0000 (21:16 +0200)]
drm/arc: Use .dumb_map_offset and .dumb_destroy defaults

This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.

Cc: Alexey Brodkin <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Acked-by: Alexey Brodkin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy
Noralf Trønnes [Sun, 23 Jul 2017 19:16:18 +0000 (21:16 +0200)]
drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy

Almost everyone did end up using GEM as bo, so this adds defaults
for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset
callbacks.

Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/gem: Add drm_gem_dumb_map_offset()
Noralf Trønnes [Sun, 23 Jul 2017 19:16:17 +0000 (21:16 +0200)]
drm/gem: Add drm_gem_dumb_map_offset()

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

Signed-off-by: Noralf Trønnes <[email protected]>
Reviewed-by: Philipp Zabel <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 years agodrm/vc4: Convert more lock requirement comments to lockdep assertions.
Eric Anholt [Tue, 25 Jul 2017 18:27:18 +0000 (11:27 -0700)]
drm/vc4: Convert more lock requirement comments to lockdep assertions.

Since I do my development with lockdep on, this will help make sure I
don't introduce bugs here.

Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Daniel Vetter <[email protected]>
7 years agodrm/vc4: Add an ioctl for labeling GEM BOs for summary stats
Eric Anholt [Tue, 25 Jul 2017 18:27:17 +0000 (11:27 -0700)]
drm/vc4: Add an ioctl for labeling GEM BOs for summary stats

This has proven immensely useful for debugging memory leaks and
overallocation (which is a rather serious concern on the platform,
given that we typically run at about 256MB of CMA out of up to 1GB
total memory, with framebuffers that are about 8MB ecah).

The state of the art without this is to dump debug logs from every GL
application, guess as to kernel allocations based on bo_stats, and try
to merge that all together into a global picture of memory allocation
state.  With this, you can add a couple of calls to the debug build of
the 3D driver and get a pretty detailed view of GPU memory usage from
/debug/dri/0/bo_stats (or when we debug print to dmesg on allocation
failure).

The Mesa side currently labels at the gallium resource level (so you
see that a 1920x20 pixmap has been created, presumably for the window
system panel), but we could extend that to be even more useful with
glObjectLabel() names being sent all the way down to the kernel.

(partial) example of sorted debugfs output with Mesa labeling all
resources:

               kernel BO cache:  16392kb BOs (3)
       tiling shadow 1920x1080:   8160kb BOs (1)
       resource 1920x1080@32/0:   8160kb BOs (1)
scanout resource 1920x1080@32/0:   8100kb BOs (1)
                        kernel:   8100kb BOs (1)

v2: Use strndup_user(), use lockdep assertion instead of just a
    comment, fix an array[-1] reference, extend comment about name
    freeing.

Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Chris Wilson <[email protected]>
7 years agodrm/vc4: Start using u64_to_user_ptr.
Eric Anholt [Tue, 25 Jul 2017 18:27:16 +0000 (11:27 -0700)]
drm/vc4: Start using u64_to_user_ptr.

Chris Wilson pointed out this little cleanup in a review of new code,
so let's fix up the code I was copying from.

Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Daniel Vetter <[email protected]>
7 years agoMerge airlied/drm-next into drm-misc-next
Sean Paul [Wed, 26 Jul 2017 22:39:07 +0000 (18:39 -0400)]
Merge airlied/drm-next into drm-misc-next

Backmerge drm-next with -rc2 in it to pull in a couple stm patches that
were previously incorrectly applied to -misc-next. By picking them up in
the correct manner, git will hopefully fix any errant trees that are out
in the wild.

Signed-off-by: Sean Paul <[email protected]>
7 years agodrm: linux-next: build failure after merge of the drm-misc tree
Stephen Rothwell [Wed, 19 Jul 2017 01:46:57 +0000 (11:46 +1000)]
drm: linux-next: build failure after merge of the drm-misc tree

Hi all,

After merging the drm-misc tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/staging/vboxvideo/vbox_drv.c:235:2: error: unknown field 'set_busid' specified in initializer
  .set_busid = drm_pci_set_busid,
  ^
drivers/staging/vboxvideo/vbox_drv.c:235:15: error: 'drm_pci_set_busid' undeclared here (not in a function)
  .set_busid = drm_pci_set_busid,
               ^
drivers/staging/vboxvideo/vbox_drv.c: In function 'vbox_init':
drivers/staging/vboxvideo/vbox_drv.c:273:9: error: implicit declaration of function 'drm_pci_init' [-Werror=implicit-function-declaration]
  return drm_pci_init(&driver, &vbox_pci_driver);
         ^
drivers/staging/vboxvideo/vbox_drv.c: In function 'vbox_exit':
drivers/staging/vboxvideo/vbox_drv.c:278:2: error: implicit declaration of function 'drm_pci_exit' [-Werror=implicit-function-declaration]
  drm_pci_exit(&driver, &vbox_pci_driver);
  ^

Caused by commits

  5c484cee7ef9 ("drm: Remove drm_driver->set_busid hook")
  10631d724def ("drm/pci: Deprecate drm_pci_init/exit completely")

interacting with commit

  dd55d44f4084 ("staging: vboxvideo: Add vboxvideo to drivers/staging")

from the staging.current tree.

I have applied the following merge fix patch - please check that it
is correct.

From: Stephen Rothwell <[email protected]>
Date: Wed, 19 Jul 2017 11:41:01 +1000
Subject: [PATCH] drm: fixes for staging due to API changes in the drm core

Signed-off-by: Stephen Rothwell <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
7 years agoBackmerge tag 'v4.13-rc2' into drm-next
Dave Airlie [Wed, 26 Jul 2017 22:15:43 +0000 (08:15 +1000)]
Backmerge tag 'v4.13-rc2' into drm-next

Linux 4.13-rc2

This is required for drm-misc fixing.

This page took 0.121006 seconds and 4 git commands to generate.