//ScrnInfoPtr pScrn = crtc->scrn;
}
+/*
+ * Cursor functions
+ */
+
static void
-crtc_destroy(xf86CrtcPtr crtc)
+crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg)
{
- struct crtc_private *crtcp = crtc->driver_private;
+}
- if (crtcp->cursor_tex)
- pipe_texture_reference(&crtcp->cursor_tex, NULL);
+static void
+crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
+{
+ modesettingPtr ms = modesettingPTR(crtc->scrn);
+ struct crtc_private *crtcp = crtc->driver_private;
- drmModeFreeCrtc(crtcp->drm_crtc);
- xfree(crtcp);
+ drmModeMoveCursor(ms->fd, crtcp->drm_crtc->crtc_id, x, y);
}
-
static void
crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image)
{
ms->screen->tex_transfer_destroy(transfer);
}
-static void
-crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
-{
- modesettingPtr ms = modesettingPTR(crtc->scrn);
- struct crtc_private *crtcp = crtc->driver_private;
-
- drmModeMoveCursor(ms->fd, crtcp->drm_crtc->crtc_id, x, y);
-}
-
static void
crtc_show_cursor(xf86CrtcPtr crtc)
{
drmModeSetCursor(ms->fd, crtcp->drm_crtc->crtc_id, 0, 0, 0);
}
+void
+crtc_cursor_destroy(xf86CrtcPtr crtc)
+{
+ struct crtc_private *crtcp = crtc->driver_private;
+
+ if (crtcp->cursor_tex) {
+ pipe_texture_reference(&crtcp->cursor_tex, NULL);
+ }
+}
+
+/*
+ * Misc functions
+ */
+
+static void
+crtc_destroy(xf86CrtcPtr crtc)
+{
+ struct crtc_private *crtcp = crtc->driver_private;
+
+ if (crtcp->cursor_tex)
+ pipe_texture_reference(&crtcp->cursor_tex, NULL);
+
+ drmModeFreeCrtc(crtcp->drm_crtc);
+ xfree(crtcp);
+}
+
static const xf86CrtcFuncsRec crtc_funcs = {
.dpms = crtc_dpms,
- .save = NULL,
- .restore = NULL,
+
.lock = crtc_lock,
.unlock = crtc_unlock,
.mode_fixup = crtc_mode_fixup,
.prepare = crtc_prepare,
.mode_set = crtc_mode_set,
.commit = crtc_commit,
- .gamma_set = crtc_gamma_set,
- .shadow_create = crtc_shadow_create,
- .shadow_allocate = crtc_shadow_allocate,
- .shadow_destroy = crtc_shadow_destroy,
+
+ .set_cursor_colors = crtc_set_cursor_colors,
.set_cursor_position = crtc_set_cursor_position,
.show_cursor = crtc_show_cursor,
.hide_cursor = crtc_hide_cursor,
- .load_cursor_image = NULL, /* lets convert to argb only */
- .set_cursor_colors = NULL, /* using argb only */
.load_cursor_argb = crtc_load_cursor_argb,
- .destroy = crtc_destroy,
-};
-void
-crtc_cursor_destroy(xf86CrtcPtr crtc)
-{
- struct crtc_private *crtcp = crtc->driver_private;
+ .shadow_create = crtc_shadow_create,
+ .shadow_allocate = crtc_shadow_allocate,
+ .shadow_destroy = crtc_shadow_destroy,
- if (crtcp->cursor_tex) {
- pipe_texture_reference(&crtcp->cursor_tex, NULL);
- }
-}
+ .gamma_set = crtc_gamma_set,
+ .destroy = crtc_destroy,
+};
void
crtc_init(ScrnInfoPtr pScrn)