Lines Matching refs:crc

19 #include "crc.h"
77 core->func->crc->set_ctx(head, ctx);
84 struct nv50_crc *crc = container_of(work, struct nv50_crc, flip_work);
85 struct nv50_head *head = container_of(crc, struct nv50_head, crc);
91 u8 new_idx = crc->ctx_idx ^ 1;
104 crtc->name, crc->ctx_idx, new_idx);
107 nv50_crc_program_ctx(head, &crc->ctx[new_idx]);
116 spin_lock_irq(&crc->lock);
117 crc->ctx_changed = true;
118 spin_unlock_irq(&crc->lock);
132 struct nv50_crc *crc = &head->crc;
135 while (crc->entry_idx < func->num_entries) {
141 output_crc = func->get_entry(head, &crc->ctx[crc->ctx_idx],
142 source, crc->entry_idx);
146 drm_crtc_add_crc_entry(crtc, true, crc->frame, &output_crc);
147 crc->frame++;
148 crc->entry_idx++;
155 struct nv50_crc *crc = &head->crc;
157 nv50_disp(head->base.base.dev)->core->func->crc;
169 if (!spin_trylock(&crc->lock))
172 if (!crc->src)
175 ctx = &crc->ctx[crc->ctx_idx];
176 if (crc->ctx_changed && func->ctx_finished(head, ctx)) {
177 nv50_crc_get_entries(head, func, crc->src);
179 crc->ctx_idx ^= 1;
180 crc->entry_idx = 0;
181 crc->ctx_changed = false;
198 head->base.index, crc->frame);
199 crc->frame++;
205 nv50_crc_get_entries(head, func, crc->src);
208 drm_vblank_work_schedule(&crc->flip_work,
210 + crc->flip_threshold
211 - crc->entry_idx,
215 spin_unlock(&crc->lock);
247 struct nv50_crc *crc = &head->crc;
249 if (!asyh->clr.crc)
252 spin_lock_irq(&crc->lock);
253 crc->src = NV50_CRC_SOURCE_NONE;
254 spin_unlock_irq(&crc->lock);
257 drm_vblank_work_cancel_sync(&crc->flip_work);
279 struct nv50_crc *crc = &head->crc;
282 if (!asyh->set.crc)
285 crc->entry_idx = 0;
286 crc->ctx_changed = false;
287 for (i = 0; i < ARRAY_SIZE(crc->ctx); i++)
288 nv50_crc_reset_ctx(&crc->ctx[i]);
295 nv50_disp(state->dev)->core->func->crc;
303 struct nv50_crc *crc = &head->crc;
304 struct nv50_crc_notifier_ctx *ctx = &crc->ctx[crc->ctx_idx];
306 if (!asyh->clr.crc)
309 if (crc->ctx_changed) {
311 ctx = &crc->ctx[crc->ctx_idx ^ 1];
326 struct nv50_crc *crc = &head->crc;
329 if (!asyh->set.crc)
334 spin_lock_irq(&crc->lock);
336 crc->frame = vbl_count;
337 crc->src = asyh->crc.src;
338 drm_vblank_work_schedule(&crc->flip_work,
339 vbl_count + crc->flip_threshold,
341 spin_unlock_irq(&crc->lock);
354 bool changed = armh->crc.src != asyh->crc.src;
356 if (!armh->crc.src && !asyh->crc.src) {
357 asyh->set.crc = false;
358 asyh->clr.crc = false;
363 asyh->clr.crc = armh->crc.src && armh->state.active;
364 asyh->set.crc = asyh->crc.src && asyh->state.active;
369 if (asyh->clr.crc && asyh->set.crc)
372 asyh->set.crc = false;
373 asyh->clr.crc = false;
406 if (!asyh->clr.crc)
453 struct nv50_crc *crc = &head->crc;
454 const struct nv50_crc_func *func = nv50_disp(dev)->core->func->crc;
466 func->set_src(head, outp->outp.or.id, nv50_crc_source_type(outp, asyh->crc.src),
467 &crc->ctx[crc->ctx_idx]);
473 nv50_disp(head->base.base.dev)->core->func->crc;
544 struct nv50_crc *crc = &head->crc;
545 const struct nv50_crc_func *func = nv50_disp(dev)->core->func->crc;
572 for (i = 0; i < ARRAY_SIZE(head->crc.ctx); i++) {
573 ret = nv50_crc_ctx_init(head, mmu, &crc->ctx[i],
590 asyh->crc.src = source;
604 crc->flip_threshold = func->flip_threshold;
611 for (i = 0; i < ARRAY_SIZE(crc->ctx); i++)
612 nv50_crc_ctx_fini(&crc->ctx[i]);
630 struct nv50_crc *crc = &head->crc;
637 seq_printf(m, "%d\n", crc->flip_threshold);
660 struct nv50_crc *crc = &head->crc;
662 nv50_disp(crtc->dev)->core->func->crc;
681 if (armh->crc.src) {
689 crc->flip_threshold = value;
709 nv50_disp(crtc->dev)->core->func->crc;
726 struct nv50_crc *crc = &head->crc;
728 crc->flip_threshold = func->flip_threshold;
729 spin_lock_init(&crc->lock);
730 drm_vblank_work_init(&crc->flip_work, &head->base.base,
738 const struct nv50_crc_func *func = disp->core->func->crc;