SHA256
1
0
forked from pool/qemu
qemu/ati-vga-add-rage128-edid-support.patch
Bruce Rogers 64435eabdc Accepting request 730437 from Virtualization:Staging
Update to v4.1.0. Also includes other major packaging changes as follows:
There is a new package maintenance workflow - see README.PACKAGING for details.
The sibling packages qemu-linux-user and qemu-testsuite are now created with the Build Service's MultiBuild feature. This also necessitates combining the qemu-linux-user changelog content back into qemu's. Luckily the delta there is quite small. Note that the qemu spec file is now that much busier, but added section markers should help reduce the confusion. Also qemu is being enabled for RISCV host compatibility, so some changes are related to that as well.

OBS-URL: https://build.opensuse.org/request/show/730437
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=487
2019-09-12 15:54:03 +00:00

79 lines
2.5 KiB
Diff

From: Gerd Hoffmann <kraxel@redhat.com>
Date: Mon, 24 Jun 2019 13:35:46 +0200
Subject: ati-vga: add rage128 edid support
Git-commit: 020bc4fc5ce93107c8e1bc731b9802cee56a123e
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
vgasrc/atiext.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/roms/seabios/vgasrc/atiext.c b/roms/seabios/vgasrc/atiext.c
index 71dfa859a22dc569ed2fd1312c6b..69dfd46e550a8865734def85c62d 100644
--- a/roms/seabios/vgasrc/atiext.c
+++ b/roms/seabios/vgasrc/atiext.c
@@ -21,6 +21,7 @@
#define CRTC_EXT_CNTL 0x0054
#define GPIO_VGA_DDC 0x0060
#define GPIO_DVI_DDC 0x0064
+#define GPIO_MONID 0x0068
#define CRTC_H_TOTAL_DISP 0x0200
#define CRTC_V_TOTAL_DISP 0x0208
#define CRTC_OFFSET 0x0224
@@ -47,6 +48,7 @@ static u32 ati_i2c_reg VAR16;
static u32 ati_i2c_bit_scl_out VAR16;
static u32 ati_i2c_bit_sda_out VAR16;
static u32 ati_i2c_bit_sda_in VAR16;
+static u32 ati_i2c_bit_enable VAR16 = -1;
int
@@ -208,8 +210,11 @@ ati_set_mode(struct vgamode_s *vmode_g, int flags)
static void
ati_i2c_set_scl_sda(int scl, int sda)
{
+ u32 enable = GET_GLOBAL(ati_i2c_bit_enable);
u32 data = 0;
+ if (enable != -1)
+ data |= (1 << enable);
if (!scl)
data |= (1 << GET_GLOBAL(ati_i2c_bit_scl_out));
if (!sda)
@@ -316,6 +321,23 @@ static void ati_i2c_edid_radeon(void)
dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid");
}
+static void ati_i2c_edid_rage128(void)
+{
+ int valid;
+
+ SET_VGA(ati_i2c_bit_enable, 25);
+ SET_VGA(ati_i2c_bit_scl_out, 18);
+ SET_VGA(ati_i2c_bit_sda_out, 17);
+ SET_VGA(ati_i2c_bit_sda_in, 9);
+ SET_VGA(ati_i2c_reg, GPIO_MONID);
+
+ dprintf(1, "ati: reading edid blob (rage128) ... \n");
+ ati_i2c_edid();
+ valid = (GET_GLOBAL(VBE_edid[0]) == 0x00 &&
+ GET_GLOBAL(VBE_edid[1]) == 0xff);
+ dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid");
+}
+
/****************************************************************
* init
****************************************************************/
@@ -379,6 +401,9 @@ ati_setup(void)
u16 device = pci_config_readw(bdf, PCI_DEVICE_ID);
switch (device) {
+ case 0x5046:
+ ati_i2c_edid_rage128();
+ break;
case 0x5159:
ati_i2c_edid_radeon();
break;