• Home
  • Raw
  • Download

Lines Matching refs:pipe

80 drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
100 static void store_vblank(struct drm_device *dev, unsigned int pipe, in store_vblank() argument
104 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in store_vblank()
120 static u32 drm_vblank_no_hw_counter(struct drm_device *dev, unsigned int pipe) in drm_vblank_no_hw_counter() argument
126 static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe) in __get_vblank_counter() argument
129 struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe); in __get_vblank_counter()
136 return dev->driver->get_vblank_counter(dev, pipe); in __get_vblank_counter()
138 return drm_vblank_no_hw_counter(dev, pipe); in __get_vblank_counter()
150 static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe) in drm_reset_vblank_timestamp() argument
164 cur_vblank = __get_vblank_counter(dev, pipe); in drm_reset_vblank_timestamp()
165 rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, false); in drm_reset_vblank_timestamp()
166 } while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0); in drm_reset_vblank_timestamp()
180 store_vblank(dev, pipe, 1, &t_vblank, cur_vblank); in drm_reset_vblank_timestamp()
197 static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, in drm_update_vblank_count() argument
200 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_update_vblank_count()
220 cur_vblank = __get_vblank_counter(dev, pipe); in drm_update_vblank_count()
221 rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, in_vblank_irq); in drm_update_vblank_count()
222 } while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0); in drm_update_vblank_count()
244 pipe, (long long) diff_ns, framedur_ns); in drm_update_vblank_count()
261 " due to pre-modeset.\n", pipe, diff); in drm_update_vblank_count()
267 pipe, vblank->count, diff, cur_vblank, vblank->last); in drm_update_vblank_count()
283 store_vblank(dev, pipe, diff, &t_vblank, cur_vblank); in drm_update_vblank_count()
286 static u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe) in drm_vblank_count() argument
288 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_count()
290 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_vblank_count()
310 unsigned int pipe = drm_crtc_index(crtc); in drm_crtc_accurate_vblank_count() local
319 drm_update_vblank_count(dev, pipe, false); in drm_crtc_accurate_vblank_count()
320 vblank = drm_vblank_count(dev, pipe); in drm_crtc_accurate_vblank_count()
328 static void __disable_vblank(struct drm_device *dev, unsigned int pipe) in __disable_vblank() argument
331 struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe); in __disable_vblank()
339 dev->driver->disable_vblank(dev, pipe); in __disable_vblank()
348 void drm_vblank_disable_and_save(struct drm_device *dev, unsigned int pipe) in drm_vblank_disable_and_save() argument
350 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_disable_and_save()
367 __disable_vblank(dev, pipe); in drm_vblank_disable_and_save()
377 drm_update_vblank_count(dev, pipe, false); in drm_vblank_disable_and_save()
386 unsigned int pipe = vblank->pipe; in vblank_disable_fn() local
391 DRM_DEBUG("disabling vblank on crtc %u\n", pipe); in vblank_disable_fn()
392 drm_vblank_disable_and_save(dev, pipe); in vblank_disable_fn()
399 unsigned int pipe; in drm_vblank_cleanup() local
405 for (pipe = 0; pipe < dev->num_crtcs; pipe++) { in drm_vblank_cleanup()
406 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_cleanup()
449 vblank->pipe = i; in drm_vblank_init()
509 unsigned int pipe = drm_crtc_index(crtc); in drm_calc_timestamping_constants() local
510 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_calc_timestamping_constants()
517 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_calc_timestamping_constants()
585 unsigned int pipe, in drm_calc_vbltimestamp_from_scanoutpos() argument
595 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_calc_vbltimestamp_from_scanoutpos()
602 crtc = drm_crtc_from_index(dev, pipe); in drm_calc_vbltimestamp_from_scanoutpos()
604 if (pipe >= dev->num_crtcs || !crtc) { in drm_calc_vbltimestamp_from_scanoutpos()
605 DRM_ERROR("Invalid crtc %u\n", pipe); in drm_calc_vbltimestamp_from_scanoutpos()
624 DRM_DEBUG("crtc %u: Noop due to uninitialized mode.\n", pipe); in drm_calc_vbltimestamp_from_scanoutpos()
642 vbl_status = dev->driver->get_scanout_position(dev, pipe, in drm_calc_vbltimestamp_from_scanoutpos()
651 pipe); in drm_calc_vbltimestamp_from_scanoutpos()
666 pipe, duration_ns/1000, *max_error/1000, i); in drm_calc_vbltimestamp_from_scanoutpos()
691 pipe, hpos, vpos, in drm_calc_vbltimestamp_from_scanoutpos()
730 drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, in drm_get_last_vbltimestamp() argument
740 ret = dev->driver->get_vblank_timestamp(dev, pipe, &max_error, in drm_get_last_vbltimestamp()
771 static u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe, in drm_vblank_count_and_time() argument
774 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_count_and_time()
778 if (WARN_ON(pipe >= dev->num_crtcs)) { in drm_vblank_count_and_time()
819 trace_drm_vblank_event_delivered(e->base.file_priv, e->pipe, in send_vblank_event()
867 unsigned int pipe = drm_crtc_index(crtc); in drm_crtc_arm_vblank_event() local
871 e->pipe = pipe; in drm_crtc_arm_vblank_event()
893 unsigned int seq, pipe = drm_crtc_index(crtc); in drm_crtc_send_vblank_event() local
897 seq = drm_vblank_count_and_time(dev, pipe, &now); in drm_crtc_send_vblank_event()
903 e->pipe = pipe; in drm_crtc_send_vblank_event()
909 static int __enable_vblank(struct drm_device *dev, unsigned int pipe) in __enable_vblank() argument
912 struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe); in __enable_vblank()
918 return dev->driver->enable_vblank(dev, pipe); in __enable_vblank()
921 static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe) in drm_vblank_enable() argument
923 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_enable()
938 ret = __enable_vblank(dev, pipe); in drm_vblank_enable()
939 DRM_DEBUG("enabling vblank on crtc %u, ret: %d\n", pipe, ret); in drm_vblank_enable()
943 drm_update_vblank_count(dev, pipe, 0); in drm_vblank_enable()
958 static int drm_vblank_get(struct drm_device *dev, unsigned int pipe) in drm_vblank_get() argument
960 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_get()
967 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_vblank_get()
973 ret = drm_vblank_enable(dev, pipe); in drm_vblank_get()
1001 static void drm_vblank_put(struct drm_device *dev, unsigned int pipe) in drm_vblank_put() argument
1003 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_put()
1005 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_vblank_put()
1047 void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe) in drm_wait_one_vblank() argument
1049 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_wait_one_vblank()
1053 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_wait_one_vblank()
1056 ret = drm_vblank_get(dev, pipe); in drm_wait_one_vblank()
1057 if (WARN(ret, "vblank not available on crtc %i, ret=%i\n", pipe, ret)) in drm_wait_one_vblank()
1060 last = drm_vblank_count(dev, pipe); in drm_wait_one_vblank()
1063 last != drm_vblank_count(dev, pipe), in drm_wait_one_vblank()
1066 WARN(ret == 0, "vblank wait timed out on crtc %i\n", pipe); in drm_wait_one_vblank()
1068 drm_vblank_put(dev, pipe); in drm_wait_one_vblank()
1100 unsigned int pipe = drm_crtc_index(crtc); in drm_crtc_vblank_off() local
1101 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_vblank_off()
1107 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_crtc_vblank_off()
1114 pipe, vblank->enabled, vblank->inmodeset); in drm_crtc_vblank_off()
1119 drm_vblank_disable_and_save(dev, pipe); in drm_crtc_vblank_off()
1134 seq = drm_vblank_count_and_time(dev, pipe, &now); in drm_crtc_vblank_off()
1137 if (e->pipe != pipe) in drm_crtc_vblank_off()
1143 drm_vblank_put(dev, pipe); in drm_crtc_vblank_off()
1170 unsigned int pipe = drm_crtc_index(crtc); in drm_crtc_vblank_reset() local
1171 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_vblank_reset()
1201 unsigned int pipe = drm_crtc_index(crtc); in drm_crtc_vblank_on() local
1202 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_vblank_on()
1205 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_crtc_vblank_on()
1210 pipe, vblank->enabled, vblank->inmodeset); in drm_crtc_vblank_on()
1218 drm_reset_vblank_timestamp(dev, pipe); in drm_crtc_vblank_on()
1225 WARN_ON(drm_vblank_enable(dev, pipe)); in drm_crtc_vblank_on()
1231 unsigned int pipe) in drm_legacy_vblank_pre_modeset() argument
1233 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_legacy_vblank_pre_modeset()
1239 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_legacy_vblank_pre_modeset()
1251 if (drm_vblank_get(dev, pipe) == 0) in drm_legacy_vblank_pre_modeset()
1257 unsigned int pipe) in drm_legacy_vblank_post_modeset() argument
1259 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_legacy_vblank_post_modeset()
1266 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_legacy_vblank_post_modeset()
1271 drm_reset_vblank_timestamp(dev, pipe); in drm_legacy_vblank_post_modeset()
1275 drm_vblank_put(dev, pipe); in drm_legacy_vblank_post_modeset()
1285 unsigned int pipe; in drm_legacy_modeset_ctl_ioctl() local
1295 pipe = modeset->crtc; in drm_legacy_modeset_ctl_ioctl()
1296 if (pipe >= dev->num_crtcs) in drm_legacy_modeset_ctl_ioctl()
1301 drm_legacy_vblank_pre_modeset(dev, pipe); in drm_legacy_modeset_ctl_ioctl()
1304 drm_legacy_vblank_post_modeset(dev, pipe); in drm_legacy_modeset_ctl_ioctl()
1318 static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe, in drm_queue_vblank_event() argument
1322 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_queue_vblank_event()
1335 e->pipe = pipe; in drm_queue_vblank_event()
1359 seq = drm_vblank_count_and_time(dev, pipe, &now); in drm_queue_vblank_event()
1362 vblwait->request.sequence, seq, pipe); in drm_queue_vblank_event()
1364 trace_drm_vblank_event_queued(file_priv, pipe, in drm_queue_vblank_event()
1369 drm_vblank_put(dev, pipe); in drm_queue_vblank_event()
1386 drm_vblank_put(dev, pipe); in drm_queue_vblank_event()
1407 unsigned int flags, seq, pipe, high_pipe; in drm_wait_vblank_ioctl() local
1428 pipe = high_pipe >> _DRM_VBLANK_HIGH_CRTC_SHIFT; in drm_wait_vblank_ioctl()
1430 pipe = flags & _DRM_VBLANK_SECONDARY ? 1 : 0; in drm_wait_vblank_ioctl()
1431 if (pipe >= dev->num_crtcs) in drm_wait_vblank_ioctl()
1434 vblank = &dev->vblank[pipe]; in drm_wait_vblank_ioctl()
1445 drm_vblank_count_and_time(dev, pipe, &now); in drm_wait_vblank_ioctl()
1451 ret = drm_vblank_get(dev, pipe); in drm_wait_vblank_ioctl()
1453 DRM_DEBUG("crtc %d failed to acquire vblank counter, %d\n", pipe, ret); in drm_wait_vblank_ioctl()
1456 seq = drm_vblank_count(dev, pipe); in drm_wait_vblank_ioctl()
1477 return drm_queue_vblank_event(dev, pipe, vblwait, file_priv); in drm_wait_vblank_ioctl()
1482 vblwait->request.sequence, pipe); in drm_wait_vblank_ioctl()
1484 vblank_passed(drm_vblank_count(dev, pipe), in drm_wait_vblank_ioctl()
1492 vblwait->reply.sequence = drm_vblank_count_and_time(dev, pipe, &now); in drm_wait_vblank_ioctl()
1497 pipe, vblwait->reply.sequence); in drm_wait_vblank_ioctl()
1499 DRM_DEBUG("crtc %d vblank wait interrupted by signal\n", pipe); in drm_wait_vblank_ioctl()
1503 drm_vblank_put(dev, pipe); in drm_wait_vblank_ioctl()
1507 static void drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe) in drm_handle_vblank_events() argument
1515 seq = drm_vblank_count_and_time(dev, pipe, &now); in drm_handle_vblank_events()
1518 if (e->pipe != pipe) in drm_handle_vblank_events()
1527 drm_vblank_put(dev, pipe); in drm_handle_vblank_events()
1531 trace_drm_vblank_event(pipe, seq); in drm_handle_vblank_events()
1544 bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe) in drm_handle_vblank() argument
1546 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_handle_vblank()
1553 if (WARN_ON(pipe >= dev->num_crtcs)) in drm_handle_vblank()
1571 drm_update_vblank_count(dev, pipe, true); in drm_handle_vblank()
1586 drm_handle_vblank_events(dev, pipe); in drm_handle_vblank()