changeset 3116:b17f1ae7ad66

Added support for single buffering, if double buffering is not available.
author Mike Gorchak <lestat@i.com.ua>
date Tue, 05 May 2009 17:50:34 +0000
parents 1102a3305928
children 39da34152ad6
files src/video/qnxgf/SDL_hiddi_joystick.h src/video/qnxgf/SDL_qnxgf.c src/video/qnxgf/SDL_qnxgf.h
diffstat 3 files changed, 45 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/qnxgf/SDL_hiddi_joystick.h	Tue May 05 17:47:41 2009 +0000
+++ b/src/video/qnxgf/SDL_hiddi_joystick.h	Tue May 05 17:50:34 2009 +0000
@@ -29,6 +29,4 @@
 
 #include <inttypes.h>
 
-
-
 #endif /* __SDL_HIDDI_JOYSTICK_H__ */
--- a/src/video/qnxgf/SDL_qnxgf.c	Tue May 05 17:47:41 2009 +0000
+++ b/src/video/qnxgf/SDL_qnxgf.c	Tue May 05 17:50:34 2009 +0000
@@ -91,88 +91,88 @@
 {
    /* ATI Rage 128 graphics driver (devg-ati_rage128)      */
    {"ati_rage128", SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Fujitsu Carmine graphics driver (devg-carmine.so)    */
    {"carmine",     SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_ACCELERATED_3D},
+                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* C&T graphics driver (devg-chips.so)                  */
    {"chips",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION | 
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Fujitsu Coral graphics driver (devg-coral.so)        */
    {"coral",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_ACCELERATED_3D},
+                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Intel integrated graphics driver (devg-extreme2.so)  */
    {"extreme2",    SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_ACCELERATED_3D},
+                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Unaccelerated FB driver (devg-flat.so)               */
    {"flat",        SDL_GF_UNACCELERATED | SDL_GF_LOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
    /* NS Geode graphics driver (devg-geode.so)             */
    {"geode",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Geode LX graphics driver (devg-geodelx.so)           */
    {"geodelx",     SDL_GF_ACCELERATED | SDL_GF_LOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Intel integrated graphics driver (devg-gma9xx.so)    */
    {"gma",         SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_ACCELERATED_3D},
+                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Intel integrated graphics driver (devg-i810.so)      */
    {"i810",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Intel integrated graphics driver (devg-i830.so)      */
    {"i830",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Geode LX graphics driver (devg-lx800.so)             */
    {"lx800",       SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Matrox Gxx graphics driver (devg-matroxg.so)         */
    {"matroxg",     SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Intel Poulsbo graphics driver (devg-poulsbo.so)      */
    {"poulsbo",     SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_ACCELERATED_3D},
+                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* ATI Radeon driver (devg-radeon.so)                   */
    {"radeon",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* ATI Rage driver (devg-rage.so)                       */
    {"rage",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* S3 Savage graphics driver (devg-s3_savage.so)        */
    {"s3_savage",   SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* SiS630 integrated graphics driver (devg-sis630.so)   */
    {"sis630",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* PowerVR SGX 535 graphics driver (devg-poulsbo.so)    */
    {"sgx",         SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_ACCELERATED_3D},
+                   SDL_GF_ACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* SM Voyager GX graphics driver (devg-smi5xx.so)       */
    {"smi5xx",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* Silicon Motion graphics driver (devg-smi7xx.so)      */
    {"smi7xx",      SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* SVGA unaccelerated gfx driver (devg-svga.so)         */
    {"svga",        SDL_GF_UNACCELERATED | SDL_GF_LOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
    /* nVidia TNT graphics driver (devg-tnt.so)             */
    {"tnt",         SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* VIA integrated graphics driver (devg-tvia.so)        */
    {"tvia",        SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* VIA UniChrome graphics driver (devg-unichrome.so)    */
    {"unichrome",   SDL_GF_ACCELERATED | SDL_GF_NOLOWRESOLUTION | 
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* VESA unaccelerated gfx driver (devg-vesa.so)         */
    {"vesa",        SDL_GF_UNACCELERATED | SDL_GF_LOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
    /* VmWare graphics driver (devg-volari.so)              */
    {"vmware",      SDL_GF_ACCELERATED | SDL_GF_LOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_NOVIDEOMEMORY},
    /* XGI XP10 graphics driver (devg-volari.so)            */
    {"volari",      SDL_GF_ACCELERATED | SDL_GF_LOWRESOLUTION |
-                   SDL_GF_UNACCELERATED_3D},
+                   SDL_GF_UNACCELERATED_3D | SDL_GF_VIDEOMEMORY},
    /* End of list */
    {NULL,          0x00000000}
 };
@@ -532,6 +532,8 @@
    SDL_DisplayData* didata;
    uint32_t it;
 
+   /* Stop collecting mouse events */
+   hiddi_disable_mouse();
    /* Delete GF input devices */
    gf_delinputdevices(_this);
 
@@ -1289,6 +1291,13 @@
          surfaces=2;
       }
 
+      /* If driver has no support of video memory allocation, then */
+      /* disable double buffering, use single buffer present copy  */
+      if ((didata->caps & SDL_GF_VIDEOMEMORY)!=SDL_GF_VIDEOMEMORY)
+      {
+         surfaces=1;
+      }
+
       /* Free main surface */
       if (didata->surface[0]!=NULL)
       {
--- a/src/video/qnxgf/SDL_qnxgf.h	Tue May 05 17:47:41 2009 +0000
+++ b/src/video/qnxgf/SDL_qnxgf.h	Tue May 05 17:50:34 2009 +0000
@@ -100,12 +100,14 @@
    uint32_t caps;
 } GF_DeviceCaps;
 
-#define SDL_GF_UNACCELERATED         0x00000000
-#define SDL_GF_ACCELERATED           0x00000001
-#define SDL_GF_NOLOWRESOLUTION       0x00000000
-#define SDL_GF_LOWRESOLUTION         0x00000002
-#define SDL_GF_UNACCELERATED_3D      0x00000000
-#define SDL_GF_ACCELERATED_3D        0x00000004
+#define SDL_GF_UNACCELERATED         0x00000000  /* driver is unaccelerated  */
+#define SDL_GF_ACCELERATED           0x00000001  /* driver is accelerated    */
+#define SDL_GF_NOLOWRESOLUTION       0x00000000  /* no modes below 640x480   */
+#define SDL_GF_LOWRESOLUTION         0x00000002  /* support modes <640x480   */
+#define SDL_GF_UNACCELERATED_3D      0x00000000  /* software OpenGL ES       */
+#define SDL_GF_ACCELERATED_3D        0x00000004  /* hardware acc. OpenGL ES  */
+#define SDL_GF_NOVIDEOMEMORY         0x00000000  /* no video memory alloc.   */
+#define SDL_GF_VIDEOMEMORY           0x00000008  /* has video memory alloc.  */
 
 /****************************************************************************/
 /* SDL_VideoDevice functions declaration                                    */