History log of /linux-master/drivers/gpu/drm/armada/armada_plane.h
Revision Date Author Comments
# 1a896130 22-Jun-2021 Daniel Vetter <daniel.vetter@ffwll.ch>

drm/armada: Remove prepare/cleanup_fb hooks

All they do is refcount the fb, which the atomic helpers already do.

This is was necessary with the legacy helpers and I guess just carry
over in the conversion. drm_plane_state always has a full reference
for its ->fb pointer during its entire lifetime,
see __drm_atomic_helper_plane_destroy_state()

Acked-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Russell King <linux@armlinux.org.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210622165511.3169559-10-daniel.vetter@ffwll.ch


# 7c11b99a 19-Feb-2021 Maxime Ripard <maxime@cerno.tech>

drm/atomic: Pass the full state to planes atomic_check

The current atomic helpers have either their object state being passed as
an argument or the full atomic state.

The former is the pattern that was done at first, before switching to the
latter for new hooks or when it was needed.

Let's convert all the remaining helpers to provide a consistent
interface, starting with the planes atomic_check.

The conversion was done using the coccinelle script below plus some
manual changes for vmwgfx, built tested on all the drivers.

@@
identifier plane, plane_state;
symbol state;
@@

struct drm_plane_helper_funcs {
...
int (*atomic_check)(struct drm_plane *plane,
- struct drm_plane_state *plane_state);
+ struct drm_atomic_state *state);
...
}

@ plane_atomic_func @
identifier helpers;
identifier func;
@@

static const struct drm_plane_helper_funcs helpers = {
...,
.atomic_check = func,
...,
};

@@
struct drm_plane_helper_funcs *FUNCS;
identifier f;
identifier dev;
identifier plane, plane_state, state;
@@

f(struct drm_device *dev, struct drm_atomic_state *state)
{
<+...
- FUNCS->atomic_check(plane, plane_state)
+ FUNCS->atomic_check(plane, state)
...+>
}

@ ignores_new_state @
identifier plane_atomic_func.func;
identifier plane, new_plane_state;
@@

func(struct drm_plane *plane, struct drm_plane_state *new_plane_state)
{
... when != new_plane_state
}

@ adds_new_state depends on plane_atomic_func && !ignores_new_state @
identifier plane_atomic_func.func;
identifier plane, new_plane_state;
@@

func(struct drm_plane *plane, struct drm_plane_state *new_plane_state)
{
+ struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane);
...
}

@ depends on plane_atomic_func @
identifier plane_atomic_func.func;
identifier plane, new_plane_state;
@@

func(struct drm_plane *plane,
- struct drm_plane_state *new_plane_state
+ struct drm_atomic_state *state
)
{ ... }

@ include depends on adds_new_state @
@@

#include <drm/drm_atomic.h>

@ no_include depends on !include && adds_new_state @
@@

+ #include <drm/drm_atomic.h>
#include <drm/...>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210219120032.260676-4-maxime@cerno.tech


# 7d62237d 25-Jan-2019 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: move plane address and pitch calculation to atomic_check

Move the plane address and pitch calculations to atomic_check rather
than the update function, so we don't have to probe the interlace
setting for the CRTC while updating the plane.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>


# 1d1547ec 25-Jan-2019 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: fix plane location and size for interlace

When the CRTC is programmed for interlace, we have to halve the Y
parameters for the plane. Rather than doing this in the update
function (which would need the calculation repeated for the old
state as well as the new state), arrange to do the calculation in
atomic_check and save it in our private plane state structure.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>


# 9184ae8d 25-Jan-2019 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: add plane size/location accessors

Add accessors for getting the register values for the plane from the
plane state. This will allow us to generate the values when validating
the plane rather than when programming, which allows us to fix the
interlace handling without adding lots of additional handling in the
update functions.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>


# 82c702cb 30-Jul-2018 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: remove unnecessary armada_plane structure

We no longer require a private armada_plane structure, so eliminate
it, and use the drm_plane structure directly.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>


# b5bae71a 30-Jul-2018 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: push interlace calculation into armada_drm_plane_calc()

Push the interlaced frame calculation down into armada_drm_plane_calc()
which needs to apply the same correction for both the overlay and
primary planes.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>


# 4aafe00e 30-Jul-2018 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: provide pitches from armada_drm_plane_calc_addrs()

Provide the framebuffer pitches from armada_drm_plane_calc_addrs() as
well as the base addresses for each plane. Since this is now about
more than just addresses, rename to armada_drm_plane_calc().

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>


# b4df3ba0 30-Jul-2018 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: pass plane state into armada_drm_plane_calc_addrs()

armada_drm_plane_calc_addrs() gets all its information from the plane
state, so it makes sense to pass the plane state pointer down into this
function, rather than extracting the information in identical ways,
sometimes a couple of layers up.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>


# d40af7b1 30-Jul-2018 Russell King <rmk+kernel@armlinux.org.uk>

drm/armada: move primary plane to separate file

Split out the primary plane support; this is now entirely separate from
the CRTC support.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>