Lines Matching defs:crc

21 #include "crc.h"
79 core->func->crc->set_ctx(head, ctx);
86 struct nv50_crc *crc = container_of(work, struct nv50_crc, flip_work);
87 struct nv50_head *head = container_of(crc, struct nv50_head, crc);
93 u8 new_idx = crc->ctx_idx ^ 1;
106 crtc->name, crc->ctx_idx, new_idx);
109 nv50_crc_program_ctx(head, &crc->ctx[new_idx]);
118 spin_lock_irq(&crc->lock);
119 crc->ctx_changed = true;
120 spin_unlock_irq(&crc->lock);
134 struct nv50_crc *crc = &head->crc;
137 while (crc->entry_idx < func->num_entries) {
143 output_crc = func->get_entry(head, &crc->ctx[crc->ctx_idx],
144 source, crc->entry_idx);
148 drm_crtc_add_crc_entry(crtc, true, crc->frame, &output_crc);
149 crc->frame++;
150 crc->entry_idx++;
157 struct nv50_crc *crc = &head->crc;
159 nv50_disp(head->base.base.dev)->core->func->crc;
171 if (!spin_trylock(&crc->lock))
174 if (!crc->src)
177 ctx = &crc->ctx[crc->ctx_idx];
178 if (crc->ctx_changed && func->ctx_finished(head, ctx)) {
179 nv50_crc_get_entries(head, func, crc->src);
181 crc->ctx_idx ^= 1;
182 crc->entry_idx = 0;
183 crc->ctx_changed = false;
200 head->base.index, crc->frame);
201 crc->frame++;
207 nv50_crc_get_entries(head, func, crc->src);
210 drm_vblank_work_schedule(&crc->flip_work,
212 + crc->flip_threshold
213 - crc->entry_idx,
217 spin_unlock(&crc->lock);
249 struct nv50_crc *crc = &head->crc;
251 if (!asyh->clr.crc)
254 spin_lock_irq(&crc->lock);
255 crc->src = NV50_CRC_SOURCE_NONE;
256 spin_unlock_irq(&crc->lock);
259 drm_vblank_work_cancel_sync(&crc->flip_work);
281 struct nv50_crc *crc = &head->crc;
284 if (!asyh->set.crc)
287 crc->entry_idx = 0;
288 crc->ctx_changed = false;
289 for (i = 0; i < ARRAY_SIZE(crc->ctx); i++)
290 nv50_crc_reset_ctx(&crc->ctx[i]);
297 nv50_disp(state->dev)->core->func->crc;
305 struct nv50_crc *crc = &head->crc;
306 struct nv50_crc_notifier_ctx *ctx = &crc->ctx[crc->ctx_idx];
308 if (!asyh->clr.crc)
311 if (crc->ctx_changed) {
313 ctx = &crc->ctx[crc->ctx_idx ^ 1];
328 struct nv50_crc *crc = &head->crc;
331 if (!asyh->set.crc)
336 spin_lock_irq(&crc->lock);
338 crc->frame = vbl_count;
339 crc->src = asyh->crc.src;
340 drm_vblank_work_schedule(&crc->flip_work,
341 vbl_count + crc->flip_threshold,
343 spin_unlock_irq(&crc->lock);
356 bool changed = armh->crc.src != asyh->crc.src;
358 if (!armh->crc.src && !asyh->crc.src) {
359 asyh->set.crc = false;
360 asyh->clr.crc = false;
365 asyh->clr.crc = armh->crc.src && armh->state.active;
366 asyh->set.crc = asyh->crc.src && asyh->state.active;
371 if (asyh->clr.crc && asyh->set.crc)
374 asyh->set.crc = false;
375 asyh->clr.crc = false;
408 if (!asyh->clr.crc)
455 struct nv50_crc *crc = &head->crc;
456 const struct nv50_crc_func *func = nv50_disp(dev)->core->func->crc;
468 func->set_src(head, outp->outp.or.id, nv50_crc_source_type(outp, asyh->crc.src),
469 &crc->ctx[crc->ctx_idx]);
475 nv50_disp(head->base.base.dev)->core->func->crc;
550 struct nv50_crc *crc = &head->crc;
551 const struct nv50_crc_func *func = nv50_disp(dev)->core->func->crc;
578 for (i = 0; i < ARRAY_SIZE(head->crc.ctx); i++) {
579 ret = nv50_crc_ctx_init(head, mmu, &crc->ctx[i],
596 asyh->crc.src = source;
610 crc->flip_threshold = func->flip_threshold;
617 for (i = 0; i < ARRAY_SIZE(crc->ctx); i++)
618 nv50_crc_ctx_fini(&crc->ctx[i]);
636 struct nv50_crc *crc = &head->crc;
643 seq_printf(m, "%d\n", crc->flip_threshold);
666 struct nv50_crc *crc = &head->crc;
668 nv50_disp(crtc->dev)->core->func->crc;
687 if (armh->crc.src) {
695 crc->flip_threshold = value;
715 nv50_disp(crtc->dev)->core->func->crc;
732 struct nv50_crc *crc = &head->crc;
734 crc->flip_threshold = func->flip_threshold;
735 spin_lock_init(&crc->lock);
736 drm_vblank_work_init(&crc->flip_work, &head->base.base,
744 const struct nv50_crc_func *func = disp->core->func->crc;