summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2019-01-25 11:23:07 +0800
committerMaxime Ripard <maxime.ripard@bootlin.com>2019-01-25 10:41:45 +0100
commite2b1d3d9ff5bda2c4caedb86dc4787ee5eb991d3 (patch)
tree4fdf473ec3754e4fc1f00f79644a68d529a1d79e /drivers
parent09e54440979c1cfa7b3f84db00835449c9f63a3a (diff)
drm/sun4i: layer: Assign backend pointer before calling DRM helpers
We might want to use the backend pointer from DRM callbacks that get called within drm_universal_plane_init(), such as the .format_mod_supported callback. Move the assignment of the layer's backend pointer to right after the structure is allocated. 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/20190125032314.20915-5-wens@csie.org
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_layer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index c5a999ca1d72..95d4aaa51a5c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -182,6 +182,8 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
if (!layer)
return ERR_PTR(-ENOMEM);
+ layer->backend = backend;
+
/* possible crtcs are set later */
ret = drm_universal_plane_init(drm, &layer->plane, 0,
&sun4i_backend_layer_funcs,
@@ -195,7 +197,6 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
drm_plane_helper_add(&layer->plane,
&sun4i_backend_layer_helper_funcs);
- layer->backend = backend;
drm_plane_create_alpha_property(&layer->plane);
drm_plane_create_zpos_property(&layer->plane, 0, 0,