From patchwork Tue Jul 26 15:20:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 593454 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b811:0:0:0:0 with SMTP id fc17csp3644591mab; Tue, 26 Jul 2022 08:25:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vY8zRep2lxAXkGnYJmOvcoq2BNpWMeGBLUcDoY+k/BTGHQhuAcWXpOFUvDypZWKaNozLvF X-Received: by 2002:a05:620a:46ac:b0:6b6:74c:6b53 with SMTP id bq44-20020a05620a46ac00b006b6074c6b53mr13616530qkb.620.1658849140578; Tue, 26 Jul 2022 08:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658849140; cv=none; d=google.com; s=arc-20160816; b=ISXPHSUocs5RbuAPkjiHWPG4Tgw3+JjLMuGi3vUiuwu4hr0tYf9qLJpMEz31F2YDIR cJDxbCpwn4MDUUmDHSjiAIqve2Ymmj/JcduKAcivQvsGbBXN8Bo10TsARYtpH8pANGHS lRmbFPr8+cE6Yae5cbppJ3GsHs0M5wkyIVsfWoVd7LJRecLOd8iJa8ruSgC5ek1AipZi HVTWZI7GZS5m0cC4w+2rmFLKszRMrvGVybUZcGPhXRStpTyw18q8kLsa1RALmTfV9OGV yDGatViWIk3T+EPPlqQpLXFbWjIqPBwJ/Gg4bfkr1PCOQ/ofJtYMvIF1fRiTRv3ntE7z RwyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=pjPZonZgIif23LZ1eMjprz1ddmRluH8DP+Iy9f6sgDM=; b=weM1PhXDI1bflkY86kqEWd8weWVYhyAB/4AMw6pMTZ7zLgeK+n7gAGK2vLWGgSLHtf cTGtAxW4f7oHh688/hgeGw/LVdEmwzMoez7KkgeLZpFWQl2HnBh605ZbTjHq2UuMRbPk fqB4mZGdNO07zmP3W3nb/MCSIOQNhz3KgcIdmGwRgkXRTbZRrPCEThWu6q6fgTlhPIfU SOtD9RcZyg/x7/YxufERj8RNGMhCl6rDSULyzzqGTtkkdaGgboKOrr12r4wpRlb9x/Tq RkhfbP0zGmoOZIHzLP/wvJ/wrFZVTAQD5dtaSGgUY/3e9VBGRxMujrpmOrm9L065VQBj ScbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=twyBhViC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n17-20020a05622a041100b0031bf5ebaaf3si12257327qtx.47.2022.07.26.08.25.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jul 2022 08:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=twyBhViC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGMRG-0003uF-O1 for patch@linaro.org; Tue, 26 Jul 2022 11:25:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGMMI-0006Vg-Rl for qemu-devel@nongnu.org; Tue, 26 Jul 2022 11:20:35 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:51736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGMMD-00063j-Ey for qemu-devel@nongnu.org; Tue, 26 Jul 2022 11:20:30 -0400 Received: by mail-wm1-x32f.google.com with SMTP id id17so8962783wmb.1 for ; Tue, 26 Jul 2022 08:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pjPZonZgIif23LZ1eMjprz1ddmRluH8DP+Iy9f6sgDM=; b=twyBhViCa3bdyDCbXVONj55ckcfmc3r4DYT7tfLNsRIkfzbCfJAKB/DzeVZh32s6zR O9u7FdQLu/U0wDycfsBBno2m4r9GotOpteYrkgvQG5giVR2lznftvE6j0fsr7GcXvXqP BnK31OchApsHrC6EEfAt22Ox5HB2qqu9/f4Aiob1x0eF54oL7r9kjpHn32L6rzCVqksK CGhpwq86ty127nqcoeU8JpX/WLszlqtwPL3yA67LlzsBCXlav9fnap7tJYmosW0udDwO A8u92dKK4W1NFyzvSRp6TjQMfUpjor0679LByECHoTA8voddhZwcWcTl0HmQyVa82Pms 1CZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pjPZonZgIif23LZ1eMjprz1ddmRluH8DP+Iy9f6sgDM=; b=ebI6dJfD4Bdl0Md4M/LAMW2pLl95wVEcZkL8gI+uJGYoj2fESlAAXXiWWdAtybFzNl 1W9zsHoKUn4sCBAYUnagkg+l9PS/BtDe6YIg/ahxjHuXajzHaF2C2ShU0+5O9NL66OcX oN8vhC7Te2tUQm5101CbHRtuifcDi6L58UgN5W9aS5vqGn84vxwMsj404kio2kx00sQJ 5LMO+P4OJZ0Q89Alpy0ka8IY20lCs3zatOKdgTiWBTTjQB6KAnC7Zw2qKzaE3czyfDoO 7ujUud9c42tG8tpDN7JdJww7aO5WtLu3NZ/70XwU8HfItuXMrdXGYbNom3AhLPKC1Fnl AaGA== X-Gm-Message-State: AJIora8tBdtx0KYBkqz+dBPpwoXHHA2NPoTfGxhCQJ5CMrS3+JKIXHgr LiiFxVAs6i/qZlm/dr1crOaoOzyDT3YV2A== X-Received: by 2002:a7b:ce0a:0:b0:3a3:1adf:af34 with SMTP id m10-20020a7bce0a000000b003a31adfaf34mr12306948wmc.127.1658848823710; Tue, 26 Jul 2022 08:20:23 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n5-20020a1c2705000000b003a1980d55c4sm21932739wmn.47.2022.07.26.08.20.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 08:20:23 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 9/9] hw/display/bcm2835_fb: Fix framebuffer allocation address Date: Tue, 26 Jul 2022 16:20:12 +0100 Message-Id: <20220726152012.1631158-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220726152012.1631158-1-peter.maydell@linaro.org> References: <20220726152012.1631158-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alan Jian This patch fixes the dedicated framebuffer mailbox interface by removing an unneeded offset. This means that we pick the framebuffer address in the same way that we do if the guest code uses the buffer allocate mechanism of the bcm2835_property interface (case 0x00040001: /* Allocate buffer */ in bcm2835_property.c). The documentation of this mailbox interface doesn't say anything about using parts of the request buffer address to affect the chosen framebuffer address: https://github.com/raspberrypi/firmware/wiki/Mailbox-framebuffer-interface Some baremetal applications like the Screen01/Screen02 examples from Baking Pi tutorial[1] didn't work before this patch. [1] https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen01.html Signed-off-by: Alan Jian Message-id: 20220725145838.8412-1-alanjian85@outlook.com [PMM: tweaked commit message] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/display/bcm2835_fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c index 088fc3d51c5..a05277674f2 100644 --- a/hw/display/bcm2835_fb.c +++ b/hw/display/bcm2835_fb.c @@ -279,8 +279,7 @@ static void bcm2835_fb_mbox_push(BCM2835FBState *s, uint32_t value) newconf.xoffset = ldl_le_phys(&s->dma_as, value + 24); newconf.yoffset = ldl_le_phys(&s->dma_as, value + 28); - newconf.base = s->vcram_base | (value & 0xc0000000); - newconf.base += BCM2835_FB_OFFSET; + newconf.base = s->vcram_base + BCM2835_FB_OFFSET; /* Copy fields which we don't want to change from the existing config */ newconf.pixo = s->config.pixo;