Lines Matching defs:state

30 	struct tegra_plane_state *state;
33 if (plane->state)
34 __drm_atomic_helper_plane_destroy_state(plane->state);
36 kfree(plane->state);
37 plane->state = NULL;
39 state = kzalloc(sizeof(*state), GFP_KERNEL);
40 if (state) {
41 plane->state = &state->base;
42 plane->state->plane = plane;
43 plane->state->zpos = p->index;
44 plane->state->normalized_zpos = p->index;
47 state->iova[i] = DMA_MAPPING_ERROR;
54 struct tegra_plane_state *state = to_tegra_plane_state(plane->state);
63 copy->tiling = state->tiling;
64 copy->format = state->format;
65 copy->swap = state->swap;
66 copy->reflect_x = state->reflect_x;
67 copy->reflect_y = state->reflect_y;
68 copy->opaque = state->opaque;
69 copy->total_peak_memory_bandwidth = state->total_peak_memory_bandwidth;
70 copy->peak_memory_bandwidth = state->peak_memory_bandwidth;
71 copy->avg_memory_bandwidth = state->avg_memory_bandwidth;
74 copy->blending[i] = state->blending[i];
85 struct drm_plane_state *state)
87 __drm_atomic_helper_plane_destroy_state(state);
88 kfree(state);
140 static int tegra_dc_pin(struct tegra_dc *dc, struct tegra_plane_state *state)
145 for (i = 0; i < state->base.fb->format->num_planes; i++) {
146 struct tegra_bo *bo = tegra_fb_get_plane(state->base.fb, i);
167 state->iova[i] = map->phys;
169 state->iova[i] = bo->iova;
172 state->map[i] = map;
181 host1x_bo_unpin(state->map[i]);
182 state->iova[i] = DMA_MAPPING_ERROR;
183 state->map[i] = NULL;
189 static void tegra_dc_unpin(struct tegra_dc *dc, struct tegra_plane_state *state)
193 for (i = 0; i < state->base.fb->format->num_planes; i++) {
194 host1x_bo_unpin(state->map[i]);
195 state->iova[i] = DMA_MAPPING_ERROR;
196 state->map[i] = NULL;
201 struct drm_plane_state *state)
203 struct tegra_dc *dc = to_tegra_dc(state->crtc);
206 if (!state->fb)
209 err = drm_gem_plane_helper_prepare_fb(plane, state);
213 return tegra_dc_pin(dc, to_tegra_plane_state(state));
217 struct drm_plane_state *state)
219 struct tegra_dc *dc = to_tegra_dc(state->crtc);
222 tegra_dc_unpin(dc, to_tegra_plane_state(state));
225 static int tegra_plane_calculate_memory_bandwidth(struct drm_plane_state *state)
227 struct tegra_plane_state *tegra_state = to_tegra_plane_state(state);
234 if (!state->visible)
237 crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc);
241 src_w = drm_rect_width(&state->src) >> 16;
242 src_h = drm_rect_height(&state->src) >> 16;
243 dst_w = drm_rect_width(&state->dst);
244 dst_h = drm_rect_height(&state->dst);
246 fmt = state->fb->format;
247 soc = to_tegra_dc(state->crtc)->soc;
298 struct drm_plane_state *state)
305 crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
309 /* Check plane state for visibility and calculate clipping bounds */
310 err = drm_atomic_helper_check_plane_state(state, crtc_state,
315 err = tegra_plane_calculate_memory_bandwidth(state);
591 struct tegra_plane_state *state)
596 switch (state->format) {
601 state->opaque = false;
605 err = tegra_plane_format_get_alpha(state->format, &format);
609 state->format = format;
610 state->opaque = true;
618 struct tegra_plane_state *state)
623 old = drm_atomic_get_old_plane_state(state->base.state, &tegra->base);
626 if (old->normalized_zpos == state->base.normalized_zpos &&
627 to_tegra_plane_state(old)->opaque == state->opaque)
638 plane_state = drm_atomic_get_plane_state(state->base.state,
668 struct tegra_plane_state *state)
674 for_each_new_plane_in_state(state->base.state, plane, new, i) {
685 state->blending[index].alpha = true;
687 state->blending[index].alpha = false;
689 if (new->normalized_zpos > state->base.normalized_zpos)
690 state->blending[index].top = true;
692 state->blending[index].top = false;
701 state->blending[index].top = (index == 1);
706 struct tegra_plane_state *state)
715 * state may require adjustment and in this case they will be included
716 * into this atom commit, otherwise blending state is unchanged.
718 err = tegra_plane_check_transparency(tegra, state);
723 * All planes are now in the atomic state, walk them up and update
724 * transparency state for each plane.
733 new = drm_atomic_get_new_plane_state(state->base.state, plane);
737 * There is no need to update blending state for the disabled
748 struct tegra_plane_state *state)
752 err = tegra_plane_setup_opacity(tegra, state);
756 err = tegra_plane_setup_transparency(tegra, state);