From nobody Tue Feb 10 07:23:32 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=1699341856; cv=none; d=zohomail.com; s=zohoarc; b=BN3RImcJdW0m8xj7SeT4V4YLvZaYvCe5NPC1Z5/1yyjIIohkQYdKrUfAZvPQJLrnotcT2ord15t9br61pTsgEkEMLi3rE7WKcp8lijj0XIvwD1xMQPrc121S0DF13UEvdFpx/X2mcKBtxVIM6iVKe7Fg+D2sFt8E7D1w736ZBlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699341856; 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=KqlpcsnIz/mGd2vU8jh0UrFLVWlxoSxGRMh9REUS5lY=; b=jM/ZJBs1/2I3iKsL9WAm53yytZBaHHgFTKfKtO9TYak43Jwmf74s0bWo8FvtK+/KzxZvULS8G2b+9mCqcPCJp9H59EVImtC0+T48j4U19LVxteAYHQvreYeKJ7DRDs/6kr4TSx1VFYfcMmfgTwRSepuK1f8wpGMYv0KSq4biyIU= 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 169934185643640.12220817302443; Mon, 6 Nov 2023 23:24:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0GP0-0003AM-IV; Tue, 07 Nov 2023 02:21:34 -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 1r0GOn-0002y0-KC for qemu-devel@nongnu.org; Tue, 07 Nov 2023 02:21:25 -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 1r0GOl-0003CL-C5 for qemu-devel@nongnu.org; Tue, 07 Nov 2023 02:21:21 -0500 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-7TR_vPz4P_uHyWgZoq2yhg-1; Tue, 07 Nov 2023 02:21:16 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 54A611C2B667; Tue, 7 Nov 2023 07:21:00 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8C01492BE0; Tue, 7 Nov 2023 07:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699341677; 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=KqlpcsnIz/mGd2vU8jh0UrFLVWlxoSxGRMh9REUS5lY=; b=KhumiChI6IYp5GpmAfsRvwCNi+YAP2AHxuEeFJ3OC1l+TmP+INshYaK2Eafviy7RBM1dSW FCpJZz4KhGh45IZwjLkK3HA3hYciCRaof6wt+B9d4vlOX7aN19M7alLce2UuQqWplK6gmh L2VU5r8BnBvijdujFIworwTpinajEaI= X-MC-Unique: 7TR_vPz4P_uHyWgZoq2yhg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , stefanha@gmail.com, Gerd Hoffmann , qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v8 23/24] hw/display/ati: allow compiling without PIXMAN Date: Tue, 7 Nov 2023 11:19:13 +0400 Message-ID: <20231107071915.2459115-24-marcandre.lureau@redhat.com> In-Reply-To: <20231107071915.2459115-1-marcandre.lureau@redhat.com> References: <20231107071915.2459115-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 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=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, 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: 1699341857270100002 From: Marc-Andr=C3=A9 Lureau Change the "x-pixman" property default value and use the fallback path when PIXMAN support is disabled. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: BALATON Zoltan --- hw/display/ati.c | 16 +++++++++++++++- hw/display/ati_2d.c | 11 +++++++---- hw/display/meson.build | 2 +- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/hw/display/ati.c b/hw/display/ati.c index 9a87a5504a..51a3b156ac 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -32,6 +32,13 @@ =20 #define ATI_DEBUG_HW_CURSOR 0 =20 +#ifdef CONFIG_PIXMAN +#define DEFAULT_X_PIXMAN 3 +#else +#define DEFAULT_X_PIXMAN 0 +#endif + + static const struct { const char *name; uint16_t dev_id; @@ -946,6 +953,12 @@ static void ati_vga_realize(PCIDevice *dev, Error **er= rp) ATIVGAState *s =3D ATI_VGA(dev); VGACommonState *vga =3D &s->vga; =20 +#ifndef CONFIG_PIXMAN + if (s->use_pixman !=3D 0) { + warn_report("x-pixman !=3D 0, not effective without PIXMAN"); + } +#endif + if (s->model) { int i; for (i =3D 0; i < ARRAY_SIZE(ati_model_aliases); i++) { @@ -1033,7 +1046,8 @@ static Property ati_vga_properties[] =3D { DEFINE_PROP_UINT16("x-device-id", ATIVGAState, dev_id, PCI_DEVICE_ID_ATI_RAGE128_PF), DEFINE_PROP_BOOL("guest_hwcursor", ATIVGAState, cursor_guest_mode, fal= se), - DEFINE_PROP_UINT8("x-pixman", ATIVGAState, use_pixman, 3), + /* this a debug option, prefer PROP_UINT over PROP_BIT for simplicity = */ + DEFINE_PROP_UINT8("x-pixman", ATIVGAState, use_pixman, DEFAULT_X_PIXMA= N), DEFINE_PROP_END_OF_LIST() }; =20 diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index 0e6b8e4367..e58acd0802 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -92,7 +92,7 @@ void ati_2d_blt(ATIVGAState *s) switch (s->regs.dp_mix & GMC_ROP3_MASK) { case ROP3_SRCCOPY: { - bool fallback =3D false; + bool fallback =3D true; unsigned src_x =3D (s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT ? s->regs.src_x : s->regs.src_x + 1 - s->regs.dst_wid= th); unsigned src_y =3D (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ? @@ -119,6 +119,7 @@ void ati_2d_blt(ATIVGAState *s) =20 src_stride /=3D sizeof(uint32_t); dst_stride /=3D sizeof(uint32_t); +#ifdef CONFIG_PIXMAN DPRINTF("pixman_blt(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d= )\n", src_bits, dst_bits, src_stride, dst_stride, bpp, bpp, src_x, src_y, dst_x, dst_y, @@ -147,9 +148,8 @@ void ati_2d_blt(ATIVGAState *s) s->regs.dst_width, s->regs.dst_heig= ht); } g_free(tmp); - } else { - fallback =3D true; } +#endif if (fallback) { unsigned int y, i, j, bypp =3D bpp / 8; unsigned int src_pitch =3D src_stride * sizeof(uint32_t); @@ -203,12 +203,15 @@ void ati_2d_blt(ATIVGAState *s) } =20 dst_stride /=3D sizeof(uint32_t); +#ifdef CONFIG_PIXMAN DPRINTF("pixman_fill(%p, %d, %d, %d, %d, %d, %d, %x)\n", dst_bits, dst_stride, bpp, dst_x, dst_y, s->regs.dst_width, s->regs.dst_height, filler); if (!(s->use_pixman & BIT(0)) || !pixman_fill((uint32_t *)dst_bits, dst_stride, bpp, dst_x, dst= _y, - s->regs.dst_width, s->regs.dst_height, filler)) { + s->regs.dst_width, s->regs.dst_height, filler)) +#endif + { /* fallback when pixman failed or we don't want to call it */ unsigned int x, y, i, bypp =3D bpp / 8; unsigned int dst_pitch =3D dst_stride * sizeof(uint32_t); diff --git a/hw/display/meson.build b/hw/display/meson.build index 9c06aaee20..344dfe3d8c 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -62,7 +62,7 @@ system_ss.add(when: 'CONFIG_XLNX_DISPLAYPORT', if_true: f= iles('xlnx_dp.c')) =20 system_ss.add(when: 'CONFIG_ARTIST', if_true: files('artist.c')) =20 -system_ss.add(when: [pixman, 'CONFIG_ATI_VGA'], if_true: files('ati.c', 'a= ti_2d.c', 'ati_dbg.c')) +system_ss.add(when: 'CONFIG_ATI_VGA', if_true: [files('ati.c', 'ati_2d.c',= 'ati_dbg.c'), pixman]) =20 =20 if config_all_devices.has_key('CONFIG_VIRTIO_GPU') --=20 2.41.0