From cb3b34ec53e00c6ca212891b314f473ee2f80a40 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Fri, 1 Jul 2011 22:54:45 +0800 Subject: [PATCH] glamor-ddx: Add missed drmmode_crtc_destroy function. Signed-off-by: Zhigang Gong --- hw/xfree86/glamor/glamor_crtc.c | 16 +++++++++++++++- hw/xfree86/glamor/glamor_ddx.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/glamor/glamor_crtc.c b/hw/xfree86/glamor/glamor_crtc.c index aba9b2c29..1f0396dbf 100644 --- a/hw/xfree86/glamor/glamor_crtc.c +++ b/hw/xfree86/glamor/glamor_crtc.c @@ -613,6 +613,20 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, drmModeCrtcSetGamma(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, size, red, green, blue); } +static void +drmmode_crtc_destroy(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + ScrnInfoPtr scrn = crtc->scrn; + if (drmmode_crtc->cursor) { + drmmode_hide_cursor(crtc); + glDeleteTextures(1, &drmmode_crtc->cursor_tex); + glamor_destroy_cursor(scrn, drmmode_crtc->cursor); + } + free(drmmode_crtc->cursor); + crtc->driver_private = NULL; +} static const xf86CrtcFuncsRec drmmode_crtc_funcs = { .dpms = drmmode_crtc_dpms, @@ -629,7 +643,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = { .shadow_destroy = drmmode_crtc_shadow_destroy, #endif .gamma_set = drmmode_crtc_gamma_set, - .destroy = NULL, /* XXX */ + .destroy = drmmode_crtc_destroy }; diff --git a/hw/xfree86/glamor/glamor_ddx.h b/hw/xfree86/glamor/glamor_ddx.h index 6f8de11ac..0e164d3b7 100644 --- a/hw/xfree86/glamor/glamor_ddx.h +++ b/hw/xfree86/glamor/glamor_ddx.h @@ -9,6 +9,7 @@ Bool glamor_load_cursor(ScrnInfoPtr scrn, void glamor_cursor_handle(ScrnInfoPtr scrn, EGLImageKHR image, uint32_t *handle, uint32_t *pitch); EGLImageKHR glamor_create_cursor_argb(ScrnInfoPtr scrn, int width, int height); +void glamor_destroy_cursor(ScrnInfoPtr scrn, EGLImageKHR cursor); Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp); void drmmode_closefb(ScrnInfoPtr scrn);