Lines Matching refs:cursor
44 struct cursor { struct
57 static struct cursor cursors[MAX_CURSORS]; argument
69 void (*run)(struct cursor *cursor, const struct cursor_step *step);
77 static void set_cursor(struct cursor *cursor, const struct cursor_step *step) in set_cursor() argument
83 handle = cursor->bo_handle; in set_cursor()
85 cursor->enabled = enabled; in set_cursor()
87 drmModeSetCursor(cursor->fd, cursor->crtc_id, handle, cursor->w, cursor->h); in set_cursor()
90 static void move_cursor(struct cursor *cursor, const struct cursor_step *step) in move_cursor() argument
92 int x = cursor->x; in move_cursor()
93 int y = cursor->y; in move_cursor()
95 if (!cursor->enabled) in move_cursor()
96 drmModeSetCursor(cursor->fd, cursor->crtc_id, in move_cursor()
97 cursor->bo_handle, cursor->w, cursor->h); in move_cursor()
100 x += cursor->dx * step->arg; in move_cursor()
101 y += cursor->dy * step->arg; in move_cursor()
105 cursor->dx = 1; in move_cursor()
106 } else if (x > (int)cursor->crtc_w) { in move_cursor()
107 x = cursor->crtc_w - 1; in move_cursor()
108 cursor->dx = -1; in move_cursor()
113 cursor->dy = 1; in move_cursor()
114 } else if (y > (int)cursor->crtc_h) { in move_cursor()
115 y = cursor->crtc_h - 1; in move_cursor()
116 cursor->dy = -1; in move_cursor()
119 cursor->x = x; in move_cursor()
120 cursor->y = y; in move_cursor()
122 drmModeMoveCursor(cursor->fd, cursor->crtc_id, x, y); in move_cursor()
148 struct cursor *cursor = &cursors[i]; in cursor_thread_func() local
149 step->run(cursor, step); in cursor_thread_func()
169 struct cursor *cursor = &cursors[ncursors]; in cursor_init() local
173 cursor->fd = fd; in cursor_init()
174 cursor->bo_handle = bo_handle; in cursor_init()
175 cursor->crtc_id = crtc_id; in cursor_init()
176 cursor->crtc_w = crtc_w; in cursor_init()
177 cursor->crtc_h = crtc_h; in cursor_init()
178 cursor->w = w; in cursor_init()
179 cursor->h = h; in cursor_init()
181 cursor->enabled = 0; in cursor_init()
182 cursor->x = w/2; in cursor_init()
183 cursor->y = h/2; in cursor_init()
184 cursor->dx = 1; in cursor_init()
185 cursor->dy = 1; in cursor_init()