Lines Matching defs:mt
8 #include <linux/input/mt.h>
28 * @flags: mt tasks to handle in core
45 if (dev->mt)
46 return dev->mt->num_slots != num_slots ? -EINVAL : 0;
52 struct input_mt *mt __free(kfree) =
53 kzalloc_flex(*mt, slots, num_slots);
54 if (!mt)
57 mt->num_slots = num_slots;
58 mt->flags = flags;
87 mt->red = kzalloc_objs(*mt->red, n2);
88 if (!mt->red)
94 input_mt_set_value(&mt->slots[i], ABS_MT_TRACKING_ID, -1);
97 mt->frame = 1;
99 dev->mt = no_free_ptr(mt);
113 if (dev->mt) {
114 kfree(dev->mt->red);
115 kfree(dev->mt);
117 dev->mt = NULL;
137 struct input_mt *mt = dev->mt;
141 if (!mt)
144 slot = &mt->slots[mt->slot];
145 slot->frame = mt->frame;
154 id = input_mt_new_trkid(mt);
197 struct input_mt *mt = dev->mt;
202 if (!mt)
206 oldid = mt->trkid;
209 for (i = 0; i < mt->num_slots; ++i) {
210 struct input_mt_slot *ps = &mt->slots[i];
221 if (mt->flags & INPUT_MT_TOTAL_FORCE)
264 static void __input_mt_drop_unused(struct input_dev *dev, struct input_mt *mt)
270 for (i = 0; i < mt->num_slots; i++) {
271 if (input_mt_is_active(&mt->slots[i]) &&
272 !input_mt_is_used(mt, &mt->slots[i])) {
287 struct input_mt *mt = dev->mt;
289 if (mt) {
292 __input_mt_drop_unused(dev, mt);
293 mt->frame++;
306 struct input_mt *mt = dev->mt;
310 if (mt) {
312 mt->frame++;
314 __input_mt_drop_unused(dev, mt);
319 mt->frame++;
324 * input_mt_sync_frame() - synchronize mt frame
333 struct input_mt *mt = dev->mt;
336 if (!mt)
339 if (mt->flags & INPUT_MT_DROP_UNUSED) {
341 __input_mt_drop_unused(dev, mt);
344 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT))
349 mt->frame++;
401 static int input_mt_set_matrix(struct input_mt *mt,
407 int *w = mt->red;
410 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
421 return w - mt->red;
424 static void input_mt_set_slots(struct input_mt *mt,
428 int *w = mt->red, j;
433 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
439 slots[j] = s - mt->slots;
447 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
453 slots[j] = s - mt->slots;
482 struct input_mt *mt = dev->mt;
486 if (!mt || !mt->red)
488 if (num_pos > mt->num_slots)
493 nrc = input_mt_set_matrix(mt, pos, num_pos, mu);
494 find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc, mu);
495 input_mt_set_slots(mt, slots, num_pos);
515 struct input_mt *mt = dev->mt;
518 if (!mt)
521 for (s = mt->slots; s != mt->slots + mt->num_slots; s++)
523 return s - mt->slots;
525 for (s = mt->slots; s != mt->slots + mt->num_slots; s++)
526 if (!input_mt_is_active(s) && !input_mt_is_used(mt, s)) {
528 return s - mt->slots;