From nobody Mon Feb 9 09:23:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562321212; cv=none; d=zoho.com; s=zohoarc; b=dRNKQF241mXlz4xZNvssO2cumAqZgB2vnXDWqsf8kMB+E0PLZratWkxxEHpmYwnTWYnXU4olJZgIiyCD/7DvDsGgcGVue3VAVrrybsGpwtXsSu9GNALEONDkz+3ClspYJmVClvVm+Z3WUlhL6dTKEb0u4V86O6d5aNUz8l6Q09Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562321212; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=Vm/9BKCA7L+vhSd9ckDhfZFIXa/kZb04Ckn0lOuHvLc=; b=dbBp+ZAV+ys/x64UKBzvaxkuExEl0U4KzcPAQtAHAM6UN/IpsbIMpIIa2Ypt/Xh8KmbZN8NoqNdDNs3DwKM09cAnwifgUbekNdy/zBWT6O1BEgt9Rpk23oXMLyLOKso+M/AIGyMJ/gHjYY0j8z7CxJ6aDQozBjLluDdWEEh7Orc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562321212164853.9103339067323; Fri, 5 Jul 2019 03:06:52 -0700 (PDT) Received: from localhost ([::1]:51216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjL76-0001e5-9o for importer@patchew.org; Fri, 05 Jul 2019 06:06:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48801) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjL5H-0000Zc-6y for qemu-devel@nongnu.org; Fri, 05 Jul 2019 06:04:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjL5F-0006kV-Iq for qemu-devel@nongnu.org; Fri, 05 Jul 2019 06:04:51 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:28857) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hjL5F-0006VR-5P for qemu-devel@nongnu.org; Fri, 05 Jul 2019 06:04:49 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 1C76C7461AE; Fri, 5 Jul 2019 12:04:19 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id F18C57461AA; Fri, 5 Jul 2019 12:04:18 +0200 (CEST) Message-Id: <99bb800cba3596e47d2681642116756330dc6f63.1562320946.git.balaton@eik.bme.hu> From: BALATON Zoltan Date: Fri, 5 Jul 2019 12:00:09 +0200 Date: Fri, 05 Jul 2019 12:02:26 +0200 MIME-Version: 1.0 To: qemu-devel@nongnu.org Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:738:2001:2001::2001 Subject: [Qemu-devel] [PATCH] ati-vga: Add registers for getting apertures X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 --- hw/display/ati.c | 15 +++++++++++++++ hw/display/ati_dbg.c | 5 +++++ hw/display/ati_regs.h | 5 +++++ 3 files changed, 25 insertions(+) diff --git a/hw/display/ati.c b/hw/display/ati.c index a747c4cc98..c8fc62505b 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 =3D s->vga.vram_size; break; + case CONFIG_APER_0_BASE: + case CONFIG_APER_1_BASE: + val =3D pci_default_read_config(&s->dev, + PCI_BASE_ADDRESS_0, size) & 0xffffff= f0; + break; + case CONFIG_APER_SIZE: + val =3D s->vga.vram_size; + break; + case CONFIG_REG_1_BASE: + val =3D pci_default_read_config(&s->dev, + PCI_BASE_ADDRESS_2, size) & 0xffffff= f0; + break; + case CONFIG_REG_APER_SIZE: + val =3D memory_region_size(&s->mm); + break; case MC_STATUS: val =3D 5; break; diff --git a/hw/display/ati_dbg.c b/hw/display/ati_dbg.c index 88b3a11315..cbc52025d0 100644 --- a/hw/display/ati_dbg.c +++ b/hw/display/ati_dbg.c @@ -28,6 +28,11 @@ static struct ati_regdesc ati_reg_names[] =3D { {"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}, diff --git a/hw/display/ati_regs.h b/hw/display/ati_regs.h index d7155c93d5..81fb5302c0 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 --=20 2.13.7