summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaitao Feng <haitao.feng@intel.com>2010-12-13 18:00:05 +0200
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-12-13 20:32:09 +0200
commita3ef2bd5b5be998b67b64ea787e1f0ea09730279 (patch)
tree1acd3fe7f988734833bfe977c8db88c139f1c51e
parentabdab32a364a0585a6327d6b2a62f52cf9821d8b (diff)
kdrive: enable notfp feature for Xephyrephyr-dri2
Signed-off-by: Haitao Feng <haitao.feng@intel.com> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
-rw-r--r--hw/kdrive/ephyr/ephyr.c1
-rw-r--r--hw/kdrive/ephyr/ephyrhostglx.c27
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c8
3 files changed, 36 insertions, 0 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 47bd82df0..c1faeca5f 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -56,6 +56,7 @@ EphyrKeySyms ephyrKeySyms;
Bool ephyrNoDRI=FALSE ;
Bool ephyrNoDRI2=FALSE ;
Bool ephyrNoOSR=FALSE ;
+Bool ephyrNoTFP=FALSE ;
Bool ephyrNoXV=FALSE ;
static int mouseState = 0;
diff --git a/hw/kdrive/ephyr/ephyrhostglx.c b/hw/kdrive/ephyr/ephyrhostglx.c
index 728687b46..2475c8a7a 100644
--- a/hw/kdrive/ephyr/ephyrhostglx.c
+++ b/hw/kdrive/ephyr/ephyrhostglx.c
@@ -153,6 +153,10 @@ typedef struct GLXGenericGetString {
#define sz_xGLXGenericGetStringReq 12
#define X_GLXGenericGetString 0
+#ifdef DRI2
+extern Bool ephyrNoTFP;
+#endif
+
Bool
ephyrHostGLXGetStringFromServer (int a_screen_number,
int a_string_name,
@@ -166,6 +170,13 @@ ephyrHostGLXGetStringFromServer (int a_screen_number,
xGLXSingleReply reply;
int length=0, numbytes=0, major_opcode=0, get_string_op=0;
+#ifdef DRI2
+ const char *glx_texture_from_pixmap = "GLX_EXT_texture_from_pixmap ";
+ char *start = NULL;
+ char *end = NULL;
+ int pos = 0, len = 0;
+#endif
+
EPHYR_RETURN_VAL_IF_FAIL (dpy && a_string, FALSE) ;
EPHYR_LOG ("enter\n") ;
@@ -232,6 +243,22 @@ ephyrHostGLXGetStringFromServer (int a_screen_number,
EPHYR_LOG ("strname:%#x, strvalue:'%s', strlen:%d\n",
a_string_name, *a_string, numbytes) ;
+#ifdef DRI2
+ if (ephyrNoTFP) {
+ start = strstr(*a_string, glx_texture_from_pixmap);
+ if (start){
+ EPHYR_LOG ("strname:%#x, strvalue:'%s', strlen:%d\n",
+ a_string_name, *a_string, numbytes) ;
+ len = strlen(glx_texture_from_pixmap);
+ pos = start - *a_string;
+ end = start + strlen(glx_texture_from_pixmap);
+ memmove(start, end, numbytes + 1 - pos - len);
+ EPHYR_LOG ("strname:%#x, strvalue:'%s', strlen:%d\n",
+ a_string_name, *a_string, numbytes) ;
+ }
+ }
+#endif
+
is_ok = TRUE ;
out:
EPHYR_LOG ("leave\n") ;
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 07e6c6521..5492e4052 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -38,6 +38,7 @@ extern Bool kdHasKbd;
extern Bool ephyrNoDRI;
extern Bool ephyrNoDRI2;
extern Bool ephyrNoOSR;
+extern Bool ephyrNoTFP;
extern Bool noGlxVisualInit;
#endif
extern Bool ephyrNoXV;
@@ -124,6 +125,7 @@ ddxUseMsg (void)
ErrorF("-nodri do not use DRI\n");
ErrorF("-nodri2 do not use DRI2\n");
ErrorF("-noosr do not use off-screen rendering\n");
+ ErrorF("-notfp do not use texture from pixmap extension\n");
#endif
ErrorF("-noxv do not use XV\n");
ErrorF("-name [name] define the name in the WM_CLASS property\n");
@@ -265,6 +267,12 @@ ddxProcessArgument (int argc, char **argv, int i)
EPHYR_LOG ("no off-screen rendering enabled\n") ;
return 1 ;
}
+ else if (!strcmp (argv[i], "-notfp"))
+ {
+ ephyrNoTFP = TRUE ;
+ EPHYR_LOG ("no texture from pixmap enabled\n") ;
+ return 1 ;
+ }
#endif
else if (!strcmp (argv[i], "-noxv"))
{