Lines Matching defs:state

28 	struct tegra_plane_state *state;
31 if (plane->state)
32 __drm_atomic_helper_plane_destroy_state(plane->state);
34 kfree(plane->state);
35 plane->state = NULL;
37 state = kzalloc(sizeof(*state), GFP_KERNEL);
38 if (state) {
39 plane->state = &state->base;
40 plane->state->plane = plane;
41 plane->state->zpos = p->index;
42 plane->state->normalized_zpos = p->index;
45 state->iova[i] = DMA_MAPPING_ERROR;
52 struct tegra_plane_state *state = to_tegra_plane_state(plane->state);
61 copy->tiling = state->tiling;
62 copy->format = state->format;
63 copy->swap = state->swap;
64 copy->reflect_x = state->reflect_x;
65 copy->reflect_y = state->reflect_y;
66 copy->opaque = state->opaque;
69 copy->blending[i] = state->blending[i];
80 struct drm_plane_state *state)
82 __drm_atomic_helper_plane_destroy_state(state);
83 kfree(state);
111 static int tegra_dc_pin(struct tegra_dc *dc, struct tegra_plane_state *state)
117 for (i = 0; i < state->base.fb->format->num_planes; i++) {
118 struct tegra_bo *bo = tegra_fb_get_plane(state->base.fb, i);
149 state->iova[i] = sg_dma_address(sgt->sgl);
150 state->sgt[i] = sgt;
152 state->iova[i] = phys_addr;
162 struct tegra_bo *bo = tegra_fb_get_plane(state->base.fb, i);
163 struct sg_table *sgt = state->sgt[i];
169 state->iova[i] = DMA_MAPPING_ERROR;
170 state->sgt[i] = NULL;
176 static void tegra_dc_unpin(struct tegra_dc *dc, struct tegra_plane_state *state)
180 for (i = 0; i < state->base.fb->format->num_planes; i++) {
181 struct tegra_bo *bo = tegra_fb_get_plane(state->base.fb, i);
182 struct sg_table *sgt = state->sgt[i];
188 state->iova[i] = DMA_MAPPING_ERROR;
189 state->sgt[i] = NULL;
194 struct drm_plane_state *state)
196 struct tegra_dc *dc = to_tegra_dc(state->crtc);
198 if (!state->fb)
201 drm_gem_fb_prepare_fb(plane, state);
203 return tegra_dc_pin(dc, to_tegra_plane_state(state));
207 struct drm_plane_state *state)
209 struct tegra_dc *dc = to_tegra_dc(state->crtc);
212 tegra_dc_unpin(dc, to_tegra_plane_state(state));
216 struct drm_plane_state *state)
223 crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
227 /* Check plane state for visibility and calculate clipping bounds */
228 err = drm_atomic_helper_check_plane_state(state, crtc_state,
427 struct tegra_plane_state *state)
432 switch (state->format) {
437 state->opaque = false;
441 err = tegra_plane_format_get_alpha(state->format, &format);
445 state->format = format;
446 state->opaque = true;
454 struct tegra_plane_state *state)
459 old = drm_atomic_get_old_plane_state(state->base.state, &tegra->base);
462 if (old->normalized_zpos == state->base.normalized_zpos &&
463 to_tegra_plane_state(old)->opaque == state->opaque)
474 plane_state = drm_atomic_get_plane_state(state->base.state,
504 struct tegra_plane_state *state)
510 for_each_new_plane_in_state(state->base.state, plane, new, i) {
521 state->blending[index].alpha = true;
523 state->blending[index].alpha = false;
525 if (new->normalized_zpos > state->base.normalized_zpos)
526 state->blending[index].top = true;
528 state->blending[index].top = false;
537 state->blending[index].top = (index == 1);
542 struct tegra_plane_state *state)
551 * state may require adjustment and in this case they will be included
552 * into this atom commit, otherwise blending state is unchanged.
554 err = tegra_plane_check_transparency(tegra, state);
559 * All planes are now in the atomic state, walk them up and update
560 * transparency state for each plane.
569 new = drm_atomic_get_new_plane_state(state->base.state, plane);
573 * There is no need to update blending state for the disabled
584 struct tegra_plane_state *state)
588 err = tegra_plane_setup_opacity(tegra, state);
592 err = tegra_plane_setup_transparency(tegra, state);