]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/log
mirror_ubuntu-eoan-kernel.git
6 years agodrm/i915: Restore planes after load detection
Ville Syrjälä [Thu, 22 Mar 2018 15:23:12 +0000 (17:23 +0200)]
drm/i915: Restore planes after load detection

Actually turn the planes back on after were done with
the load detection.

Fixes: 20bdc112bbe4 ("drm/i915: Disable all planes for load detection, v2.")
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-23-ville.syrjala@linux.intel.com
6 years agodrm/zte: Stop consulting plane->crtc
Ville Syrjälä [Mon, 26 Mar 2018 12:14:42 +0000 (15:14 +0300)]
drm/zte: Stop consulting plane->crtc

We want to get rid of plane->crtc on atomic drivers. Stop looking at it.

v2: Use old_state->crtc (Maarten)
v3: s/fb/crtc/ in commit message to actually match the patch (Shawn)

Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180326121442.32009-1-ville.syrjala@linux.intel.com
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm/vmwgfx: Stop consulting plane->fb
Ville Syrjälä [Thu, 22 Mar 2018 15:23:02 +0000 (17:23 +0200)]
drm/vmwgfx: Stop consulting plane->fb

We want to get rid of plane->fb on atomic drivers. Stop looking at it.

Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-13-ville.syrjala@linux.intel.com
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm/sti: Stop consulting plane->fb
Ville Syrjälä [Thu, 22 Mar 2018 15:23:01 +0000 (17:23 +0200)]
drm/sti: Stop consulting plane->fb

We want to get rid of plane->fb on atomic drivers. Stop looking at it.

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-12-ville.syrjala@linux.intel.com
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm/i915: Stop consulting plane->fb
Ville Syrjälä [Thu, 22 Mar 2018 15:22:59 +0000 (17:22 +0200)]
drm/i915: Stop consulting plane->fb

We want to get rid of plane->fb on atomic drivers. Stop looking at it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-10-ville.syrjala@linux.intel.com
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm: Use plane->state->fb over plane->fb
Ville Syrjälä [Thu, 22 Mar 2018 15:22:58 +0000 (17:22 +0200)]
drm: Use plane->state->fb over plane->fb

Stop looking at plane->fb on atomic drivers. Use plane->state->fb
instead.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-9-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm: Make the fb refcount handover less magic
Ville Syrjälä [Thu, 22 Mar 2018 15:22:57 +0000 (17:22 +0200)]
drm: Make the fb refcount handover less magic

Instead of assigning the plane->fb pointer and clearing the fb pointer
to hand over the reference, let's just do it by grabbing another
referece for plane->fb and let fb keep its original one.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-8-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm: Adjust whitespace for legibility
Ville Syrjälä [Thu, 22 Mar 2018 15:22:56 +0000 (17:22 +0200)]
drm: Adjust whitespace for legibility

Add a bit of whitespace here and there to make the code look a bit
more structured.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-7-ville.syrjala@linux.intel.com
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm: Add local 'plane' variable for primary/cursor planes
Ville Syrjälä [Thu, 22 Mar 2018 15:22:55 +0000 (17:22 +0200)]
drm: Add local 'plane' variable for primary/cursor planes

Make the code a bit more readable by storing the plane pointer in a
local variable rather than having to do crtc->{primary,cursor} all the
time.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-6-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm/atomic-helper: WARN if legacy plane fb pointers are bogus when committing duplica...
Ville Syrjälä [Thu, 22 Mar 2018 15:22:54 +0000 (17:22 +0200)]
drm/atomic-helper: WARN if legacy plane fb pointers are bogus when committing duplicated state

drm_atomic_helper_commit_duplicated_state() should only be called
resume/reset/load_detect paths where plane->old_fb should always be
NULL and plane->fb should be equal to the new_plane_state->fb.
Assert that is indeed the case.

Cc: martin.peres@free.fr
Cc: chris@chris-wilson.co.uk
Cc: Dave Airlie <airlied@gmail.com> (v1)
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-5-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm: Clear crtc->primary->crtc when disabling the crtc via setcrtc()
Ville Syrjälä [Thu, 22 Mar 2018 15:22:53 +0000 (17:22 +0200)]
drm: Clear crtc->primary->crtc when disabling the crtc via setcrtc()

Keep the primary->crtc in sync with the state->crtc (also with
primary->fb and state->fb) when disabling the crtc (and thus also
the primary) via setcrtc().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-4-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
6 years agodrm/atomic-helper: Drop plane->fb references only for drm_atomic_helper_shutdown()
Ville Syrjälä [Thu, 22 Mar 2018 15:22:51 +0000 (17:22 +0200)]
drm/atomic-helper: Drop plane->fb references only for drm_atomic_helper_shutdown()

drm_atomic_helper_shutdown() needs to release the reference held by
plane->fb. Since commit 49d70aeaeca8 ("drm/atomic-helper: Fix leak in
disable_all") we're doing that by calling drm_atomic_clean_old_fb() in
drm_atomic_helper_disable_all(). This also leaves plane->fb == NULL
afterwards. However, since drm_atomic_helper_disable_all() is also
used by the i915 gpu reset code
drm_atomic_helper_commit_duplicated_state() then has to undo the
damage and put the correct plane->fb pointers back in (and also
adjust the ref counts to match again as well).

That approach doesn't work so well for load detection as nothing
sets up the plane->old_fb pointers for us. This causes us to
leak an extra reference for each plane->fb when
drm_atomic_helper_commit_duplicated_state() calls
drm_atomic_clean_old_fb() after load detection.

To fix this let's call drm_atomic_clean_old_fb() only for
drm_atomic_helper_shutdown() as that's the only time we need to
actually drop the plane->fb references. In all the other cases
(load detection, gpu reset) we want to leave plane->fb alone.

v2: Don't inflict the clean_old_fbs bool to drivers (Daniel)
v3: Squash in the revert and rewrite the commit msg (Daniel)

Cc: martin.peres@free.fr
Cc: chris@chris-wilson.co.uk
Cc: Dave Airlie <airlied@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-3-ville.syrjala@linux.intel.com
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #pre-squash
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: Use srcu to protect drm_device.unplugged
Noralf Trønnes [Wed, 28 Mar 2018 07:38:35 +0000 (10:38 +0300)]
drm: Use srcu to protect drm_device.unplugged

Use srcu to protect drm_device.unplugged in a race free manner.
Drivers can use drm_dev_enter()/drm_dev_exit() to protect and mark
sections preventing access to device resources that are not available
after the device is gone.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Tested-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: intel-gfx@lists.freedesktop.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1522222715-11814-1-git-send-email-andr2000@gmail.com
6 years agodrm: add parameter explanation for some gem dmabuf_ops
Samuel Li [Mon, 26 Mar 2018 19:22:25 +0000 (15:22 -0400)]
drm: add parameter explanation for some gem dmabuf_ops

To reduce some warnings.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Samuel Li <Samuel.Li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1522092145-12645-1-git-send-email-Samuel.Li@amd.com
6 years agodrm/tinydrm: Make fb_dirty into a lower level hook
Ville Syrjälä [Fri, 23 Mar 2018 15:35:09 +0000 (17:35 +0200)]
drm/tinydrm: Make fb_dirty into a lower level hook

mipi_dbi_enable_flush() wants to call the fb->dirty() hook from the
bowels of the .atomic_enable() hook. That prevents us from taking the
plane mutex in fb->dirty() unless we also plumb down the acquire
context.

Instead it seems simpler to split the fb->dirty() into a tinydrm
specific lower level hook that can be called from
mipi_dbi_enable_flush() and from a generic higher level
tinydrm_fb_dirty() helper. As we don't have a tinydrm specific
vfuncs table we'll just stick it into tinydrm_device directly
for now.

v2: Deal with the fb->dirty() in tinydrm_display_pipe_update() as well (Noralf)

Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: David Lechner <david@lechnology.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180323153509.15287-1-ville.syrjala@linux.intel.com
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Tested-by: Noralf Trønnes <noralf@tronnes.org>
6 years agodrm/simple-kms-helper: Plumb plane state to the enable hook
Ville Syrjälä [Thu, 22 Mar 2018 20:27:37 +0000 (22:27 +0200)]
drm/simple-kms-helper: Plumb plane state to the enable hook

tinydrm enable hook wants to play around with the new fb in
.atomic_enable(), thus we'll need access to the plane state.

Performed with coccinelle:
@r1@
identifier F =~ ".*enable$";
identifier P, CS;
@@
F(
struct drm_simple_display_pipe *P
,struct drm_crtc_state *CS
+ ,struct drm_plane_state *plane_state
)
{
...
}

@@
struct drm_simple_display_pipe *P;
expression E;
@@
{
+ struct drm_plane *plane;
...
+ plane = &P->plane;
P->funcs->enable(P
,E
+ ,plane->state
);
...
}

@@
identifier P, CS;
@@
struct drm_simple_display_pipe_funcs {
...
        void (*enable)(struct drm_simple_display_pipe *P
      ,struct drm_crtc_state *CS
+ ,struct drm_plane_state *plane_state
);
...
};

v2: Pimp the commit message (David)

Cc: Marek Vasut <marex@denx.de>
Cc: Eric Anholt <eric@anholt.net>
Cc: David Lechner <david@lechnology.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322202738.25817-1-ville.syrjala@linux.intel.com
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
6 years agodrm/udl: Get rid of dev->struct_mutex usage
Daniel Vetter [Tue, 27 Mar 2018 08:23:54 +0000 (10:23 +0200)]
drm/udl: Get rid of dev->struct_mutex usage

It's only used to protect our page list, and only when we know we have
a full reference. This means none of these code paths can ever race
with the final unref, and hence we do not need dev->struct_mutex
serialization and can simply switch to our own locking.

For more context the only magic the locked gem_free_object provides is
that it prevents concurrent final unref (and destruction) of gem
objects while anyone is holding dev->struct_mutex. This was used by
i915 (and other drivers) to implement eviction handling with less
headaches.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180327082356.24516-3-daniel.vetter@ffwll.ch
6 years agodrm/rockchip: fixup comment for gem_free_object_unlocked
Daniel Vetter [Tue, 27 Mar 2018 08:23:53 +0000 (10:23 +0200)]
drm/rockchip: fixup comment for gem_free_object_unlocked

Just want to clean out all grep hits. gem_free_object is deprecated.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180327082356.24516-2-daniel.vetter@ffwll.ch
6 years agostaging/vboxvideo: Use gem_free_object_unlocked
Daniel Vetter [Tue, 27 Mar 2018 08:23:52 +0000 (10:23 +0200)]
staging/vboxvideo: Use gem_free_object_unlocked

vboxvideo doesn't use dev->struct_mutex and therefore has no need to use
gem_free_object.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Michael Thayer <michael.thayer@oracle.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180327082356.24516-1-daniel.vetter@ffwll.ch
6 years agodrm/omap: Use normalized zpos for plane placement
Peter Ujfalusi [Wed, 21 Mar 2018 10:20:29 +0000 (12:20 +0200)]
drm/omap: Use normalized zpos for plane placement

Planes with identical zpos value will result undefined behavior:
disappearing planes, screen flickering and it is not supported by the
hardware.

Use normalized zpos to make sure that we don't encounter invalid
configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-7-peter.ujfalusi@ti.com
6 years agodrm: rcar-du: Let core take care of normalizing the zpos
Peter Ujfalusi [Wed, 21 Mar 2018 10:20:28 +0000 (12:20 +0200)]
drm: rcar-du: Let core take care of normalizing the zpos

Set the drm_mode_config->normalize_zpos and call drm_atomic_helper_check()
from rcar_du_atomic_check() instead of re implementing the function locally.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-6-peter.ujfalusi@ti.com
6 years agodrm/sti: Let core take care of normalizing the zpos
Peter Ujfalusi [Wed, 21 Mar 2018 10:20:27 +0000 (12:20 +0200)]
drm/sti: Let core take care of normalizing the zpos

Instead of re-implementing the drm_atomic_helper_check() locally with just
adding drm_atomic_normalize_zpos() into it, set the
drm_mode_config->normalize_zpos.

Note: the drm_atomic_helper_check() now includes

if (state->legacy_cursor_update)
state->async_update = !drm_atomic_helper_async_check(drm, state);

which was added after the driver moved away from using it
(38d868e41c4b9250d5a115c049dc2d48f4909581 drm: Don't force all planes to
be added to the state due to zpos)

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Benjamin Gaignard <benjamin.gaignard@linaro.org>
CC: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-5-peter.ujfalusi@ti.com
6 years agodrm/tegra: Let core take care of normalizing the zpos
Peter Ujfalusi [Wed, 21 Mar 2018 10:20:26 +0000 (12:20 +0200)]
drm/tegra: Let core take care of normalizing the zpos

Set the drm_mode_config->normalize_zpos and call the generic
drm_atomic_helper_check() instead of duplicating it within
tegra_atomic_check().

Call tegra_display_hub_atomic_check() after the drm_atomic_helpre_check()
returned without error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-4-peter.ujfalusi@ti.com
6 years agodrm/exynos: Let core take care of normalizing the zpos
Peter Ujfalusi [Wed, 21 Mar 2018 10:20:25 +0000 (12:20 +0200)]
drm/exynos: Let core take care of normalizing the zpos

Instead of re-implementing the drm_atomic_helper_check() locally with just
adding drm_atomic_normalize_zpos() into it, set the
drm_mode_config->normalize_zpos.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Inki Dae <inki.dae@samsung.com>
CC: Joonyoung Shim <jy0922.shim@samsung.com>
CC: Seung-Woo Kim <sw0312.kim@samsung.com>
CC: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-3-peter.ujfalusi@ti.com
6 years agodrm: Add drm_mode_config->normalize_zpos boolean
Peter Ujfalusi [Wed, 21 Mar 2018 10:20:24 +0000 (12:20 +0200)]
drm: Add drm_mode_config->normalize_zpos boolean

Instead of drivers duplicating the drm_atomic_helper_check() code to be
able to normalize the zpos they can use the normalize_zpos flag to let the
drm core to do it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321102029.15248-2-peter.ujfalusi@ti.com
6 years agodrm: make drm_core_check_feature() bool that it is
Jani Nikula [Tue, 27 Mar 2018 20:47:22 +0000 (23:47 +0300)]
drm: make drm_core_check_feature() bool that it is

Bool is the more appropriate return type here, use it.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180327204722.31246-3-jani.nikula@intel.com
6 years agodrm: remove old documentation comment cruft from drmP.h
Jani Nikula [Tue, 27 Mar 2018 20:47:21 +0000 (23:47 +0300)]
drm: remove old documentation comment cruft from drmP.h

Throw out the leftovers.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180327204722.31246-2-jani.nikula@intel.com
6 years agodrm: prefer inline over __inline__
Jani Nikula [Tue, 27 Mar 2018 20:47:20 +0000 (23:47 +0300)]
drm: prefer inline over __inline__

Remove last users of __inline__.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180327204722.31246-1-jani.nikula@intel.com
6 years agodrm/dp/mst: Fix off-by-one typo when dump payload table
Andy Shevchenko [Mon, 19 Mar 2018 14:19:32 +0000 (16:19 +0200)]
drm/dp/mst: Fix off-by-one typo when dump payload table

It seems there is a classical off-by-one typo from the beginning
when commit

  ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)")

introduced a new helper.

Fix a typo by introducing a macro constant.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180319141932.37290-1-andriy.shevchenko@linux.intel.com
6 years agodrm/tinydrm: Use gem_free_object_unlocked
Daniel Vetter [Thu, 22 Mar 2018 10:51:28 +0000 (11:51 +0100)]
drm/tinydrm: Use gem_free_object_unlocked

tinydrm doesn't use dev->struct_mutex and therefore has no need to use
gem_free_object.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322105133.11211-2-daniel.vetter@ffwll.ch
6 years agodrm/scdc-helper: Convert errors into debug messages
Ville Syrjälä [Fri, 23 Mar 2018 18:25:37 +0000 (20:25 +0200)]
drm/scdc-helper: Convert errors into debug messages

Since we may attempt to reconfigure SCDC when the sink has already been
disconnected we probably shouldn't scare the user with errors in dmesg
that are 100% expected in that case. Just leave it up to the caller
whether to print an error message or not, and just output debug
messages from the helper itself.

Cc: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180323182537.30784-1-ville.syrjala@linux.intel.com
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
6 years agodrm/gem: Document that handle_create must be the last step
Daniel Vetter [Thu, 22 Mar 2018 08:02:33 +0000 (09:02 +0100)]
drm/gem: Document that handle_create must be the last step

It published the gem object to userspace, by that point other threads
can guess the id and start using it. And gem IDs are _very_ easy to
guess (it's just an idr).

Since gem objects is the only thing we allow drivers to create
themselves (all the kms/prime/syncobj stuff is handled by the core) no
other functions seem to be in need of this clarification.

Motivated by reviewing the xen-front kms driver.

Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322080233.17266-1-daniel.vetter@ffwll.ch
6 years agogpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
Arushi Singhal [Sun, 25 Mar 2018 18:01:33 +0000 (23:31 +0530)]
gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry

It's better to use list_entry instead of list_{next/prev}_entry
as it makes the code more clear to read.
This patch replace list_entry with list_{next/prev}_entry.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1522000893-5331-3-git-send-email-arushisinghal19971997@gmail.com
6 years agogpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
Arushi Singhal [Sun, 25 Mar 2018 18:01:32 +0000 (23:31 +0530)]
gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry

It's better to use list_entry instead of list_{next/prev}_entry
as it makes the code more clear to read.
This patch replace list_entry with list_{next/prev}_entry.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1522000893-5331-2-git-send-email-arushisinghal19971997@gmail.com
6 years agodrm: Remove drm_property_{un/reference}_blob aliases
Haneen Mohammed [Tue, 20 Mar 2018 13:37:49 +0000 (09:37 -0400)]
drm: Remove drm_property_{un/reference}_blob aliases

This patch remove the compatibility aliases
drm_property_{reference/unreference}_blob of
drm_property_blob_{get/put} since all callers have been converted to the
prefered _{get/put}.

Remove the helpers from the semantic patch drm-get-put-cocci.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180320133749.GA11695@haneen-VirtualBox
6 years agoMerge airlied/drm-next into drm-misc-next
Sean Paul [Wed, 21 Mar 2018 13:40:55 +0000 (09:40 -0400)]
Merge airlied/drm-next into drm-misc-next

Refresh -misc-next

Signed-off-by: Sean Paul <seanpaul@chromium.org>
6 years agodrm/qxl: Replace drm_gem_object_reference/unreference() with _get/put()
Santha Meena Ramamoorthy [Tue, 20 Mar 2018 18:29:27 +0000 (11:29 -0700)]
drm/qxl: Replace drm_gem_object_reference/unreference() with _get/put()

Replace drm_gem_object_reference/unreference function with *_get/put()
suffixes, because it is shorter and consistent with the kernel
kref_get/put() functions. The following Coccinelle script was used:

@@
expression e;
@@

(
-drm_gem_object_reference(e);
+drm_gem_object_get(e);
|
-drm_gem_object_unreference(e);
+drm_gem_object_put(e);
|
-drm_gem_object_unreference_unlocked(e);
+drm_gem_object_put_unlocked(e);
)

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1521570567-22519-1-git-send-email-santhameena13@gmail.com
6 years agoMerge tag 'omapdrm-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux...
Dave Airlie [Wed, 21 Mar 2018 04:07:03 +0000 (14:07 +1000)]
Merge tag 'omapdrm-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm patches for v4.17

* Fix sparse warnings from omapdrm
* HPD support for DVI connector
* Big cleanup to remove static variables

* tag 'omapdrm-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (69 commits)
  drm/omap: fix compile error when DPI is disabled
  drm/omap: fix compile error when debugfs is disabled
  drm: omapdrm: displays: panel-dsi-cm: Fix field access before set
  drm/omap: cleanup color space conversion
  drm/omap: Allow HDMI audio setup even if we do not have video configured
  drm/omap: fix maximum sizes
  drm/omap: add writeback funcs to dispc_ops
  drm/omap: fix scaling limits for WB
  drm/omap: fix WB height with interlace
  drm/omap: fix WBDELAYCOUNT with interlace
  drm/omap: fix WBDELAYCOUNT for HDMI
  drm/omap: set WB channel-in in wb_setup()
  drm/omap: Add pclk setting case when channel is DSS_WB
  drm/omap: dispc: disp_wb_setup to check return code
  drm/omap: remove leftover enums
  dt-bindings: display: add HPD gpio to DVI connector
  drm/omap: add HPD support to connector-dvi
  drm/omap: Init fbdev emulation only when we have displays
  drm/omap: cleanup fbdev init/free
  drm/omap: fix omap_fbdev_free() when omap_fbdev_create() wasn't called
  ...

6 years agoMerge tag 'drm-msm-next-2018-03-20' of git://people.freedesktop.org/~robclark/linux...
Dave Airlie [Wed, 21 Mar 2018 04:06:00 +0000 (14:06 +1000)]
Merge tag 'drm-msm-next-2018-03-20' of git://people.freedesktop.org/~robclark/linux into drm-next

Updates for 4.17.  Sorry, running a bit late on this, didn't have a
chance to send pull-req before heading to linaro.  But it has all been
in linux-next for a while.  Main updates:

 + DSI updates from 10nm / SDM845
 + fix for race condition with a3xx/a4xx fence completion irq
 + some refactoring/prep work for eventual a6xx support (ie. when we have
   a userspace)
 + a5xx debugfs enhancements
 + some mdp5 fixes/cleanups to prepare for eventually merging writeback
   support (ie. when we have a userspace)

* tag 'drm-msm-next-2018-03-20' of git://people.freedesktop.org/~robclark/linux: (36 commits)
  drm/msm: fix building without debugfs
  drm/msm/mdp5: don't pre-reserve LM's if no dual-dsi
  drm/msm/mdp5: add missing LM flush bits
  drm/msm/mdp5: print a bit more of the atomic state
  drm/msm/mdp5: rework CTL START signal handling
  drm/msm: Trigger fence completion from GPU
  drm/msm/dsi: fix direct caller of msm_gem_free_object()
  drm/msm: strip out msm_fence_cb
  drm/msm: rename mdp->disp
  drm/msm/dsi: Fix potential NULL pointer dereference in msm_dsi_modeset_init
  drm/msm/adreno/a5xx_debugfs: fix potential NULL pointer dereference
  drm/msm/dsi: Get byte_intf_clk only for versions that need it
  drm/msm/adreno: Use generic function to load firmware to a buffer object
  drm/msm/adreno: Define a list of firmware files to load per target
  drm/msm/adreno: Rename gpmufw to powerfw
  drm/msm: Pass the correct aperture end to drm_mm_init
  drm/msm/gpu: Set number of clocks to 0 if the list allocation fails
  drm/msm: Replace gem_object deprecated functions
  drm/msm/hdmi: fix semicolon.cocci warnings
  drm/msm/mdp5: Fix trailing semicolon
  ...

6 years agoMerge tag 'drm/tegra/for-4.17-rc1' of git://anongit.freedesktop.org/tegra/linux into...
Dave Airlie [Wed, 21 Mar 2018 04:04:38 +0000 (14:04 +1000)]
Merge tag 'drm/tegra/for-4.17-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v4.17-rc1

This fixes mmap() for fbdev devices by providing a custom implementation
based on the KMS variant. This is a fairly exotic case these days, hence
why it is not flagged for stable.

There is also support for dedicating one of the overlay planes to serve
as a hardware cursor on older Tegra that did support hardware cursors
but not RGBA formats for it.

Planes will now also export the IN_FORMATS property by supporting the
various block-linear tiling modifiers for RGBA pixel formats.

Other than that, there's a bit of cleanup of DMA API abuse, use of the
private object infrastructure for global state (rather than subclassing
atomic state objects) and an implementation of ->{begin,end}_cpu_access
callbacks for PRIME exported buffers, which allow users to perform cache
maintenance on these buffers.

* tag 'drm/tegra/for-4.17-rc1' of git://anongit.freedesktop.org/tegra/linux:
  drm/tegra: prime: Implement ->{begin,end}_cpu_access()
  drm/tegra: gem: Map pages via the DMA API
  drm/tegra: hub: Use private object for global state
  drm/tegra: fb: Properly support linear modifier
  drm/tegra: plane: Support format modifiers
  drm/tegra: dc: Dedicate overlay plane to cursor on older Tegra's
  drm/tegra: plane: Make tegra_plane_get_overlap_index() static
  drm/tegra: fb: Implement ->fb_mmap() callback
  drm/tegra: gem: Make __tegra_gem_mmap() available more widely
  drm/tegra: gem: Reshuffle declarations

6 years agoMerge branch 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-next
Dave Airlie [Wed, 21 Mar 2018 03:58:43 +0000 (13:58 +1000)]
Merge branch 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-next

I have accumulated some patches as we went through some internal testing
for mali-dp and I was waiting for the YUV2RGB patches to land in your
tree.

* 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld:
  drm: mali-dp: Add YUV->RGB conversion support for video layers
  drm: mali-dp: Turn off CRTC vblank when removing module.
  drm: arm: malidp: Use drm_atomic_helper_shutdown() to disable planes on removal
  drm: arm: malidp: Don't destroy planes manually in error handlers
  drm/mali-dp: Fix malidp_atomic_commit_hw_done() for event sending.
  drm/arm/malidp: Disable pixel alpha blending for colors that do not have alpha
  drm: mali-dp: Fix bug on scaling with rotation
  drm/mali-dp: Don't enable scaling engine for planes that only rotate.
  drm: mali-dp: Uninitialized variable in malidp_se_check_scaling()
  drm/mali-dp: Align pitch size to be multiple of bus burst read size.
  drm/mali-dp: Rotated planes need a larger pitch size.

6 years agoMerge branch 'drm-next-4.17' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Wed, 21 Mar 2018 01:46:05 +0000 (11:46 +1000)]
Merge branch 'drm-next-4.17' of git://people.freedesktop.org/~agd5f/linux into drm-next

- Continued cleanup and restructuring of powerplay
- Fetch VRAM type from vbios rather than hardcoding for SOC15 asics
- Allow ttm to drop its backing store when drivers don't need it
- DC bandwidth calc updates
- Enable DC backlight control pre-DCE11 asics
- Enable DC on all supported asics
- DC Fixes for planes due to the way our hw is ordered vs what drm expects
- DC CTM/regamma fixes
- Misc cleanup and bug fixes

* 'drm-next-4.17' of git://people.freedesktop.org/~agd5f/linux: (89 commits)
  amdgpu/dm: Default PRE_VEGA ASIC support to 'y'
  drm/amd/pp: Remove the cgs wrapper for notify smu version on APU
  drm/amd/display: fix dereferencing possible ERR_PTR()
  drm/amd/display: Refine disable VGA
  drm/amdgpu: Improve documentation of bo_ptr in amdgpu_bo_create_kernel
  drm/radeon: Don't turn off DP sink when disconnected
  drm/amd/pp: Rename file name cz_* to smu8_*
  drm/amd/pp: Replace function/struct name cz_* with smu8_*
  drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c
  drm/amd/pp: Mv cz uvd/vce pg/dpm functions to cz_hwmgr.c
  drm/amd/pp: Remove dead header file pp_asicblocks.h
  drm/amd/pp: Delete dead code on cz_clockpowergating.c
  drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c
  drm/amdgpu: Remove wrapper layer of smu ip functions
  drm/amdgpu: Don't compared ip_block_type with ip_block_index
  drm/amdgpu: Plus NULL function pointer check
  drm/amd/pp: Move helper functions to smu_help.c
  drm/amd/pp: Replace rv_* with smu10_*
  drm/amd/pp: Fix function parameter not correct
  drm/amd/pp: Add rv_copy_table_from/to_smc to smu backend function table
  ...

6 years agodrm/meson: Fix potential NULL dereference in meson_drv_bind_master()
Wei Yongjun [Tue, 20 Mar 2018 14:20:30 +0000 (14:20 +0000)]
drm/meson: Fix potential NULL dereference in meson_drv_bind_master()

platform_get_resource_byname() may fail and return NULL, so we should
better check it's return value to avoid a NULL pointer dereference
a bit later in the code.

This is detected by Coccinelle semantic patch.

@@
expression pdev, res, n, t, e, e1, e2;
@@

res = platform_get_resource_byname(pdev, t, n);
+ if (!res)
+   return -EINVAL;
... when != res == NULL
e = devm_ioremap(e1, res->start, e2);

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1521555630-29284-1-git-send-email-weiyongjun1@huawei.com
6 years agodrm/sun4i: backend: Support YUV planes
Maxime Ripard [Thu, 1 Mar 2018 19:18:46 +0000 (20:18 +0100)]
drm/sun4i: backend: Support YUV planes

Now that we have the guarantee that we will have only a single YUV plane,
actually support them. The way it works is not really straightforward,
since we first need to enable the YUV mode in the plane that we want to
setup, and then we have a few registers to setup the YUV buffer and
parameters.

We also need to setup the color correction to actually have something
displayed.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/66088c1398bd3189123f28a89a7ccc669fe9f296.1519931807.git-series.maxime.ripard@bootlin.com
6 years agodrm/sun4i: backend: Check that we only have a single YUV plane
Maxime Ripard [Thu, 1 Mar 2018 19:18:45 +0000 (20:18 +0100)]
drm/sun4i: backend: Check that we only have a single YUV plane

Just like for the frontend, a single plane can use a YUV format. Make sure
we have that constraint covered in our atomic_check.

This is preliminary to the actual YUV support to make sure we don't end up
in an impossible to support situation.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2f8586493d9139b12efe7e94f65e9a149f818e0e.1519931807.git-series.maxime.ripard@bootlin.com
6 years agodrm/sun4i: Add driver support for A80 display pipeline
Chen-Yu Tsai [Thu, 15 Mar 2018 11:41:33 +0000 (19:41 +0800)]
drm/sun4i: Add driver support for A80 display pipeline

This patch adds support for the compatible strings of the A80 display
pipeline.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180315114136.24747-6-wens@csie.org
6 years agodrm/sun4i: Add compatible strings for the A80 display pipeline
Chen-Yu Tsai [Thu, 15 Mar 2018 11:41:32 +0000 (19:41 +0800)]
drm/sun4i: Add compatible strings for the A80 display pipeline

This patch adds compatible strings for the remaining documented
components of the Allwinner A80 display pipeline.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180315114136.24747-5-wens@csie.org
6 years agodrm/sun4i: Add support for A80 TCONs
Chen-Yu Tsai [Thu, 15 Mar 2018 11:41:31 +0000 (19:41 +0800)]
drm/sun4i: Add support for A80 TCONs

The Allwinner A80 SoC has 2 documented TCONs. The display pipeline
diagram from the user manual shows a third TCON, but it's missing
an interrupt line, and its registers are not explained either.
It's also not used in Allwinner's vendor BSP.

The first TCON only has channel 0, for LCD panel output. The TCON
hardware setup is peculiar in that the eDP reset must also be
deasserted to allow access to the TCON. How the eDP module is wired
in the SoC itself is never explained.

The second TCON only has channel 1, and its output is connected to
the HDMI encoder block.

This patch adds a "needs_edp_reset" field to the tcon quirks structure,
and adds quirks and compatible strings for the 2 documented TCONs.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180315114136.24747-4-wens@csie.org
6 years agodrm/sun4i: Add DT binding for Detail Enhancement Unit in Allwinner A80 SoC
Chen-Yu Tsai [Thu, 15 Mar 2018 11:41:30 +0000 (19:41 +0800)]
drm/sun4i: Add DT binding for Detail Enhancement Unit in Allwinner A80 SoC

The display pipeline on the A80 SoC has what is called the Detail
Enhancement Unit, or DEU for short, block in between the display
frontend and backend. This unit can sharpen images in both luma
and chroma channels. It seems to also do colorspace conversion.

This patch adds the device tree binding for this hardware block.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180315114136.24747-3-wens@csie.org
6 years agodrm/sun4i: Add compatible strings for A80 TCONs
Chen-Yu Tsai [Thu, 15 Mar 2018 11:41:29 +0000 (19:41 +0800)]
drm/sun4i: Add compatible strings for A80 TCONs

The A80 has 2 or 3 TCONs. The documentation and vendor kernel are very
vague about the third TCON, to the point that it might not exist.

In the documentation, the first TCON is missing channel 1, and the
second is missing channel 0. However the vendor kernel seems to be
able to use them regardless. Here we model them like the old TCONs.

An oddity is that TCON0 requires the reset control for the eDP block
to be deasserted, for any register access to stick.

This patch adds compatible strings for TCON0 and TCON1, with TCON0
requiring an extra "edp" reset control.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180315114136.24747-2-wens@csie.org
6 years agodrm: Reduce object size of DRM_DEV_<LEVEL> uses
Joe Perches [Fri, 16 Mar 2018 20:56:27 +0000 (13:56 -0700)]
drm: Reduce object size of DRM_DEV_<LEVEL> uses

These macros are similar to the DRM_<LEVEL> with the addition
of a struct device * to the arguments.

Convert the single drm_dev_printk function into 2 separate functions.
drm_dev_printk with a KERN_<LEVEL> * for generic use and drm_dev_dbg
for conditional masked use.

Remove the __func__ argument and use __builtin_return_address(0) to be
similar to the DRM_<LEVEL> macros uses.

Convert the DRM_DEV_<LEVEL> macros to remove now unnecessary arguments
and use a consistent style.

These macros are rarely used in the generic gpu/drm code so the code
size does not change much for a defconfig, but when more drivers are
enabled, there is ~4k savings.

Many of these macros have no existing use at all.

$ size -t drivers/gpu/drm/built-in.a | tail -1
1877530   44651     995 1923176  1d5868 (TOTALS)

$ size -t drivers/gpu/drm/built-in.a | tail -1
1877527   44651     995 1923173  1d5865 (TOTALS)

$ size -t drivers/gpu/drm/built-in.a | tail -1
17166750 2689238  108352 19964340 130a1b4 (TOTALS)

$ size -t drivers/gpu/drm/built-in.a | tail -1
17168888 2691734  108352 19968974 130b3ce (TOTALS)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/e5c164946e15375ac71b69b75f296efdf0b76e6d.1521233717.git.joe@perches.com
6 years agodrm/doc: Put all driver docs into a separate chapter
Daniel Vetter [Fri, 16 Mar 2018 07:59:26 +0000 (08:59 +0100)]
drm/doc: Put all driver docs into a separate chapter

We have quite a few driver docs now, which is great, but having them
all in the top-level gpu documentation chapter makes it harder to spot
the core/shared bits.

Stuff them into a separate chapter and ecourage people to add even
more!

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180316075926.13584-1-daniel.vetter@ffwll.ch
6 years agodrm: dma_bufs: Fixed checkpatch issues
Paul McQuade [Mon, 19 Mar 2018 00:52:22 +0000 (00:52 +0000)]
drm: dma_bufs: Fixed checkpatch issues

Fix a couple of checkpatch issues

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
[seanpaul squashed series of 4 into one patch, and changed commit msg]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180319005225.1545-1-paulmcquad@gmail.com
6 years agodrm: remove drm_mode_object_{un/reference} aliases
Haneen Mohammed [Mon, 19 Mar 2018 05:58:20 +0000 (01:58 -0400)]
drm: remove drm_mode_object_{un/reference} aliases

This patch remove the compatibility aliases
drm_mode_object_{reference/unreference} of drm_mode_object_{get/put}
since all callers have been converted to the prefered _{get/put}.

Remove the helpers from the semantic patch drm-get-put-cocci.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180319055820.GA17502@haneen-VirtualBox
6 years agodrm/msm: fix building without debugfs
Arnd Bergmann [Mon, 26 Feb 2018 09:49:26 +0000 (10:49 +0100)]
drm/msm: fix building without debugfs

The adreno driver stopped building when CONFIG_DEBUGFS is disabled:

drivers/gpu/drm/msm/adreno/adreno_device.c: In function 'adreno_load_gpu':
drivers/gpu/drm/msm/adreno/adreno_device.c:153:16: error: 'const struct msm_gpu_funcs' has no member named 'debugfs_init'
  if (gpu->funcs->debugfs_init) {
                ^~
drivers/gpu/drm/msm/adreno/adreno_device.c:154:13: error: 'const struct msm_gpu_funcs' has no member named 'debugfs_init'
   gpu->funcs->debugfs_init(gpu, dev->primary);
             ^~

This adds an #ifdef around the code that references the hidden
pointer.

Fixes: 331dc0bc195b ("drm/msm: add a5xx specific debugfs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm/mdp5: don't pre-reserve LM's if no dual-dsi
Rob Clark [Mon, 19 Feb 2018 13:31:29 +0000 (08:31 -0500)]
drm/msm/mdp5: don't pre-reserve LM's if no dual-dsi

If there is only a single DSI interface, don't reserve the first two
layer-mixers for the dual-DSI use-case.

This was causing problems for WB, not being able to assign a LM, on
8x16, which has only two LM's and a single DSI.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm/mdp5: add missing LM flush bits
Rob Clark [Mon, 19 Feb 2018 13:29:33 +0000 (08:29 -0500)]
drm/msm/mdp5: add missing LM flush bits

For some reason, layer-mixer 3 and 4 were missing.  LM3 is used for
writeback on 8x16.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm/mdp5: print a bit more of the atomic state
Rob Clark [Mon, 19 Feb 2018 13:27:13 +0000 (08:27 -0500)]
drm/msm/mdp5: print a bit more of the atomic state

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm/mdp5: rework CTL START signal handling
Rob Clark [Mon, 19 Feb 2018 13:17:06 +0000 (08:17 -0500)]
drm/msm/mdp5: rework CTL START signal handling

For DSI cmd-mode and writeback, we need to write the CTL's START
register to kick things off, but we only want to do that once both
the encoder and the crtc have a chance to write their corresponding
flush bits.  The difficulty is that when there is a full modeset
(ie. encoder state has changed) we want to defer the start until
encoder->enable().  But if only plane's have changed, we want to do
this from crtc->commit().

The start_mask was a previous attempt to handle this, but it didn't
really do the right thing since atomic conversion.

Instead track in the crtc state that the start should be deferred,
set to try from encoder's (or in future writeback's) atomic_check().
This way the state is part of the atomic state, and rollback can
work properly if an atomic test fails.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm: Trigger fence completion from GPU
Bjorn Andersson [Wed, 14 Feb 2018 06:46:58 +0000 (22:46 -0800)]
drm/msm: Trigger fence completion from GPU

Interrupt commands causes the CP to trigger an interrupt as the command
is processed, regardless of the GPU being done processing previous
commands. This is seen by the interrupt being delivered before the
fence is written on 8974 and is likely the cause of the additional
CP_WAIT_FOR_IDLE workaround found for a306, which would cause the CP to
wait for the GPU to go idle before triggering the interrupt.

Instead we can set the (undocumented) BIT(31) of the CACHE_FLUSH_TS
which will cause a special CACHE_FLUSH_TS interrupt to be triggered from
the GPU as the write event is processed.

Add CACHE_FLUSH_TS to the IRQ masks of A3xx and A4xx and remove the
workaround for A306.

Suggested-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm/dsi: fix direct caller of msm_gem_free_object()
Rob Clark [Wed, 14 Feb 2018 16:14:23 +0000 (11:14 -0500)]
drm/msm/dsi: fix direct caller of msm_gem_free_object()

This should be using drm_gem_object_put().  Also since this is done only
in driver unload path, we don't need to synchronize setting tx_gem_obj
to NULL, so juse use the _unlocked() variant.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm: strip out msm_fence_cb
Rob Clark [Wed, 14 Feb 2018 15:46:19 +0000 (10:46 -0500)]
drm/msm: strip out msm_fence_cb

Remnants of pre-dma_fence fencing which got left behind by mistake.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm: rename mdp->disp
Rob Clark [Mon, 12 Feb 2018 13:18:27 +0000 (08:18 -0500)]
drm/msm: rename mdp->disp

Since new display controller is called "dpu" instead of "mdp".  Lets
make the name of the toplevel directory for the display controllers a
bit more generic.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
6 years agodrm/msm/dsi: Fix potential NULL pointer dereference in msm_dsi_modeset_init
Gustavo A. R. Silva [Fri, 2 Feb 2018 12:42:33 +0000 (06:42 -0600)]
drm/msm/dsi: Fix potential NULL pointer dereference in msm_dsi_modeset_init

_dev_ is being dereferenced before it is null checked, hence there
is a potential null pointer dereference.

Fix this by moving the pointer dereference after _dev_ has been
null checked.

Fixes: d4e7f38d70ef ("drm/msm/dsi: check msm_dsi and dsi pointers before use")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm/msm/adreno/a5xx_debugfs: fix potential NULL pointer dereference
Gustavo A. R. Silva [Fri, 2 Feb 2018 12:32:23 +0000 (06:32 -0600)]
drm/msm/adreno/a5xx_debugfs: fix potential NULL pointer dereference

_minor_ is being dereferenced before it is null checked, hence there
is a potential null pointer dereference. Fix this by moving the pointer
dereference after _minor_ has been null checked.

Fixes: 024ad8df763f ("drm/msm: add a5xx specific debugfs")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agodrm: Add PSR version 3 macro
José Roberto de Souza [Sat, 17 Mar 2018 01:38:28 +0000 (18:38 -0700)]
drm: Add PSR version 3 macro

eDP 1.4a specification defines PSR version 3, it PSR2 with the
addition of Y-coordinate support when doing selective update.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180317013828.24182-1-jose.souza@intel.com
6 years agodrm/tegra: prime: Implement ->{begin,end}_cpu_access()
Thierry Reding [Wed, 13 Dec 2017 11:25:14 +0000 (12:25 +0100)]
drm/tegra: prime: Implement ->{begin,end}_cpu_access()

These callbacks allow the exporter to swap in and pin the backing
storage for buffers as well as invalidate the cache in preparation for
accessing the buffer from the CPU, and flush the cache and unpin the
backing storage when the CPU is done modifying the buffer.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agodrm/tegra: gem: Map pages via the DMA API
Thierry Reding [Wed, 13 Dec 2017 11:22:48 +0000 (12:22 +0100)]
drm/tegra: gem: Map pages via the DMA API

When allocating pages, map them with the DMA API in order to invalidate
caches. This is the correct usage of the API and works just as well as
faking up the SG table and using the dma_sync_sg_for_device() function.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agodrm/tegra: hub: Use private object for global state
Thierry Reding [Tue, 28 Nov 2017 10:20:40 +0000 (11:20 +0100)]
drm/tegra: hub: Use private object for global state

Rather than subclass the global atomic state to store the hub display
clock and rate, create a private object and store this data in its
state.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agodrm/vc4_validate: Remove VLA usage
Gustavo A. R. Silva [Tue, 13 Mar 2018 14:31:51 +0000 (09:31 -0500)]
drm/vc4_validate: Remove VLA usage

In preparation to enabling -Wvla, remove VLA. In this particular
case use macro ARRAY_SIZE so the length of array _bo_ can be
computed at preprocessing time.

The use of stack Variable Length Arrays needs to be avoided, as they
can be a vector for stack exhaustion, which can be both a runtime bug
or a security flaw. Also, in general, as code evolves it is easy to
lose track of how big a VLA can get. Thus, we can end up having runtime
failures that are hard to debug.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20180313143151.GA27486@embeddedgus
6 years agoamdgpu/dm: Default PRE_VEGA ASIC support to 'y'
Harry Wentland [Wed, 8 Nov 2017 20:58:25 +0000 (15:58 -0500)]
amdgpu/dm: Default PRE_VEGA ASIC support to 'y'

Even though we default PRE_VEGA support to 'n' upstream in amd-staging
we want to keep it enabled by default.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove the cgs wrapper for notify smu version on APU
Rex Zhu [Thu, 15 Mar 2018 06:45:04 +0000 (14:45 +0800)]
drm/amd/pp: Remove the cgs wrapper for notify smu version on APU

Refine commit f49e9bac191b ("drm/amd/pp: Get and save Rv smu version")

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: fix dereferencing possible ERR_PTR()
Shirish S [Thu, 15 Mar 2018 10:31:00 +0000 (16:01 +0530)]
drm/amd/display: fix dereferencing possible ERR_PTR()

This patch fixes static checker warning caused by
"36cc549d5986: "drm/amd/display: disable CRTCs with
NULL FB on their primary plane (V2)"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/display: Refine disable VGA
Clark Zheng [Thu, 15 Mar 2018 06:02:06 +0000 (14:02 +0800)]
drm/amd/display: Refine disable VGA

bad case won't follow normal sense, it will not enable vga1 as usual, but vga2,3,4 is on.

Signed-off-by: Clark Zheng <clark.zheng@amd.com>
Reviewed-by: Tony Cheng <tony.cheng@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm: Make drm_mode_vrefresh() a bit more accurate
Ville Syrjälä [Tue, 13 Mar 2018 15:07:58 +0000 (17:07 +0200)]
drm: Make drm_mode_vrefresh() a bit more accurate

Do the refresh rate calculation with a single division. This gives
us slightly more accurate results, especially for interlaced since
we don't just double the final truncated result.

We do lose one bit compared to the old way, so with an interlaced
mode the new code can only handle ~2GHz instead of the ~4GHz the
old code handeled.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180313150759.27620-2-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: Nuke the useless 'ret' variable from drm_mode_convert_umode()
Ville Syrjälä [Tue, 13 Mar 2018 15:07:57 +0000 (17:07 +0200)]
drm: Nuke the useless 'ret' variable from drm_mode_convert_umode()

No need to store the return value in a variable since we don't have to
do any unwinding.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180313150759.27620-1-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm/i915: Use drm_color_lut_size()
Ville Syrjälä [Fri, 23 Feb 2018 19:25:06 +0000 (21:25 +0200)]
drm/i915: Use drm_color_lut_size()

Avoid all the sizeof(drm_color_lut) business by using
drm_color_lut_size() to convert the blob length into
number of LUT entries.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180223192506.29992-6-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm/i915: Remove the blob->data casts
Ville Syrjälä [Fri, 23 Feb 2018 19:25:05 +0000 (21:25 +0200)]
drm/i915: Remove the blob->data casts

Now that blob->data is void* again we don't need to cast it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180223192506.29992-5-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm: Introduce drm_color_lut_size()
Ville Syrjälä [Thu, 15 Mar 2018 15:23:38 +0000 (17:23 +0200)]
drm: Introduce drm_color_lut_size()

Provide a small helper to convert the blob length in bytes
to the number of LUT entries.

v2: Add kerneldoc (Daniel)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180315152338.7248-1-ville.syrjala@linux.intel.com
6 years agodrm: Verify gamma/degamma LUT size
Ville Syrjälä [Thu, 15 Mar 2018 15:22:41 +0000 (17:22 +0200)]
drm: Verify gamma/degamma LUT size

While we want to potentially support multiple different gamma/degamma
LUT sizes we can (and should) at least check that the blob length
is a multiple of the LUT entry size.

v2: s/expected_size_mod/expected_elem_size/ (Daniel)
    Add kernel doc (Daniel)
v3: s/we/were/ typo in the docs

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180315152241.7113-1-ville.syrjala@linux.intel.com
6 years agodrm: Remove now pointelss blob->data casts
Ville Syrjälä [Fri, 23 Feb 2018 19:25:02 +0000 (21:25 +0200)]
drm: Remove now pointelss blob->data casts

Now that blob->data is void* again we don't need the casts anymore.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180223192506.29992-2-ville.syrjala@linux.intel.com
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agoRevert "drm: Use a flexible array member for blob property data"
Ville Syrjälä [Fri, 23 Feb 2018 19:25:01 +0000 (21:25 +0200)]
Revert "drm: Use a flexible array member for blob property data"

Using a flexible array for the blob data was a mistake by me. It
forces all users of the blob data to cast blob->data to something
else. void* is clearly superior so let's go back to the original
scheme.

Not a clean revert as the code has moved.

This reverts commit d63f5e6bf6f2a1573ea39c9937cdf5ab0b3a4b77.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180223192506.29992-1-ville.syrjala@linux.intel.com
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agodrm/rockchip: cdn-dp: remove the DP phy switch
Chris Zhong [Fri, 16 Feb 2018 12:09:56 +0000 (13:09 +0100)]
drm/rockchip: cdn-dp: remove the DP phy switch

There are 2 Type-c PHYs in RK3399, but only one DP controller. Hence
only one PHY can connect to DP controller at one time, the other should
be disconnected. The GRF_SOC_CON26 register has a switch bit to do it,
set this bit means enable PHY 1, clear this bit means enable PHY 0.

If the board has 2 Type-C ports, the DP driver get the phy id from
devm_of_phy_get_by_index, and then control this switch according to
this id. But some others board only has one Type-C port, it may be PHY 0
or PHY 1. The dts node id can not tell us the correct PHY id. Hence move
this switch to PHY driver, the PHY driver can distinguish between PHY 0
and PHY 1, and then write the correct register bit.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
[The phy-changes are in the phy-tree now and the cdn-dp wasn't
 enabled at all so far, so this change can go through drm-misc
 alone without causing issues when testing drm-misc]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180216120956.19034-6-enric.balletbo@collabora.com
6 years agodrm: Reduce object size of DRM_ERROR and DRM_DEBUG uses
Joe Perches [Tue, 13 Mar 2018 22:02:15 +0000 (15:02 -0700)]
drm: Reduce object size of DRM_ERROR and DRM_DEBUG uses

drm_printk is used for both DRM_ERROR and DRM_DEBUG with unnecessary
arguments that can be removed by creating separate functins.

Create specific functions for these calls to reduce x86/64 defconfig
size by ~20k.

Modify the existing macros to use the specific calls.

new:
$ size -t drivers/gpu/drm/built-in.a | tail -1
1876562   44542     995 1922099  1d5433 (TOTALS)

old:
$ size -t drivers/gpu/drm/built-in.a | tail -1
1897565   44542     995 1943102  1da63e (TOTALS)

Miscellanea:

o intel_display requires a change to use the specific calls.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/016b5cb84cede20fd0f91ed6965421d99fd5f2ce.1520978414.git.joe@perches.com
6 years agodrm/amdgpu: Improve documentation of bo_ptr in amdgpu_bo_create_kernel
Andrey Grodzovsky [Wed, 14 Mar 2018 15:45:22 +0000 (11:45 -0400)]
drm/amdgpu: Improve documentation of bo_ptr in amdgpu_bo_create_kernel

and amdgpu_bo_create_reserved.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/tegra: fb: Properly support linear modifier
Thierry Reding [Thu, 15 Mar 2018 15:45:45 +0000 (16:45 +0100)]
drm/tegra: fb: Properly support linear modifier

Instead of relying on the tiling attached to a buffer object, make sure
to set the proper tiling for linear buffers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agodrm/tegra: plane: Support format modifiers
Thierry Reding [Thu, 15 Mar 2018 15:44:04 +0000 (16:44 +0100)]
drm/tegra: plane: Support format modifiers

Pass the list of valid format modifiers to planes upon initialization
and implement the ->format_mod_supported() callback so that userspace
can query for the valid combinations of formats and modifiers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
6 years agodrm/radeon: Don't turn off DP sink when disconnected
Michel Dänzer [Wed, 14 Mar 2018 17:14:04 +0000 (18:14 +0100)]
drm/radeon: Don't turn off DP sink when disconnected

Turning off the sink in this case causes various issues, because
userspace expects it to stay on until it turns it off explicitly.

Instead, turn the sink off and back on when a display is connected
again. This dance seems necessary for link training to work correctly.

Bugzilla: https://bugs.freedesktop.org/105308
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Rename file name cz_* to smu8_*
Rex Zhu [Wed, 14 Mar 2018 12:05:12 +0000 (20:05 +0800)]
drm/amd/pp: Rename file name cz_* to smu8_*

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Replace function/struct name cz_* with smu8_*
Rex Zhu [Wed, 14 Mar 2018 09:29:54 +0000 (17:29 +0800)]
drm/amd/pp: Replace function/struct name cz_* with smu8_*

hw ip smu8 was used on CZ/ST,
so use smu8 as the prefix of the function/struct name in powerplay.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c
Rex Zhu [Tue, 13 Mar 2018 08:50:44 +0000 (16:50 +0800)]
drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c

Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Mv cz uvd/vce pg/dpm functions to cz_hwmgr.c
Rex Zhu [Tue, 13 Mar 2018 07:44:42 +0000 (15:44 +0800)]
drm/amd/pp: Mv cz uvd/vce pg/dpm functions to cz_hwmgr.c

1. delete cz_clockpowergating.c/.h files
2. mark uvd/vce dpm/pg functions static

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Remove dead header file pp_asicblocks.h
Rex Zhu [Tue, 13 Mar 2018 07:35:17 +0000 (15:35 +0800)]
drm/amd/pp: Remove dead header file pp_asicblocks.h

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Delete dead code on cz_clockpowergating.c
Rex Zhu [Tue, 13 Mar 2018 07:27:06 +0000 (15:27 +0800)]
drm/amd/pp: Delete dead code on cz_clockpowergating.c

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c
Rex Zhu [Mon, 12 Mar 2018 11:53:01 +0000 (19:53 +0800)]
drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c

make it symmetric with amdgpu_ucode_init_bo in amd_powerplay.c

refine the "commit b22558bb4ff8fc9fe925222f90297d7a03a5fb20"

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Remove wrapper layer of smu ip functions
Rex Zhu [Mon, 12 Mar 2018 11:52:23 +0000 (19:52 +0800)]
drm/amdgpu: Remove wrapper layer of smu ip functions

1. delete amdgpu_powerplay.c used for wrapping smu ip functions
2. delete struct pp_instance,
3. make struct hwmgr as the smu hw handle.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Don't compared ip_block_type with ip_block_index
Rex Zhu [Wed, 14 Mar 2018 07:38:48 +0000 (15:38 +0800)]
drm/amdgpu: Don't compared ip_block_type with ip_block_index

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Plus NULL function pointer check
Rex Zhu [Mon, 12 Mar 2018 11:50:38 +0000 (19:50 +0800)]
drm/amdgpu: Plus NULL function pointer check

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Move helper functions to smu_help.c
Rex Zhu [Fri, 9 Mar 2018 11:52:26 +0000 (19:52 +0800)]
drm/amd/pp: Move helper functions to smu_help.c

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/pp: Replace rv_* with smu10_*
Rex Zhu [Tue, 6 Mar 2018 09:28:38 +0000 (17:28 +0800)]
drm/amd/pp: Replace rv_* with smu10_*

Powerplay is for the hw ip smu, for RV, smu10 is used,
so use smu10 as the prefix of the files name/function name.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>