Lines Matching refs:mt
42 struct input_mt *mt = dev->mt; in input_mt_init_slots() local
47 if (mt) in input_mt_init_slots()
48 return mt->num_slots != num_slots ? -EINVAL : 0; in input_mt_init_slots()
50 mt = kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL); in input_mt_init_slots()
51 if (!mt) in input_mt_init_slots()
54 mt->num_slots = num_slots; in input_mt_init_slots()
55 mt->flags = flags; in input_mt_init_slots()
84 mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL); in input_mt_init_slots()
85 if (!mt->red) in input_mt_init_slots()
91 input_mt_set_value(&mt->slots[i], ABS_MT_TRACKING_ID, -1); in input_mt_init_slots()
94 mt->frame = 1; in input_mt_init_slots()
96 dev->mt = mt; in input_mt_init_slots()
99 kfree(mt); in input_mt_init_slots()
113 if (dev->mt) { in input_mt_destroy_slots()
114 kfree(dev->mt->red); in input_mt_destroy_slots()
115 kfree(dev->mt); in input_mt_destroy_slots()
117 dev->mt = NULL; in input_mt_destroy_slots()
138 struct input_mt *mt = dev->mt; in input_mt_report_slot_state() local
142 if (!mt) in input_mt_report_slot_state()
145 slot = &mt->slots[mt->slot]; in input_mt_report_slot_state()
146 slot->frame = mt->frame; in input_mt_report_slot_state()
155 id = input_mt_new_trkid(mt); in input_mt_report_slot_state()
198 struct input_mt *mt = dev->mt; in input_mt_report_pointer_emulation() local
202 if (!mt) in input_mt_report_pointer_emulation()
206 oldid = mt->trkid; in input_mt_report_pointer_emulation()
209 for (i = 0; i < mt->num_slots; ++i) { in input_mt_report_pointer_emulation()
210 struct input_mt_slot *ps = &mt->slots[i]; in input_mt_report_pointer_emulation()
259 static void __input_mt_drop_unused(struct input_dev *dev, struct input_mt *mt) in __input_mt_drop_unused() argument
265 for (i = 0; i < mt->num_slots; i++) { in __input_mt_drop_unused()
266 if (input_mt_is_active(&mt->slots[i]) && in __input_mt_drop_unused()
267 !input_mt_is_used(mt, &mt->slots[i])) { in __input_mt_drop_unused()
282 struct input_mt *mt = dev->mt; in input_mt_drop_unused() local
284 if (mt) { in input_mt_drop_unused()
289 __input_mt_drop_unused(dev, mt); in input_mt_drop_unused()
290 mt->frame++; in input_mt_drop_unused()
305 struct input_mt *mt = dev->mt; in input_mt_release_slots() local
309 if (mt) { in input_mt_release_slots()
311 mt->frame++; in input_mt_release_slots()
313 __input_mt_drop_unused(dev, mt); in input_mt_release_slots()
318 mt->frame++; in input_mt_release_slots()
332 struct input_mt *mt = dev->mt; in input_mt_sync_frame() local
335 if (!mt) in input_mt_sync_frame()
338 if (mt->flags & INPUT_MT_DROP_UNUSED) { in input_mt_sync_frame()
342 __input_mt_drop_unused(dev, mt); in input_mt_sync_frame()
346 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) in input_mt_sync_frame()
351 mt->frame++; in input_mt_sync_frame()
403 static int input_mt_set_matrix(struct input_mt *mt, in input_mt_set_matrix() argument
409 int *w = mt->red; in input_mt_set_matrix()
412 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_matrix()
423 return w - mt->red; in input_mt_set_matrix()
426 static void input_mt_set_slots(struct input_mt *mt, in input_mt_set_slots() argument
430 int *w = mt->red, j; in input_mt_set_slots()
435 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
441 slots[j] = s - mt->slots; in input_mt_set_slots()
449 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
455 slots[j] = s - mt->slots; in input_mt_set_slots()
484 struct input_mt *mt = dev->mt; in input_mt_assign_slots() local
488 if (!mt || !mt->red) in input_mt_assign_slots()
490 if (num_pos > mt->num_slots) in input_mt_assign_slots()
495 nrc = input_mt_set_matrix(mt, pos, num_pos, mu); in input_mt_assign_slots()
496 find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc, mu); in input_mt_assign_slots()
497 input_mt_set_slots(mt, slots, num_pos); in input_mt_assign_slots()
517 struct input_mt *mt = dev->mt; in input_mt_get_slot_by_key() local
520 if (!mt) in input_mt_get_slot_by_key()
523 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
525 return s - mt->slots; in input_mt_get_slot_by_key()
527 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
528 if (!input_mt_is_active(s) && !input_mt_is_used(mt, s)) { in input_mt_get_slot_by_key()
530 return s - mt->slots; in input_mt_get_slot_by_key()