OSDN Git Service

save
authorAustin Yuan <shengquan.yuan@gmail.com>
Fri, 16 Apr 2010 18:56:53 +0000 (02:56 +0800)
committerAustin Yuan <shengquan.yuan@gmail.com>
Fri, 16 Apr 2010 18:56:53 +0000 (02:56 +0800)
Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
va/Makefile.am
va/android/drmtest.c
va/android/va_android.c
va/va_dummy.h [new symlink]
va/x11/va_dricommon.h

index 508cf7e..f57ac42 100644 (file)
@@ -57,7 +57,7 @@ endif
 libva_la_SOURCES = va.c va_trace.c
 
 libvaincludedir = ${includedir}/va
-libvainclude_HEADERS = va.h va_x11.h va_backend.h va_version.h
+libvainclude_HEADERS = va.h va_x11.h va_backend.h va_dummy.h va_version.h
 
 DISTCLEANFILES = \
        va_version.h
index 685a652..3a8bd0d 100644 (file)
@@ -107,7 +107,7 @@ int drm_open_any(void)
 
        if (fd < 0) {
                fprintf(stderr, "failed to open any drm device\n");
-               abort();
+               //abort();
        }
 
        return fd;
@@ -122,7 +122,7 @@ int drm_open_any_master(void)
 
        if (fd < 0) {
                fprintf(stderr, "failed to open any drm device\n");
-               abort();
+               //abort();
        }
 
        return fd;
index f3ae345..6868084 100644 (file)
@@ -97,8 +97,15 @@ static VAStatus va_DisplayContextGetDriverName (
 
     memset(dri_state, 0, sizeof(*dri_state));
     dri_state->fd = drm_open_any_master();
-    if (dri_state->fd < 0)
+    if (dri_state->fd < 0) {
+        fprintf(stderr, "open DRM device by udev failed, try /dev/dri/card0\n");
+        dri_state->fd = open("/dev/dri/card0", O_RDWR);
+    }
+    
+    if (dri_state->fd < 0) {
+        fprintf(stderr,"can't open DRM devices\n");
         return VA_STATUS_ERROR_UNKNOWN;
+    }
     
     if ((driver_name_env = getenv("LIBVA_DRIVER_NAME")) != NULL
         && geteuid() == getuid())
@@ -110,7 +117,7 @@ static VAStatus va_DisplayContextGetDriverName (
         *driver_name = strdup(devices[0].driver_name);
 
     
-    dri_state->driConnectedFlag = VA_DRI2;
+    dri_state->driConnectedFlag = VA_DUMMY;
     
     return VA_STATUS_SUCCESS;
 }
diff --git a/va/va_dummy.h b/va/va_dummy.h
new file mode 120000 (symlink)
index 0000000..69128f8
--- /dev/null
@@ -0,0 +1 @@
+va_android.h
\ No newline at end of file
index b762bd0..437b64f 100644 (file)
@@ -13,7 +13,8 @@ enum
 {
     VA_NONE = 0,
     VA_DRI1 = 1,
-    VA_DRI2 = 2
+    VA_DRI2 = 2,
+    VA_DUMMY = 3
 };
 
 union dri_buffer