From nobody Thu Nov 6 06:17:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539348188851559.2780961873674; Fri, 12 Oct 2018 05:43:08 -0700 (PDT) Received: from localhost ([::1]:40280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAwmZ-0001G2-Cg for importer@patchew.org; Fri, 12 Oct 2018 08:43:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAwif-0006uS-W5 for qemu-devel@nongnu.org; Fri, 12 Oct 2018 08:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAwiY-0007c9-S0 for qemu-devel@nongnu.org; Fri, 12 Oct 2018 08:39:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gAwiY-0007aW-Hp for qemu-devel@nongnu.org; Fri, 12 Oct 2018 08:38:58 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3BDB30820C4; Fri, 12 Oct 2018 12:38:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-238.ams2.redhat.com [10.36.116.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id A29857943E; Fri, 12 Oct 2018 12:38:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EB5A74FD5C; Fri, 12 Oct 2018 14:38:51 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 Oct 2018 14:38:48 +0200 Message-Id: <20181012123851.30856-3-kraxel@redhat.com> In-Reply-To: <20181012123851.30856-1-kraxel@redhat.com> References: <20181012123851.30856-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 12 Oct 2018 12:38:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/5] bochs-display: wire up edid support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Message-id: 20181005160147.892-3-kraxel@redhat.com --- hw/display/bochs-display.c | 13 +++++++++++++ hw/display/Makefile.objs | 1 + 2 files changed, 14 insertions(+) diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index 09d8944a1b..3d439eb240 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -9,6 +9,7 @@ #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/display/bochs-vbe.h" +#include "hw/display/edid.h" =20 #include "qapi/error.h" =20 @@ -35,9 +36,13 @@ typedef struct BochsDisplayState { MemoryRegion mmio; MemoryRegion vbe; MemoryRegion qext; + MemoryRegion edid; =20 /* device config */ uint64_t vgamem; + bool enable_edid; + qemu_edid_info edid_info; + uint8_t edid_blob[256]; =20 /* device registers */ uint16_t vbe_regs[VBE_DISPI_INDEX_NB]; @@ -283,6 +288,12 @@ static void bochs_display_realize(PCIDevice *dev, Erro= r **errp) pci_register_bar(&s->pci, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->vram); pci_register_bar(&s->pci, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio); =20 + if (s->enable_edid) { + qemu_edid_generate(s->edid_blob, sizeof(s->edid_blob), &s->edid_in= fo); + qemu_edid_region_io(&s->edid, obj, s->edid_blob, sizeof(s->edid_bl= ob)); + memory_region_add_subregion(&s->mmio, 0, &s->edid); + } + if (pci_bus_is_express(pci_get_bus(dev))) { dev->cap_present |=3D QEMU_PCI_CAP_EXPRESS; ret =3D pcie_endpoint_cap_init(dev, 0x80); @@ -325,6 +336,8 @@ static void bochs_display_exit(PCIDevice *dev) =20 static Property bochs_display_properties[] =3D { DEFINE_PROP_SIZE("vgamem", BochsDisplayState, vgamem, 16 * MiB), + DEFINE_PROP_BOOL("edid", BochsDisplayState, enable_edid, false), + DEFINE_EDID_PROPERTIES(BochsDisplayState, edid_info), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs index 2a0de16a55..2e1b1bcd22 100644 --- a/hw/display/Makefile.objs +++ b/hw/display/Makefile.objs @@ -19,6 +19,7 @@ common-obj-$(CONFIG_VGA_ISA) +=3D vga-isa.o common-obj-$(CONFIG_VGA_ISA_MM) +=3D vga-isa-mm.o common-obj-$(CONFIG_VMWARE_VGA) +=3D vmware_vga.o common-obj-$(CONFIG_BOCHS_DISPLAY) +=3D bochs-display.o +common-obj-$(CONFIG_BOCHS_DISPLAY) +=3D edid-region.o =20 common-obj-$(CONFIG_BLIZZARD) +=3D blizzard.o common-obj-$(CONFIG_EXYNOS4) +=3D exynos4210_fimd.o --=20 2.9.3