From nobody Wed Nov 27 11:49:21 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=1699352434; cv=none; d=zohomail.com; s=zohoarc; b=feq1JC+1FaMXjV+WZ0V4PEwPs6BjUFC3Weu8bVBjx/PgQxpA0XgQUIcPVSm+rAOlaBGKpEzxdWGVJuEJo8DiYohvBHUAFc9mSIpGVcQsIviBB/WONhOBUr2uL3CL798LjJT88NYrqtISUFXRfWcia9a/2/iKyKRrRJlBwT7huAE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699352434; 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=yvieHJpm0aK+J18vgG/hswy0zeFDJ/RTZo7QtUWXNZs=; b=IZuuDE+6xMlrP9eb4O4UA3iGATtK0v3UE7R+AOLhOKu7TXRjwLwy3DMrveBnX7xGy4DmLoSVBcF9axL+wS0b3xdrO4rXc6XvcQSXF72MJMb1D/t6NMGbGws26GRv78JbT5Fq0DpJYXaWJAp4FDtyVeGj6ARN4GQH3UWbzsxwdgE= 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 169935243453241.19831071624344; Tue, 7 Nov 2023 02:20:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0J95-0005Mz-EZ; Tue, 07 Nov 2023 05:17:19 -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 1r0J92-000522-CA for qemu-devel@nongnu.org; Tue, 07 Nov 2023 05:17:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0J8y-0003hD-Rj for qemu-devel@nongnu.org; Tue, 07 Nov 2023 05:17:16 -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-459-qa02UJU1OL2hYkY5u2acQA-1; Tue, 07 Nov 2023 05:17:07 -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 C61593821572; Tue, 7 Nov 2023 10:17:06 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3248492BE0; Tue, 7 Nov 2023 10:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699352228; 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=yvieHJpm0aK+J18vgG/hswy0zeFDJ/RTZo7QtUWXNZs=; b=RMKIhGFcM+pi3DN34XcN7co0jfhb1eDzWl2CIQ3yth12juEOsLksxKcB2BDjPiudwtgB9v 6Z5TdVz9iOjV8i2UKzoRfuxufgotSmt4zXfAd4dOqrSxAMsOCnzsSis1ddQ79SZdAy0poT xyjLAqfO1LtlsZWniet4VpCrDvvvUbw= X-MC-Unique: qa02UJU1OL2hYkY5u2acQA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL v3 24/25] hw/display/ati: allow compiling without PIXMAN Date: Tue, 7 Nov 2023 14:15:22 +0400 Message-ID: <20231107101524.2993389-25-marcandre.lureau@redhat.com> In-Reply-To: <20231107101524.2993389-1-marcandre.lureau@redhat.com> References: <20231107101524.2993389-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.129.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_H4=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: 1699352436560100003 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 | 15 ++++++++++++++- hw/display/ati_2d.c | 10 ++++++++-- hw/display/meson.build | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/hw/display/ati.c b/hw/display/ati.c index 9a87a5504a..569b8f6165 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -32,6 +32,12 @@ =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 +952,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 +1045,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 is a debug option, prefer PROP_UINT over PROP_BIT for simplici= ty */ + 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..309bb5ccb6 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -123,6 +123,7 @@ void ati_2d_blt(ATIVGAState *s) src_bits, dst_bits, src_stride, dst_stride, bpp, bpp, src_x, src_y, dst_x, dst_y, s->regs.dst_width, s->regs.dst_height); +#ifdef CONFIG_PIXMAN if ((s->use_pixman & BIT(1)) && s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT && s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM) { @@ -147,7 +148,9 @@ void ati_2d_blt(ATIVGAState *s) s->regs.dst_width, s->regs.dst_heig= ht); } g_free(tmp); - } else { + } else +#endif + { fallback =3D true; } if (fallback) { @@ -206,9 +209,12 @@ void ati_2d_blt(ATIVGAState *s) 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); +#ifdef CONFIG_PIXMAN 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