From nobody Mon Feb 9 16:34:42 2026 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1659107236; cv=none; d=zohomail.com; s=zohoarc; b=Lobuil7T2KjNHpeQ3FQLmY1LPhAx4YgvPK3AntzGGdE1qSJC0LKsrAicI4ok1bDulMf3pmt3rX7YDzvqDH4bzN7DLTPRmSG9gSddZ3sPgthecgbs73Ml3SXmNRuzKjZILsL+MKKme/nGeq0GGCMU9IKUpJXcdvdtQTGMpW6UAGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659107236; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y9jTGz6yycUqlvdaKmP8LetyYM6boIaRuNVp7IEHQfM=; b=aQ0QkXDIMwmGvPO+Oi6y0Tu28R/f90jOu2Qn0u7419PMtEfp0yZJNPTVLmOwcP8+cqqTVitknRpo3KUcdNhshRo1gp7B96XHuWHJaMT+G1qK7wObfwdxUhG3Vcj7WJ0zszApyrxSr3cN072+HgqSSiDZMM/5+PHq/n78cSum0+U= 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 1659107236443769.8224756274608; Fri, 29 Jul 2022 08:07:16 -0700 (PDT) Received: from localhost ([::1]:34848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHRa7-0005kF-0u for importer@patchew.org; Fri, 29 Jul 2022 11:07:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHRXo-0003cx-Sg for qemu-devel@nongnu.org; Fri, 29 Jul 2022 11:04:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHRXk-0005WQ-UU for qemu-devel@nongnu.org; Fri, 29 Jul 2022 11:04:51 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-58-jYTcdJ0nO2-ay0GUGeLHrA-1; Fri, 29 Jul 2022 11:04:46 -0400 Received: by mail-ed1-f71.google.com with SMTP id h15-20020a056402280f00b0043bd8412fe0so3097289ede.16 for ; Fri, 29 Jul 2022 08:04:46 -0700 (PDT) Received: from goa-sendmail ([93.56.169.184]) by smtp.gmail.com with ESMTPSA id c10-20020a17090618aa00b00704fa2748ffsm5261ejf.99.2022.07.29.08.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 08:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659107087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y9jTGz6yycUqlvdaKmP8LetyYM6boIaRuNVp7IEHQfM=; b=CsC/xvxexhQbF0mJSYzoiA30eoM66QwCSH6tdQN6SgQw3ksbuXUiKAnVZh76X7NG+f5VXG 5fIF1OJ9d3G9qH1H297vaVW1LbLhST7j64qhKnZLfFNi2lLl95UHKBWfK1YxtVCOxLFnK7 VFLQBjNs7e5P3wxt4Wiiax6uy6SAzSw= X-MC-Unique: jYTcdJ0nO2-ay0GUGeLHrA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y9jTGz6yycUqlvdaKmP8LetyYM6boIaRuNVp7IEHQfM=; b=MInU204ivvDftirRd28lh+y0Wz1HwB6q3zJ16O8l8b9XgNwscgAw/3tqnJfSfMfLrF VgCIP3iP6YETh+A9LyvSVQOMsLxHNMlcrEvzDjCJlVkQz2sFDwnUWBlxaqHY0nksAseT TMeZmdISsfTGHNnDUYxNOoxGOKTBHxbhT0bFXnq5qISh1qyO6Vhq6QSqyS0CXJp/N56q ZTyClvyS8TC8aFr9TIA7Z0hlT0XRi2d+z+jldkoaYvrBo4R5xsicdCYcEWFAIx6v/pIb LvuNsTzsmqc1NX2pdVEZtmJbjgvCd1POngQMqjZlxa3zSAeDyOLznVYLARVMwkrdOvxG VGeA== X-Gm-Message-State: AJIora+O19MUULrhxkO9ioqhhzR6olpoXEKO5+JPt/kGQX8zRm22oGAe aeqYhqRdZF3gAu7cS587APpNBIfh1GUlqeNdn+prgyENywulhkcTWte++VQ5ZSYAcZlRqKt3UR7 V9sXcUPPJ7PHIm5ra5lmSd+V+cmBNR/bZ/mnpSpYFiOQlmVi80ReAi7r9dpR50oAErHU= X-Received: by 2002:a05:6402:348f:b0:43c:2919:cfb5 with SMTP id v15-20020a056402348f00b0043c2919cfb5mr3919113edc.326.1659107084983; Fri, 29 Jul 2022 08:04:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sMtoLcMgY1uS8qqJ7PSO+4SCI7OdFvpQ+DTvcxZapp249wgSwzU/7/Om+5aCZMI5zT0CCfDA== X-Received: by 2002:a05:6402:348f:b0:43c:2919:cfb5 with SMTP id v15-20020a056402348f00b0043c2919cfb5mr3919070edc.326.1659107084505; Fri, 29 Jul 2022 08:04:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Korneliusz Osmenda Subject: [PULL 2/6] vga: fix incorrect line height in 640x200x2 mode Date: Fri, 29 Jul 2022 17:04:34 +0200 Message-Id: <20220729150438.20293-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220729150438.20293-1-pbonzini@redhat.com> References: <20220729150438.20293-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659107238583100003 Content-Type: text/plain; charset="utf-8" When in CGA modes, QEMU wants to ignore the maximum scan field (bits 0..4) = of the maximum scan length register in the CRTC. It is not clear why this is needed---for example, Bochs ignores bit 7 instead. The issue is that the CGA modes are not detected correctly, and in particular mode 6 results in multi_scan=3D=3D3 according to how SeaBIOS programs it. The right way to c= heck for CGA graphics modes is to check whether bit 13 of the address is special cased by the CRT controller to achieve line interleaving, i.e. whether bit 0 of the CRTC mode control register is clear. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1020 Reported-by: Korneliusz Osmenda Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index 5dca2d1528..50ecb1ad02 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1514,9 +1514,10 @@ static void vga_draw_graphic(VGACommonState *s, int = full_update) force_shadow =3D true; } =20 + /* bits 5-6: 0 =3D 16-color mode, 1 =3D 4-color mode, 2 =3D 256-color = mode. */ shift_control =3D (s->gr[VGA_GFX_MODE] >> 5) & 3; double_scan =3D (s->cr[VGA_CRTC_MAX_SCAN] >> 7); - if (shift_control !=3D 1) { + if (s->cr[VGA_CRTC_MODE] & 1) { multi_scan =3D (((s->cr[VGA_CRTC_MAX_SCAN] & 0x1f) + 1) << double_= scan) - 1; } else { --=20 2.36.1