Lines Matching refs:mt

68 	uint16_t	mt;  member
109 struct evdev_mt *mt; in evdev_mt_init() local
124 size += sizeof(mt->slots[0]) * slots; in evdev_mt_init()
126 size += sizeof(mt->match_slots[0]) * slots; in evdev_mt_init()
127 size += sizeof(mt->matrix[0]) * (slots + 6) * slots; in evdev_mt_init()
130 mt = malloc(size, M_EVDEV, M_WAITOK | M_ZERO); in evdev_mt_init()
131 evdev->ev_mt = mt; in evdev_mt_init()
132 mt->type_a = type_a; in evdev_mt_init()
135 mt->match_slots = mt->slots + slots; in evdev_mt_init()
136 mt->matrix = (int *)(mt->match_slots + slots); in evdev_mt_init()
141 mt->slots[slot].id = -1; in evdev_mt_init()
198 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_push_slot() local
201 if ((type_a || (mt != NULL && mt->type_a)) && state == NULL) in evdev_mt_push_slot()
207 if (bit_test(evdev->ev_flags, EVDEV_FLAG_MT_TRACK) && mt->type_a) { in evdev_mt_push_slot()
208 mt->match_slots[mt->match_slot] = *state; in evdev_mt_push_slot()
213 mt->match_slots[mt->match_slot] = *state; in evdev_mt_push_slot()
318 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_match_frame() local
323 MPASS(mt->matrix != NULL); in evdev_mt_match_frame()
329 p = mt->matrix; in evdev_mt_match_frame()
330 num_touches = bitcount(mt->touches); in evdev_mt_match_frame()
332 FOREACHBIT(mt->touches, slot) in evdev_mt_match_frame()
334 dx = pt[i].x - mt->slots[slot].x; in evdev_mt_match_frame()
335 dy = pt[i].y - mt->slots[slot].y; in evdev_mt_match_frame()
342 FOREACHBIT(mt->touches, slot) { in evdev_mt_match_frame()
343 dx = pt[i].x - mt->slots[slot].x; in evdev_mt_match_frame()
344 dy = pt[i].y - mt->slots[slot].y; in evdev_mt_match_frame()
350 evdev_mt_matching(mt->matrix, m, n, p); in evdev_mt_match_frame()
364 FOREACHBIT(mt->touches, slot) in evdev_mt_match_frame()
366 pt[i].id = mt->tracking_ids[slot]; in evdev_mt_match_frame()
372 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_send_frame() local
384 slot->id = ffc_slot(evdev, mt->touches | mt->frame); in evdev_mt_send_frame()
407 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_record_event() local
415 KASSERT(mt->type_a, ("Not a MT type A protocol")); in evdev_mt_record_event()
416 mt->match_frame |= 1U << mt->match_slot; in evdev_mt_record_event()
417 mt->match_slot++; in evdev_mt_record_event()
424 KASSERT(!mt->type_a, ("Not a MT type B protocol")); in evdev_mt_record_event()
426 mt->match_slot = value; in evdev_mt_record_event()
427 mt->match_frame |= 1U << mt->match_slot; in evdev_mt_record_event()
430 KASSERT(!mt->type_a, ("Not a MT type B protocol")); in evdev_mt_record_event()
432 mt->match_frame &= ~(1U << mt->match_slot); in evdev_mt_record_event()
435 KASSERT(mt->match_slot >= 0, ("Negative slot")); in evdev_mt_record_event()
436 KASSERT(mt->match_slot <= MAXIMAL_MT_SLOT(evdev), in evdev_mt_record_event()
438 mt->match_slots[mt->match_slot]. in evdev_mt_record_event()
453 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_replay_events() local
458 FOREACHBIT(mt->match_frame, slot) { in evdev_mt_replay_events()
460 mt->match_slots[size] = mt->match_slots[slot]; in evdev_mt_replay_events()
463 evdev_mt_match_frame(evdev, mt->match_slots, size); in evdev_mt_replay_events()
464 evdev_mt_send_frame(evdev, mt->match_slots, size); in evdev_mt_replay_events()
465 mt->match_slot = 0; in evdev_mt_replay_events()
466 mt->match_frame = 0; in evdev_mt_replay_events()
484 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_set_last_slot() local
488 mt->frame |= 1U << slot; in evdev_mt_set_last_slot()
489 mt->last_reported_slot = slot; in evdev_mt_set_last_slot()
495 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_get_value() local
499 return (mt->slots[slot].val[ABS_MT_INDEX(code)]); in evdev_mt_get_value()
506 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_set_value() local
512 mt->touches |= 1U << slot; in evdev_mt_set_value()
514 mt->touches &= ~(1U << slot); in evdev_mt_set_value()
516 mt->slots[slot].val[ABS_MT_INDEX(code)] = value; in evdev_mt_set_value()
522 struct evdev_mt *mt = evdev->ev_mt; in evdev_get_mt_slot_by_tracking_id() local
525 KASSERT(!mt->type_a, ("Not a MT type B protocol")); in evdev_get_mt_slot_by_tracking_id()
532 return (ffc_slot(evdev, mt->match_frame)); in evdev_get_mt_slot_by_tracking_id()
534 FOREACHBIT(mt->touches, slot) in evdev_get_mt_slot_by_tracking_id()
535 if (mt->tracking_ids[slot] == tracking_id) in evdev_get_mt_slot_by_tracking_id()
541 return (ffc_slot(evdev, mt->touches | mt->frame)); in evdev_get_mt_slot_by_tracking_id()
547 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_reassign_id() local
551 mt->tracking_ids[slot] = id; in evdev_mt_reassign_id()
557 KASSERT(id == mt->tracking_ids[slot], in evdev_mt_reassign_id()
562 mt->tracking_ids[slot] = id; in evdev_mt_reassign_id()
564 nid = mt->tracking_id++; in evdev_mt_reassign_id()
565 FOREACHBIT(mt->touches, slot) in evdev_mt_reassign_id()
600 if (!bit_test(evdev->ev_abs_flags, evdev_mtstmap[i].mt) || in evdev_support_mt_compat()
603 ai = evdev->ev_absinfo + evdev_mtstmap[i].mt; in evdev_support_mt_compat()
626 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_send_st_compat() local
631 nfingers = bitcount(mt->touches); in evdev_mt_send_st_compat()
635 st_slot = ffs(mt->touches) - 1; in evdev_mt_send_st_compat()
637 FOREACHBIT(mt->mtst_events, i) in evdev_mt_send_st_compat()
640 st_slot, evdev_mtstmap[i].mt), in evdev_mt_send_st_compat()
641 evdev->ev_absinfo[evdev_mtstmap[i].mt].minimum, in evdev_mt_send_st_compat()
642 evdev->ev_absinfo[evdev_mtstmap[i].mt].maximum, in evdev_mt_send_st_compat()
665 struct evdev_mt *mt = evdev->ev_mt; in evdev_mt_send_autorel() local
669 KASSERT(mt->match_frame == 0, ("Unmatched events exist")); in evdev_mt_send_autorel()
671 FOREACHBIT(mt->touches & ~mt->frame, slot) in evdev_mt_send_autorel()