Lines Matching refs:crc

49  * file dri/0/crtc-N/crc/control in debugfs, with N being the :ref:`index of
55 * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
100 if (strcmp(sources[i], crtc->crc.source))
109 seq_printf(m, "%s*\n", crtc->crc.source);
125 struct drm_crtc_crc *crc = &crtc->crc;
134 DRM_DEBUG_KMS("Expected < %lu bytes into crtc crc control\n",
152 spin_lock_irq(&crc->lock);
154 if (crc->opened) {
155 spin_unlock_irq(&crc->lock);
160 kfree(crc->source);
161 crc->source = source;
163 spin_unlock_irq(&crc->lock);
178 static int crtc_crc_data_count(struct drm_crtc_crc *crc)
180 assert_spin_locked(&crc->lock);
181 return CIRC_CNT(crc->head, crc->tail, DRM_CRC_ENTRIES_NR);
184 static void crtc_crc_cleanup(struct drm_crtc_crc *crc)
186 kfree(crc->entries);
187 crc->overflow = false;
188 crc->entries = NULL;
189 crc->head = 0;
190 crc->tail = 0;
191 crc->values_cnt = 0;
192 crc->opened = false;
198 struct drm_crtc_crc *crc = &crtc->crc;
216 ret = crtc->funcs->verify_crc_source(crtc, crc->source, &values_cnt);
230 spin_lock_irq(&crc->lock);
231 if (!crc->opened) {
232 crc->opened = true;
233 crc->entries = entries;
234 crc->values_cnt = values_cnt;
238 spin_unlock_irq(&crc->lock);
245 ret = crtc->funcs->set_crc_source(crtc, crc->source);
252 spin_lock_irq(&crc->lock);
253 crtc_crc_cleanup(crc);
254 spin_unlock_irq(&crc->lock);
261 struct drm_crtc_crc *crc = &crtc->crc;
264 spin_lock_irq(&crc->lock);
265 crc->opened = false;
266 spin_unlock_irq(&crc->lock);
270 spin_lock_irq(&crc->lock);
271 crtc_crc_cleanup(crc);
272 spin_unlock_irq(&crc->lock);
288 struct drm_crtc_crc *crc = &crtc->crc;
293 spin_lock_irq(&crc->lock);
295 if (!crc->source) {
296 spin_unlock_irq(&crc->lock);
301 while (crtc_crc_data_count(crc) == 0) {
303 spin_unlock_irq(&crc->lock);
307 ret = wait_event_interruptible_lock_irq(crc->wq,
308 crtc_crc_data_count(crc),
309 crc->lock);
311 spin_unlock_irq(&crc->lock);
317 entry = &crc->entries[crc->tail];
319 if (count < LINE_LEN(crc->values_cnt)) {
320 spin_unlock_irq(&crc->lock);
325 crc->tail = (crc->tail + 1) & (DRM_CRC_ENTRIES_NR - 1);
327 spin_unlock_irq(&crc->lock);
334 for (i = 0; i < crc->values_cnt; i++)
336 sprintf(buf + 10 + crc->values_cnt * 11, "\n");
338 if (copy_to_user(user_buf, buf, LINE_LEN(crc->values_cnt)))
341 return LINE_LEN(crc->values_cnt);
347 struct drm_crtc_crc *crc = &crtc->crc;
350 poll_wait(file, &crc->wq, wait);
352 spin_lock_irq(&crc->lock);
353 if (crc->source && crtc_crc_data_count(crc))
355 spin_unlock_irq(&crc->lock);
375 crc_ent = debugfs_create_dir("crc", crtc->debugfs_entry);
396 struct drm_crtc_crc *crc = &crtc->crc;
401 spin_lock_irqsave(&crc->lock, flags);
404 if (!crc->entries) {
405 spin_unlock_irqrestore(&crc->lock, flags);
409 head = crc->head;
410 tail = crc->tail;
413 bool was_overflow = crc->overflow;
415 crc->overflow = true;
416 spin_unlock_irqrestore(&crc->lock, flags);
424 entry = &crc->entries[head];
427 memcpy(&entry->crcs, crcs, sizeof(*crcs) * crc->values_cnt);
430 crc->head = head;
432 spin_unlock_irqrestore(&crc->lock, flags);
434 wake_up_interruptible(&crc->wq);