From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 1/8] ati-vga: Add registers for getting apertures
Date: Thu, 22 Aug 2019 10:04:55 +0200 [thread overview]
Message-ID: <20190822080503.12063-2-kraxel@redhat.com> (raw)
In-Reply-To: <20190822080503.12063-1-kraxel@redhat.com>
From: BALATON Zoltan <balaton@eik.bme.hu>
Some drivers (e.g. Linux radeon drm and MacOS) access these to find
apertures to access card. Try to implement these but not sure these
are correct yet.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-id: b2df13655feecd63c0049ec45fd87d1026f67091.1565558093.git.balaton@eik.bme.hu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/ati_regs.h | 5 +++++
hw/display/ati.c | 15 +++++++++++++++
hw/display/ati_dbg.c | 5 +++++
3 files changed, 25 insertions(+)
diff --git a/hw/display/ati_regs.h b/hw/display/ati_regs.h
index d7155c93d53b..81fb5302c036 100644
--- a/hw/display/ati_regs.h
+++ b/hw/display/ati_regs.h
@@ -46,6 +46,11 @@
#define CNFG_CNTL 0x00e0
#define GEN_RESET_CNTL 0x00f0
#define CNFG_MEMSIZE 0x00f8
+#define CONFIG_APER_0_BASE 0x0100
+#define CONFIG_APER_1_BASE 0x0104
+#define CONFIG_APER_SIZE 0x0108
+#define CONFIG_REG_1_BASE 0x010c
+#define CONFIG_REG_APER_SIZE 0x0110
#define MEM_CNTL 0x0140
#define MC_FB_LOCATION 0x0148
#define MC_AGP_LOCATION 0x014C
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 35f49a591b7b..6cdcbef238fe 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -307,6 +307,21 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
case CNFG_MEMSIZE:
val = s->vga.vram_size;
break;
+ case CONFIG_APER_0_BASE:
+ case CONFIG_APER_1_BASE:
+ val = pci_default_read_config(&s->dev,
+ PCI_BASE_ADDRESS_0, size) & 0xfffffff0;
+ break;
+ case CONFIG_APER_SIZE:
+ val = s->vga.vram_size;
+ break;
+ case CONFIG_REG_1_BASE:
+ val = pci_default_read_config(&s->dev,
+ PCI_BASE_ADDRESS_2, size) & 0xfffffff0;
+ break;
+ case CONFIG_REG_APER_SIZE:
+ val = memory_region_size(&s->mm);
+ break;
case MC_STATUS:
val = 5;
break;
diff --git a/hw/display/ati_dbg.c b/hw/display/ati_dbg.c
index 88b3a11315d8..cbc52025d01c 100644
--- a/hw/display/ati_dbg.c
+++ b/hw/display/ati_dbg.c
@@ -28,6 +28,11 @@ static struct ati_regdesc ati_reg_names[] = {
{"CNFG_CNTL", 0x00e0},
{"GEN_RESET_CNTL", 0x00f0},
{"CNFG_MEMSIZE", 0x00f8},
+ {"CONFIG_APER_0_BASE", 0x0100},
+ {"CONFIG_APER_1_BASE", 0x0104},
+ {"CONFIG_APER_SIZE", 0x0108},
+ {"CONFIG_REG_1_BASE", 0x010c},
+ {"CONFIG_REG_APER_SIZE", 0x0110},
{"MEM_CNTL", 0x0140},
{"MC_FB_LOCATION", 0x0148},
{"MC_AGP_LOCATION", 0x014C},
--
2.18.1
next prev parent reply other threads:[~2019-08-22 8:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 8:04 [Qemu-devel] [PULL 0/8] Vga 20190822 patches Gerd Hoffmann
2019-08-22 8:04 ` Gerd Hoffmann [this message]
2019-08-22 8:04 ` [Qemu-devel] [PULL 2/8] ati-vga: Add some register definitions for debugging Gerd Hoffmann
2019-08-22 8:04 ` [Qemu-devel] [PULL 3/8] ati-vga: Fix GPIO_MONID register write Gerd Hoffmann
2019-08-22 8:04 ` [Qemu-devel] [PULL 4/8] ati-vga: Fix cursor color with guest_hwcursor=true Gerd Hoffmann
2019-08-22 8:04 ` [Qemu-devel] [PULL 5/8] ati-vga: Fix hardware cursor image offset Gerd Hoffmann
2019-08-22 8:05 ` [Qemu-devel] [PULL 6/8] ati-vga: Attempt to handle CRTC offset not exact multiple of stride Gerd Hoffmann
2019-08-22 8:05 ` [Qemu-devel] [PULL 7/8] ati-vga: Add limited support for big endian frame buffer aperture Gerd Hoffmann
2019-08-22 8:05 ` [Qemu-devel] [PULL 8/8] ati-vga: Implement dummy VBlank IRQ Gerd Hoffmann
2019-08-22 16:01 ` [Qemu-devel] [PULL 0/8] Vga 20190822 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190822080503.12063-2-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).