Lines Matching refs:state
37 void armada_drm_plane_calc(struct drm_plane_state *state, u32 addrs[2][3],
40 struct drm_framebuffer *fb = state->fb;
43 unsigned int x = state->src.x1 >> 16;
44 unsigned int y = state->src.y1 >> 16;
82 struct drm_plane_state *state)
86 state->fb ? state->fb->base.id : 0);
92 if (state->fb)
93 drm_framebuffer_get(state->fb);
109 struct drm_plane_state *state)
111 struct armada_plane_state *st = to_armada_plane_state(state);
112 struct drm_crtc *crtc = state->crtc;
117 if (!state->fb || WARN_ON(!state->crtc)) {
118 state->visible = false;
122 if (state->state)
123 crtc_state = drm_atomic_get_existing_crtc_state(state->state, crtc);
125 crtc_state = crtc->state;
127 ret = drm_atomic_helper_check_plane_state(state, crtc_state, 0,
134 if ((state->dst.y1 | state->dst.y2) & 1)
136 st->src_hw = drm_rect_height(&state->src) >> 17;
137 st->dst_yx = state->dst.y1 >> 1;
138 st->dst_hw = drm_rect_height(&state->dst) >> 1;
140 st->src_hw = drm_rect_height(&state->src) >> 16;
141 st->dst_yx = state->dst.y1;
142 st->dst_hw = drm_rect_height(&state->dst);
146 st->src_hw |= drm_rect_width(&state->src) >> 16;
148 st->dst_yx |= state->dst.x1 & 0x0000ffff;
150 st->dst_hw |= drm_rect_width(&state->dst) & 0x0000ffff;
152 armada_drm_plane_calc(state, st->addrs, st->pitches, interlace);
161 struct drm_plane_state *state = plane->state;
169 if (!state->fb || WARN_ON(!state->crtc))
174 state->crtc->base.id, state->crtc->name,
175 state->fb->base.id,
176 old_state->visible, state->visible);
178 dcrtc = drm_to_armada_crtc(state->crtc);
182 if (!old_state->visible && state->visible) {
184 if (drm_fb_to_armada_fb(state->fb)->fmt > CFG_420)
188 val = armada_src_hw(state);
191 val = armada_dst_yx(state);
194 val = armada_dst_hw(state);
197 if (old_state->src.x1 != state->src.x1 ||
198 old_state->src.y1 != state->src.y1 ||
199 old_state->fb != state->fb ||
200 state->crtc->state->mode_changed) {
201 armada_reg_queue_set(regs, idx, armada_addr(state, 0, 0),
203 armada_reg_queue_set(regs, idx, armada_addr(state, 1, 0),
205 armada_reg_queue_mod(regs, idx, armada_pitch(state, 0), 0xffff,
208 if (old_state->fb != state->fb ||
209 state->crtc->state->mode_changed) {
210 cfg = CFG_GRA_FMT(drm_fb_to_armada_fb(state->fb)->fmt) |
211 CFG_GRA_MOD(drm_fb_to_armada_fb(state->fb)->mod);
212 if (drm_fb_to_armada_fb(state->fb)->fmt > CFG_420)
214 if (state->visible)
216 if (to_armada_plane_state(state)->interlace)
223 } else if (old_state->visible != state->visible) {
224 cfg = state->visible ? CFG_GRA_ENA : 0;
229 if (drm_rect_width(&old_state->src) != drm_rect_width(&state->src) ||
230 drm_rect_width(&old_state->dst) != drm_rect_width(&state->dst)) {
232 if (drm_rect_width(&state->src) >> 16 !=
233 drm_rect_width(&state->dst))
284 if (plane->state)
285 __drm_atomic_helper_plane_destroy_state(plane->state);
286 kfree(plane->state);
296 if (WARN_ON(!plane->state))
299 st = kmemdup(plane->state, sizeof(*st), GFP_KERNEL);