Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39F3DC001B0 for ; Sun, 23 Jul 2023 04:42:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 70A0A867C8; Sun, 23 Jul 2023 06:41:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 08B84867CF; Sun, 23 Jul 2023 06:41:24 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 35A3C86607 for ; Sun, 23 Jul 2023 06:41:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng@tinylab.org X-QQ-mid: bizesmtp84t1690087271tyjcadup Received: from ubuntu.. ( [111.196.130.174]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 23 Jul 2023 12:41:10 +0800 (CST) X-QQ-SSF: 01200000000000F0H000000A0000000 X-QQ-FEAT: eSZ1CZgv+JBCsknc9NjpwFnlwUD3WXz6tcIlu1/VRskjyvGHIjZoHYvlx0mZh 6tzLINHA2CEK70OqWG4lp/dGdXdxdAwl165i066d6F71B/fBh/elh8g3IHeR3pb3BOU0GvF RDePm5FHYUZ4RHfHVhA1JlJ0EH1WPwpy5o2ywYEwBuUeeaL5Y2rFVCGWORnUFcPGk0GJzjy jsm+jIwzFK62eR07c+z69YHHWaiXngmMztOj5yFEeliB6TjqrhpRqoQe/zkxNL5EDlgjcwA FOERwnX/Kh1S99lfWXVzXw5Xmw9bmlJ8WRdUKmB0ICiv8j5E2pIA/pipUhKo2bY6fcFdPz9 uWjSZf5ssEH0/v2vTgr4huXnavl6Z7ncK3tAOZc X-QQ-GoodBg: 0 X-BIZMAIL-ID: 739911086382007375 From: Bin Meng To: Simon Glass , u-boot@lists.denx.de Cc: Anatolij Gustschin Subject: [PATCH 09/18] video: bochs: Set the frame buffer size per configuration Date: Sun, 23 Jul 2023 12:40:32 +0800 Message-Id: <20230723044041.1089804-10-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230723044041.1089804-1-bmeng@tinylab.org> References: <20230723044041.1089804-1-bmeng@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean At present the uclass stored frame buffer size is set to a hard coded value, but we can calculate the correct value based on what is configured. Signed-off-by: Bin Meng --- drivers/video/bochs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/bochs.c b/drivers/video/bochs.c index 5923ff81c6..022ea38d4c 100644 --- a/drivers/video/bochs.c +++ b/drivers/video/bochs.c @@ -101,8 +101,8 @@ static int bochs_video_bind(struct udevice *dev) { struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev); - /* Set the maximum supported resolution */ - uc_plat->size = 2560 * 1600 * 4; + /* Set the frame buffer size per configuration */ + uc_plat->size = xsize * ysize * 32 / 8; log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); return 0; -- 2.34.1