From patchwork Mon Dec 5 09:51:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 631045 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2422334pvb; Mon, 5 Dec 2022 01:54:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ka4B+lsFtVU4MAsZFjx5Jr8tsLsBddiq2cnKPY4YUD2mJUuBKiywmHUdylXSBtABlv3Uy X-Received: by 2002:a0c:edcf:0:b0:4b3:fe67:349d with SMTP id i15-20020a0cedcf000000b004b3fe67349dmr74565090qvr.60.1670234078007; Mon, 05 Dec 2022 01:54:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670234078; cv=none; d=google.com; s=arc-20160816; b=Hqxr3WAFiLoVdXHQxkUzl1OifCc9WZZeEjPR/LjpIb/0hiATrDdN+f8YQGSzvbyth/ Pj3IprmCJiJrvzkqQF+YTKTl9cx+EHGQHxA3fEaoJEwBkgBq8ymMR1D1gTJcuaQxsDMk btLZYZSAfuNQtAridLabJuEYhRHJ+14ryZ6ofncVQDaPexmll1iQI1n+Arl2oHxtd8sp 0/LRU0MPE9JjhGPz7FeMMzIk2Wfp4pKYu2vx8XlKoq48oKZ63X/O95xCXXVTYsrcNBEr iN77itMK+wZeleWcLzlsUAlpigxut9lkJ0ZXQJ/OS4zjcz/dlYGIOQlX8jeajIFV6HyL hZkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i2+Mno2782955D37e2Tk3rpJLYwAGRf+TLqC5a0fYsE=; b=HnMxnlkCTLq+dHLausrDpowg0biCl23SY0buD/QjsN2KB/migg6DrbkrQKesU7CmjI 7XGdzCuGiSlFVTGPOcoRmdb766zLDbTGcOxzhI+KqXSl5tkIN0DDd72kWQLDW+7bG1lH lD8PTWEBjW8zGslwEfsQ2zn+K02hjZ8j7EOWYBvzTqtMpRF++7nrmvPKZtQ2JolwoX8/ PysAtS95mVVzaBecBH/WZbP/6aDyUT9doaxxhsJzagu4ZSlSBmCdig6VVregj+uEbR+G 2XFjg7GxTUgJw1Sa6rxJQKVHxPFujpxD45zdq2kQSdz+CdKQYGAu2DMjR3fvJJKcrqo3 SX6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gt0X0oqc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i14-20020ac8488e000000b003a7e7f08f6esi267773qtq.737.2022.12.05.01.54.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Dec 2022 01:54:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gt0X0oqc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p28AM-0000lS-Ns; Mon, 05 Dec 2022 04:53:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p28A5-0000c6-Du for qemu-devel@nongnu.org; Mon, 05 Dec 2022 04:53:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p28A2-0006Qm-AB for qemu-devel@nongnu.org; Mon, 05 Dec 2022 04:53:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670233997; 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=i2+Mno2782955D37e2Tk3rpJLYwAGRf+TLqC5a0fYsE=; b=Gt0X0oqclauMlmYCZexZ5PycCHQLKs41W3j3WE5aw9OwC328mx4vfwhnehtYpHeBCIEL79 Xlj3P81DpvM6uggj96Y78DQJgOOFmXn/iaQG4j3QMNXd8s3oMYXelvoIO7JMQGjG4XPViu A6yr0ziTHE0ABQx5IaLF/LtURCXKH0U= 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-416-CHUk4CsCOM6mJ6mmfIORaw-1; Mon, 05 Dec 2022 04:53:14 -0500 X-MC-Unique: CHUk4CsCOM6mJ6mmfIORaw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FD6E894E81; Mon, 5 Dec 2022 09:53:13 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B08C2166B29; Mon, 5 Dec 2022 09:53:05 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Cc: Fam Zheng , Thomas Huth , Viresh Kumar , Kevin Wolf , Mathieu Poirier , Laurent Vivier , Eric Blake , Richard Henderson , Raphael Norwitz , Stefan Hajnoczi , Juan Quintela , virtio-fs@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , Christian Borntraeger , "Gonglei (Arei)" , qemu-block@nongnu.org, Xiaojuan Yang , Thomas Huth , Ilya Leoshkevich , Eduardo Habkost , Gerd Hoffmann , "Dr. David Alan Gilbert" , Alex Williamson , Eric Farman , Halil Pasic , Peter Maydell , Vladimir Sementsov-Ogievskiy , Jason Wang , Laurent Vivier , Song Gao , qemu-s390x@nongnu.org, Pavel Dovgalyuk , Klaus Jensen , John Snow , Michael Tokarev , qemu-arm@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , Keith Busch , David Hildenbrand , qemu-trivial@nongnu.org, Hanna Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= Subject: [PATCH v2 04/51] hw/display/qxl: Have qxl_log_command Return early if no log_cmd handler Date: Mon, 5 Dec 2022 10:51:41 +0100 Message-Id: <20221205095228.1314-5-quintela@redhat.com> In-Reply-To: <20221205095228.1314-1-quintela@redhat.com> References: <20221205095228.1314-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Only 3 command types are logged: no need to call qxl_phys2virt() for the other types. Using different cases will help to pass different structure sizes to qxl_phys2virt() in a pair of commits. Reviewed-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Hajnoczi Message-Id: <20221128202741.4945-2-philmd@linaro.org> --- hw/display/qxl-logger.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/display/qxl-logger.c b/hw/display/qxl-logger.c index 68bfa47568..1bcf803db6 100644 --- a/hw/display/qxl-logger.c +++ b/hw/display/qxl-logger.c @@ -247,6 +247,16 @@ int qxl_log_command(PCIQXLDevice *qxl, const char *ring, QXLCommandExt *ext) qxl_name(qxl_type, ext->cmd.type), compat ? "(compat)" : ""); + switch (ext->cmd.type) { + case QXL_CMD_DRAW: + break; + case QXL_CMD_SURFACE: + break; + case QXL_CMD_CURSOR: + break; + default: + goto out; + } data = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id); if (!data) { return 1; @@ -269,6 +279,7 @@ int qxl_log_command(PCIQXLDevice *qxl, const char *ring, QXLCommandExt *ext) qxl_log_cmd_cursor(qxl, data, ext->group_id); break; } +out: fprintf(stderr, "\n"); return 0; }