From nobody Tue Feb 10 10:42:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647343567; cv=none; d=zohomail.com; s=zohoarc; b=LL9pEd0tqRKALtxvZ7ouEcbc+UHzzAH3TpKE6lQrZW2f6sSHnCoAQgNXVS1qNcpZyGHwh/YHT9KCFEnoDp9cqnzKPaKt4ALgSMODfsvrHaUSafgnlsw69OdQ75rK+Lphr4EXbwKLsmmXEvtaSdQMlj1xTNeWRrtgOh5odC81OZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647343567; 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=PhJu/fGjs6woppUiaVUm0HazUAIcaTnSY8JXdBoNP7M=; b=JE0FINSmrrQB4448IFfoMCZmikGAJ+D6JKFn7FVrZvtwhbXlIftb+uDhrPdBhhZHzBiudBlL6t/l5g86P1KnN0dvJsmK2wOcNzGJn8f4iG+1rfFNauTQhk4+GXRmWZzsoIy8ZIVpVZ5oU7Af6xudCbX3KSZVvHscdejc4xrWl6o= 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 1647343567657138.38719512794125; Tue, 15 Mar 2022 04:26:07 -0700 (PDT) Received: from localhost ([::1]:40218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU5JW-0008CE-1P for importer@patchew.org; Tue, 15 Mar 2022 07:26:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU53S-0006Tf-Kh for qemu-devel@nongnu.org; Tue, 15 Mar 2022 07:09:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU53J-0005uo-JB for qemu-devel@nongnu.org; Tue, 15 Mar 2022 07:09:24 -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-103-KDqxUU6TO4i9WLIwGGRkIQ-1; Tue, 15 Mar 2022 07:09:18 -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 80BB2811E7A; Tue, 15 Mar 2022 11:09:17 +0000 (UTC) Received: from localhost (unknown [10.39.208.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 473E540C1257; Tue, 15 Mar 2022 11:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647342561; 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=PhJu/fGjs6woppUiaVUm0HazUAIcaTnSY8JXdBoNP7M=; b=Vdyan4670YqEMLXVS+YzOb+IcERUXUExj9LKhP+/wNMqx79s5hyEB4x8fx5L5rrJVCCVWk amdib82t1BxLvDXje7Vx7q1Tn929T26k5f5MMsM0UeOy7g6j7yV+5QJRc+y0gJT97wFIV+ tUULbPGvHJF08gP1YgmXzQSvSPRlTGU= X-MC-Unique: KDqxUU6TO4i9WLIwGGRkIQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PULL v2 11/12] ui/dbus: do not send 2d scanout until gfx_update Date: Tue, 15 Mar 2022 15:07:38 +0400 Message-Id: <20220315110739.2095676-12-marcandre.lureau@redhat.com> In-Reply-To: <20220315110739.2095676-1-marcandre.lureau@redhat.com> References: <20220315110739.2095676-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Cc: peter.maydell@linaro.org, kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1647343571612100001 From: Marc-Andr=C3=A9 Lureau gfx_switch() is called to set the new_surface, not necessarily to display it. It should be displayed after gfx_update(). Send the whole scanout only in this case. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Gerd Hoffmann --- ui/dbus-listener.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index a287edd2fc15..f9fc8eda519a 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -255,6 +255,26 @@ static void dbus_gfx_update(DisplayChangeListener *dcl, =20 trace_dbus_update(x, y, w, h); =20 + if (x =3D=3D 0 && y =3D=3D 0 && w =3D=3D surface_width(ddl->ds) && h = =3D=3D surface_height(ddl->ds)) { + v_data =3D g_variant_new_from_data( + G_VARIANT_TYPE("ay"), + surface_data(ddl->ds), + surface_stride(ddl->ds) * surface_height(ddl->ds), + TRUE, + (GDestroyNotify)pixman_image_unref, + pixman_image_ref(ddl->ds->image)); + qemu_dbus_display1_listener_call_scanout( + ddl->proxy, + surface_width(ddl->ds), + surface_height(ddl->ds), + surface_stride(ddl->ds), + surface_format(ddl->ds), + v_data, + G_DBUS_CALL_FLAGS_NONE, + DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL); + return; + } + /* make a copy, since gvariant only handles linear data */ img =3D pixman_image_create_bits(surface_format(ddl->ds), w, h, NULL, stride); @@ -295,29 +315,12 @@ static void dbus_gfx_switch(DisplayChangeListener *dc= l, struct DisplaySurface *new_surface) { DBusDisplayListener *ddl =3D container_of(dcl, DBusDisplayListener, dc= l); - GVariant *v_data =3D NULL; =20 ddl->ds =3D new_surface; if (!ddl->ds) { /* why not call disable instead? */ return; } - - v_data =3D g_variant_new_from_data( - G_VARIANT_TYPE("ay"), - surface_data(ddl->ds), - surface_stride(ddl->ds) * surface_height(ddl->ds), - TRUE, - (GDestroyNotify)pixman_image_unref, - pixman_image_ref(ddl->ds->image)); - qemu_dbus_display1_listener_call_scanout(ddl->proxy, - surface_width(ddl->ds), - surface_height(ddl->ds), - surface_stride(ddl->ds), - surface_format(ddl->ds), - v_data, - G_DBUS_CALL_FLAGS_NONE, - DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL); } =20 static void dbus_mouse_set(DisplayChangeListener *dcl, --=20 2.35.1.273.ge6ebfd0e8cbb