From: Jakob Bornecrantz Date: Sun, 18 Oct 2009 09:46:19 +0000 (+0200) Subject: st/xorg: Clean up cursor functions a bit X-Git-Tag: android-x86-2.2~7958 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e9e6152cb38ca5f1ea6d65cf9bf32150bf9d2b7b;p=android-x86%2Fexternal-mesa.git st/xorg: Clean up cursor functions a bit --- diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index 67fe29a69da..6c6b6b5d1cc 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -173,18 +173,23 @@ crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) //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) { @@ -230,15 +235,6 @@ crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image) } 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) { modesettingPtr ms = modesettingPTR(crtc->scrn); @@ -258,38 +254,55 @@ crtc_hide_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)