From nobody Fri Nov 1 07:28:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1708097810; cv=none; d=zohomail.com; s=zohoarc; b=bf8ZfMHPgH5zCRXCPGeaCh3m2E9yTb6q913+3UtbWYYmUXPucHF+zjHGwLFSylnDKg3pGcrDZFWNFkVPmQY5Ppvw2OYuODzEBRmNAalUhJKEIa/TZoQhR0jKHNKPXkHpisp6zYOZu9++aCYk/O8nOdIm63IbWcNB2LDyZa1V9/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708097810; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; b=VNmKRmPewjfaJ2iHqsknHuLENOpnKt2IdnzIbc0HGFmOY0W5lhjsndRCVweXFgNr2EKFbjvIQ4DNnNfKxSZjY9efaYPdHVnRpIM+vxSS9vhb/JjiQwtBWpZ1uwz7m0SyREW9CCFw9bWzHjipEjurPyNrSoVQARUCvIq1YJJ3G4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708097810363476.03588321761436; Fri, 16 Feb 2024 07:36:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb0Fr-0004GI-MZ; Fri, 16 Feb 2024 10:35:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0Fi-0004AJ-J0 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:54 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb0Ff-0008Im-Li for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:50 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-55a8fd60af0so3193124a12.1 for ; Fri, 16 Feb 2024 07:35:46 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id df13-20020a05640230ad00b005621a9b09fbsm83681edb.41.2024.02.16.07.35.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097745; x=1708702545; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; b=OHbhCNXn0vnVsM5RG9SuZuIctabUQbGfbSYJtKURuTuvdJrs+JGCCQqgFNT5r+aZdg r1OCYf0/ro7oFmtLQWz8061n4f5qIJs6UKMdVffDoCeN1LM2mCZj/qBhlQjzGHQBz4FM bacWMeQvkffmzh5BDVCp7LLzGDaxa55LFp8e13xbN9Bp9Lpp59bhH/vlc2O5lNkUnG2k H47gffriNLc1u/GoMNoKMa0VvA+BMKp07abfufSPnZUmo2poQhGyCtG3qwX7AEY5TtZL UkFMD6ZMzFoCleJiSR0zRVZMumLjbm5yJeVcxP6SoRxkD2gfJcXAslAWbiMKp/CuGWz0 DWHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097745; x=1708702545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; b=NZ8Stf+axABhOTSqm5EDXnfA5jZ26VBp1iy9TS+HIqG70C9gYn7PTxcK/vVh0FDGg1 z/gBMoYu3u7FpdwtSK8B7S6YTjDc95b+em4Wqw/mqD7uTgzq+0BiEWYfYRTSZdhUSHtM 6PhEhYBfv81qL6SXXPT1FDgwlf/uUpUlZwWQYxycT1CTwJhyuDPHw42IFj0HLdILodnw tZ6puKUxTIc1aCdVd2qUrdn63M5K7tl88BdN4ShaAZJx6Pt28uoAqSJoNZE0R06Hurww S57XaEhUKxC5i/CSVDnhdxwodpnudCyfm/VkQHW9UnM2kRUbTpKE4cYCGUmB32XwHArV C/eg== X-Gm-Message-State: AOJu0YzcXLagCUTMtnClX8EpxGfndTBxveRlOaieQbRwKCWcsTAPV5m7 m02LT9J9hXX4rnMXY3TLYkFjbKR5HhAzuJ7QOE2RGx4l/FLeUdNUcNXapKkLd62XqIR7hvZH0ql P X-Google-Smtp-Source: AGHT+IGAFxEntDsPXEoYg04THRPSQ35FumBk18CuWooi3xaKjvMlW2W8e2Rd87e9wlVE4krtOGb7/g== X-Received: by 2002:a05:6402:793:b0:564:1c0:bf4b with SMTP id d19-20020a056402079300b0056401c0bf4bmr836119edy.40.1708097744750; Fri, 16 Feb 2024 07:35:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/6] hw/display/exynos4210_fimd: Pass frame buffer memory region as link Date: Fri, 16 Feb 2024 16:35:15 +0100 Message-ID: <20240216153517.49422-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1708097811035100009 Add the Exynos4210fimdState::'framebuffer-memory' property. Have the board set it. We don't need to call sysbus_address_space() anymore. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/display/exynos4210_fimd.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 84687527d5..5712558e13 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "hw/qdev-properties.h" #include "hw/hw.h" #include "hw/irq.h" #include "hw/sysbus.h" @@ -32,6 +33,7 @@ #include "qemu/bswap.h" #include "qemu/module.h" #include "qemu/log.h" +#include "qapi/error.h" #include "qom/object.h" =20 /* Debug messages configuration */ @@ -302,6 +304,7 @@ struct Exynos4210fimdState { MemoryRegion iomem; QemuConsole *console; qemu_irq irq[3]; + MemoryRegion *fbmem; =20 uint32_t vidcon[4]; /* Video main control registers 0-3 */ uint32_t vidtcon[4]; /* Video time control registers 0-3 */ @@ -1119,7 +1122,6 @@ static void exynos4210_fimd_invalidate(void *opaque) * VIDOSDA, VIDOSDB, VIDWADDx and SHADOWCON registers */ static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned wi= n) { - SysBusDevice *sbd =3D SYS_BUS_DEVICE(s); Exynos4210fimdWindow *w =3D &s->window[win]; hwaddr fb_start_addr, fb_mapped_len; =20 @@ -1147,8 +1149,7 @@ static void fimd_update_memory_section(Exynos4210fimd= State *s, unsigned win) memory_region_unref(w->mem_section.mr); } =20 - w->mem_section =3D memory_region_find(sysbus_address_space(sbd), - fb_start_addr, w->fb_len); + w->mem_section =3D memory_region_find(s->fbmem, fb_start_addr, w->fb_l= en); assert(w->mem_section.mr); assert(w->mem_section.offset_within_address_space =3D=3D fb_start_addr= ); DPRINT_TRACE("Window %u framebuffer changed: address=3D0x%08x, len=3D0= x%x\n", @@ -1924,6 +1925,12 @@ static const GraphicHwOps exynos4210_fimd_ops =3D { .gfx_update =3D exynos4210_fimd_update, }; =20 +static Property exynos4210_fimd_properties[] =3D { + DEFINE_PROP_LINK("framebuffer-memory", Exynos4210fimdState, fbmem, + TYPE_MEMORY_REGION, MemoryRegion *), + DEFINE_PROP_END_OF_LIST(), +}; + static void exynos4210_fimd_init(Object *obj) { Exynos4210fimdState *s =3D EXYNOS4210_FIMD(obj); @@ -1944,6 +1951,11 @@ static void exynos4210_fimd_realize(DeviceState *dev= , Error **errp) { Exynos4210fimdState *s =3D EXYNOS4210_FIMD(dev); =20 + if (!s->fbmem) { + error_setg(errp, "'framebuffer-memory' property was not set"); + return; + } + s->console =3D graphic_console_init(dev, 0, &exynos4210_fimd_ops, s); } =20 @@ -1954,6 +1966,7 @@ static void exynos4210_fimd_class_init(ObjectClass *k= lass, void *data) dc->vmsd =3D &exynos4210_fimd_vmstate; dc->reset =3D exynos4210_fimd_reset; dc->realize =3D exynos4210_fimd_realize; + device_class_set_props(dc, exynos4210_fimd_properties); } =20 static const TypeInfo exynos4210_fimd_info =3D { --=20 2.41.0