From nobody Mon May 20 14:11:14 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=1689598004; cv=none; d=zohomail.com; s=zohoarc; b=brq0JVlfscD0j+/qGO7jaocOywZ6ISYI4xY3WmcWaFSvIm8n+t6fLa+NwCmDJnMVqdEWM2jAmLek8MBM7J2v+rT8IX4jrEgICnLR7cqRb7MvW2obdhqtn0HcXVUOfp04QaprtWU/D3BrQQCXwejf41J9uiBP/qPZRda93HWlRHU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598004; 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=k7EcIQ6oE7UuoHciJ+XtjlKaMt+IzLcWsu+rBf4L6cs=; b=lNTFPEDVzpunZqagej8Bmx3iJkQTWBGJ2iRJzWZFXiPweKFMgT6iHwwkfnr1fbQSzYOvwRY+rn6/uR4etFOzc+k3RIUtxE79HsBmWLMA1NngFf959xg7ZK7TSoTH9YrJCBXxpMdOC6zNH5KjwsTgYhTJcMo1RZowdn4ED60cwB0= 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 168959800423890.9550358339734; Mon, 17 Jul 2023 05:46:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcA-0005bX-EN; Mon, 17 Jul 2023 08:46:10 -0400 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 1qLNc1-0005Uz-8r for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:04 -0400 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 1qLNbx-0008Dq-Py for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:00 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-536-YhN-9hE_O5Cv7hILMCX0EA-1; Mon, 17 Jul 2023 08:45:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BC7A3815F64; Mon, 17 Jul 2023 12:45:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66FB340C6F4F; Mon, 17 Jul 2023 12:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597956; 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=k7EcIQ6oE7UuoHciJ+XtjlKaMt+IzLcWsu+rBf4L6cs=; b=WDYwCs0Mj/N8/I7LtRemIoCtF/oLZu4IqLS29ursE2FSGBgJKDd4m1hy7I2dl8/9W/VeJd sFdSunOlGQbJqeIuzVhQ8Mn2KV7vFmHnngxJL1juawEP38tHxMSmu0/UYHIN0CG7jE3727 xGEJNNJtY0eWKT4IBS/mzLEHmorUMlQ= X-MC-Unique: YhN-9hE_O5Cv7hILMCX0EA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 01/19] virtio-gpu: fix potential divide-by-zero regression Date: Mon, 17 Jul 2023 16:45:26 +0400 Message-ID: <20230717124545.177236-2-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.2 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_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: 1689598005206100001 From: Marc-Andr=C3=A9 Lureau Commit 9462ff4695aa0 ("virtio-gpu/win32: allocate shareable 2d resources/images") introduces a division, which can lead to crashes when "height" is 0. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1744 Reviewed-by: Alexander Bulekov Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/display/virtio-gpu.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index befa7d6d78..e937c4e348 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -303,10 +303,11 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *= g, goto end; } #endif - res->image =3D pixman_image_create_bits(pformat, - c2d.width, - c2d.height, - bits, res->hostmem / c2d.hei= ght); + res->image =3D pixman_image_create_bits( + pformat, + c2d.width, + c2d.height, + bits, c2d.height ? res->hostmem / c2d.height : 0); #ifdef WIN32 if (res->image) { pixman_image_set_destroy_function(res->image, win32_pixman_ima= ge_destroy, res->handle); @@ -1272,9 +1273,10 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque= , size_t size, return -EINVAL; } #endif - res->image =3D pixman_image_create_bits(pformat, - res->width, res->height, - bits, res->hostmem / res->he= ight); + res->image =3D pixman_image_create_bits( + pformat, + res->width, res->height, + bits, res->height ? res->hostmem / res->height : 0); if (!res->image) { g_free(res); return -EINVAL; --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598255; cv=none; d=zohomail.com; s=zohoarc; b=KyOVGE4g8xj5frfqmFq23Aad5PkTiP4ha5cCfr8EmrQai8SnT+TRMP+RQSmaJFQ1nmYO3UI9uJnhUm464PjSz18t4W1WW6s//SlQgQo/qcfmxmZFvBHxNpl/FgTXUzW0taQCG6fsDVNPBiLrquLC/+0yNKPQx4/FAq90j+V6h60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598255; 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=qLzXBnMmR2LAO+O7JfopvcOfOmKHCnmgOIlg/BtKIA8=; b=Vak8ihvec903aMMEYePI3in7Wo8kduSfxhbmaZr7YI+tPePqla9Zc5zDBJtyXxCORjsk/bekJKl+WdKR/beYGdj+kM+QnTCq6zCWtLKi/Ka7zKS2mFZT4Ko5XI5KKwaTJql+ncwkK0YFoOE6vbzcaDOqT86Z6P8lbESAMU742WQ= 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 SMTP id 1689598255315998.0024032631654; Mon, 17 Jul 2023 05:50:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcE-0005dk-Ml; Mon, 17 Jul 2023 08:46:16 -0400 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 1qLNc5-0005YZ-Jb for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:06 -0400 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 1qLNc3-0008EL-0w for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-hhPqY3umOTK0ucBlp8zPqg-1; Mon, 17 Jul 2023 08:45:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1D2E8D1688; Mon, 17 Jul 2023 12:45:57 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id E694440C206F; Mon, 17 Jul 2023 12:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597961; 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=qLzXBnMmR2LAO+O7JfopvcOfOmKHCnmgOIlg/BtKIA8=; b=CU/fL73xw+o2l+C7PPr+6ooaCaVin78L6pCbRTShbsIXRMc8tfH2BXp+qmuq8DQ6bUJV5e W5Wp6bDU/1eMQ8jrL35QFyO4UWLEcZ9Wdw7NCtmKOozWrY1qxi7dqoXd9zDhPemtmjmbUm I8qK92iVGZzSXQr7JEpiYHnOCHHc7jg= X-MC-Unique: hhPqY3umOTK0ucBlp8zPqg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake , Mauro Matteo Cascella Subject: [PULL 02/19] ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255) Date: Mon, 17 Jul 2023 16:45:27 +0400 Message-ID: <20230717124545.177236-3-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.1 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_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: 1689598255627100001 From: Mauro Matteo Cascella A wrong exit condition may lead to an infinite loop when inflating a valid zlib buffer containing some extra bytes in the `inflate_buffer` function. The bug only occurs post-authentication. Return the buffer immediately if the end of the compressed data has been reached (Z_STREAM_END). Fixes: CVE-2023-3255 Fixes: 0bf41cab ("ui/vnc: clipboard support") Reported-by: Kevin Denis Signed-off-by: Mauro Matteo Cascella Reviewed-by: Marc-Andr=C3=A9 Lureau Tested-by: Marc-Andr=C3=A9 Lureau Message-ID: <20230704084210.101822-1-mcascell@redhat.com> --- ui/vnc-clipboard.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/vnc-clipboard.c b/ui/vnc-clipboard.c index 8aeadfaa21..c759be3438 100644 --- a/ui/vnc-clipboard.c +++ b/ui/vnc-clipboard.c @@ -50,8 +50,11 @@ static uint8_t *inflate_buffer(uint8_t *in, uint32_t in_= len, uint32_t *size) ret =3D inflate(&stream, Z_FINISH); switch (ret) { case Z_OK: - case Z_STREAM_END: break; + case Z_STREAM_END: + *size =3D stream.total_out; + inflateEnd(&stream); + return out; case Z_BUF_ERROR: out_len <<=3D 1; if (out_len > (1 << 20)) { @@ -66,11 +69,6 @@ static uint8_t *inflate_buffer(uint8_t *in, uint32_t in_= len, uint32_t *size) } } =20 - *size =3D stream.total_out; - inflateEnd(&stream); - - return out; - err_end: inflateEnd(&stream); err: --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598357; cv=none; d=zohomail.com; s=zohoarc; b=ii7YTk+17SxUlu1+6ELTDvgkrG3rFkSEO/kXAUmABL8w8CyyvBIj2vJdEOvkB6fWK7cSVr+T837cJ3vYGgHmMDRIwcWflZpSfXQuGQSgVbTdk1EqPRwgRoDazuoRrZu1bSYAG4ld39klQKQzKi3ZlacNw9gdv7mVPYvHYc8VDdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598357; 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=4QWpDZ8cYfLOy/V9/2FO6ewZmYkahgo3N9Qbw4+S1DY=; b=TLH3W2c4i1mVMdKwy18ha2UtDyRqyWv1JWJp+eISuM+u/LRaJGfYbg5JQvvZXLDcxo9FNjv1hp0/20bKMgCR/dIzSid5klRtVJG+xZQq/CMR0UhKXpMvHjHtAPfuHZ65uNJ3fBD6FkaRoEgEkze9WwWpPxNkxDpfK1tR2b2HIi0= 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 1689598357751929.4768499858206; Mon, 17 Jul 2023 05:52:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcQ-0005k3-9N; Mon, 17 Jul 2023 08:46:26 -0400 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 1qLNc5-0005Ya-Ux for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:06 -0400 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 1qLNc4-0008EZ-Ct for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-411-nECTegRrNdmjPafOdgWYEw-1; Mon, 17 Jul 2023 08:46:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9E526185A7A7; Mon, 17 Jul 2023 12:46:01 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9466B10E58; Mon, 17 Jul 2023 12:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597963; 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=4QWpDZ8cYfLOy/V9/2FO6ewZmYkahgo3N9Qbw4+S1DY=; b=IJL+Dw8hLrOnEBkhft/yiRGo1oY07pd62vD5FDbfq2Bm9E8T0Uff/+J18tkGz4q6315Wma asUz6x7aCA8CbPx+r1nvdVBLntXHLajvOKNpu42ZXIPAVguFB9Qec6tfF/f/OiX7HuhT5X 686EGCrlilm7vwe3yXAYMTm6yKAvZFc= X-MC-Unique: nECTegRrNdmjPafOdgWYEw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake , Dongwon Kim , Vivek Kasireddy Subject: [PULL 03/19] ui/gtk: Make sure the right EGL context is currently bound Date: Mon, 17 Jul 2023 16:45:28 +0400 Message-ID: <20230717124545.177236-4-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.5 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: 1689598358763100001 From: Dongwon Kim Observed a wrong context is bound when changing the scanout mode. To prevent problem, it is needed to make sure to bind the right context in gtk_egl_set_scanout_mode/gtk_gl_area_set_scanout_mode as well as unbind one in the end of gd_egl_update/gd_gl_area_update. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20230628191504.17185-1-dongwon.kim@intel.com> --- ui/gtk-egl.c | 4 ++++ ui/gtk-gl-area.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index d59b8cd7d7..42db1bb6cf 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -32,6 +32,8 @@ static void gtk_egl_set_scanout_mode(VirtualConsole *vc, = bool scanout) =20 vc->gfx.scanout_mode =3D scanout; if (!vc->gfx.scanout_mode) { + eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, + vc->gfx.esurface, vc->gfx.ectx); egl_fb_destroy(&vc->gfx.guest_fb); if (vc->gfx.surface) { surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds); @@ -135,6 +137,8 @@ void gd_egl_update(DisplayChangeListener *dcl, vc->gfx.esurface, vc->gfx.ectx); surface_gl_update_texture(vc->gfx.gls, vc->gfx.ds, x, y, w, h); vc->gfx.glupdates++; + eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, + EGL_NO_SURFACE, EGL_NO_CONTEXT); } =20 void gd_egl_refresh(DisplayChangeListener *dcl) diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index 7367dfd793..a9a7fdf50c 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -26,6 +26,7 @@ static void gtk_gl_area_set_scanout_mode(VirtualConsole *= vc, bool scanout) =20 vc->gfx.scanout_mode =3D scanout; if (!vc->gfx.scanout_mode) { + gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area)); egl_fb_destroy(&vc->gfx.guest_fb); if (vc->gfx.surface) { surface_gl_destroy_texture(vc->gfx.gls, vc->gfx.ds); @@ -115,6 +116,7 @@ void gd_gl_area_update(DisplayChangeListener *dcl, gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area)); surface_gl_update_texture(vc->gfx.gls, vc->gfx.ds, x, y, w, h); vc->gfx.glupdates++; + gdk_gl_context_clear_current(); } =20 void gd_gl_area_refresh(DisplayChangeListener *dcl) --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598065; cv=none; d=zohomail.com; s=zohoarc; b=K2yrvvFqyTt8oEPdHHeADCN9mXm+/BfBbdS0z9HIvzIaj057fIHPpPYPlkh4PjVntYyfJvrnpmYwHnvt14uljNfN6bl+cmFnBCILXCgFrLoKNkAg8DRujM1sTKtHJWVl4HJt+oFHmmzmxdX2SmdYfrUpmpUVk2ui8571hlPF1ZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598065; 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=k6aHtTIAg4kdv6BfFhRmW/dM6P9zqwKpeITi3mITOFE=; b=N5KI7+c9hAbO/xaobzyHMj705NI54hI674GURfopFRltgKsNBfm9jxCu+TSlvdTtc12ZZ75jpgPBWCidcBv9eFfsz95DAZ9LweZF1xbTBH290BzclvM0poR5zg9sWdyOE/B+EZ3vESTDcLIiJgM/V/TUZ3hXw2EjFKDd5eGYCcA= 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 16895980659421002.9439218326985; Mon, 17 Jul 2023 05:47:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcQ-0005u8-R1; Mon, 17 Jul 2023 08:46:26 -0400 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 1qLNcC-0005dO-2x for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:12 -0400 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 1qLNcA-0008FE-Fq for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:11 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-321-xgEDtM8tMcO0OvLNxFsSMQ-1; Mon, 17 Jul 2023 08:46:06 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ED3AC1C28CE0; Mon, 17 Jul 2023 12:46:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE4D64CD0C8; Mon, 17 Jul 2023 12:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597969; 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=k6aHtTIAg4kdv6BfFhRmW/dM6P9zqwKpeITi3mITOFE=; b=fkDII0TmB2/rxxmYXwhUQfSRE9phe0M3L82Dtr7mV2ccXW+PkLi74dHngLlJjhEO3Ujvg9 w2pbXB5juRul/Z3rZEN0rZ0xVlI+BYv+qKJfQQtiukTpvIXCJzvXIPN1zGDbh4V+QRpCSX 6tm+7U20F4pfFXgv5iXnOi4jFyJzy4g= X-MC-Unique: xgEDtM8tMcO0OvLNxFsSMQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake , Dongwon Kim , Vivek Kasireddy Subject: [PULL 04/19] virtio-gpu: replace the surface with null surface when resetting Date: Mon, 17 Jul 2023 16:45:29 +0400 Message-ID: <20230717124545.177236-5-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.10 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: 1689598068155100003 From: Dongwon Kim The primary guest scanout shows the booting screen right after reboot but additional guest displays (i.e. max_ouptuts > 1) will keep displaying the old frames until the guest virtio gpu driver gets initialized, which could cause some confusion. A better way is to to replace the surface with a place holder that tells the display is not active during the reset of virtio-gpu device. And to immediately update the surface with the place holder image after the switch, displaychangelistener_gfx_switch needs to be called with 'update =3D=3D TRUE' in dpy_gfx_replace_surface when the new surface is NUL= L. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Acked-by: Marc-Andr=C3=A9 Lureau Message-ID: <20230627224451.11739-1-dongwon.kim@intel.com> --- hw/display/virtio-gpu.c | 5 +++++ ui/console.c | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index e937c4e348..e8603d78ca 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1397,6 +1397,7 @@ void virtio_gpu_reset(VirtIODevice *vdev) VirtIOGPU *g =3D VIRTIO_GPU(vdev); struct virtio_gpu_simple_resource *res, *tmp; struct virtio_gpu_ctrl_command *cmd; + int i =3D 0; =20 QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) { virtio_gpu_resource_destroy(g, res); @@ -1415,6 +1416,10 @@ void virtio_gpu_reset(VirtIODevice *vdev) g_free(cmd); } =20 + for (i =3D 0; i < g->parent_obj.conf.max_outputs; i++) { + dpy_gfx_replace_surface(g->parent_obj.scanout[i].con, NULL); + } + virtio_gpu_base_reset(VIRTIO_GPU_BASE(vdev)); } =20 diff --git a/ui/console.c b/ui/console.c index c1544e0fb8..8da2170a7e 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1898,6 +1898,7 @@ void dpy_gfx_replace_surface(QemuConsole *con, static const char placeholder_msg[] =3D "Display output is not active.= "; DisplayState *s =3D con->ds; DisplaySurface *old_surface =3D con->surface; + DisplaySurface *new_surface =3D surface; DisplayChangeListener *dcl; int width; int height; @@ -1911,19 +1912,19 @@ void dpy_gfx_replace_surface(QemuConsole *con, height =3D 480; } =20 - surface =3D qemu_create_placeholder_surface(width, height, placeho= lder_msg); + new_surface =3D qemu_create_placeholder_surface(width, height, pla= ceholder_msg); } =20 - assert(old_surface !=3D surface); + assert(old_surface !=3D new_surface); =20 con->scanout.kind =3D SCANOUT_SURFACE; - con->surface =3D surface; - dpy_gfx_create_texture(con, surface); + con->surface =3D new_surface; + dpy_gfx_create_texture(con, new_surface); QLIST_FOREACH(dcl, &s->listeners, next) { if (con !=3D (dcl->con ? dcl->con : active_console)) { continue; } - displaychangelistener_gfx_switch(dcl, surface, FALSE); + displaychangelistener_gfx_switch(dcl, new_surface, surface ? FALSE= : TRUE); } dpy_gfx_destroy_texture(con, old_surface); qemu_free_displaysurface(old_surface); --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598041; cv=none; d=zohomail.com; s=zohoarc; b=io+mEVs0snzYx0Zv2/5mTYgmKS3qQD4YLJlqSLZ8EECymHNUCX5gM+c8JA1DXgBlxc8QJE0lRuBfjIm2nuJWRxi3bkmoIaeCqDnR0STxuOkzzA7KkGemBjH2zY5VcWpGcB07bqkgVEYJTlKRKfJWcVVOATXhk9UdOk5i3px7hxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598041; 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=vIytHURs/QEdgu0hfWQD43vbrrPmr96KHEM9sueWxJ0=; b=cynuiTrRBGrX+w0h3wxURXTHVxOjUqqKaQYumVgSEQoBPubks1xMApsQNLzhJFUQdBuoa4oqpt3E+ZCxU+oWcwju8FMxRcug4uScQbvwK2Meizhw5we+bRkWZ1yQgYOgbWH4MPtYVlhSAkPgvxnuFUeCq1HhMCT1X8WU9j7ueMQ= 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 1689598041145763.5530274612009; Mon, 17 Jul 2023 05:47:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcS-0005zo-RC; Mon, 17 Jul 2023 08:46:29 -0400 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 1qLNcI-0005js-N8 for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:20 -0400 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 1qLNcF-0008G3-Tc for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:17 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-92-1EJYVD4wPXig_5rtBmcEOA-1; Mon, 17 Jul 2023 08:46:12 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 935D1805951; Mon, 17 Jul 2023 12:46:11 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DB7140C2063; Mon, 17 Jul 2023 12:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597975; 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=vIytHURs/QEdgu0hfWQD43vbrrPmr96KHEM9sueWxJ0=; b=f/QUtZMUXG/FB/mEeKUqzHDB3HFCc65U9s8tR1s8QrsBrFsEavESKYcxTKudpoJtT6meDF 1jLwj8jfj9QkqQHiFW0KWPzxi5tThhnoc1TW88NOR3Ler0H4yjcoe2b4Md9LpRZQxyfRQZ 0ZobQ6BRc4Sq5U3Uu7XY/dQKYRBBt+E= X-MC-Unique: 1EJYVD4wPXig_5rtBmcEOA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake , Dongwon Kim , Vivek Kasireddy Subject: [PULL 05/19] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties Date: Mon, 17 Jul 2023 16:45:30 +0400 Message-ID: <20230717124545.177236-6-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.1 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_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: 1689598042062100001 From: Dongwon Kim Replace 'width' and 'height' in QemuDmaBuf with 'backing_widht' and 'backing_height' as these commonly indicate the size of the whole surface (e.g. guest's Xorg extended display). Then use 'width' and 'height' for sub region in there (e.g. guest's scanouts). Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20230713040444.32267-1-dongwon.kim@intel.com> --- include/ui/console.h | 4 ++-- hw/display/virtio-gpu-udmabuf.c | 12 ++++++------ ui/dbus-listener.c | 8 ++++---- ui/egl-helpers.c | 8 ++++---- ui/gtk-egl.c | 10 ++++++---- ui/gtk-gl-area.c | 7 ++++--- 6 files changed, 26 insertions(+), 23 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index f27b2aad4f..3e8b22d6c6 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -201,8 +201,8 @@ typedef struct QemuDmaBuf { uint32_t texture; uint32_t x; uint32_t y; - uint32_t scanout_width; - uint32_t scanout_height; + uint32_t backing_width; + uint32_t backing_height; bool y0_top; void *sync; int fence_fd; diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabu= f.c index ef1a740de5..d51184d658 100644 --- a/hw/display/virtio-gpu-udmabuf.c +++ b/hw/display/virtio-gpu-udmabuf.c @@ -181,13 +181,13 @@ static VGPUDMABuf } =20 dmabuf =3D g_new0(VGPUDMABuf, 1); - dmabuf->buf.width =3D fb->width; - dmabuf->buf.height =3D fb->height; + dmabuf->buf.width =3D r->width; + dmabuf->buf.height =3D r->height; dmabuf->buf.stride =3D fb->stride; dmabuf->buf.x =3D r->x; dmabuf->buf.y =3D r->y; - dmabuf->buf.scanout_width =3D r->width; - dmabuf->buf.scanout_height =3D r->height; + dmabuf->buf.backing_width =3D fb->width; + dmabuf->buf.backing_height =3D fb->height; dmabuf->buf.fourcc =3D qemu_pixman_to_drm_format(fb->format); dmabuf->buf.fd =3D res->dmabuf_fd; dmabuf->buf.allow_fences =3D true; @@ -218,8 +218,8 @@ int virtio_gpu_update_dmabuf(VirtIOGPU *g, =20 g->dmabuf.primary[scanout_id] =3D new_primary; qemu_console_resize(scanout->con, - new_primary->buf.scanout_width, - new_primary->buf.scanout_height); + new_primary->buf.width, + new_primary->buf.height); dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf); =20 if (old_primary) { diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 0240c39510..68ff343799 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -415,13 +415,13 @@ static void dbus_scanout_texture(DisplayChangeListene= r *dcl, backing_width, backing_height, x, y, w, h); #ifdef CONFIG_GBM QemuDmaBuf dmabuf =3D { - .width =3D backing_width, - .height =3D backing_height, + .width =3D w, + .height =3D h, .y0_top =3D backing_y_0_top, .x =3D x, .y =3D y, - .scanout_width =3D w, - .scanout_height =3D h, + .backing_width =3D backing_width, + .backing_height =3D backing_height, }; =20 assert(tex_id); diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 8f9fbf583e..3d19dbe382 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -148,8 +148,8 @@ void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip) if (src->dmabuf) { x1 =3D src->dmabuf->x; y1 =3D src->dmabuf->y; - w =3D src->dmabuf->scanout_width; - h =3D src->dmabuf->scanout_height; + w =3D src->dmabuf->width; + h =3D src->dmabuf->height; } =20 w =3D (x1 + w) > src->width ? src->width - x1 : w; @@ -314,9 +314,9 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf) } =20 attrs[i++] =3D EGL_WIDTH; - attrs[i++] =3D dmabuf->width; + attrs[i++] =3D dmabuf->backing_width; attrs[i++] =3D EGL_HEIGHT; - attrs[i++] =3D dmabuf->height; + attrs[i++] =3D dmabuf->backing_height; attrs[i++] =3D EGL_LINUX_DRM_FOURCC_EXT; attrs[i++] =3D dmabuf->fourcc; =20 diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 42db1bb6cf..eee821d73a 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -262,9 +262,10 @@ void gd_egl_scanout_dmabuf(DisplayChangeListener *dcl, } =20 gd_egl_scanout_texture(dcl, dmabuf->texture, - dmabuf->y0_top, dmabuf->width, dmabuf->height, - dmabuf->x, dmabuf->y, dmabuf->scanout_width, - dmabuf->scanout_height, NULL); + dmabuf->y0_top, + dmabuf->backing_width, dmabuf->backing_height, + dmabuf->x, dmabuf->y, dmabuf->width, + dmabuf->height, NULL); =20 if (dmabuf->allow_fences) { vc->gfx.guest_fb.dmabuf =3D dmabuf; @@ -284,7 +285,8 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl, if (!dmabuf->texture) { return; } - egl_fb_setup_for_tex(&vc->gfx.cursor_fb, dmabuf->width, dmabuf->he= ight, + egl_fb_setup_for_tex(&vc->gfx.cursor_fb, + dmabuf->backing_width, dmabuf->backing_height, dmabuf->texture, false); } else { egl_fb_destroy(&vc->gfx.cursor_fb); diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index a9a7fdf50c..4513d3d059 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -301,9 +301,10 @@ void gd_gl_area_scanout_dmabuf(DisplayChangeListener *= dcl, } =20 gd_gl_area_scanout_texture(dcl, dmabuf->texture, - dmabuf->y0_top, dmabuf->width, dmabuf->heig= ht, - dmabuf->x, dmabuf->y, dmabuf->scanout_width, - dmabuf->scanout_height, NULL); + dmabuf->y0_top, + dmabuf->backing_width, dmabuf->backing_heig= ht, + dmabuf->x, dmabuf->y, dmabuf->width, + dmabuf->height, NULL); =20 if (dmabuf->allow_fences) { vc->gfx.guest_fb.dmabuf =3D dmabuf; --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598640; cv=none; d=zohomail.com; s=zohoarc; b=m3YnLmbQOJlrVeYCmtU+EdJ0j6FbYD/fp2RkVEObglOTIyH1bqfpM2WI+C9sPNPWisxWbsoSbi/z2mHv5vVhBtFJEyD/GTquFuG8tOdCPjrWHFEAfC05ae5eRX5JvA+6pd9n/MSgrshUM4ruaalI+XbKsRfuRB5soy1TW3Lk9vo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598640; 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=Ub/E+D8ys9W7BO4mkQPiBOhrxJPXHUZoZBx3FV6N0yc=; b=SdrVDnj+ilAhX3bokIWRsGvYFiQea8j65bHzVPO/9EuZph9Mj3fOhPuuJm+9us1F5Hf0gtd4349/NYihiOYo9uHntfdG+PQKIitHFE+mwABou0qhoLfmmQdorHuq85QudJKsbPpX/avrQ//qW+grgDAbth8sMobyTiycCLf616k= 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 1689598640257198.1817682956315; Mon, 17 Jul 2023 05:57:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcU-00064Q-RC; Mon, 17 Jul 2023 08:46:30 -0400 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 1qLNcP-0005qg-W8 for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:26 -0400 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 1qLNcN-0008Gj-A8 for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:25 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-360-snpQZr1tMCCjSGPpbT6I3w-1; Mon, 17 Jul 2023 08:46:16 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E392B3C147EA; Mon, 17 Jul 2023 12:46:15 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id F159640C206F; Mon, 17 Jul 2023 12:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597980; 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=Ub/E+D8ys9W7BO4mkQPiBOhrxJPXHUZoZBx3FV6N0yc=; b=LIP1wsgpNwcQDEiV1iugiMS3733JxNrEmt9qG0HlM49IUWFCWoPXOo5u7sJyaHapDq8dMh ZGzycxs7Ca+DoVPXwLe7Gdt6OxsBFWNe+UFnq9rd/XTRFbUEEiQGHz1EM0tjbbUPKIm+wK HjFJM8V/mhBbTdgVpABvHeHDEMeJcN8= X-MC-Unique: snpQZr1tMCCjSGPpbT6I3w-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake , Dongwon Kim , Vivek Kasireddy Subject: [PULL 06/19] ui/gtk: set scanout-mode right before scheduling draw Date: Mon, 17 Jul 2023 16:45:31 +0400 Message-ID: <20230717124545.177236-7-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.1 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_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: 1689598640911100001 From: Dongwon Kim Setting scanout mode is better to be done very last minute right because the mode can be reset anytime after it is set in dpy_gl_scanout_texture by any asynchronouse dpy_refresh call, which eventually cancels drawing of the guest scanout texture. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Acked-by: Marc-Andr=C3=A9 Lureau Message-ID: <20230706183355.29361-1-dongwon.kim@intel.com> --- ui/gtk-egl.c | 2 +- ui/gtk-gl-area.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index eee821d73a..98b3a116bf 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -242,7 +242,6 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl, eglMakeCurrent(qemu_egl_display, vc->gfx.esurface, vc->gfx.esurface, vc->gfx.ectx); =20 - gtk_egl_set_scanout_mode(vc, true); egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height, backing_id, false); } @@ -353,6 +352,7 @@ void gd_egl_flush(DisplayChangeListener *dcl, if (vc->gfx.guest_fb.dmabuf && !vc->gfx.guest_fb.dmabuf->draw_submitte= d) { graphic_hw_gl_block(vc->gfx.dcl.con, true); vc->gfx.guest_fb.dmabuf->draw_submitted =3D true; + gtk_egl_set_scanout_mode(vc, true); gtk_widget_queue_draw_area(area, x, y, w, h); return; } diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index 4513d3d059..28d9e49888 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -264,7 +264,6 @@ void gd_gl_area_scanout_texture(DisplayChangeListener *= dcl, return; } =20 - gtk_gl_area_set_scanout_mode(vc, true); egl_fb_setup_for_tex(&vc->gfx.guest_fb, backing_width, backing_height, backing_id, false); } @@ -284,6 +283,7 @@ void gd_gl_area_scanout_flush(DisplayChangeListener *dc= l, if (vc->gfx.guest_fb.dmabuf && !vc->gfx.guest_fb.dmabuf->draw_submitte= d) { graphic_hw_gl_block(vc->gfx.dcl.con, true); vc->gfx.guest_fb.dmabuf->draw_submitted =3D true; + gtk_gl_area_set_scanout_mode(vc, true); } gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area)); } --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598178; cv=none; d=zohomail.com; s=zohoarc; b=XXuEW4MPxqXT1964bVpJ9+SkUVlKUzkBwK8pN+pnlWhIc4IbVjST4+z6qMLTatFtxwP/8oDmqL0I14as5TBOZA7wUYaps5ABgdoIEmRIN0TDLMlEXqh+bS6ZEnDE+ammZCeAdVezS4fmwTMch/VAKbFErV9s4QNJQKu1Br/FPZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598178; 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=9jJhd0nXcKpbP4xI8lyzEFj7qDAb0vnPKb1C7/51uiY=; b=E7SZDro602t5vanz7ROhCk5ROyjQjWogBauvKaEUzJVIvq23pqm+KSqgtFmpSQ4lVlarieTA4h1S2udUQGO08i8x0ykNSTePfYWp+6MXVOfvXFCKKSP9E0zG6pdXCjja6EvjcADntsARk+fjdKTbbVg0gBdvUoURSH3I0zcxzQg= 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 SMTP id 1689598178406102.80744408316184; Mon, 17 Jul 2023 05:49:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcV-00067p-Ph; Mon, 17 Jul 2023 08:46:31 -0400 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 1qLNcS-0005ww-Aw for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:28 -0400 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 1qLNcP-0008H1-Ly for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-Eu9w4cSkPnSRymgYmmY5Qg-1; Mon, 17 Jul 2023 08:46:21 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E10CC800193; Mon, 17 Jul 2023 12:46:20 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8D04492B01; Mon, 17 Jul 2023 12:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597982; 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=9jJhd0nXcKpbP4xI8lyzEFj7qDAb0vnPKb1C7/51uiY=; b=AUTBnvTty8QTbYkd74/2AxC0MhYhgj8LMLBXxOigFtuIrLkZUKtJtA9ciOVK8a7qc2C+hr pDUYIXQKl81lMrJ98K4IHxmGN43SBgJG+zhapN2BRBbGbg5IzENCqNpt8eMqddtuOREFPG EJIKATd3NlxOhODAyn/KAoC2NLXOkbE= X-MC-Unique: Eu9w4cSkPnSRymgYmmY5Qg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake , Dongwon Kim , Vivek Kasireddy Subject: [PULL 07/19] ui/gtk: skip refresh if new dmabuf has been submitted Date: Mon, 17 Jul 2023 16:45:32 +0400 Message-ID: <20230717124545.177236-8-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.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_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: 1689598179630100003 From: Dongwon Kim Skip refresh if a new dmabuf (guest scanout frame) has already been submitted and ready to be drawn because the scanout will be updated with new frame anyway. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Acked-by: Marc-Andr=C3=A9 Lureau Message-ID: <20230706183355.29361-2-dongwon.kim@intel.com> --- ui/gtk-egl.c | 4 ++++ ui/gtk-gl-area.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 98b3a116bf..4c29ac10d0 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -148,6 +148,10 @@ void gd_egl_refresh(DisplayChangeListener *dcl) gd_update_monitor_refresh_rate( vc, vc->window ? vc->window : vc->gfx.drawing_area); =20 + if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted= ) { + return; + } + if (!vc->gfx.esurface) { gd_egl_init(vc); if (!vc->gfx.esurface) { diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c index 28d9e49888..1ce34a249e 100644 --- a/ui/gtk-gl-area.c +++ b/ui/gtk-gl-area.c @@ -125,6 +125,10 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl) =20 gd_update_monitor_refresh_rate(vc, vc->window ? vc->window : vc->gfx.d= rawing_area); =20 + if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted= ) { + return; + } + if (!vc->gfx.gls) { if (!gtk_widget_get_realized(vc->gfx.drawing_area)) { return; --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598190; cv=none; d=zohomail.com; s=zohoarc; b=UrF4aN/wOVQAd2Xd46X2hEumIbtzvrASM9prIO4LzmbIvH43G0C20NUm6dQltGcm4KWPLF280QSLCHcTWoORhWHet2r/gj34tL+M3kq7nUyNuP7hPQb/OKAI0RZRNIbMcF3jglNAfVj0PXOndD8WMn81ss/r1oqa1SL7gv3BGqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598190; 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=Pybjy811ADNRdGEoQ0H12A+JRbq8ySn13kdk8RJRtRU=; b=AXgemzKRCPWGPbbU4PqBS+jZ+Mhp3EnKazdfBzTIsIatkU0UuRxEEcYNFTH2cLxbysZmlx4G8gN71NdY4FAslCWSeJMEuvQ8Ds6HsFkiChD9SPjbvCgwPV6oRbImnDG1jGqS+GwnaFFGB8v4kvtjXGuvmjFEBZBoQ4JtTBnXJ4s= 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 1689598190868402.50403055468394; Mon, 17 Jul 2023 05:49:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNca-0006J6-Rv; Mon, 17 Jul 2023 08:46:37 -0400 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 1qLNcZ-0006GE-QE for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:35 -0400 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 1qLNcX-0008Ht-Dh for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:34 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-341-744Cz1g0OSCbGAPSzx4IyA-1; Mon, 17 Jul 2023 08:46:26 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EF5B5185A793; Mon, 17 Jul 2023 12:46:24 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F761492B01; Mon, 17 Jul 2023 12:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597991; 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=Pybjy811ADNRdGEoQ0H12A+JRbq8ySn13kdk8RJRtRU=; b=ditTqdRGgUCLaezq6ZBV45agdjPDltGnOZdBt5JWk3l4Mgr2ivCeaSofjpb65Y6psdY1GD Gn0VZzx6MdPvbOVJtoyWO6UvxVSXTb41ylsNc+Xe4PY2YGh5edBloE5TjB7MFOojYw7ME0 9J/PB/fU6jythVu5dIGsWSuX8kCdpUg= X-MC-Unique: 744Cz1g0OSCbGAPSzx4IyA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 08/19] libvirt-ci: update submodule to cover pipewire Date: Mon, 17 Jul 2023 16:45:33 +0400 Message-ID: <20230717124545.177236-9-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.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: 1689598192710100005 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20230506163735.3481387-2-marcandre.lureau@redhat.com> --- tests/lcitool/libvirt-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci index b0f44f929a..9bff3b763b 160000 --- a/tests/lcitool/libvirt-ci +++ b/tests/lcitool/libvirt-ci @@ -1 +1 @@ -Subproject commit b0f44f929a81c0a604fb7fbf8afc34d37ab0eae9 +Subproject commit 9bff3b763b5531a1490e238bfbf77306dc3a6dbb --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598561; cv=none; d=zohomail.com; s=zohoarc; b=P8FbPIxvgShjQ5Ohvkz8Z1xfw52MWfax+5cdDFibuE9idiPBHr5JqrAt7xLI66ZZfQOraqlddCBq6BiXTUC6H2+sfdjr0m1EhpL/qt58xn90PAYnkFmGerCQenW+UsNIHyNnGXSJHNcKmxq2e15VeTFN9CaU0Hp5RpveFNc3oQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598561; 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=TxPD72r1VF9f8XKugMnfp1PJeyYlHWXDCpSi6pCqFsc=; b=Cv0T6Fs+yKRW3Aajq2rQitHWYa/NS/CNgmUAmHhmdzeST8eGYcEvpiAZ285o/rk4XvwZyq29arZqhvVMo+LxFaFnAq4+4BHi8YfbwqLSePvbW6UxQN1cnaEf7iESwsF8cL/QacmEh9fOWY5rtN+IdqHw8MlWCB/l59mAGi9MSfw= 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 1689598561010856.6470980682788; Mon, 17 Jul 2023 05:56:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcd-0006Ko-7N; Mon, 17 Jul 2023 08:46:39 -0400 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 1qLNcZ-0006Fz-M9 for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:35 -0400 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 1qLNcX-0008IB-GC for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:35 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-520-WneXG20PMMqof9rZodiTHA-1; Mon, 17 Jul 2023 08:46:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B8158D168D; Mon, 17 Jul 2023 12:46:29 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id E750C1121314; Mon, 17 Jul 2023 12:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597992; 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=TxPD72r1VF9f8XKugMnfp1PJeyYlHWXDCpSi6pCqFsc=; b=CPz72fqg4odepOH4JB9fPRSz1UoNFmonxzHM1wZKxFPlZG3jHEqBxYXFwtOePlHqFldkaI Y8nnzwpkj7Mpe5WlvoZpXrlJhiFzR5Wvp1r7Q9TQ3GlscRHz2N+/Ei0Pypordi+00QN3Qt OfLGt5yf1zUOMS7fomewDgwNGANn6bI= X-MC-Unique: WneXG20PMMqof9rZodiTHA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 09/19] tests/lcitool: add pipewire Date: Mon, 17 Jul 2023 16:45:34 +0400 Message-ID: <20230717124545.177236-10-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.3 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_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: 1689598562108100008 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230506163735.3481387-3-marcandre.lureau@redhat.com> --- tests/docker/dockerfiles/alpine.docker | 1 + tests/docker/dockerfiles/centos8.docker | 1 + tests/docker/dockerfiles/debian-amd64-cross.docker | 1 + tests/docker/dockerfiles/debian-amd64.docker | 1 + tests/docker/dockerfiles/debian-arm64-cross.docker | 1 + tests/docker/dockerfiles/debian-armel-cross.docker | 1 + tests/docker/dockerfiles/debian-armhf-cross.docker | 1 + tests/docker/dockerfiles/debian-mips64el-cross.docker | 1 + tests/docker/dockerfiles/debian-mipsel-cross.docker | 1 + tests/docker/dockerfiles/debian-ppc64el-cross.docker | 1 + tests/docker/dockerfiles/debian-s390x-cross.docker | 1 + tests/docker/dockerfiles/fedora.docker | 1 + tests/docker/dockerfiles/opensuse-leap.docker | 1 + tests/docker/dockerfiles/ubuntu2204.docker | 1 + tests/lcitool/projects/qemu.yml | 1 + 15 files changed, 15 insertions(+) diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfi= les/alpine.docker index 43370f7b36..fa455f1474 100644 --- a/tests/docker/dockerfiles/alpine.docker +++ b/tests/docker/dockerfiles/alpine.docker @@ -77,6 +77,7 @@ RUN apk update && \ numactl-dev \ openssh-client \ pcre-dev \ + pipewire-dev \ pixman-dev \ pkgconf \ pulseaudio-dev \ diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerf= iles/centos8.docker index 78f454b782..da7dc818fb 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos8.docker @@ -90,6 +90,7 @@ RUN dnf distro-sync -y && \ openssh-clients \ pam-devel \ pcre-static \ + pipewire-devel \ pixman-devel \ pkgconfig \ pulseaudio-libs-devel \ diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/doc= ker/dockerfiles/debian-amd64-cross.docker index 016c2321f1..b7bdc01243 100644 --- a/tests/docker/dockerfiles/debian-amd64-cross.docker +++ b/tests/docker/dockerfiles/debian-amd64-cross.docker @@ -116,6 +116,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:amd64 \ libnuma-dev:amd64 \ libpam0g-dev:amd64 \ + libpipewire-0.3-dev:amd64 \ libpixman-1-dev:amd64 \ libpmem-dev:amd64 \ libpng-dev:amd64 \ diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/do= ckerfiles/debian-amd64.docker index e39871c7bb..6d2fa38e3e 100644 --- a/tests/docker/dockerfiles/debian-amd64.docker +++ b/tests/docker/dockerfiles/debian-amd64.docker @@ -69,6 +69,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnuma-dev \ libpam0g-dev \ libpcre2-dev \ + libpipewire-0.3-dev \ libpixman-1-dev \ libpmem-dev \ libpng-dev \ diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/doc= ker/dockerfiles/debian-arm64-cross.docker index 3c114efa11..68165c2f23 100644 --- a/tests/docker/dockerfiles/debian-arm64-cross.docker +++ b/tests/docker/dockerfiles/debian-arm64-cross.docker @@ -116,6 +116,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:arm64 \ libnuma-dev:arm64 \ libpam0g-dev:arm64 \ + libpipewire-0.3-dev:arm64 \ libpixman-1-dev:arm64 \ libpng-dev:arm64 \ libpulse-dev:arm64 \ diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/doc= ker/dockerfiles/debian-armel-cross.docker index dfbd47db89..2fb65308c7 100644 --- a/tests/docker/dockerfiles/debian-armel-cross.docker +++ b/tests/docker/dockerfiles/debian-armel-cross.docker @@ -116,6 +116,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:armel \ libnuma-dev:armel \ libpam0g-dev:armel \ + libpipewire-0.3-dev:armel \ libpixman-1-dev:armel \ libpng-dev:armel \ libpulse-dev:armel \ diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/doc= ker/dockerfiles/debian-armhf-cross.docker index 4e0084e896..df77ccb57b 100644 --- a/tests/docker/dockerfiles/debian-armhf-cross.docker +++ b/tests/docker/dockerfiles/debian-armhf-cross.docker @@ -116,6 +116,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:armhf \ libnuma-dev:armhf \ libpam0g-dev:armhf \ + libpipewire-0.3-dev:armhf \ libpixman-1-dev:armhf \ libpng-dev:armhf \ libpulse-dev:armhf \ diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/= docker/dockerfiles/debian-mips64el-cross.docker index 88adf333e9..63a3d7aa3b 100644 --- a/tests/docker/dockerfiles/debian-mips64el-cross.docker +++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker @@ -115,6 +115,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:mips64el \ libnuma-dev:mips64el \ libpam0g-dev:mips64el \ + libpipewire-0.3-dev:mips64el \ libpixman-1-dev:mips64el \ libpng-dev:mips64el \ libpulse-dev:mips64el \ diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/do= cker/dockerfiles/debian-mipsel-cross.docker index 256e8b5dfe..ac87bbb095 100644 --- a/tests/docker/dockerfiles/debian-mipsel-cross.docker +++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker @@ -115,6 +115,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:mipsel \ libnuma-dev:mipsel \ libpam0g-dev:mipsel \ + libpipewire-0.3-dev:mipsel \ libpixman-1-dev:mipsel \ libpng-dev:mipsel \ libpulse-dev:mipsel \ diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/d= ocker/dockerfiles/debian-ppc64el-cross.docker index 4d19cd2bd7..def11f1693 100644 --- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker +++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker @@ -116,6 +116,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:ppc64el \ libnuma-dev:ppc64el \ libpam0g-dev:ppc64el \ + libpipewire-0.3-dev:ppc64el \ libpixman-1-dev:ppc64el \ libpng-dev:ppc64el \ libpulse-dev:ppc64el \ diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/doc= ker/dockerfiles/debian-s390x-cross.docker index 642bbde3d1..80028e1eea 100644 --- a/tests/docker/dockerfiles/debian-s390x-cross.docker +++ b/tests/docker/dockerfiles/debian-s390x-cross.docker @@ -116,6 +116,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnfs-dev:s390x \ libnuma-dev:s390x \ libpam0g-dev:s390x \ + libpipewire-0.3-dev:s390x \ libpixman-1-dev:s390x \ libpng-dev:s390x \ libpulse-dev:s390x \ diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfi= les/fedora.docker index 8a35a17617..c5b6c96943 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -98,6 +98,7 @@ exec "$@"\n' > /usr/bin/nosync && \ openssh-clients \ pam-devel \ pcre-static \ + pipewire-devel \ pixman-devel \ pkgconfig \ pulseaudio-libs-devel \ diff --git a/tests/docker/dockerfiles/opensuse-leap.docker b/tests/docker/d= ockerfiles/opensuse-leap.docker index 185abe57d8..37c83e5e4e 100644 --- a/tests/docker/dockerfiles/opensuse-leap.docker +++ b/tests/docker/dockerfiles/opensuse-leap.docker @@ -88,6 +88,7 @@ RUN zypper update -y && \ openssh \ pam-devel \ pcre-devel-static \ + pipewire-devel \ pkgconfig \ python39-base \ python39-pip \ diff --git a/tests/docker/dockerfiles/ubuntu2204.docker b/tests/docker/dock= erfiles/ubuntu2204.docker index 1d442cdfe6..8f939870ae 100644 --- a/tests/docker/dockerfiles/ubuntu2204.docker +++ b/tests/docker/dockerfiles/ubuntu2204.docker @@ -69,6 +69,7 @@ RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ libnuma-dev \ libpam0g-dev \ libpcre2-dev \ + libpipewire-0.3-dev \ libpixman-1-dev \ libpmem-dev \ libpng-dev \ diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.= yml index 21fd3d2cf9..d452a891ee 100644 --- a/tests/lcitool/projects/qemu.yml +++ b/tests/lcitool/projects/qemu.yml @@ -85,6 +85,7 @@ packages: - pam - pcre-static - pixman + - pipewire - pkg-config - pulseaudio - python3 --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598212; cv=none; d=zohomail.com; s=zohoarc; b=DVCjU7LVzu40faYgDvW4LZaRw/4W8ad3Tsmezg8zb+o4eGUf+Xzp9+rabLgD1FkPARCYFrkwrurw1JE7EKwIKMcvv59II87B5GTgYOI1bVPTB0nQxRA1ZBhjqqn3BDagPDGteSotuFLXf4xWYJe3Hqi4ylmu545RhmyUCzp/hbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598212; 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=sVRAKyzcSWph+sMMEPDHDQCieaXgxeApMAEASqQQ0H0=; b=CI6DFtxODFyA/Lm23YFATzFKQkOIrQ3y786h6+p8z7t50R9ijlrxfs9WmD6UI8HrGHdjW3izf27vHv5626Y4WsBW9yedFEW63ABPJIlmmrKHlKxwlESPjzvUmTz2zkqbnSZJqeccXt0Uvz5RKTugFlDzTsM+fUWIddv2izSPymo= 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 1689598212866786.4814705229549; Mon, 17 Jul 2023 05:50:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcf-0006SY-MP; Mon, 17 Jul 2023 08:46:41 -0400 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 1qLNcf-0006QR-1n for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:41 -0400 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 1qLNcd-0008Iw-8m for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:40 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-195-myjesN7wOXK7Wf1n0Np85g-1; Mon, 17 Jul 2023 08:46:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 20298800B35; Mon, 17 Jul 2023 12:46:34 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E0BA2017DC6; Mon, 17 Jul 2023 12:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689597997; 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=sVRAKyzcSWph+sMMEPDHDQCieaXgxeApMAEASqQQ0H0=; b=BSeGI1Or6+zo7x6nwqdC6t8T4/5/RrA32nqagclUtJa15I6iI3nAO0uqGsu4sQaqe1bvuw CCqu0+kLDar4GjeiBP1tXtc9UqoWNhwiR5bH/txcGlsCc/og2G+/uJemEGecVUsE6WY2ek gZ1rzoT6YlPE8r/8S8L/bCJ+RH/xhFQ= X-MC-Unique: myjesN7wOXK7Wf1n0Np85g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 10/19] audio/pw: Pipewire->PipeWire case fix for user-visible text Date: Mon, 17 Jul 2023 16:45:35 +0400 Message-ID: <20230717124545.177236-11-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.4 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: 1689598213846100007 From: Marc-Andr=C3=A9 Lureau "PipeWire" is the correct case. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-4-marcandre.lureau@redhat.com> --- meson.build | 2 +- qapi/audio.json | 12 ++++++------ audio/pwaudio.c | 10 +++++----- audio/trace-events | 2 +- meson_options.txt | 2 +- qemu-options.hx | 4 ++-- scripts/meson-buildoptions.sh | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 5fcdb37a71..98e68ef0b1 100644 --- a/meson.build +++ b/meson.build @@ -4251,7 +4251,7 @@ if targetos =3D=3D 'linux' summary_info +=3D {'ALSA support': alsa} summary_info +=3D {'PulseAudio support': pulse} endif -summary_info +=3D {'Pipewire support': pipewire} +summary_info +=3D {'PipeWire support': pipewire} summary_info +=3D {'JACK support': jack} summary(summary_info, bool_yn: true, section: 'Audio backends') =20 diff --git a/qapi/audio.json b/qapi/audio.json index 534f10d8b1..519697c0cd 100644 --- a/qapi/audio.json +++ b/qapi/audio.json @@ -328,17 +328,17 @@ ## # @AudiodevPipewirePerDirectionOptions: # -# Options of the Pipewire backend that are used for both playback and +# Options of the PipeWire backend that are used for both playback and # recording. # # @name: name of the sink/source to use # -# @stream-name: name of the Pipewire stream created by qemu. Can be -# used to identify the stream in Pipewire when you create multiple -# Pipewire devices or run multiple qemu instances (default: +# @stream-name: name of the PipeWire stream created by qemu. Can be +# used to identify the stream in PipeWire when you create multiple +# PipeWire devices or run multiple qemu instances (default: # audiodev's id) # -# @latency: latency you want Pipewire to achieve in microseconds +# @latency: latency you want PipeWire to achieve in microseconds # (default 46000) # # Since: 8.1 @@ -353,7 +353,7 @@ ## # @AudiodevPipewireOptions: # -# Options of the Pipewire audio backend. +# Options of the PipeWire audio backend. # # @in: options of the capture stream # diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 1d108bdebb..9eb69bfd18 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -1,5 +1,5 @@ /* - * QEMU Pipewire audio driver + * QEMU PipeWire audio driver * * Copyright (c) 2023 Red Hat Inc. * @@ -800,21 +800,21 @@ qpw_audio_init(Audiodev *dev) assert(dev->driver =3D=3D AUDIODEV_DRIVER_PIPEWIRE); =20 pw->dev =3D dev; - pw->thread_loop =3D pw_thread_loop_new("Pipewire thread loop", NULL); + pw->thread_loop =3D pw_thread_loop_new("PipeWire thread loop", NULL); if (pw->thread_loop =3D=3D NULL) { - error_report("Could not create Pipewire loop"); + error_report("Could not create PipeWire loop"); goto fail; } =20 pw->context =3D pw_context_new(pw_thread_loop_get_loop(pw->thread_loop), NULL, 0); if (pw->context =3D=3D NULL) { - error_report("Could not create Pipewire context"); + error_report("Could not create PipeWire context"); goto fail; } =20 if (pw_thread_loop_start(pw->thread_loop) < 0) { - error_report("Could not start Pipewire loop"); + error_report("Could not start PipeWire loop"); goto fail; } =20 diff --git a/audio/trace-events b/audio/trace-events index 85dbb506b2..ab04f020ce 100644 --- a/audio/trace-events +++ b/audio/trace-events @@ -24,7 +24,7 @@ pw_read(int32_t avail, uint32_t index, size_t len) "avail= =3D%d index=3D%u len=3D%zu" pw_write(int32_t filled, int32_t avail, uint32_t index, size_t len) "fille= d=3D%d avail=3D%d index=3D%u len=3D%zu" pw_vol(const char *ret) "set volume: %s" pw_period(uint64_t quantum, uint32_t rate) "period =3D%" PRIu64 "/%u" -pw_audio_init(void) "Initialize Pipewire context" +pw_audio_init(void) "Initialize PipeWire context" =20 # audio.c audio_timer_start(int interval) "interval %d ms" diff --git a/meson_options.txt b/meson_options.txt index bbb5c7e886..aaea5ddd77 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -267,7 +267,7 @@ option('oss', type: 'feature', value: 'auto', option('pa', type: 'feature', value: 'auto', description: 'PulseAudio sound support') option('pipewire', type: 'feature', value: 'auto', - description: 'Pipewire sound support') + description: 'PipeWire sound support') option('sndio', type: 'feature', value: 'auto', description: 'sndio sound support') =20 diff --git a/qemu-options.hx b/qemu-options.hx index f8f384e551..29b98c3d4c 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -963,10 +963,10 @@ SRST to honor this value but actual latencies may be lower or higher. =20 ``-audiodev pipewire,id=3Did[,prop[=3Dvalue][,...]]`` - Creates a backend using Pipewire. This backend is available on + Creates a backend using PipeWire. This backend is available on most systems. =20 - Pipewire specific options are: + PipeWire specific options are: =20 ``in|out.latency=3Dusecs`` Desired latency in microseconds. diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 7dd5709ef4..9da3fe299b 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -145,7 +145,7 @@ meson_options_help() { printf "%s\n" ' oss OSS sound support' printf "%s\n" ' pa PulseAudio sound support' printf "%s\n" ' parallels parallels image format support' - printf "%s\n" ' pipewire Pipewire sound support' + printf "%s\n" ' pipewire PipeWire sound support' printf "%s\n" ' png PNG support with libpng' printf "%s\n" ' pvrdma Enable PVRDMA support' printf "%s\n" ' qcow1 qcow1 image format support' --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598197; cv=none; d=zohomail.com; s=zohoarc; b=c+cBXXBZPJYf6FBYa0/lC9dXY7Etqf2vvMFs6OIDfy6pKsX/d37MpIeUDt1LUOY/UO5ihtnBGdtxwqrmHVrlj1cD7ibDBZmxwqtEMdJ5urKHBM/Xasqm1tk4SqJgbw/IqdcqsgcXBqqfyuWK4bPrmINkFGbvOd4jPiHk6wLJ16Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598197; 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=/2cOk0mH1lr6yom5ZRfnzu7cpKGV+fhIBIjAHw74xoA=; b=TgNXGJgJnD3AHeXUHkyUL02GXhOdNSDyg1pqTpyyXsLhfss6qWB2jVNcsKxn9q2bOmmfHmMhnuC/6AqhYmVhosG8t28SM2kh8C7VH/j54nXx9UEgSxQtwX/dzU5BuItmUnFu0ADRY+WJpt2JWqssdqWHjgd/ctWbd8qKA+HvFWg= 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 1689598197515565.6086889456693; Mon, 17 Jul 2023 05:49:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNck-0006o9-Bt; Mon, 17 Jul 2023 08:46:46 -0400 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 1qLNci-0006f1-Ee for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:44 -0400 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 1qLNcg-0008JJ-Se for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:44 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-397-kh1Impa-Mtm1pAlmyGwEKg-1; Mon, 17 Jul 2023 08:46:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B53478966C8; Mon, 17 Jul 2023 12:46:37 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0ABC40C6F4C; Mon, 17 Jul 2023 12:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598001; 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=/2cOk0mH1lr6yom5ZRfnzu7cpKGV+fhIBIjAHw74xoA=; b=Q9N03ztHMM3j+xxma8B7biTDI2iUN5FRJdaIDijDfEL10n6BJkz4wmIm+9uHlLJoGoehSD fVHxeqO5EPZh7Ft29+7n2HKKDCXxX8OaC4hwFnc75dZWuBHB+eaZkJvQf+xyYAKEL1JkQE AMB9mknuBp4ps2tweFSZddhudya5CJ4= X-MC-Unique: kh1Impa-Mtm1pAlmyGwEKg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 11/19] audio/pw: drop needless case statement Date: Mon, 17 Jul 2023 16:45:36 +0400 Message-ID: <20230717124545.177236-12-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.2 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: 1689598197747100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-5-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 9eb69bfd18..51cfc0b052 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -197,16 +197,6 @@ on_stream_state_changed(void *data, enum pw_stream_sta= te old, =20 trace_pw_state_changed(pw_stream_get_node_id(v->stream), pw_stream_state_as_string(state)); - - switch (state) { - case PW_STREAM_STATE_ERROR: - case PW_STREAM_STATE_UNCONNECTED: - break; - case PW_STREAM_STATE_PAUSED: - case PW_STREAM_STATE_CONNECTING: - case PW_STREAM_STATE_STREAMING: - break; - } } =20 static const struct pw_stream_events capture_stream_events =3D { --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598560; cv=none; d=zohomail.com; s=zohoarc; b=FHAoooY7Z7JgGvsfIN4iEozmWZjitpx0QIwzOv5ieHFAwkW4UTXXmOn4hwPmJ87S9c5ew7f4kKXAg06nPN82cI8dd7q55JANCs1oxdbkGjB/tbALHHKjfM+NxqdmB3//baDKgSvbV1vD9x05/AOIgho04Ds9lA+223UBEo7QrwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598560; 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=ozG8C0tRI1xcJGjq4mgkk7rCxE3A2vzX2ZTHq5FZwRE=; b=Z9FJhZY7DHOV/GcVveorwiDUGOf5+Vk9odjxIRC67tMfQnAzpWXPA5ocxqyoyC3X7WpUXRax6hILp4y13Id3ri8i2Vnt1owlsL4G5luI50XdCE7F8DQAVZiFWrT63zK+MzuRHYCjI071BWlYJ2gsk3AQZh1Gu/ih0W77jwAnKhM= 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 1689598560332183.74388094234791; Mon, 17 Jul 2023 05:56:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNco-00077M-27; Mon, 17 Jul 2023 08:46:50 -0400 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 1qLNcm-000725-GX for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:48 -0400 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 1qLNck-0008K3-Uz for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:48 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-91-FdPg6OPWNYKuZB8jyxTL0Q-1; Mon, 17 Jul 2023 08:46:42 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C573B8D1685; Mon, 17 Jul 2023 12:46:41 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D9D940C6F4C; Mon, 17 Jul 2023 12:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598006; 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=ozG8C0tRI1xcJGjq4mgkk7rCxE3A2vzX2ZTHq5FZwRE=; b=IZUueBoelquusUEm/lleIEUT2S4gGe6G1k+Aq5BIlH29hPadJPgC18I4j+eIn/223B1O5S aAxtGIcjv5p8+501Nxdvhz1+bZKc5fFlvCRb1aIyRVAHak0k2f2bZQ+IgeFPkhF7r08cDd XqfSBC4bsoQHIFtfSW/udzxNPMCKlmI= X-MC-Unique: FdPg6OPWNYKuZB8jyxTL0Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 12/19] audio/pw: needless check for NULL Date: Mon, 17 Jul 2023 16:45:37 +0400 Message-ID: <20230717124545.177236-13-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.2 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: 1689598561931100001 From: Marc-Andr=C3=A9 Lureau g_clear_pointer() already checks for NULL. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-6-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 51cfc0b052..6ca4ef4f62 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -834,12 +834,8 @@ fail: if (pw->thread_loop) { pw_thread_loop_stop(pw->thread_loop); } - if (pw->context) { - g_clear_pointer(&pw->context, pw_context_destroy); - } - if (pw->thread_loop) { - g_clear_pointer(&pw->thread_loop, pw_thread_loop_destroy); - } + g_clear_pointer(&pw->context, pw_context_destroy); + g_clear_pointer(&pw->thread_loop, pw_thread_loop_destroy); return NULL; } =20 --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598663; cv=none; d=zohomail.com; s=zohoarc; b=fkGGaptkn7j1guQPdDZdSAOBa9YZQ1urWVsI5QPBBUlR0OkMN3ye1msKLKy/q9lqfUu/ND7/5JQvvMxjnf6ew5wfJoybee2GVVrr2uWRrYxnlhljJeEHyLU3L9/vFOSHFfjHKOKTy47AiFyS+plHblD5fKlSA+zj5KO1EWxK6nQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598663; 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=lb+yWS3DLhsJsTjBeM+HQ0POpf7hQcpeukXjHOiIT1I=; b=HGZoV2ykfRojWsAPsmLprWRL7FjG+4iFzeZltQ3asaOy0EXmPRLNvZ55OD1lbUzRIx764ynfBhiY3u6on1spfvaAJJ/J0vGPIDUWFh9Gf3NcTBtC9a2NS3AJ2azAJUIr4fDN71KVd5lgjKDrHahowZVZERTobxiEaECJJSheZ6U= 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 1689598663905316.2470089033541; Mon, 17 Jul 2023 05:57:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcr-0007Fx-Ej; Mon, 17 Jul 2023 08:46:53 -0400 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 1qLNcp-0007Bo-Ri for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:51 -0400 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 1qLNcn-0008M4-Rq for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:51 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-483-zVCkpnKxP_ubrK_m1IXi1Q-1; Mon, 17 Jul 2023 08:46:46 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A65B0185A7B0; Mon, 17 Jul 2023 12:46:45 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4FFC40C206F; Mon, 17 Jul 2023 12:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598009; 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=lb+yWS3DLhsJsTjBeM+HQ0POpf7hQcpeukXjHOiIT1I=; b=OUf6B+1AX8/9VTewy1IuJUtNNscRpI1iWSSGx8YU9sXfYxeWPiIA/Frf1U4xB6ynQ7+8sI BqvbSSDk653BmexmPB00XynZ5EAtLl6qGu+JWOkz5KewlqbA3JB0Za7I2U0QlHAOOKaqhS p+0FdGEucvj2NKvJGgECRmNJGxb1n9Y= X-MC-Unique: zVCkpnKxP_ubrK_m1IXi1Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 13/19] audio/pw: trace during init before calling pipewire API Date: Mon, 17 Jul 2023 16:45:38 +0400 Message-ID: <20230717124545.177236-14-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.1 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: 1689598665459100011 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-7-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 6ca4ef4f62..2b12b40934 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -784,10 +784,11 @@ static void * qpw_audio_init(Audiodev *dev) { g_autofree pwaudio *pw =3D g_new0(pwaudio, 1); - pw_init(NULL, NULL); =20 - trace_pw_audio_init(); assert(dev->driver =3D=3D AUDIODEV_DRIVER_PIPEWIRE); + trace_pw_audio_init(); + + pw_init(NULL, NULL); =20 pw->dev =3D dev; pw->thread_loop =3D pw_thread_loop_new("PipeWire thread loop", NULL); --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598190; cv=none; d=zohomail.com; s=zohoarc; b=b7MbTgJ5R7DBKdb9iRtRTpo1/WAIdF0BP4VLXRCCPHecYMDWmesTFGJ0HxAZ8VC9OYYK9AZkL4sacEUuUNhPZ9T6V79trQa+tkLTROGy9C1Si0MfXmbFgHVQGgx57hg1Oa4zZ7A4Yjg02pIX4BNVrcdzPfjau9ReGUBts0DM1gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598190; 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=Dt1ZK5Q+hUpKLxd8NdpCQ4LNP1XKHpwMbwszUVNWgEc=; b=jUoqL58RW8xxMcaXNb08Ono8ilU7Nswg+NCiSgrZrlBxgxfUT3Ihbm8Dy2COaGMlaIms70pooOs9Us1KPa4A4Jp4Vuu6Yo1A2PwAUJKNzL0enCIDWsGRSm3j3yXu9pEGM8DoW1I81kBQeqkDiBUsw6AnSR7xf9rA7M5ArTrTF1s= 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 168959819044711.57581619861412; Mon, 17 Jul 2023 05:49:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNcu-0007Pd-RQ; Mon, 17 Jul 2023 08:47:00 -0400 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 1qLNct-0007HU-2t for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:55 -0400 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 1qLNcr-0008MN-Ll for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:54 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-256-Rtoldcb_PZOJ3oPm_vHSLg-1; Mon, 17 Jul 2023 08:46:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A76D1044597; Mon, 17 Jul 2023 12:46:49 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCB4A40C6F4F; Mon, 17 Jul 2023 12:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598013; 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=Dt1ZK5Q+hUpKLxd8NdpCQ4LNP1XKHpwMbwszUVNWgEc=; b=R7fm8Uq9FGbaX1biLG23JX0Oc7mL2gzepths4ikAVamaMMhKwIscA1QVlRDlznC0KnZRGw YUuwu2Av7rwFK2E7zvPpvyIJ1a9akOc0oQ7A/IIUEvUZCs/UwCxmMRKfSu2PN5heu/X7Fs MLhEQpCLgMD/0Kg3iQVMXPkkGrxcoZ8= X-MC-Unique: Rtoldcb_PZOJ3oPm_vHSLg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 14/19] audio/pw: add more details on error Date: Mon, 17 Jul 2023 16:45:39 +0400 Message-ID: <20230717124545.177236-15-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.2 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_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: 1689598192724100008 From: Marc-Andr=C3=A9 Lureau PipeWire uses errno to report error details. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-8-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 2b12b40934..d0bc4680a6 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -750,6 +750,7 @@ static int wait_resync(pwaudio *pw) } return 0; } + static void on_core_error(void *data, uint32_t id, int seq, int res, const char *messa= ge) { @@ -793,19 +794,19 @@ qpw_audio_init(Audiodev *dev) pw->dev =3D dev; pw->thread_loop =3D pw_thread_loop_new("PipeWire thread loop", NULL); if (pw->thread_loop =3D=3D NULL) { - error_report("Could not create PipeWire loop"); + error_report("Could not create PipeWire loop: %s", g_strerror(errn= o)); goto fail; } =20 pw->context =3D pw_context_new(pw_thread_loop_get_loop(pw->thread_loop), NULL, 0); if (pw->context =3D=3D NULL) { - error_report("Could not create PipeWire context"); + error_report("Could not create PipeWire context: %s", g_strerror(e= rrno)); goto fail; } =20 if (pw_thread_loop_start(pw->thread_loop) < 0) { - error_report("Could not start PipeWire loop"); + error_report("Could not start PipeWire loop: %s", g_strerror(errno= )); goto fail; } =20 --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598076; cv=none; d=zohomail.com; s=zohoarc; b=hn198L7AZ2cH4W2iIQq+T9VliqjaShnSLE14+K8IkNmRBUukzXYX2DHibWvpFicod52saBt44bAF0GERgsHDt2xIgPadz0J1vJDUM50iZUdqqwGLLoc7czgKCblIGPs1eVa/05GSHCjtzxRLh1h08aY+JCaSli0gl8RDNjQUyq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598076; 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=1cllmiSG86Yx960rNzc5saZMsutjJXM/EbUt0OszhmI=; b=WvQrkHkIamMH0BT2MIlSXgwLRAUhGKqnm/aut1obRdYpehajCcEw5KKW13LuIBUV+eNMU/CRn6lJsyKbZ4I872gW80gntqm0GksnPUw+eR/DeofMRG2ReTVFnRMdN8CY8yX3hamOv6X5pyREYXjgKp3qv2ONuOFuP75bjYE5JX0= 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 1689598076680569.5572249159366; Mon, 17 Jul 2023 05:47:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNdf-00080g-E0; Mon, 17 Jul 2023 08:47:49 -0400 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 1qLNcy-0007TY-81 for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:02 -0400 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 1qLNcw-0008Mp-CE for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:46:59 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-380-pv_YPxr-OayajYswIngqRQ-1; Mon, 17 Jul 2023 08:46:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F303D101A528; Mon, 17 Jul 2023 12:46:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E43D40C2063; Mon, 17 Jul 2023 12:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598017; 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=1cllmiSG86Yx960rNzc5saZMsutjJXM/EbUt0OszhmI=; b=gGoPZkDZDIJRg1IlkNHn15IPFyCbmQROit35FBgmdRrECB8PXOB8LcITWBObGUy0zkT5bn 4x93Tspyd+2l4EA5rMlWpXOmeIUxd/mdIUPNn8/+uPkhFf1jIbhlz/EA0oy2Za7KGJZz/y WSuWZPuJ8GBrW3Qnj/yaeWx/GoD5VUU= X-MC-Unique: pv_YPxr-OayajYswIngqRQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 15/19] audio/pw: factorize some common code Date: Mon, 17 Jul 2023 16:45:40 +0400 Message-ID: <20230717124545.177236-16-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.1 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_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: 1689598077694100003 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-9-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 85 ++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 51 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index d0bc4680a6..70f0c46240 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -66,6 +66,9 @@ typedef struct PWVoiceIn { PWVoice v; } PWVoiceIn; =20 +#define PW_VOICE_IN(v) ((PWVoiceIn *)v) +#define PW_VOICE_OUT(v) ((PWVoiceOut *)v) + static void stream_destroy(void *data) { @@ -630,62 +633,55 @@ qpw_init_in(HWVoiceIn *hw, struct audsettings *as, vo= id *drv_opaque) } =20 static void -qpw_fini_out(HWVoiceOut *hw) +qpw_voice_fini(PWVoice *v) { - PWVoiceOut *pw =3D (PWVoiceOut *) hw; - PWVoice *v =3D &pw->v; + pwaudio *c =3D v->g; =20 - if (v->stream) { - pwaudio *c =3D v->g; - pw_thread_loop_lock(c->thread_loop); - pw_stream_destroy(v->stream); - v->stream =3D NULL; - pw_thread_loop_unlock(c->thread_loop); + if (!v->stream) { + return; } + pw_thread_loop_lock(c->thread_loop); + pw_stream_destroy(v->stream); + v->stream =3D NULL; + pw_thread_loop_unlock(c->thread_loop); } =20 static void -qpw_fini_in(HWVoiceIn *hw) +qpw_fini_out(HWVoiceOut *hw) { - PWVoiceIn *pw =3D (PWVoiceIn *) hw; - PWVoice *v =3D &pw->v; + qpw_voice_fini(&PW_VOICE_OUT(hw)->v); +} =20 - if (v->stream) { - pwaudio *c =3D v->g; - pw_thread_loop_lock(c->thread_loop); - pw_stream_destroy(v->stream); - v->stream =3D NULL; - pw_thread_loop_unlock(c->thread_loop); - } +static void +qpw_fini_in(HWVoiceIn *hw) +{ + qpw_voice_fini(&PW_VOICE_IN(hw)->v); } =20 static void -qpw_enable_out(HWVoiceOut *hw, bool enable) +qpw_voice_set_enabled(PWVoice *v, bool enable) { - PWVoiceOut *po =3D (PWVoiceOut *) hw; - PWVoice *v =3D &po->v; pwaudio *c =3D v->g; pw_thread_loop_lock(c->thread_loop); pw_stream_set_active(v->stream, enable); pw_thread_loop_unlock(c->thread_loop); } =20 +static void +qpw_enable_out(HWVoiceOut *hw, bool enable) +{ + qpw_voice_set_enabled(&PW_VOICE_OUT(hw)->v, enable); +} + static void qpw_enable_in(HWVoiceIn *hw, bool enable) { - PWVoiceIn *pi =3D (PWVoiceIn *) hw; - PWVoice *v =3D &pi->v; - pwaudio *c =3D v->g; - pw_thread_loop_lock(c->thread_loop); - pw_stream_set_active(v->stream, enable); - pw_thread_loop_unlock(c->thread_loop); + qpw_voice_set_enabled(&PW_VOICE_IN(hw)->v, enable); } =20 static void -qpw_volume_out(HWVoiceOut *hw, Volume *vol) +qpw_voice_set_volume(PWVoice *v, Volume *vol) { - PWVoiceOut *pw =3D (PWVoiceOut *) hw; - PWVoice *v =3D &pw->v; pwaudio *c =3D v->g; int i, ret; =20 @@ -707,28 +703,15 @@ qpw_volume_out(HWVoiceOut *hw, Volume *vol) } =20 static void -qpw_volume_in(HWVoiceIn *hw, Volume *vol) +qpw_volume_out(HWVoiceOut *hw, Volume *vol) { - PWVoiceIn *pw =3D (PWVoiceIn *) hw; - PWVoice *v =3D &pw->v; - pwaudio *c =3D v->g; - int i, ret; - - pw_thread_loop_lock(c->thread_loop); - v->volume.channels =3D vol->channels; - - for (i =3D 0; i < vol->channels; ++i) { - v->volume.values[i] =3D (float)vol->vol[i] / 255; - } - - ret =3D pw_stream_set_control(v->stream, - SPA_PROP_channelVolumes, v->volume.channels, v->volume.values, 0); - trace_pw_vol(ret =3D=3D 0 ? "success" : "failed"); + qpw_voice_set_volume(&PW_VOICE_OUT(hw)->v, vol); +} =20 - v->muted =3D vol->mute; - float val =3D v->muted ? 1.f : 0.f; - ret =3D pw_stream_set_control(v->stream, SPA_PROP_mute, 1, &val, 0); - pw_thread_loop_unlock(c->thread_loop); +static void +qpw_volume_in(HWVoiceIn *hw, Volume *vol) +{ + qpw_voice_set_volume(&PW_VOICE_IN(hw)->v, vol); } =20 static int wait_resync(pwaudio *pw) --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598190; cv=none; d=zohomail.com; s=zohoarc; b=nzefgxyzawW8IhJX6sT20CR1pdHsn0L3L4zxRo7IDW8uj/MQvEjM8GPT1mSJsNqP7KtiUwDF50A9/9nxodolyQHR8JqPZ0U9tGl7Nd48hKBq/vpzmL0Jos4+Oy/BofcT27xZFl31jTjAP9hWzrN9b3rILLGkIGlswpK4+BIrUHg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598190; 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=c0IfWS9EMdsUFmJ5bsrmW0GVPdFrF2Q5OErIVgOV174=; b=LR+ta3y2nhgbMJywf6NLNEEavGsIJ6cBETMDuJshm1Nl5aAp0wVxjV75hvbQbHuKU+FsRJqoAHbOpSTqCq8M2PBDDqPIz+5g7y28wLHz8MUHlUQqhLEss6I9+z7NIFw9IyGx28u9/wnls4hgwoW1klXwbAwYn13R0SxbuD8AHzY= 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 1689598190748143.8953659671273; Mon, 17 Jul 2023 05:49:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNdl-00089W-Rs; Mon, 17 Jul 2023 08:47:50 -0400 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 1qLNd3-0007c1-3D for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:07 -0400 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 1qLNd0-0008NW-KU for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:03 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-435-SB4kTr97Nb6qRVcWwXm8kQ-1; Mon, 17 Jul 2023 08:46:59 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ACC0F299E742; Mon, 17 Jul 2023 12:46:58 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97412492B01; Mon, 17 Jul 2023 12:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598022; 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=c0IfWS9EMdsUFmJ5bsrmW0GVPdFrF2Q5OErIVgOV174=; b=Bf9DZY4cMPnyRH+uoIKMOHQgD9VQ2gnIndXczCXpeA/IKJGmK2sVI89yUYjZdFvJA8JtMS TlPB+AaC9kHPUf0rHOwYhy6VLXW9a1TvmEnCumTMSOByOUatImj2jQgOBMFMMI+K4gjn/G uLE+oxNsrzwjyNiyIBBHg3ijOhslACg= X-MC-Unique: SB4kTr97Nb6qRVcWwXm8kQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 16/19] audio/pw: add more error reporting Date: Mon, 17 Jul 2023 16:45:41 +0400 Message-ID: <20230717124545.177236-17-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.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: 1689598192714100006 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-10-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 70f0c46240..f1c5e5dd48 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -429,6 +429,10 @@ create_stream(pwaudio *c, PWVoice *v, const char *stre= am_name, struct pw_properties *props; =20 props =3D pw_properties_new(NULL, NULL); + if (!props) { + error_report("Failed to create PW properties: %s", g_strerror(errn= o)); + return -1; + } =20 /* 75% of the timer period for faster updates */ buf_samples =3D (uint64_t)v->g->dev->timer_period * v->info.rate @@ -441,8 +445,8 @@ create_stream(pwaudio *c, PWVoice *v, const char *strea= m_name, pw_properties_set(props, PW_KEY_TARGET_OBJECT, name); } v->stream =3D pw_stream_new(c->core, stream_name, props); - if (v->stream =3D=3D NULL) { + error_report("Failed to create PW stream: %s", g_strerror(errno)); return -1; } =20 @@ -470,6 +474,7 @@ create_stream(pwaudio *c, PWVoice *v, const char *strea= m_name, PW_STREAM_FLAG_MAP_BUFFERS | PW_STREAM_FLAG_RT_PROCESS, params, n_params); if (res < 0) { + error_report("Failed to connect PW stream: %s", g_strerror(errno)); pw_stream_destroy(v->stream); return -1; } --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598663; cv=none; d=zohomail.com; s=zohoarc; b=YV54RCv3bxmpIN492X6XJZJd+2BEONQ9GN/ILvVJTHK9Iwas4wDN+gtGVhXYutP4oyGGRBch5SV0JjyQsOBIWDmXTXprbKCzhnPV4ICwt/SS79djxJ7Dsv2Qr0G1Ql+UVIf0zZof9nuLsZDNbPxo1U61TvM0bJZJ0pWfODhwfv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598663; 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=tpaHmDZaPv+Ht3JQzteeEJnimLdekuMUGpDCss9LcJ8=; b=dV2vhpTYJJds1P5Fgw54HQhypGduoEC1LNUjYfGm97Z1smUSHy86WOTwDwwlGuAIfQc1BjBbzIHkt0a13PkmGWWM3XKxlNrEStrpW4fdt85MpIGji7+3OlGTXw1By9h7lvDSwEXZDlV0wvicecHz8NpTOeL0Fnwg/9VRXwT/lJY= 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 168959866313252.11427521900953; Mon, 17 Jul 2023 05:57:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNfi-0001VW-OD; Mon, 17 Jul 2023 08:49:52 -0400 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 1qLNd7-0007gS-6A for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:14 -0400 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 1qLNd4-0008OP-Qb for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:08 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-318-wpJSrmfRNDepWOWqMDYyVQ-1; Mon, 17 Jul 2023 08:47:02 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A011856F67; Mon, 17 Jul 2023 12:47:02 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF7EC1121314; Mon, 17 Jul 2023 12:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598026; 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=tpaHmDZaPv+Ht3JQzteeEJnimLdekuMUGpDCss9LcJ8=; b=QceltKA8x23XOy/eNWiBUKYkYq52a7WxhMIIz5aIt9rwdn21RDfYqa8EaZqaZfZ1ttAliz ZYWGDK0jp60O3mZuSrKiVpuoFfiz2w9HF98LVYsMRtjhqfUCynjzfKZRKqeAa/9Jt0nsgP HXLSk+0YEglM9Yg1/lfBOKYAniqvnN8= X-MC-Unique: wpJSrmfRNDepWOWqMDYyVQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 17/19] audio/pw: simplify error reporting in stream creation Date: Mon, 17 Jul 2023 16:45:42 +0400 Message-ID: <20230717124545.177236-18-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.3 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_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: 1689598663477100005 From: Marc-Andr=C3=A9 Lureau create_stream() now reports on all error paths. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-11-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index f1c5e5dd48..7d5005b971 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -486,8 +486,6 @@ static int qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, const char *name, enum spa_direction dir) { - int r; - switch (v->info.channels) { case 8: v->info.position[0] =3D SPA_AUDIO_CHANNEL_FL; @@ -540,13 +538,7 @@ qpw_stream_new(pwaudio *c, PWVoice *v, const char *str= eam_name, } =20 /* create a new unconnected pwstream */ - r =3D create_stream(c, v, stream_name, name, dir); - if (r < 0) { - AUD_log(AUDIO_CAP, "Failed to create stream."); - return -1; - } - - return r; + return create_stream(c, v, stream_name, name, dir); } =20 static int @@ -577,7 +569,6 @@ qpw_init_out(HWVoiceOut *hw, struct audsettings *as, vo= id *drv_opaque) r =3D qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id, ppdo->name, SPA_DIRECTION_OUTPUT); if (r < 0) { - error_report("qpw_stream_new for playback failed"); pw_thread_loop_unlock(c->thread_loop); return -1; } @@ -621,7 +612,6 @@ qpw_init_in(HWVoiceIn *hw, struct audsettings *as, void= *drv_opaque) r =3D qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id, ppdo->name, SPA_DIRECTION_INPUT); if (r < 0) { - error_report("qpw_stream_new for recording failed"); pw_thread_loop_unlock(c->thread_loop); return -1; } --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598210; cv=none; d=zohomail.com; s=zohoarc; b=Gy4SrVj91qi+4SXUwy9zxv2qFPYdwyA4i1hf4wo8+tCozFeXG9yT7UdHuT4cxbTV8Zb575k2Am1Xl3Ef4Svdh3BS7E46j2LrZiTV7wpHgQWcvHzhKcWUqOh/1ojcyJna2NMzxI6IArB7HrzNl3Z2Y4IDQePQDHrslnI4pSf4XXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598210; 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=eRQsbnZtXsvuE/Hz/YYIIxffOd3lgd7mjI4qN3e3TAU=; b=RqqIdYSUctwEfawi4PHfuO5CLldfKWwR2mIkQdiC/1x/exrgJXhP4EUf1KwLpsEDVjoaZxvYvKEwKqJJA43XC2/SzPU+AlICej7GiTWiby/eHR3+Mx6E1OQhKrI6+kYvjE8ny9+aFtEvyjRtfxe53t1eEn1H2SMXwJLDpwaBxFI= 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 1689598210492423.7594101694614; Mon, 17 Jul 2023 05:50:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNeC-000093-Nq; Mon, 17 Jul 2023 08:48:17 -0400 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 1qLNdD-0007jO-BZ for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:20 -0400 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 1qLNd9-0008Os-CF for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:13 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-465-E6ETJOnmN6e72Yw5AgUjAQ-1; Mon, 17 Jul 2023 08:47:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F1A24867940; Mon, 17 Jul 2023 12:47:06 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC1A340C206F; Mon, 17 Jul 2023 12:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598030; 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=eRQsbnZtXsvuE/Hz/YYIIxffOd3lgd7mjI4qN3e3TAU=; b=HlVxR8l4HdBG7LNA1NviCpqxhIPkDobuGJVEXw+tN6MlLn8CxUd1/HcJloRFYPEYbyi2Qh FD2LulviVRehNdD//BrkE1hE2euTGeWvcGXo7hON3pQWIEZ0sLOpX1xZrDYwREPzWShRtD BimtKV9XKNRGZvw9rsdhL6UbAcxO3sc= X-MC-Unique: E6ETJOnmN6e72Yw5AgUjAQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 18/19] audio/pw: remove wrong comment Date: Mon, 17 Jul 2023 16:45:43 +0400 Message-ID: <20230717124545.177236-19-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.1 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: 1689598211812100003 From: Marc-Andr=C3=A9 Lureau The stream is actually created connected. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-12-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index 7d5005b971..a101ffeff1 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -537,7 +537,6 @@ qpw_stream_new(pwaudio *c, PWVoice *v, const char *stre= am_name, break; } =20 - /* create a new unconnected pwstream */ return create_stream(c, v, stream_name, name, dir); } =20 --=20 2.41.0 From nobody Mon May 20 14:11:14 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=1689598342; cv=none; d=zohomail.com; s=zohoarc; b=LBk8Eit1VDhwC/5unAn1PkbqiR/pTeDebTY+LWzZIHzZn+ad6z/5DU1TFATSe6++pE8Bw7sBa2slPoeOMHj8sETaZysBX/MFHHbyHttN37tcYCuagtoP+QE2anb+K1ywJPaXxDBqK1urHhznCUtVdDDLG6y67++P+zgv3TMGynM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689598342; 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=oKlS5hRDGOMxyXKDJpllQ4xZZoY7yU8FDeO5tvaBJ64=; b=CBy14X4nui8nwXcnySsIDArENZ5o9+f9hgFEwbVfHvdTzf/L5rW7GuUdS5t2q9pAZQ8Flq7A/ofC6b+VfHFyTDD09zh/JnPExTJyP2zj2W9j5wg2HmHKVcxIRG7Gn3+DbL5/TcMGvC+9psjbHYXrbR51723QAaQGq1Ru3cWpO40= 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 1689598342939840.6375426271114; Mon, 17 Jul 2023 05:52:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLNgl-0002Qg-Q7; Mon, 17 Jul 2023 08:50:55 -0400 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 1qLNdJ-0007uf-3O for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:28 -0400 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 1qLNdG-0008PD-H9 for qemu-devel@nongnu.org; Mon, 17 Jul 2023 08:47:20 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-VGGsooOBMjCFJfaTvUmRuQ-1; Mon, 17 Jul 2023 08:47:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 42F368966C4; Mon, 17 Jul 2023 12:47:13 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1EF740C206F; Mon, 17 Jul 2023 12:47:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689598037; 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=oKlS5hRDGOMxyXKDJpllQ4xZZoY7yU8FDeO5tvaBJ64=; b=gXtEHlWSrmZ+c5VJzvE0BZBMD2lkx81uEnilWOvFPURP4f6FCdH7ZgRMkUy8IzidDSBS1n DTwjhn0QzzrR49S/HtFZ+t9G3UAiWkgw1eX9ki2tMGO2ezCKb9WLosQENcjccyQ52KqjV1 OUfF189nVO970ZdaQM348KvOLocQvcM= X-MC-Unique: VGGsooOBMjCFJfaTvUmRuQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal , richard.henderson@linaro.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Wainer dos Santos Moschetta , Thomas Huth , Eric Blake Subject: [PULL 19/19] audio/pw: improve channel position code Date: Mon, 17 Jul 2023 16:45:44 +0400 Message-ID: <20230717124545.177236-20-marcandre.lureau@redhat.com> In-Reply-To: <20230717124545.177236-1-marcandre.lureau@redhat.com> References: <20230717124545.177236-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.1 on 10.11.54.1 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: 1689598343616100001 From: Marc-Andr=C3=A9 Lureau Follow PulseAudio backend comment and code, and only implement the channels QEMU actually supports at this point, and add the same comment about limits and future mappings. Simplify a bit the code. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Volker R=C3=BCmelin Message-Id: <20230506163735.3481387-13-marcandre.lureau@redhat.com> --- audio/pwaudio.c | 75 +++++++++++++++++-------------------------------- 1 file changed, 26 insertions(+), 49 deletions(-) diff --git a/audio/pwaudio.c b/audio/pwaudio.c index a101ffeff1..b6a38738ee 100644 --- a/audio/pwaudio.c +++ b/audio/pwaudio.c @@ -417,8 +417,8 @@ pw_to_audfmt(enum spa_audio_format fmt, int *endianness, } =20 static int -create_stream(pwaudio *c, PWVoice *v, const char *stream_name, - const char *name, enum spa_direction dir) +qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, + const char *name, enum spa_direction dir) { int res; uint32_t n_params; @@ -482,62 +482,37 @@ create_stream(pwaudio *c, PWVoice *v, const char *str= eam_name, return 0; } =20 -static int -qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name, - const char *name, enum spa_direction dir) +static void +qpw_set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNE= LS]) { - switch (v->info.channels) { + memcpy(position, (uint32_t[SPA_AUDIO_MAX_CHANNELS]) { SPA_AUDIO_CHANNE= L_UNKNOWN, }, + sizeof(uint32_t) * SPA_AUDIO_MAX_CHANNELS); + /* + * TODO: This currently expects the only frontend supporting more than= 2 + * channels is the usb-audio. We will need some means to set channel + * order when a new frontend gains multi-channel support. + */ + switch (channels) { case 8: - v->info.position[0] =3D SPA_AUDIO_CHANNEL_FL; - v->info.position[1] =3D SPA_AUDIO_CHANNEL_FR; - v->info.position[2] =3D SPA_AUDIO_CHANNEL_FC; - v->info.position[3] =3D SPA_AUDIO_CHANNEL_LFE; - v->info.position[4] =3D SPA_AUDIO_CHANNEL_RL; - v->info.position[5] =3D SPA_AUDIO_CHANNEL_RR; - v->info.position[6] =3D SPA_AUDIO_CHANNEL_SL; - v->info.position[7] =3D SPA_AUDIO_CHANNEL_SR; - break; + position[6] =3D SPA_AUDIO_CHANNEL_SL; + position[7] =3D SPA_AUDIO_CHANNEL_SR; + /* fallthrough */ case 6: - v->info.position[0] =3D SPA_AUDIO_CHANNEL_FL; - v->info.position[1] =3D SPA_AUDIO_CHANNEL_FR; - v->info.position[2] =3D SPA_AUDIO_CHANNEL_FC; - v->info.position[3] =3D SPA_AUDIO_CHANNEL_LFE; - v->info.position[4] =3D SPA_AUDIO_CHANNEL_RL; - v->info.position[5] =3D SPA_AUDIO_CHANNEL_RR; - break; - case 5: - v->info.position[0] =3D SPA_AUDIO_CHANNEL_FL; - v->info.position[1] =3D SPA_AUDIO_CHANNEL_FR; - v->info.position[2] =3D SPA_AUDIO_CHANNEL_FC; - v->info.position[3] =3D SPA_AUDIO_CHANNEL_LFE; - v->info.position[4] =3D SPA_AUDIO_CHANNEL_RC; - break; - case 4: - v->info.position[0] =3D SPA_AUDIO_CHANNEL_FL; - v->info.position[1] =3D SPA_AUDIO_CHANNEL_FR; - v->info.position[2] =3D SPA_AUDIO_CHANNEL_FC; - v->info.position[3] =3D SPA_AUDIO_CHANNEL_RC; - break; - case 3: - v->info.position[0] =3D SPA_AUDIO_CHANNEL_FL; - v->info.position[1] =3D SPA_AUDIO_CHANNEL_FR; - v->info.position[2] =3D SPA_AUDIO_CHANNEL_LFE; - break; + position[2] =3D SPA_AUDIO_CHANNEL_FC; + position[3] =3D SPA_AUDIO_CHANNEL_LFE; + position[4] =3D SPA_AUDIO_CHANNEL_RL; + position[5] =3D SPA_AUDIO_CHANNEL_RR; + /* fallthrough */ case 2: - v->info.position[0] =3D SPA_AUDIO_CHANNEL_FL; - v->info.position[1] =3D SPA_AUDIO_CHANNEL_FR; + position[0] =3D SPA_AUDIO_CHANNEL_FL; + position[1] =3D SPA_AUDIO_CHANNEL_FR; break; case 1: - v->info.position[0] =3D SPA_AUDIO_CHANNEL_MONO; + position[0] =3D SPA_AUDIO_CHANNEL_MONO; break; default: - for (size_t i =3D 0; i < v->info.channels; i++) { - v->info.position[i] =3D SPA_AUDIO_CHANNEL_UNKNOWN; - } - break; + dolog("Internal error: unsupported channel count %d\n", channels); } - - return create_stream(c, v, stream_name, name, dir); } =20 static int @@ -555,6 +530,7 @@ qpw_init_out(HWVoiceOut *hw, struct audsettings *as, vo= id *drv_opaque) =20 v->info.format =3D audfmt_to_pw(as->fmt, as->endianness); v->info.channels =3D as->nchannels; + qpw_set_position(as->nchannels, v->info.position); v->info.rate =3D as->freq; =20 obt_as.fmt =3D @@ -601,6 +577,7 @@ qpw_init_in(HWVoiceIn *hw, struct audsettings *as, void= *drv_opaque) =20 v->info.format =3D audfmt_to_pw(as->fmt, as->endianness); v->info.channels =3D as->nchannels; + qpw_set_position(as->nchannels, v->info.position); v->info.rate =3D as->freq; =20 obt_as.fmt =3D --=20 2.41.0