Lines Matching +full:layer +full:- +full:primary

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Maxime Ripard <maxime.ripard@free-electrons.com>
23 if (plane->state) { in sun4i_backend_layer_reset()
24 state = state_to_sun4i_layer_state(plane->state); in sun4i_backend_layer_reset()
26 __drm_atomic_helper_plane_destroy_state(&state->state); in sun4i_backend_layer_reset()
29 plane->state = NULL; in sun4i_backend_layer_reset()
34 __drm_atomic_helper_plane_reset(plane, &state->state); in sun4i_backend_layer_reset()
40 struct sun4i_layer_state *orig = state_to_sun4i_layer_state(plane->state); in sun4i_backend_layer_duplicate_state()
47 __drm_atomic_helper_plane_duplicate_state(plane, &copy->state); in sun4i_backend_layer_duplicate_state()
48 copy->uses_frontend = orig->uses_frontend; in sun4i_backend_layer_duplicate_state()
50 return &copy->state; in sun4i_backend_layer_duplicate_state()
69 struct sun4i_layer *layer = plane_to_sun4i_layer(plane); in sun4i_backend_layer_atomic_disable() local
70 struct sun4i_backend *backend = layer->backend; in sun4i_backend_layer_atomic_disable()
72 sun4i_backend_layer_enable(backend, layer->id, false); in sun4i_backend_layer_atomic_disable()
74 if (layer_state->uses_frontend) { in sun4i_backend_layer_atomic_disable()
77 spin_lock_irqsave(&backend->frontend_lock, flags); in sun4i_backend_layer_atomic_disable()
78 backend->frontend_teardown = true; in sun4i_backend_layer_atomic_disable()
79 spin_unlock_irqrestore(&backend->frontend_lock, flags); in sun4i_backend_layer_atomic_disable()
89 struct sun4i_layer *layer = plane_to_sun4i_layer(plane); in sun4i_backend_layer_atomic_update() local
90 struct sun4i_backend *backend = layer->backend; in sun4i_backend_layer_atomic_update()
91 struct sun4i_frontend *frontend = backend->frontend; in sun4i_backend_layer_atomic_update()
93 sun4i_backend_cleanup_layer(backend, layer->id); in sun4i_backend_layer_atomic_update()
95 if (layer_state->uses_frontend) { in sun4i_backend_layer_atomic_update()
101 sun4i_backend_update_layer_frontend(backend, layer->id, in sun4i_backend_layer_atomic_update()
105 sun4i_backend_update_layer_formats(backend, layer->id, plane); in sun4i_backend_layer_atomic_update()
106 sun4i_backend_update_layer_buffer(backend, layer->id, plane); in sun4i_backend_layer_atomic_update()
109 sun4i_backend_update_layer_coord(backend, layer->id, plane); in sun4i_backend_layer_atomic_update()
110 sun4i_backend_update_layer_zpos(backend, layer->id, plane); in sun4i_backend_layer_atomic_update()
111 sun4i_backend_layer_enable(backend, layer->id, true); in sun4i_backend_layer_atomic_update()
117 struct sun4i_layer *layer = plane_to_sun4i_layer(plane); in sun4i_layer_format_mod_supported() local
119 if (IS_ERR_OR_NULL(layer->backend->frontend)) in sun4i_layer_format_mod_supported()
198 struct sun4i_layer *layer; in sun4i_layer_init_one() local
201 layer = devm_kzalloc(drm->dev, sizeof(*layer), GFP_KERNEL); in sun4i_layer_init_one()
202 if (!layer) in sun4i_layer_init_one()
203 return ERR_PTR(-ENOMEM); in sun4i_layer_init_one()
205 layer->id = id; in sun4i_layer_init_one()
206 layer->backend = backend; in sun4i_layer_init_one()
208 if (IS_ERR_OR_NULL(backend->frontend)) { in sun4i_layer_init_one()
215 ret = drm_universal_plane_init(drm, &layer->plane, 0, in sun4i_layer_init_one()
220 dev_err(drm->dev, "Couldn't initialize layer\n"); in sun4i_layer_init_one()
224 drm_plane_helper_add(&layer->plane, in sun4i_layer_init_one()
227 drm_plane_create_alpha_property(&layer->plane); in sun4i_layer_init_one()
228 drm_plane_create_zpos_property(&layer->plane, layer->id, in sun4i_layer_init_one()
229 0, SUN4I_BACKEND_NUM_LAYERS - 1); in sun4i_layer_init_one()
231 return layer; in sun4i_layer_init_one()
242 planes = devm_kcalloc(drm->dev, SUN4I_BACKEND_NUM_LAYERS + 1, in sun4i_layers_init()
245 return ERR_PTR(-ENOMEM); in sun4i_layers_init()
249 struct sun4i_layer *layer; in sun4i_layers_init() local
251 layer = sun4i_layer_init_one(drm, backend, type, i); in sun4i_layers_init()
252 if (IS_ERR(layer)) { in sun4i_layers_init()
253 dev_err(drm->dev, "Couldn't initialize %s plane\n", in sun4i_layers_init()
254 i ? "overlay" : "primary"); in sun4i_layers_init()
255 return ERR_CAST(layer); in sun4i_layers_init()
258 planes[i] = &layer->plane; in sun4i_layers_init()