From nobody Tue Nov 26 22:14:09 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1704015643; cv=none; d=zohomail.com; s=zohoarc; b=Gdh05FY/RaWV4YX2C/Qods0YeR90XYQUwZkXzJ898cQhWJVx+tmuVWKTM+gGorUmvQAGjn899N1hozMk6NoVMe7zhyvvTnlDnZJOMyk3tqaLMtP0cc7RVqKjgxT0pdLMRRwaMS5cwT40FbgJmeCnKNd1fqAC1DNabw1+XuQP9wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704015643; 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=zGuVDWpXyHgDtnpBoCqtCU0iZWlD325c2JY3QKidV/E=; b=Nb7zBk57iQ3VnHjKC7/Y15FAYyI9K3W2AFyxTRGMm36dOUnrLblawT2Df8zGsuSY0YDpCTTzmmLEkpcB5a0l7CxF5joYkp5nPPmjtYdhzU2V2UCYLqdbPk+EMciKGG8wYAdXC9W8+3+S8alZH6cw2n9HpcctBzpSjLPdXuiA1lI= 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 1704015643121976.1209700953244; Sun, 31 Dec 2023 01:40:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJsIX-0003Vk-5x; Sun, 31 Dec 2023 04:39:57 -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 1rJsIO-0003NA-IF for qemu-devel@nongnu.org; Sun, 31 Dec 2023 04:39:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJsIK-0001PM-RX for qemu-devel@nongnu.org; Sun, 31 Dec 2023 04:39:48 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-J-a3J6KBPoud5swmYfs4aA-1; Sun, 31 Dec 2023 04:39:35 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40d4a423c84so71887975e9.3 for ; Sun, 31 Dec 2023 01:39:35 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id g14-20020a05600c310e00b0040d6eb862a7sm10785056wmo.41.2023.12.31.01.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 01:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704015580; 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=zGuVDWpXyHgDtnpBoCqtCU0iZWlD325c2JY3QKidV/E=; b=FfJwpW2Bk9CLJrgm9wdKacJhFIVqMATvN8Z/yee/iSrL/eGIMEyGI1UoS2JaNuFL31H3+V RsU9Ifu6vbTHFWTxMTJ5MejQieC9IqNzDkg3/BQfJtA85iS+RSPJp7W7hTj8tI7753298k XDvevv9DmgJMXoZvR+GALJI6ZmOSXA4= X-MC-Unique: J-a3J6KBPoud5swmYfs4aA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704015574; x=1704620374; 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=zGuVDWpXyHgDtnpBoCqtCU0iZWlD325c2JY3QKidV/E=; b=S26Z2Xy7LRTvD5KbWxfv/QZ/bQmqJte+74Mdnyok2TQtSHphtfdaj/JM9v49Ec1pCE PoEeCdQ2CmlKDR3jm+eT7QNWiBIJeF/D4IbqJJ3tKdO3veZLRvstaSJU6QFyvTTdYC48 84Jk25C6vl+6u+uXyMleR37hzHt61PQr84JDdoyEVh7ggFVtEpcIHjDInzEdCdvaYGCH pucViR2nddxbcBbFpFOAHCNX7mGif4+TPJMpxUxCiL/oI6YYLb4cBwnyHopFJCuq5NbN b3b/3YG6RACvaTsJs1Q9UTb65epSeYYQVFnBNvENwvw55M9txwOK2iKFvuWodU2UKRVH Xq+w== X-Gm-Message-State: AOJu0Yyvxj7PoTYbaALVxOuCE5LNCHGE8ujQi8jWuWL34JSNkldlvBTA yv8+iS5TrezckQpFuHdqpTZl3JpSYlx+uFNnG9r2ahBPF8N1LgPGUjBWK42PpwRAcuGe2Zhe7mp JU4NpuUgpbPiBDuKrNNuc5kQRjp+FKs+dCzqI7zOYYU2W/j/63+c70JfVOQo1sB5zx42VrhktSf aJjlySafk= X-Received: by 2002:a05:600c:5204:b0:40d:7b30:4f9f with SMTP id fb4-20020a05600c520400b0040d7b304f9fmr1138845wmb.26.1704015574055; Sun, 31 Dec 2023 01:39:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQvi8QqI4heBaLzPOhUxOiDs8qK2I6mTEOKcjO1KnTpZH9JjjR5DyxQzXzmpqH1USxD6h3QA== X-Received: by 2002:a05:600c:5204:b0:40d:7b30:4f9f with SMTP id fb4-20020a05600c520400b0040d7b304f9fmr1138842wmb.26.1704015573745; Sun, 31 Dec 2023 01:39:33 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kraxel@redhat.com Subject: [PATCH 5/8] vga: optimize horizontal pel panning in 256-color modes Date: Sun, 31 Dec 2023 10:39:15 +0100 Message-ID: <20231231093918.239549-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231231093918.239549-1-pbonzini@redhat.com> References: <20231231093918.239549-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: -47 X-Spam_score: -4.8 X-Spam_bar: ---- X-Spam_report: (-4.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.667, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 @redhat.com) X-ZM-MESSAGEID: 1704015644558100003 Content-Type: text/plain; charset="utf-8" Do not go through the panning buffer unless the address wraps in the middle of the line. Signed-off-by: Paolo Bonzini --- hw/display/vga-helpers.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/display/vga-helpers.h b/hw/display/vga-helpers.h index 29933562c45..60ddb27d946 100644 --- a/hw/display/vga-helpers.h +++ b/hw/display/vga-helpers.h @@ -265,6 +265,18 @@ static void *vga_draw_line8d2(VGACommonState *vga, uin= t8_t *d, =20 palette =3D vga->last_palette; hpel =3D (hpel >> 1) & 3; + + /* For 256 color modes, we can adjust the source address and write dir= ectly + * to the destination, even if horizontal pel panning is active. Howe= ver, + * the loop below assumes that the address does not wrap in the middle= of a + * plane. If that happens... + */ + if (addr + (width >> 3) * 4 < VGA_VRAM_SIZE) { + addr +=3D hpel * 4; + hpel =3D 0; + } + + /* ... use the panning buffer as in planar modes. */ if (hpel) { width +=3D 8; d =3D vga->panning_buf; --=20 2.43.0