From 5b75e12f9165c890fd14b22983d6289be8f20abc Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Thu, 25 Mar 2010 17:01:53 +0200 Subject: st/dri: add drisw --- src/gallium/state_trackers/dri/dri_screen.c | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/gallium/state_trackers/dri/dri_screen.c') diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 1d808f0..ae31164 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -30,7 +30,9 @@ */ #include "utils.h" +#ifndef __NOT_HAVE_DRM_H #include "vblank.h" +#endif #include "xmlpool.h" #include "dri_screen.h" @@ -40,6 +42,7 @@ #include "dri1_helper.h" #include "dri1.h" #include "dri2.h" +#include "drisw.h" #include "util/u_inlines.h" #include "pipe/p_screen.h" @@ -262,6 +265,8 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen, /* let the state tracker allocate the accum buffer */ } +#ifndef __NOT_HAVE_DRM_H + /** * Get information about previous buffer swaps. */ @@ -274,6 +279,8 @@ dri_get_swap_info(__DRIdrawable * dPriv, __DRIswapInfo * sInfo) return 0; } +#endif + static void dri_destroy_option_cache(struct dri_screen * screen) { @@ -308,6 +315,8 @@ dri_destroy_screen(__DRIscreen * sPriv) sPriv->extensions = NULL; } +#ifndef __NOT_HAVE_DRM_H + const struct __DriverAPIRec driDriverAPI = { .DestroyScreen = dri_destroy_screen, .CreateContext = dri_create_context, @@ -334,4 +343,28 @@ PUBLIC const __DRIextension *__driDriverExtensions[] = { NULL }; +#else + +const struct __DriverAPIRec driDriverAPI = { + .DestroyScreen = dri_destroy_screen, + .CreateContext = dri_create_context, + .DestroyContext = dri_destroy_context, + .CreateBuffer = dri_create_buffer, + .DestroyBuffer = dri_destroy_buffer, + .MakeCurrent = dri_make_current, + .UnbindContext = dri_unbind_context, + + .InitScreen = drisw_init_screen, + .SwapBuffers = drisw_swap_buffers, +}; + +/* This is the table of extensions that the loader will dlsym() for. */ +PUBLIC const __DRIextension *__driDriverExtensions[] = { + &driCoreExtension.base, + &driSWRastExtension.base, + NULL +}; + +#endif + /* vim: set sw=3 ts=8 sts=3 expandtab: */ -- cgit v1.1