From patchwork Thu Jul 18 13:20:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 813168 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp289691wro; Thu, 18 Jul 2024 06:20:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWDByF7qFnASSAcQbZQ3UE9Mjoma6dazwBFvQaF0+bzzd22tcUiY9Qsli1/nmTmiKrZyUlS2+fuj5P0GpXGvszi X-Google-Smtp-Source: AGHT+IGN3/d53Cpe+vLZMw5/nOUnq3UqaZeAb8U5aPvsUT6xnOUkxrnyE/p8ZFZFmRIoZC41XGt/ X-Received: by 2002:a05:6808:14c3:b0:3d9:6fbc:1b70 with SMTP id 5614622812f47-3dad521d8c3mr4292072b6e.24.1721308848604; Thu, 18 Jul 2024 06:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721308848; cv=none; d=google.com; s=arc-20160816; b=cQcruxnQtpTHzfgwXoAJErnXkhxKPSgRVHnAJxmZKnbXQZNnS55EfQDU2mJiRjYAfU fREZ2rqH2R0iMPKXZkvhAKAkMJNTb1PHiC44D4NH2DOzBGAZlYGQzqjs7DINVTg0kJuH 4xhesCA416y49E91Z+aAY5PDV1m4WgP8qJ4KViJmr8jyCyLbGjGijELa2V7A29gHjcgn qtq/zlLYx1aGcSiRjcORTJn3kwlTJa1UiIUQX7q2tcWgCn8psKTVKmNkZT9m32CiMnhC oiBQhV1qtGNs6CoOJm82wHz6ninGmxzpYcTaWcJk8sg84/5xYh2wduIaRTMWdt7f5AZU wFbg== 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=yCmmBscXHr7DP5v15ZBTuTVPUGJ3/3t6QvO+9hat3Zg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=VOcTQo4Cksewn/3xwG9+UTo0yQ11AhXiF0dSNkkBql6WHWz4RPIWrAh4ONbPA8alCw A61e7XCj002GiO3a3PN1iZVS+8IR+n7bI4pTvLUugsojcPa6wHLpxxb6H0OrcX9dSs5G tdhyuNEQ9j5N3Aka5MTsGcnTlaOgFhOMYbRFBqzHePk1y2Ok3scWV1ZMDxL78WyqOHdS F9pNKAU8jA/GHgdPHzQX5T0pIOUyKDPmVpYHV5GMFzgXqfnIpfa42RA3NdM7hkGgAsGR Nu7u0HhSOLJZCZZ+42orSQ8A/a/oeOiZ7qB16+aPNLEDSRfL6/Z2LBAAxUjoH1VYZYy9 QvaA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZXzWSJwm; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-491561e4f52si970521137.801.2024.07.18.06.20.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jul 2024 06:20:48 -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=ZXzWSJwm; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUR3q-0008F5-Oa; Thu, 18 Jul 2024 09:20:42 -0400 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 1sUR3l-0007td-4l for qemu-devel@nongnu.org; Thu, 18 Jul 2024 09:20:38 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sUR3i-0004Sw-O2 for qemu-devel@nongnu.org; Thu, 18 Jul 2024 09:20:36 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2eefc3d707dso10106351fa.0 for ; Thu, 18 Jul 2024 06:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721308832; x=1721913632; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yCmmBscXHr7DP5v15ZBTuTVPUGJ3/3t6QvO+9hat3Zg=; b=ZXzWSJwmIXu4ps812/7Zlkt10i+g9PzqVVi66timp6scgeqeoEAARK14HUg1o5aMme 2DmLEJ/ekfpXmsJNPtWMx5TXQhfStM9bjlgNO8y6Bigox4NRH12Mrmlquejv7+N2NZgu KAvebyV02Cg0+49/YiJNDz/KgiTbLo9lNPWTIpbeOEbTIfkR3NCTBQwNEBmbLdbgbCOu gOsKOW3MKQSnauVVn2iXdESSS2ApziWYakhwCx1Bb+btmYeG3SAw+mWF5UDlHWI7IEwV lCPXoL0tEH0IUizLdxmV4OMPN9HXzcbzImqmQloMvxo2K6KH/iNp/uDUygLfJlY99bQH Rv8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721308832; x=1721913632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yCmmBscXHr7DP5v15ZBTuTVPUGJ3/3t6QvO+9hat3Zg=; b=Lg3pYg4zqSxGO0/EPLdJ7uOG6dKZTXaEHdYBlP3j0psp/2PAwKdIEMoDxKMJS2zvzs ntytLZO9+7ui6omTxTjdAvBiOhX+iYq2JEr5BN9qLCwTvISb3BIZOD8v+etq/m8hb2Jt kzC12XhURQ7dGQvBIYtUCLboH88v/SRglXP9KrEE0ylLxCAbQOqhzFKnfmEoP3qyWolo MQG7QPvXiOxCvZW60uPFFxU6mDzG6rGWgSzyV20svRQiGW7aGT7nJKV/M2JbVAdSMnry h7/xDOX4OQw2vnok47NYl66zYfi1lxIjF3efj4avTQyq/6dn7jfiJrNutZMl2lSuRL7J odbA== X-Gm-Message-State: AOJu0YwyitLTObNa0EeFNAsa7tm4pYn7xRpg5K3m2FXoAQJXNDeUFIVG n5XGskD7Wu+a5rCPLgAA+QSydJl7zPg17RcQLYKHO6qLsjAC3apnW1ObNg8eHmdtuyIMqhdDu1L C X-Received: by 2002:a2e:7314:0:b0:2ee:bd1b:84c with SMTP id 38308e7fff4ca-2ef05996013mr16963951fa.0.1721308831557; Thu, 18 Jul 2024 06:20:31 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a8e420sm14059315e9.35.2024.07.18.06.20.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 06:20:31 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/26] hw/display/bcm2835_fb: fix fb_use_offsets condition Date: Thu, 18 Jul 2024 14:20:05 +0100 Message-Id: <20240718132028.697927-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718132028.697927-1-peter.maydell@linaro.org> References: <20240718132028.697927-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x236.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 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-bounces+patch=linaro.org@nongnu.org From: SamJakob It is common practice when implementing double-buffering on VideoCore to do so by multiplying the height of the virtual buffer by the number of virtual screens desired (i.e., two - in the case of double-bufferring). At present, this won't work in QEMU because the logic in fb_use_offsets require that both the virtual width and height exceed their physical counterparts. This appears to be unintentional/a typo and indeed the comment states; "Experimentally, the hardware seems to do this only if the viewport size is larger than the physical screen". The viewport/virtual size would be larger than the physical size if either virtual dimension were larger than their physical counterparts and not necessarily both. Signed-off-by: SamJakob Message-id: 20240713160353.62410-1-me@samjakob.com Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- hw/display/bcm2835_fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c index e40ed2d2e18..650db3da82c 100644 --- a/hw/display/bcm2835_fb.c +++ b/hw/display/bcm2835_fb.c @@ -145,7 +145,7 @@ static bool fb_use_offsets(BCM2835FBConfig *config) * viewport size is larger than the physical screen. (It doesn't * prevent the guest setting this silly viewport setting, though...) */ - return config->xres_virtual > config->xres && + return config->xres_virtual > config->xres || config->yres_virtual > config->yres; }