diff options
author | Emil Velikov <[email protected]> | 2014-03-16 01:17:46 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-04-28 19:13:37 +0100 |
commit | ecfe986120adb2c574cb03bea318eae96e564924 (patch) | |
tree | 0848f01dcdea17d32f9312c5a759d15bbd52315a /src | |
parent | 4be3874c97379b72f1129e7866ec6868610778a5 (diff) |
glx/dri3: rework __DRIextension handling
Use a const array with the extensions, rather than assigning each
one to a fixed size array at runtime.
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glx/dri3_glx.c | 17 | ||||
-rw-r--r-- | src/glx/dri3_priv.h | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 653b1e5c5f6..2a178d55610 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -1307,6 +1307,12 @@ static const __DRIimageLoaderExtension imageLoaderExtension = { .flushFrontBuffer = dri3_flush_front_buffer, }; +static const __DRIextension *loader_extensions[] = { + &imageLoaderExtension.base, + &systemTimeExtension.base, + NULL +}; + /** dri3_swap_buffers * * Make the current back buffer visible using the present extension @@ -1689,8 +1695,7 @@ dri3_create_screen(int screen, struct glx_display * priv) psc->driScreen = psc->image_driver->createNewScreen2(screen, psc->fd, - (const __DRIextension **) - &pdp->loader_extensions[0], + pdp->loader_extensions, extensions, &driver_configs, psc); @@ -1807,7 +1812,6 @@ _X_HIDDEN __GLXDRIdisplay * dri3_create_display(Display * dpy) { struct dri3_display *pdp; - int i; xcb_connection_t *c = XGetXCBConnection(dpy); xcb_dri3_query_version_cookie_t dri3_cookie; xcb_dri3_query_version_reply_t *dri3_reply; @@ -1863,13 +1867,8 @@ dri3_create_display(Display * dpy) pdp->base.createScreen = dri3_create_screen; loader_set_logger(dri_message); - i = 0; - - pdp->loader_extensions[i++] = &imageLoaderExtension.base; - - pdp->loader_extensions[i++] = &systemTimeExtension.base; - pdp->loader_extensions[i++] = NULL; + pdp->loader_extensions = loader_extensions; return &pdp->base; no_extension: diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h index 316e3131532..38463310570 100644 --- a/src/glx/dri3_priv.h +++ b/src/glx/dri3_priv.h @@ -106,7 +106,7 @@ struct dri3_display { __GLXDRIdisplay base; - const __DRIextension *loader_extensions[8]; + const __DRIextension **loader_extensions; /* DRI3 bits */ int dri3Major; |