Lines Matching refs:cursor
48 struct cursor { struct
61 static struct cursor cursors[MAX_CURSORS]; argument
73 void (*run)(struct cursor *cursor, const struct cursor_step *step);
81 static void set_cursor(struct cursor *cursor, const struct cursor_step *step) in set_cursor() argument
87 handle = cursor->bo_handle; in set_cursor()
89 cursor->enabled = enabled; in set_cursor()
91 drmModeSetCursor(cursor->fd, cursor->crtc_id, handle, cursor->w, cursor->h); in set_cursor()
94 static void move_cursor(struct cursor *cursor, const struct cursor_step *step) in move_cursor() argument
96 int x = cursor->x; in move_cursor()
97 int y = cursor->y; in move_cursor()
99 if (!cursor->enabled) in move_cursor()
100 drmModeSetCursor(cursor->fd, cursor->crtc_id, in move_cursor()
101 cursor->bo_handle, cursor->w, cursor->h); in move_cursor()
104 x += cursor->dx * step->arg; in move_cursor()
105 y += cursor->dy * step->arg; in move_cursor()
109 cursor->dx = 1; in move_cursor()
110 } else if (x > (int)cursor->crtc_w) { in move_cursor()
111 x = cursor->crtc_w - 1; in move_cursor()
112 cursor->dx = -1; in move_cursor()
117 cursor->dy = 1; in move_cursor()
118 } else if (y > (int)cursor->crtc_h) { in move_cursor()
119 y = cursor->crtc_h - 1; in move_cursor()
120 cursor->dy = -1; in move_cursor()
123 cursor->x = x; in move_cursor()
124 cursor->y = y; in move_cursor()
126 drmModeMoveCursor(cursor->fd, cursor->crtc_id, x, y); in move_cursor()
152 struct cursor *cursor = &cursors[i]; in cursor_thread_func() local
153 step->run(cursor, step); in cursor_thread_func()
173 struct cursor *cursor = &cursors[ncursors]; in cursor_init() local
177 cursor->fd = fd; in cursor_init()
178 cursor->bo_handle = bo_handle; in cursor_init()
179 cursor->crtc_id = crtc_id; in cursor_init()
180 cursor->crtc_w = crtc_w; in cursor_init()
181 cursor->crtc_h = crtc_h; in cursor_init()
182 cursor->w = w; in cursor_init()
183 cursor->h = h; in cursor_init()
185 cursor->enabled = 0; in cursor_init()
186 cursor->x = w/2; in cursor_init()
187 cursor->y = h/2; in cursor_init()
188 cursor->dx = 1; in cursor_init()
189 cursor->dy = 1; in cursor_init()