From: George Sapountzis Date: Thu, 25 Mar 2010 15:01:52 +0000 (+0200) Subject: st/dri: minor cosmetic for screen X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c049d58a229125ce7ad61c645902eb2638e87194;p=mesa.git st/dri: minor cosmetic for screen - put extensions above init_screen - split out destroy_option_cache --- diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 733d71f9959..cb650122668 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -51,7 +51,7 @@ PUBLIC const char __driConfigOptions[] = DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY - /*DRI_CONF_FORCE_S3TC_ENABLE(false) */ +/* DRI_CONF_FORCE_S3TC_ENABLE(false) */ DRI_CONF_ALLOW_LARGE_TEXTURES(1) DRI_CONF_SECTION_END DRI_CONF_END; @@ -87,17 +87,6 @@ static const __DRI2flushExtension dri2FlushExtension = { dri2_invalidate_drawable, }; - static const __DRIextension *dri_screen_extensions[] = { - &driReadDrawableExtension, - &driCopySubBufferExtension.base, - &driSwapControlExtension.base, - &driFrameTrackingExtension.base, - &driMediaStreamCounterExtension.base, - &dri2TexBufferExtension.base, - &dri2FlushExtension.base, - NULL - }; - const __DRIconfig ** dri_fill_in_modes(struct dri_screen *screen, unsigned pixel_bits) @@ -313,11 +302,24 @@ dri_get_swap_info(__DRIdrawable * dPriv, __DRIswapInfo * sInfo) return 0; } +static void +dri_destroy_option_cache(struct dri_screen * screen) +{ + int i; + + for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) { + FREE(screen->optionCache.info[i].name); + FREE(screen->optionCache.info[i].ranges); + } + + FREE(screen->optionCache.info); + FREE(screen->optionCache.values); +} + static void dri_destroy_screen(__DRIscreen * sPriv) { struct dri_screen *screen = dri_screen(sPriv); - int i; if (screen->dri1_pipe) screen->dri1_pipe->destroy(screen->dri1_pipe); @@ -327,19 +329,24 @@ dri_destroy_screen(__DRIscreen * sPriv) if (screen->pipe_screen) screen->pipe_screen->destroy(screen->pipe_screen); - for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) { - FREE(screen->optionCache.info[i].name); - FREE(screen->optionCache.info[i].ranges); - } - - FREE(screen->optionCache.info); - FREE(screen->optionCache.values); + dri_destroy_option_cache(screen); FREE(screen); sPriv->private = NULL; sPriv->extensions = NULL; } +static const __DRIextension *dri_screen_extensions[] = { + &driReadDrawableExtension, + &driCopySubBufferExtension.base, + &driSwapControlExtension.base, + &driFrameTrackingExtension.base, + &driMediaStreamCounterExtension.base, + &dri2TexBufferExtension.base, + &dri2FlushExtension.base, + NULL +}; + /** * This is the driver specific part of the createNewScreen entry point. *