X-Git-Url: https://git.piment-noir.org/?p=deb_xorg-server.git;a=blobdiff_plain;f=debian%2Fpatches%2F111_armel-drv-fallbacks.patch;fp=debian%2Fpatches%2F111_armel-drv-fallbacks.patch;h=bc76c4eec6bcb3a113c163df4c477445f209c249;hp=0000000000000000000000000000000000000000;hb=7217e0ca50bba73dad94782e67980aeeb24ab693;hpb=a09e091a5c996d46a398abb27b06fe504591673f diff --git a/debian/patches/111_armel-drv-fallbacks.patch b/debian/patches/111_armel-drv-fallbacks.patch new file mode 100644 index 0000000..bc76c4e --- /dev/null +++ b/debian/patches/111_armel-drv-fallbacks.patch @@ -0,0 +1,86 @@ +diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c +index 55412b4..d4a95d2 100644 +--- a/hw/xfree86/common/xf86AutoConfig.c ++++ b/hw/xfree86/common/xf86AutoConfig.c +@@ -45,6 +45,12 @@ + #include "xf86sbusBus.h" + #endif + ++#if defined(__arm__) && defined(__linux__) ++#include "loaderProcs.h" ++#include /* For opendir in test_sysfs_device */ ++#include /* For opendir in test_sysfs_device */ ++#endif ++ + #ifdef sun + #include + #include +@@ -200,6 +206,27 @@ xf86AutoConfig(void) + return ret == CONFIG_OK; + } + ++#if defined(__arm__) && defined(__linux__) ++static int ++test_sysfs_device(char *device_name, char *driver_name) ++{ ++ DIR *dir = opendir("/sys/devices/platform"); ++ struct dirent *current_dir; ++ int len = strlen(device_name); ++ ++ while (current_dir = readdir(dir)) { ++ if (strlen(current_dir->d_name) >= len && ++ strncmp(device_name, current_dir->d_name, len) == 0) ++ break; ++ } ++ closedir(dir); ++ if (!current_dir) ++ return 0; ++ ++ return 1; ++} ++#endif /* defined(__arm__) && defined(__linux__) */ ++ + static void + listPossibleVideoDrivers(char *matches[], int nmatches) + { +@@ -287,6 +314,21 @@ listPossibleVideoDrivers(char *matches[], int nmatches) + #endif + } + ++#if defined(__linux__) && defined(__arm__) ++ if (i < (nmatches - 1)) { ++ if (test_sysfs_device("mxc_gpu", "imx")) ++ matches[i++] = xnfstrdup("imx"); ++ else if (test_sysfs_device("dovefb", "dovefb")) ++ matches[i++] = xnfstrdup("dovefb"); ++ else if (test_sysfs_device("omapdrm", "omap")) ++ matches[i++] = xnfstrdup("omap"); ++ else if (test_sysfs_device("omapfb", "omapfb")) ++ matches[i++] = xnfstrdup("omapfb"); ++ else if (test_sysfs_device("omap", "pvr")) ++ matches[i++] = xnfstrdup("pvr"); ++ } ++#endif /* defined(__linux__) && defined(__arm__) */ ++ + #if defined(__linux__) + matches[i++] = xnfstrdup("modesetting"); + #endif +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 24b9473..0061c25 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -362,6 +362,14 @@ xf86platformProbeDev(DriverPtr drvp) + if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) + break; + } ++ else { ++ /* there's no way to handle real platform devices at this point, ++ * as there's no valid busID to be used, so try to move forward ++ * in case there's only one platform device, and see if the ++ * driver's probe succeeds or not at least once */ ++ if ((xf86_num_platform_devices == 1) && (!foundScreen)) ++ break; ++ } + } + } +