[Mesa-dev] [PATCH 2/8] st/dri: use pipe_screen::get_driver_name to select the config

Vadim Girlin vadimgirlin at gmail.com
Mon Apr 9 08:32:33 PDT 2012


If optional pipe_screen::get_driver_name is implemented, then use returned
string to select the configuration, instead of "dri".

Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
---
 .../state_trackers/dri/common/dri_context.c        |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c
index e07e168..780cab1 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -36,6 +36,7 @@
 #include "dri_context.h"
 
 #include "pipe/p_context.h"
+#include "pipe/p_screen.h"
 #include "state_tracker/st_context.h"
 
 static void
@@ -64,6 +65,8 @@ dri_create_context(gl_api api, const struct gl_config * visual,
    struct st_context_iface *st_share = NULL;
    struct st_context_attribs attribs;
    enum st_context_error ctx_err = 0;
+   struct pipe_screen * pscreen = screen->base.screen;
+   const char *driverName;
 
    memset(&attribs, 0, sizeof(attribs));
    switch (api) {
@@ -103,8 +106,13 @@ dri_create_context(gl_api api, const struct gl_config * visual,
    ctx->cPriv = cPriv;
    ctx->sPriv = sPriv;
 
+   if (pscreen->get_driver_name)
+	   driverName = pscreen->get_driver_name(pscreen);
+   else
+	   driverName = "dri";
+
    driParseConfigFiles(&ctx->optionCache,
-		       &screen->optionCache, sPriv->myNum, "dri");
+		       &screen->optionCache, sPriv->myNum, driverName);
 
    dri_fill_st_visual(&attribs.visual, screen, visual);
    ctx->st = stapi->create_context(stapi, &screen->base, &attribs, &ctx_err,
-- 
1.7.7.6



More information about the mesa-dev mailing list