void-packages/srcpkgs/xf86-video-mga/patches/no-vbe-non-x86.patch
Đoàn Trần Công Danh 3353bf4722 srcpkgs/x*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

89 lines
2.3 KiB
Diff

From 9bbf539cee8b899c09454a433b8e6fca349400df Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Mon, 22 Feb 2021 21:08:26 +0100
Subject: [PATCH] only attempt to use VBE on x86
---
src/mga_driver.c | 10 ++++++++--
src/mga_merge.c | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git src/mga_driver.c src/mga_driver.c
index 94183db..68f911f 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -77,7 +77,9 @@
#include "xf86DDC.h"
+#if defined(__i386__) || defined(__x86_64__)
#include "vbe.h"
+#endif
#include "fb.h"
#include "dixstruct.h"
@@ -1378,6 +1380,7 @@ MGAdoDDC(ScrnInfoPtr pScrn)
pMga->ddc1Read ) ;
from = "DDC1";
}
+#if defined(__i386__) || defined(__x86_64__)
if (!MonInfo){
vbeInfoPtr pVbe;
if (xf86LoadSubModule(pScrn, "vbe")) {
@@ -1387,6 +1390,7 @@ MGAdoDDC(ScrnInfoPtr pScrn)
from = "VBE";
}
}
+#endif
}
if (MonInfo) {
@@ -1418,12 +1422,14 @@ MGAdoDDC(ScrnInfoPtr pScrn)
void
MGAProbeDDC(ScrnInfoPtr pScrn, int index)
{
+#if defined(__i386__) || defined(__x86_64__)
vbeInfoPtr pVbe;
if (xf86LoadSubModule(pScrn, "vbe")) {
pVbe = VBEInit(NULL,index);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
vbeFree(pVbe);
}
+#endif
}
Bool
@@ -1905,7 +1911,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling KVM\n");
}
-#if !defined(__powerpc__)
+#if defined(__i386__) || defined(__x86_64__)
pMga->softbooted = FALSE;
Default = (pMga->chip_attribs->dual_head_possible
&& !pMga->Primary && !pMga->SecondCrtc);
@@ -2251,7 +2257,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
*/
(*pMga->PreInit)(pScrn);
-#if !defined(__powerpc__)
+#if defined(__i386__) || defined(__x86_64__)
/* Read and print the Monitor DDC info */
pScrn->monitor->DDC = MGAdoDDC(pScrn);
diff --git src/mga_merge.c src/mga_merge.c
index 64c85b4..62a6330 100644
--- a/src/mga_merge.c
+++ b/src/mga_merge.c
@@ -406,7 +406,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
*/
(*pMga->PreInit)(pScrn);
-#if !defined(__powerpc__)
+#if defined(__i386__) || defined(__x86_64__)
/* Read and print the Monitor DDC info */
/* pScrn->monitor->DDC = MGAdoDDC(pScrn);*/ /*FIXME: have to try this*/
--
2.30.1