Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit e2b1d3d9 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Maxime Ripard
Browse files

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: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190125032314.20915-5-wens@csie.org
parent 09e54440
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -182,6 +182,8 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
	if (!layer)
	if (!layer)
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);


	layer->backend = backend;

	/* possible crtcs are set later */
	/* possible crtcs are set later */
	ret = drm_universal_plane_init(drm, &layer->plane, 0,
	ret = drm_universal_plane_init(drm, &layer->plane, 0,
				       &sun4i_backend_layer_funcs,
				       &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,
	drm_plane_helper_add(&layer->plane,
			     &sun4i_backend_layer_helper_funcs);
			     &sun4i_backend_layer_helper_funcs);
	layer->backend = backend;


	drm_plane_create_alpha_property(&layer->plane);
	drm_plane_create_alpha_property(&layer->plane);
	drm_plane_create_zpos_property(&layer->plane, 0, 0,
	drm_plane_create_zpos_property(&layer->plane, 0, 0,