void-packages/srcpkgs/xf86-video-r128/patches/fix-non-x86.patch

124 lines
3.8 KiB
Diff

From 827f6ce66f57bb5777b32d9badb943cc57b9b1c9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Thu, 23 Jan 2020 19:25:56 +0100
Subject: [PATCH xf86-video-r128] Disable VBE on non-x86, disable XAA, fix
invalid VBIOS access
This should fix the driver on non-x86 platforms.
XAA disablement taken from:
https://code.foxkit.us/adelie/packages/blob/master/user/xf86-video-r128
---
src/r128_driver.c | 24 ++++++++++++++++--------
src/r128_output.c | 1 +
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git src/r128_driver.c src/r128_driver.c
index 18ff57f..3f9159a 100644
--- src/r128_driver.c
+++ src/r128_driver.c
@@ -91,7 +91,11 @@
#endif
#include "xf86cmap.h"
#include "xf86xv.h"
+#if defined(__i386__) || defined(__x86_64__)
#include "vbe.h"
+#else
+typedef void *xf86Int10InfoPtr;
+#endif
/* fbdevhw & vgahw */
#ifdef WITH_VGAHW
@@ -417,11 +421,14 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
return FALSE;
}
+#if defined(__x86_64__) || defined(__i386__)
if (pInt10) {
info->BIOSAddr = pInt10->BIOSseg << 4;
(void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr),
R128_VBIOS_SIZE);
- } else {
+ } else
+#endif
+ {
#ifdef XSERVER_LIBPCIACCESS
if (pci_device_read_rom(info->PciInfo, info->VBIOS)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -986,7 +993,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
static Bool R128PreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
{
-#if !defined(__powerpc__) && !defined(__alpha__) && !defined(__sparc__)
+#if defined(__i386__) || defined(__x86_64__)
R128InfoPtr info = R128PTR(pScrn);
vbeInfoPtr pVbe;
#endif
@@ -994,8 +1001,7 @@ static Bool R128PreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE;
if (!xf86LoadSubModule(pScrn, "i2c")) return FALSE;
-#if defined(__powerpc__) || defined(__alpha__) || defined(__sparc__)
- /* Int10 is broken on PPC and some Alphas */
+#if !defined(__i386__) && !defined(__x86_64__)
return TRUE;
#else
if (xf86LoadSubModule(pScrn, "vbe")) {
@@ -1031,9 +1037,8 @@ static Bool R128PreInitCursor(ScrnInfoPtr pScrn)
static Bool R128PreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
{
+#if defined(__i386__) || defined(__x86_64__)
R128InfoPtr info = R128PTR(pScrn);
-#if !defined(__powerpc__) && !defined(__alpha__)
- /* int10 is broken on some Alphas and powerpc */
if (xf86LoadSubModule(pScrn, "int10")) {
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n");
*ppInt10 = xf86InitInt10(info->pEnt->index);
@@ -1377,9 +1382,11 @@ static Bool R128LegacyMS(ScrnInfoPtr pScrn)
ret = TRUE;
freeInt10:
/* Free int10 info */
+#if defined(__i386__) || defined(__x86_64__)
if (pInt10) {
xf86FreeInt10(pInt10);
}
+#endif
exit:
return ret;
@@ -1887,14 +1894,15 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
}
if (!info->noAccel) {
+#ifdef HAVE_XAA_H
if (R128XAAAccelInit(pScreen)) {
info->accelOn = TRUE;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"XAA acceleration enabled.\n");
- } else {
+ } else
+#endif
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Acceleration disabled.\n");
- }
}
}
}
diff --git src/r128_output.c src/r128_output.c
index 1d98fb9..5a94a3f 100644
--- src/r128_output.c
+++ src/r128_output.c
@@ -426,6 +426,7 @@ void R128GetConnectorInfoFromBIOS(ScrnInfoPtr pScrn, R128OutputType *otypes)
/* non-x86 platform */
if (!info->VBIOS) {
otypes[0] = OUTPUT_VGA;
+ return;
}
bios_header = R128_BIOS16(0x48);
--
2.25.0