From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669926; cv=none; d=zohomail.com; s=zohoarc; b=WKwV0fyoVrSODZj2wLif+21aKnlf1BgGo7vvwJzQoz4uWlAVUgtUVA/NpCma2X/O0I3sUlhVsZXBJPC0sWArRlb/yXr+4HsMXAk0JTCLJdV/t8iUpCgvOZleFkkNbOKyLa5JyJ4VcUzYzmtx/eRgScfD3dX5jLT0RJWPmL1bFGk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669926; 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=O28inHDVpVZDhPHiuyyYR/itAk5vSTfRey6DnLy0yh4=; b=TCstDHwskA9yX123wIK7lAt0sNc3wKKRvOy3UJYkkuPPqUbS++JRBH8A+2PbHs15Rmz9KerqWDt4igNrq2kmX/jq9eLyLLcqN36H61ZG0y7tSHQT3jo71rUPd2woyaB58oH14F4xzjAKL4xJzJuFSkUNEzNm2cUPCMkwg97MFX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669926491359.6695502107485; Thu, 28 May 2020 05:45:26 -0700 (PDT) Received: from localhost ([::1]:46350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHuX-0003ka-8M for importer@patchew.org; Thu, 28 May 2020 08:45:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHmC-0002WW-Vr for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:49 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:29057 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHmC-0005P4-4g for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:48 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-agnOQl7SOzCNxWJBmamIUQ-1; Thu, 28 May 2020 08:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8B6E8005AA; Thu, 28 May 2020 12:36:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BFBF5C1C8; Thu, 28 May 2020 12:36:13 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 606A19DAD; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669407; 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=O28inHDVpVZDhPHiuyyYR/itAk5vSTfRey6DnLy0yh4=; b=E8NaT+hUItrs1yZqDLNS4YXuxG22wibDOJh6B1sHM56TuFdbbreuai1zQABJT9CQFc5x29 qIti6sBPr1TTVgiOi7hcnrklKUgpyjIBPxniRwJsDHil2zUvKccoYo4DMqzUwHKYE4QpdU p9LAV45ji/02RjjDnIC+7q0Jp/ITUv4= X-MC-Unique: agnOQl7SOzCNxWJBmamIUQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 01/21] hw/display/edid: Add missing 'qdev-properties.h' header Date: Thu, 28 May 2020 14:35:49 +0200 Message-Id: <20200528123609.27362-2-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 When trying to consume the DEFINE_EDID_PROPERTIES() macro by including "hw/display/edid.h", we get this build failure: include/hw/display/edid.h:24:5: error: implicit declaration of function =E2=80=98DEFINE_PROP_UINT32=E2=80=99 [-Werror=3Dimplicit-functio= n-declaration] 24 | DEFINE_PROP_UINT32("xres", _state, _edid_info.prefx, 0), \ | ^~~~~~~~~~~~~~~~~~ Headers should be self-contained, and one shouldn't have to dig to find the missing headers. In this case "hw/qdev-properties.h" is missing. Add it. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-2-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- include/hw/display/edid.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/display/edid.h b/include/hw/display/edid.h index ff99dc0a052b..23371ee82c63 100644 --- a/include/hw/display/edid.h +++ b/include/hw/display/edid.h @@ -2,6 +2,7 @@ #define EDID_H =20 #include "qom/object.h" +#include "hw/qdev-properties.h" =20 typedef struct qemu_edid_info { const char *vendor; /* http://www.uefi.org/pnp_id_list */ --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669689; cv=none; d=zohomail.com; s=zohoarc; b=lp734/ronKfnBXvJobyWQq5/xB6InasyG7VCPEuoCFSFneCkFRjj1IARFBXOhCH8XPWSAloFpzB7c6RXmdX/73QIybwwUWyq1goWWfUSmp/lvaXF+b/azpNM4vkBtaH89raTD5no8zvRupou8h/03hyqHEmeAzEqgwlVW4fTq50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669689; 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=dbM4DIqFT/1AAo5DPEyqBeuBxBSshlvJ2pooOBfqays=; b=buDEh/B0vKVrWLCynVr08RQJ1jY3raXCafEeO1WL4NrGnvtguKGKu7h4vbjx5o7l+eJE2EfJUwRdsojSmMuhb8NZZ2sS5+2SjZR2LcP5Sddp8SHqX+zUiNJKMXJRDDM/bKioo+yhY1Vrls9lcw+MrBjF7tD7FadoO6wNorIEwoc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669689992939.8475608328957; Thu, 28 May 2020 05:41:29 -0700 (PDT) Received: from localhost ([::1]:53298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHqi-0003CV-Et for importer@patchew.org; Thu, 28 May 2020 08:41:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlt-0001bn-CW for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:21498 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlp-0005AO-E7 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-xY18pM-pNsaKqZfQxmKmcw-1; Thu, 28 May 2020 08:36:20 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7FD41460; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 874475C1D6; Thu, 28 May 2020 12:36:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6AD6A9DAE; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669384; 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=dbM4DIqFT/1AAo5DPEyqBeuBxBSshlvJ2pooOBfqays=; b=cM+eUoPiHcuG86Er4SIP9n+1RuZJ4NSNqnK+fxA0YZ9zdcNA2/J0cEWjXDTfiyQVGzhrKY Q5vleRdeyZcw79QAG7UTu6ZMw6z371Vh2gKWGOxz3TeLT56yV0Vim8FPf87bbhd7SCw8J7 qksbnYSqUdCDP8jrNmyRBA7QhgetHcI= X-MC-Unique: xY18pM-pNsaKqZfQxmKmcw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 02/21] hw/display/cg3: Convert debug printf()s to trace events Date: Thu, 28 May 2020 14:35:50 +0200 Message-Id: <20200528123609.27362-3-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Convert DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-3-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/cg3.c | 14 ++++---------- hw/display/trace-events | 4 ++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index f7f1c199ce54..7cbe6e56ff69 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -35,6 +35,7 @@ #include "hw/qdev-properties.h" #include "qemu/log.h" #include "qemu/module.h" +#include "trace.h" =20 /* Change to 1 to enable debugging */ #define DEBUG_CG3 0 @@ -63,12 +64,6 @@ #define CG3_VRAM_SIZE 0x100000 #define CG3_VRAM_OFFSET 0x800000 =20 -#define DPRINTF(fmt, ...) do { \ - if (DEBUG_CG3) { \ - printf("CG3: " fmt , ## __VA_ARGS__); \ - } \ -} while (0) - #define TYPE_CG3 "cgthree" #define CG3(obj) OBJECT_CHECK(CG3State, (obj), TYPE_CG3) =20 @@ -195,7 +190,8 @@ static uint64_t cg3_reg_read(void *opaque, hwaddr addr,= unsigned size) val =3D 0; break; } - DPRINTF("read %02x from reg %" HWADDR_PRIx "\n", val, addr); + trace_cg3_read(addr, val, size); + return val; } =20 @@ -206,9 +202,7 @@ static void cg3_reg_write(void *opaque, hwaddr addr, ui= nt64_t val, uint8_t regval; int i; =20 - DPRINTF("write %" PRIx64 " to reg %" HWADDR_PRIx " size %d\n", - val, addr, size); - + trace_cg3_write(addr, val, size); switch (addr) { case CG3_REG_BT458_ADDR: s->dac_index =3D val; diff --git a/hw/display/trace-events b/hw/display/trace-events index e6e22bef8899..47b2b168ae15 100644 --- a/hw/display/trace-events +++ b/hw/display/trace-events @@ -151,3 +151,7 @@ artist_vram_write(unsigned int size, uint64_t addr, uin= t64_t val) "%u 0x%"PRIx64 artist_fill_window(unsigned int start_x, unsigned int start_y, unsigned in= t width, unsigned int height, uint32_t op, uint32_t ctlpln) "start=3D%ux%u = length=3D%ux%u op=3D0x%08x ctlpln=3D0x%08x" artist_block_move(unsigned int start_x, unsigned int start_y, unsigned int= dest_x, unsigned int dest_y, unsigned int width, unsigned int height) "sou= rce %ux%u -> dest %ux%u size %ux%u" artist_draw_line(unsigned int start_x, unsigned int start_y, unsigned int = end_x, unsigned int end_y) "%ux%u %ux%u" + +# cg3.c +cg3_read(uint32_t addr, uint32_t val, unsigned size) "read addr:0x%06"PRIx= 32" val:0x%08"PRIx32" size:%u" +cg3_write(uint32_t addr, uint32_t val, unsigned size) "write addr:0x%06"PR= Ix32" val:0x%08"PRIx32" size:%u" --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669462; cv=none; d=zohomail.com; s=zohoarc; b=POALDUMXNbXyvKLfJfxOWqY2eR8QJ3k8Nzrhl2Wf0AEGpRCGWVTqkNCvpZULaHKy+36Yq2FIGkh5nx8hbKEk3h58CHhLFG60LPl7PduPlrIvINvO2mtFdW6JD0qwsxyW3G3QSw1SZralQwLqiUCBggyJ+lNA0AZiuRYmmKb78pQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669462; 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=NQraKQ1whxiMPOPRulSbwT/9AZGl8U9QqvXdcnOFJ2M=; b=al0+j9hnzhDRQyiP1usUxHs70eqVngo1/uRrCmWLKrUKbabdm4JH8mgWGL3EOr+o000iuAaBpVY1lbLIdNrAf5v5mJeN20KwvaStk/DAq47a/VSZoMsGf+5JpCRfy6aZIZ3dVsBANconXY9FRLb956KdVcTWuCR7naMNlcCf+ic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669462520793.9367539601732; Thu, 28 May 2020 05:37:42 -0700 (PDT) Received: from localhost ([::1]:34696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHn2-0003hQ-Sw for importer@patchew.org; Thu, 28 May 2020 08:37:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlo-0001SL-LD for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:25 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:32745 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHln-00058o-OM for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-y3HQRic6Nl69h3rhBn_Ahw-1; Thu, 28 May 2020 08:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 387301005510; Thu, 28 May 2020 12:36:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2743A7A8B4; Thu, 28 May 2020 12:36:13 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7505C9DAF; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669382; 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=NQraKQ1whxiMPOPRulSbwT/9AZGl8U9QqvXdcnOFJ2M=; b=YEcuxlHtp1oi5IVguYKAr5QillPwD189ysFCe+GxMQYL3X+kkORU/Wtbdq4EFL2EDDn7SL 2tU1VOJ7+VLNNhOdlfilhZaf1liWzPCaEuxcXZN9c9XjUBF21mB4U/snwNIFqRinv2QYfq SvJ29O8M0pwxWLNAX5yPKVWa9JNNiWE= X-MC-Unique: y3HQRic6Nl69h3rhBn_Ahw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 03/21] hw/display/cirrus_vga: Convert debug printf() to trace event Date: Thu, 28 May 2020 14:35:51 +0200 Message-Id: <20200528123609.27362-4-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-4-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c | 4 +--- hw/display/trace-events | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 1f29731ffe11..33ccdde00061 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -1512,9 +1512,7 @@ static int cirrus_vga_read_gr(CirrusVGAState * s, uns= igned reg_index) static void cirrus_vga_write_gr(CirrusVGAState * s, unsigned reg_index, int reg_value) { -#if defined(DEBUG_BITBLT) && 0 - printf("gr%02x: %02x\n", reg_index, reg_value); -#endif + trace_vga_cirrus_write_gr(reg_index, reg_value); switch (reg_index) { case 0x00: // Standard VGA, BGCOLOR 0x000000ff s->vga.gr[reg_index] =3D reg_value & gr_mask[reg_index]; diff --git a/hw/display/trace-events b/hw/display/trace-events index 47b2b168ae15..c3043e4ced19 100644 --- a/hw/display/trace-events +++ b/hw/display/trace-events @@ -133,6 +133,7 @@ vga_vbe_write(uint32_t index, uint32_t val) "index 0x%x= , val 0x%x" vga_cirrus_read_io(uint32_t addr, uint32_t val) "addr 0x%x, val 0x%x" vga_cirrus_write_io(uint32_t addr, uint32_t val) "addr 0x%x, val 0x%x" vga_cirrus_write_blt(uint32_t offset, uint32_t val) "offset 0x%x, val 0x%x" +vga_cirrus_write_gr(uint8_t index, uint8_t val) "GR addr 0x%02x, val 0x%02= x" =20 # sii9022.c sii9022_read_reg(uint8_t addr, uint8_t val) "addr 0x%02x, val 0x%02x" --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669457; cv=none; d=zohomail.com; s=zohoarc; b=TjkIXL+lwReN3qBXcrGNqlp7e++8juKaRY27cZcWzAnfXEEZh9IOKBP+8mZ9vmNEKS1ckCt20hCmuYAwRRF/hCAQ3HYdrFNWvbZ2Nk11u2xoL1fxC+cPoh1+aB/vl/9fB0WYhzSe1KHxhVB5Z2yZXK+oTgQcFa8RechH8M33i6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669457; 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=gSO6NhcNMiTStuHwRH+gYIc78ZhIvSobrclrvmNcmdU=; b=bFtn8ocum7GqUUTmijn7SIeytH0IOWxoCRY4tdWeyn0wyGBTUIQ09RxvSR1bxDmXtRbn1CJQKFgNE48CDdGTiT64XyE3P2GJ+LbOVXbHLqFlrhu4/RbE9VJzxmjb45YTDdjKQUu1Y4Thm9BnVE8aZ/bK1rcZDoJeAJidqa5Cr4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669457020918.2333012838799; Thu, 28 May 2020 05:37:37 -0700 (PDT) Received: from localhost ([::1]:34050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHmx-0003RB-4i for importer@patchew.org; Thu, 28 May 2020 08:37:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHln-0001Rd-AJ for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:23 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:35536 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHll-00057t-MA for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:22 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-Go_BTCXYMAC3E1__ZNjC6w-1; Thu, 28 May 2020 08:36:17 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2256E107ACF3; Thu, 28 May 2020 12:36:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46D087E467; Thu, 28 May 2020 12:36:12 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7DDE09DB0; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669380; 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=gSO6NhcNMiTStuHwRH+gYIc78ZhIvSobrclrvmNcmdU=; b=PWQ6H3+9C/vBcGgaIVi0tpUbCYCQUTdzUcbIkgZpRxVcvp2Co3YO99SUJHT9udORRCM3rN MEDq4RS4rv2vx+spdcXO/ORmG6F617Cg6rmnbifBfGT/xaseHVmYIuGIauTa50S5eaEhxi 7Mj5D95M8ShsedUBFXLFv2XWf9E1f20= X-MC-Unique: Go_BTCXYMAC3E1__ZNjC6w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 04/21] hw/display/cirrus_vga: Use qemu_log_mask(UNIMP) instead of debug printf Date: Thu, 28 May 2020 14:35:52 +0200 Message-Id: <20200528123609.27362-5-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Replace some debug printf() calls by qemu_log_mask(LOG_UNIMP), and add a new one in cirrus_linear_bitblt_read(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-5-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 33ccdde00061..f9f837b8508c 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -35,6 +35,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/units.h" +#include "qemu/log.h" #include "sysemu/reset.h" #include "qapi/error.h" #include "trace.h" @@ -905,9 +906,8 @@ static int cirrus_bitblt_cputovideo(CirrusVGAState * s) static int cirrus_bitblt_videotocpu(CirrusVGAState * s) { /* XXX */ -#ifdef DEBUG_BITBLT - printf("cirrus: bitblt (video to cpu) is not implemented yet\n"); -#endif + qemu_log_mask(LOG_UNIMP, + "cirrus: bitblt (video to cpu) is not implemented\n"); return 0; } =20 @@ -989,9 +989,8 @@ static void cirrus_bitblt_start(CirrusVGAState * s) cirrus_blt_mode & (CIRRUS_BLTMODE_MEMSYSSRC | CIRRUS_BLTMODE_MEMSYSDEST)) =3D=3D (CIRRUS_BLTMODE_MEMSYSSRC | CIRRUS_BLTMODE_MEMSYSDEST)) { -#ifdef DEBUG_BITBLT - printf("cirrus: bitblt - memory-to-memory copy is requested\n"); -#endif + qemu_log_mask(LOG_UNIMP, + "cirrus: bitblt - memory-to-memory copy requested\n"= ); goto bitblt_ignore; } =20 @@ -2412,6 +2411,9 @@ static uint64_t cirrus_linear_bitblt_read(void *opaqu= e, =20 /* XXX handle bitblt */ (void)s; + qemu_log_mask(LOG_UNIMP, + "cirrus: linear bitblt is not implemented\n"); + return 0xff; } =20 --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590670303; cv=none; d=zohomail.com; s=zohoarc; b=bf0wc3FtibSafRHHn/49la1QwUYzOqzmgnzAe/60T8fKwOdLBnp3OnXVRWNcuJivaLOx9FfHpuCqlgRXFzFPaipHBuQYtUHnuL9rlsk1N6pzKp2lbrT6O24NTS56IkeP3G7Y2roU2gA1wJYmBzMOxh22Jf+HJIprC7c49p7iTMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590670303; 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=alJWWguzMdAxzeeZpfBMp4t+t9rEX1QSKuKtB7IIv5E=; b=BGpGyvseX8awMacPuCCNVBTzZIw2o3JdGnA3ZvT6iCVir9vr+L1EM108MCurNx4atmbrYZTe3fEzPErlwz79eKpPHvZKfNND87/rTuiQHfxIoZn7Oo/T0Fe77N1Eu5sbXwze+Q+0xYdVufRebrdMw5hixeAykf2rKyJ0xnkMxeo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590670303739332.2177784502736; Thu, 28 May 2020 05:51:43 -0700 (PDT) Received: from localhost ([::1]:41652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeI0c-0004xd-Hy for importer@patchew.org; Thu, 28 May 2020 08:51:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHmB-0002Sr-Jo for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:47 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:40691 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHm7-0005NW-59 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-278-JuWgx9MlNF20MyKJL9fEuA-1; Thu, 28 May 2020 08:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BFD301855A10; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7179A60FC2; Thu, 28 May 2020 12:36:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 871139D54; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669402; 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=alJWWguzMdAxzeeZpfBMp4t+t9rEX1QSKuKtB7IIv5E=; b=MuLaLznVahQ31texZ5QnalElOdTj0/3a71rltmXwcR5hs8nobjojtb0YYPvYNjVRFiWG3a oEZNRKDXry7I0S70yNJYlr5Nn6puh79dZBoyPD6alBHYluybptmxVWKE9ltNgPhU+ZVIOm iYWpZIlabnhEvHU8GM+r/qJgJcObjj4= X-MC-Unique: JuWgx9MlNF20MyKJL9fEuA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 05/21] hw/display/cirrus_vga: Use qemu_log_mask(ERROR) instead of debug printf Date: Thu, 28 May 2020 14:35:53 +0200 Message-Id: <20200528123609.27362-6-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 06:31:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Replace some debug printf() calls by qemu_log_mask(LOG_GUEST_ERROR). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-6-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c | 77 ++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index f9f837b8508c..76e2dc5bb604 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -978,9 +978,8 @@ static void cirrus_bitblt_start(CirrusVGAState * s) s->cirrus_blt_pixelwidth =3D 4; break; default: -#ifdef DEBUG_BITBLT - printf("cirrus: bitblt - pixel width is unknown\n"); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: bitblt - pixel width is unknown\n"); goto bitblt_ignore; } s->cirrus_blt_mode &=3D ~CIRRUS_BLTMODE_PIXELWIDTHMASK; @@ -1037,7 +1036,9 @@ static void cirrus_bitblt_start(CirrusVGAState * s) } else { if (s->cirrus_blt_mode & CIRRUS_BLTMODE_TRANSPARENTCOMP) { if (s->cirrus_blt_pixelwidth > 2) { - printf("src transparent without colorexpand must be 8bpp or 16bpp\n"= ); + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: src transparent without colorexpand " + "must be 8bpp or 16bpp\n"); goto bitblt_ignore; } if (s->cirrus_blt_mode & CIRRUS_BLTMODE_BACKWARDS) { @@ -1135,10 +1136,9 @@ static uint32_t cirrus_get_bpp16_depth(CirrusVGAStat= e * s) ret =3D 16; break; /* XGA HiColor */ default: -#ifdef DEBUG_CIRRUS - printf("cirrus: invalid DAC value %x in 16bpp\n", - (s->cirrus_hidden_dac_data & 0xf)); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: invalid DAC value 0x%x in 16bpp\n", + (s->cirrus_hidden_dac_data & 0xf)); ret =3D 15; /* XXX */ break; } @@ -1307,11 +1307,9 @@ static int cirrus_vga_read_sr(CirrusVGAState * s) #endif return s->vga.sr[s->vga.sr_index]; default: -#ifdef DEBUG_CIRRUS - printf("cirrus: inport sr_index %02x\n", s->vga.sr_index); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: inport sr_index 0x%02x\n", s->vga.sr_index); return 0xff; - break; } } =20 @@ -1400,10 +1398,9 @@ static void cirrus_vga_write_sr(CirrusVGAState * s, = uint32_t val) cirrus_update_memory_access(s); break; default: -#ifdef DEBUG_CIRRUS - printf("cirrus: outport sr_index %02x, sr_value %02x\n", - s->vga.sr_index, val); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: outport sr_index 0x%02x, sr_value 0x%02x\n", + s->vga.sr_index, val); break; } } @@ -1501,9 +1498,8 @@ static int cirrus_vga_read_gr(CirrusVGAState * s, uns= igned reg_index) if (reg_index < 0x3a) { return s->vga.gr[reg_index]; } else { -#ifdef DEBUG_CIRRUS - printf("cirrus: inport gr_index %02x\n", reg_index); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: inport gr_index 0x%02x\n", reg_index); return 0xff; } } @@ -1590,10 +1586,9 @@ cirrus_vga_write_gr(CirrusVGAState * s, unsigned reg= _index, int reg_value) cirrus_write_bitblt(s, reg_value); break; default: -#ifdef DEBUG_CIRRUS - printf("cirrus: outport gr_index %02x, gr_value %02x\n", reg_index, - reg_value); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: outport gr_index 0x%02x, gr_value 0x%02x\n", + reg_index, reg_value); break; } } @@ -1648,9 +1643,8 @@ static int cirrus_vga_read_cr(CirrusVGAState * s, uns= igned reg_index) return s->vga.ar_index & 0x3f; break; default: -#ifdef DEBUG_CIRRUS - printf("cirrus: inport cr_index %02x\n", reg_index); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: inport cr_index 0x%02x\n", reg_index); return 0xff; } } @@ -1721,10 +1715,9 @@ static void cirrus_vga_write_cr(CirrusVGAState * s, = int reg_value) break; case 0x25: // Part Status default: -#ifdef DEBUG_CIRRUS - printf("cirrus: outport cr_index %02x, cr_value %02x\n", - s->vga.cr_index, reg_value); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: outport cr_index 0x%02x, cr_value 0x%02x\n", + s->vga.cr_index, reg_value); break; } } @@ -1834,9 +1827,8 @@ static uint8_t cirrus_mmio_blt_read(CirrusVGAState * = s, unsigned address) value =3D cirrus_vga_read_gr(s, 0x31); break; default: -#ifdef DEBUG_CIRRUS - printf("cirrus: mmio read - address 0x%04x\n", address); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: mmio read - address 0x%04x\n", address); break; } =20 @@ -1946,10 +1938,9 @@ static void cirrus_mmio_blt_write(CirrusVGAState * s= , unsigned address, cirrus_vga_write_gr(s, 0x31, value); break; default: -#ifdef DEBUG_CIRRUS - printf("cirrus: mmio write - addr 0x%04x val 0x%02x (ignored)\n", - address, value); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: mmio write - addr 0x%04x val 0x%02x (ignore= d)\n", + address, value); break; } } @@ -2047,9 +2038,8 @@ static uint64_t cirrus_vga_mem_read(void *opaque, } } else { val =3D 0xff; -#ifdef DEBUG_CIRRUS - printf("cirrus: mem_readb " TARGET_FMT_plx "\n", addr); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: mem_readb 0x" TARGET_FMT_plx "\n", addr); } return val; } @@ -2112,10 +2102,9 @@ static void cirrus_vga_mem_write(void *opaque, cirrus_mmio_blt_write(s, addr & 0xff, mem_value); } } else { -#ifdef DEBUG_CIRRUS - printf("cirrus: mem_writeb " TARGET_FMT_plx " value 0x%02" PRIu64 = "\n", addr, - mem_value); -#endif + qemu_log_mask(LOG_GUEST_ERROR, + "cirrus: mem_writeb 0x" TARGET_FMT_plx " " + "value 0x%02" PRIu64 "\n", addr, mem_value); } } =20 --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590670171; cv=none; d=zohomail.com; s=zohoarc; b=FbvtBILnDIws6kYx2KyQpA9uwDiKxHdHXIqKgtGte+yFrs1+u24MNxIwWv/fQx9ZDITMS16X7WH6zLc0QIpPFXUUcuwd3O/PqlPYvCsmPnSPAOlty+H+CxgVPQuDVMLreDTG84k7bRPFv28nHcNLt17pUVg0zoGK5r0oxwA5Tps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590670171; 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=H/6seJUaK2U1QNuJEnB6P9QD85AsJH8sJzJwLeDEzLE=; b=iTduAve8pkR3DAlORHiKEPj21YSyvr8UleLowiR5M7sfzo/B9kpA81AYbNlL4rXnVc4NlvLIwFo2mEwQNVMUZIyHfVdDYtu3Xr2LQNWu/EbRsaQ6oNQIaFNk4bgQj0GUZXiH34l8tPtLtmZZZ+6Q20j2m2ETiWFuBQjFzK8cfQU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159067017164510.582163925249688; Thu, 28 May 2020 05:49:31 -0700 (PDT) Received: from localhost ([::1]:36258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHyU-0002qz-FD for importer@patchew.org; Thu, 28 May 2020 08:49:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlz-0001tf-GQ for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:35 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:40049 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHls-0005E0-BT for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-OlkcRaAEMI-HYdXL3Mt_tg-1; Thu, 28 May 2020 08:36:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E79E8018A7; Thu, 28 May 2020 12:36:21 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 846915C1D6; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9155C9D55; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669387; 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=H/6seJUaK2U1QNuJEnB6P9QD85AsJH8sJzJwLeDEzLE=; b=POKOjD1elzK1+9E2TrR45qg4hQ5tmLW1qPdjq/iMDRsVlyEWpxJ5FG/YSySRKfGDVYBCxP zDQKypCNg5zcfDDmLvpY1N9RtFQuu1lTmtDafdATUqxHODVLlJxcv/FAxc6r/fOal7JZVC W7+Q/NGu60Snvxudxy8BVfexP5BzLdc= X-MC-Unique: OlkcRaAEMI-HYdXL3Mt_tg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 06/21] hw/display/cirrus_vga: Convert debug printf() to trace event Date: Thu, 28 May 2020 14:35:54 +0200 Message-Id: <20200528123609.27362-7-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Convert the final bit of DEBUG_BITBLT to a tracepoint. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-7-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c | 24 ++++++++++-------------- hw/display/trace-events | 1 + 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 76e2dc5bb604..92c197cdde1d 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -53,7 +53,6 @@ */ =20 //#define DEBUG_CIRRUS -//#define DEBUG_BITBLT =20 /*************************************** * @@ -950,19 +949,16 @@ static void cirrus_bitblt_start(CirrusVGAState * s) s->cirrus_blt_dstaddr &=3D s->cirrus_addr_mask; s->cirrus_blt_srcaddr &=3D s->cirrus_addr_mask; =20 -#ifdef DEBUG_BITBLT - printf("rop=3D0x%02x mode=3D0x%02x modeext=3D0x%02x w=3D%d h=3D%d dpit= ch=3D%d spitch=3D%d daddr=3D0x%08x saddr=3D0x%08x writemask=3D0x%02x\n", - blt_rop, - s->cirrus_blt_mode, - s->cirrus_blt_modeext, - s->cirrus_blt_width, - s->cirrus_blt_height, - s->cirrus_blt_dstpitch, - s->cirrus_blt_srcpitch, - s->cirrus_blt_dstaddr, - s->cirrus_blt_srcaddr, - s->vga.gr[0x2f]); -#endif + trace_vga_cirrus_bitblt_start(blt_rop, + s->cirrus_blt_mode, + s->cirrus_blt_modeext, + s->cirrus_blt_width, + s->cirrus_blt_height, + s->cirrus_blt_dstpitch, + s->cirrus_blt_srcpitch, + s->cirrus_blt_dstaddr, + s->cirrus_blt_srcaddr, + s->vga.gr[0x2f]); =20 switch (s->cirrus_blt_mode & CIRRUS_BLTMODE_PIXELWIDTHMASK) { case CIRRUS_BLTMODE_PIXELWIDTH8: diff --git a/hw/display/trace-events b/hw/display/trace-events index c3043e4ced19..bb089a5f5e0c 100644 --- a/hw/display/trace-events +++ b/hw/display/trace-events @@ -134,6 +134,7 @@ vga_cirrus_read_io(uint32_t addr, uint32_t val) "addr 0= x%x, val 0x%x" vga_cirrus_write_io(uint32_t addr, uint32_t val) "addr 0x%x, val 0x%x" vga_cirrus_write_blt(uint32_t offset, uint32_t val) "offset 0x%x, val 0x%x" vga_cirrus_write_gr(uint8_t index, uint8_t val) "GR addr 0x%02x, val 0x%02= x" +vga_cirrus_bitblt_start(uint8_t blt_rop, uint8_t blt_mode, uint8_t blt_mod= eext, int blt_width, int blt_height, int blt_dstpitch, int blt_srcpitch, ui= nt32_t blt_dstaddr, uint32_t blt_srcaddr, uint8_t gr_val) "rop=3D0x%02x mod= e=3D0x%02x modeext=3D0x%02x w=3D%d h=3D%d dpitch=3D%d spitch=3D%d daddr=3D0= x%08"PRIx32" saddr=3D0x%08"PRIx32" writemask=3D0x%02x" =20 # sii9022.c sii9022_read_reg(uint8_t addr, uint8_t val) "addr 0x%02x, val 0x%02x" --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669727; cv=none; d=zohomail.com; s=zohoarc; b=eI9vPKyihzXnYMpTT4D5p7UAdP2hQjUhSHws29WoPjZMlPHl9KJF1I1hMHKsicZsbTUdtcFxHDy/R1aGM8OnTBbxF/SPZgu9wqpqxHVA1ze5nIRMavKVt55yHiRsDFcdpw1MG/3egCjXoaGvuj0vE5HUQG0KdlQKzOYgpwDM42U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669727; 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=GjBeLOnSl8+/Wo0uSP7u1jiRlC54KdrOxT12kH38g0Y=; b=bndrBnTSlwRxwjMZts5KzT3QH4dqTzcpkeY8DEIDMcUarHwOeaVTTLsTUUjKDHaHV0/8LQXiOx0mRTKnfiVIXOmIv6AjwhDPf2VhdJKH502r/cTLmLNS27o2YPtRBXkLtwlr3d2niXXHbN5HYq3EtfE7AKtlvB0ijWGAtu9zMT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669727953759.9134632817735; Thu, 28 May 2020 05:42:07 -0700 (PDT) Received: from localhost ([::1]:57404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHrK-0004lf-P1 for importer@patchew.org; Thu, 28 May 2020 08:42:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHm0-0001wt-Lt for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:36 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39460 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlu-0005GZ-G6 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-XC2NpcD-O3aSs0bKivgeuQ-1; Thu, 28 May 2020 08:36:25 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2F5C835B41; Thu, 28 May 2020 12:36:23 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A939768D8; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9A67C9D56; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669389; 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=GjBeLOnSl8+/Wo0uSP7u1jiRlC54KdrOxT12kH38g0Y=; b=OCTb4qgkQAq+cLGjPfjMyVUhJ//lY/g0L+DPBAeqx8FDkcRxJFM6ypw0Y4DIH3b1N5ZABb EqVWWx2hByaVa9Sqdn04MNywwSJBnFm7RACjAy32W6hwYnNEhoSACVr0KO2GZnodA2lSvS XorcZKT7lWzl+/JNU56wWQRl0r2fnI0= X-MC-Unique: XC2NpcD-O3aSs0bKivgeuQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 07/21] hw/display/dpcd: Fix memory region size Date: Thu, 28 May 2020 14:35:55 +0200 Message-Id: <20200528123609.27362-8-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 The memory region size is 512K. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-8-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/dpcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/dpcd.c b/hw/display/dpcd.c index 170545c605ee..0c1b7b35fbb4 100644 --- a/hw/display/dpcd.c +++ b/hw/display/dpcd.c @@ -1,5 +1,5 @@ /* - * dpcd.c + * Xilinx Display Port Control Data * * Copyright (C) 2015 : GreenSocs Ltd * http://www.greensocs.com/ , email: info@greensocs.com @@ -137,7 +137,7 @@ static void dpcd_init(Object *obj) { DPCDState *s =3D DPCD(obj); =20 - memory_region_init_io(&s->iomem, obj, &aux_ops, s, TYPE_DPCD, 0x7FFFF); + memory_region_init_io(&s->iomem, obj, &aux_ops, s, TYPE_DPCD, 0x80000); aux_init_mmio(AUX_SLAVE(obj), &s->iomem); } =20 --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669507; cv=none; d=zohomail.com; s=zohoarc; b=ORSkpDPZ0dH2yPmcvLU6g/xXtTkoDfXIfYqf5WHTM1oPkAmGeLFiyma+58pD5cJWF+qaTarr3cBXxy7SFXGakPnGemeA5WuhYcsjjjT01k0v2MtJE1OsotjalVlHIDy8pOCUorAo/IFRPXTuWSbAu90SYvZJBW9TZgQqTajB9sc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669507; 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=+afJjiLO1e/ioNxL9yvN1UMqnBe577QM6XrVyi3y+YM=; b=Vwmo5TT3bK4+ZfA7W399rqkqfLrRMytCxxhKIxm6/yF+inUZV4BH/E1T4eN48dU0ctoLMaqbWNCScbEZnvC6dj/AslbtA50NZlWCTxsHygo9F0sN0e5loVE+1rEt3HyVA3SolGiDqJruX12dTKskL1ELiLU5Ll4g9akbVbfS2+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669507592907.0598647811836; Thu, 28 May 2020 05:38:27 -0700 (PDT) Received: from localhost ([::1]:38212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHnm-00054f-BW for importer@patchew.org; Thu, 28 May 2020 08:38:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlq-0001Uv-RR for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:26 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:45129 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlp-00059v-CL for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:26 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-432-CyMFlhC2MRWfaQ5r7Euz5g-1; Thu, 28 May 2020 08:36:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D2274474; Thu, 28 May 2020 12:36:17 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76D147E467; Thu, 28 May 2020 12:36:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A502A9D57; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669384; 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=+afJjiLO1e/ioNxL9yvN1UMqnBe577QM6XrVyi3y+YM=; b=Mf+tKORfhqdFEv7b8UCiCiJwKKSLlKzXXcxRJlxTvUtmwnZ53AEynaok97GGuL3L8M2nrY Eh32JWJmMcGymK+C74UAigQNy6WnWUo8EhowhjaS96OwDsdRrRAkwpHPlsZ5dUjIXzCVZ/ Gu69gI/USyCqwOlX/47ahZz+mZugC0A= X-MC-Unique: CyMFlhC2MRWfaQ5r7Euz5g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 08/21] hw/display/dpcd: Convert debug printf()s to trace events Date: Thu, 28 May 2020 14:35:56 +0200 Message-Id: <20200528123609.27362-9-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 06:31:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Convert DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-9-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/dpcd.c | 16 +++------------- hw/display/trace-events | 4 ++++ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/hw/display/dpcd.c b/hw/display/dpcd.c index 0c1b7b35fbb4..64463654a1a0 100644 --- a/hw/display/dpcd.c +++ b/hw/display/dpcd.c @@ -32,16 +32,7 @@ #include "hw/misc/auxbus.h" #include "migration/vmstate.h" #include "hw/display/dpcd.h" - -#ifndef DEBUG_DPCD -#define DEBUG_DPCD 0 -#endif - -#define DPRINTF(fmt, ...) do { = \ - if (DEBUG_DPCD) { = \ - qemu_log("dpcd: " fmt, ## __VA_ARGS__); = \ - } = \ -} while (0) +#include "trace.h" =20 #define DPCD_READABLE_AREA 0x600 =20 @@ -70,8 +61,8 @@ static uint64_t dpcd_read(void *opaque, hwaddr offset, un= signed size) offset); ret =3D 0; } + trace_dpcd_read(offset, ret); =20 - DPRINTF("read 0x%" PRIX8 " @0x%" HWADDR_PRIX "\n", ret, offset); return ret; } =20 @@ -80,8 +71,7 @@ static void dpcd_write(void *opaque, hwaddr offset, uint6= 4_t value, { DPCDState *e =3D DPCD(opaque); =20 - DPRINTF("write 0x%" PRIX8 " @0x%" HWADDR_PRIX "\n", (uint8_t)value, of= fset); - + trace_dpcd_write(offset, value); if (offset < DPCD_READABLE_AREA) { e->dpcd_info[offset] =3D value; } else { diff --git a/hw/display/trace-events b/hw/display/trace-events index bb089a5f5e0c..72d4c9812c69 100644 --- a/hw/display/trace-events +++ b/hw/display/trace-events @@ -157,3 +157,7 @@ artist_draw_line(unsigned int start_x, unsigned int sta= rt_y, unsigned int end_x, # cg3.c cg3_read(uint32_t addr, uint32_t val, unsigned size) "read addr:0x%06"PRIx= 32" val:0x%08"PRIx32" size:%u" cg3_write(uint32_t addr, uint32_t val, unsigned size) "write addr:0x%06"PR= Ix32" val:0x%08"PRIx32" size:%u" + +# dpcd.c +dpcd_read(uint32_t addr, uint8_t val) "read addr:0x%"PRIx32" val:0x%02x" +dpcd_write(uint32_t addr, uint8_t val) "write addr:0x%"PRIx32" val:0x%02x" --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590670229; cv=none; d=zohomail.com; s=zohoarc; b=IBWkgc7+R5mTOPoAVelZFq4NDPi3o6DVEuodT/l/0yH1MNqdTlJUGCY7x0uiAdsn8udMWIhIz0bzncayASEkqUx9gD2/KCRzThm4/gAdLCDQsYcLCRIpGFIWUyYfMk1p6wPBbuL5kPT4CxkitMg7NotpX0DIKCgFwDY2NzOz+fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590670229; 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=vhaGpItVAJY0Kh28EoW+iZj4wIKFYfoIVL8Ul9ZNK3k=; b=gN9nar08kilwNuuLeIEj1wt++Tv8dfA7eL9S4RIKEucSuOSPy9qVIBhRGRoNAg8DtwI98ENSIXmj0OFmDw3qD83VqQxFaHSbA0EFu2/uGbQVlgcn3EfhZAVmocAqgysKi+UMj3MGagYpYpa9QWADhp0PePl4ee64oRH+G2IG1rU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590670229201582.5657888530833; Thu, 28 May 2020 05:50:29 -0700 (PDT) Received: from localhost ([::1]:38992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHzP-0003rO-0O for importer@patchew.org; Thu, 28 May 2020 08:50:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHm0-0001w7-Ee for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:36 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:32554 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlt-0005Fd-Ex for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-613lVL-COoqGZLJCqhXdvQ-1; Thu, 28 May 2020 08:36:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D7DC8015CF; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3242A102D; Thu, 28 May 2020 12:36:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AE16D9D58; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669388; 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=vhaGpItVAJY0Kh28EoW+iZj4wIKFYfoIVL8Ul9ZNK3k=; b=hkkgMXlbdb0Oepm/iBUriTasZTFEI2ZdEAQG8t8l5O9NJLoB+GPaCg9YvpFAaU5+KY5pTG FkbIBaoCFLSfbz7NeI07SaKibkoBMRZO8vApL8YTaRyKXDzUmnWuaA0kGj0p8p6VewqAK1 po8e/eHDmQ2sFof7fiV22b3pHwCel3o= X-MC-Unique: 613lVL-COoqGZLJCqhXdvQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 09/21] hw/display/xlnx_dp: Replace disabled DPRINTF() by error_report() Date: Thu, 28 May 2020 14:35:57 +0200 Message-Id: <20200528123609.27362-10-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 DPRINTF() calls are disabled by default, so when unexpected data is used, the whole process abort without information. Display a bit of information with error_report() before crashing. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-10-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/xlnx_dp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 3e5fb44e06ee..8d940cd8d1a5 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1,5 +1,5 @@ /* - * xlnx_dp.c + * Xilinx Display Port * * Copyright (C) 2015 : GreenSocs Ltd * http://www.greensocs.com/ , email: info@greensocs.com @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/error-report.h" #include "qemu/log.h" #include "qemu/module.h" #include "hw/display/xlnx_dp.h" @@ -465,7 +466,7 @@ static uint8_t xlnx_dp_aux_pop_tx_fifo(XlnxDPState *s) uint8_t ret; =20 if (fifo8_is_empty(&s->tx_fifo)) { - DPRINTF("tx_fifo underflow..\n"); + error_report("%s: TX_FIFO underflow", __func__); abort(); } ret =3D fifo8_pop(&s->tx_fifo); @@ -525,6 +526,7 @@ static void xlnx_dp_aux_set_command(XlnxDPState *s, uin= t32_t value) qemu_log_mask(LOG_UNIMP, "xlnx_dp: Write i2c status not implemente= d\n"); break; default: + error_report("%s: invalid command: %u", __func__, cmd); abort(); } =20 @@ -631,8 +633,8 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s) s->g_plane.format =3D PIXMAN_b8g8r8; break; default: - DPRINTF("error: unsupported graphic format %u.\n", - s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK); + error_report("%s: unsupported graphic format %u", __func__, + s->avbufm_registers[AV_BUF_FORMAT] & DP_GRAPHIC_MASK); abort(); } =20 @@ -647,8 +649,8 @@ static void xlnx_dp_change_graphic_fmt(XlnxDPState *s) s->v_plane.format =3D PIXMAN_x8b8g8r8; break; default: - DPRINTF("error: unsupported video format %u.\n", - s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MASK); + error_report("%s: unsupported video format %u", __func__, + s->avbufm_registers[AV_BUF_FORMAT] & DP_NL_VID_FMT_MA= SK); abort(); } =20 --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590670108; cv=none; d=zohomail.com; s=zohoarc; b=N3U/9io++b2vtvYoZaIrLcetE0e6skEOnP0ubPaiKWqFVqSa/mI4sFq75ChViEfL6kGJbam2ghBATPfb/Y/4+HT7H1kHgfh9wNuJRiDjcwRDNBNCwxCWbhNzNJFKawFEZFHaougFxQdR0FlLZNS0CF67yafZ1w0GwNgEIYzeyao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590670108; 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=FTTWm2Ie3ZetkYcgR/YsLvRvE6iLrx2iZOgaTJeYsuo=; b=jpAyBG1Oj1N26zDk7xGD8jxvoMHYTKgvLq6U77uQ/VbRGf8ZG2FuasHdLyN4+KtqBlmcr2bqKgX2+bleDzyr80XWmW85qWqPef9iysxrD5wNjS1N2KNDaLqiUNvMwpE9nBZeHuhdU6KLNIhPjUv5HhQuE9EJBpOaANRoDqOGlg4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590670108888457.13331970225465; Thu, 28 May 2020 05:48:28 -0700 (PDT) Received: from localhost ([::1]:60658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHxS-0001Wv-3a for importer@patchew.org; Thu, 28 May 2020 08:48:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHly-0001pm-7b for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:34 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:50234 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlr-0005Cu-P9 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:33 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-WqQZlz30MHmC6OHdIHC5jw-1; Thu, 28 May 2020 08:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65DD3835B40; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBBFA610AB; Thu, 28 May 2020 12:36:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B6F089D59; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669386; 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=FTTWm2Ie3ZetkYcgR/YsLvRvE6iLrx2iZOgaTJeYsuo=; b=YEtR0YeeCHy33ZC7cz110CQGB4nG/VlQUNm0X4W5s+tW/+jUrZTzyGeHovQKOt5ABC0u7k vYADVK9KthLmEOQxY21ciGFbubwVSGiSbt7jtj9NtSZ3AdifEOrd1mimyiv9NenXw+ILXO YmdfRIo4XfVdEg43EZGdIwkl9+srBQE= X-MC-Unique: WqQZlz30MHmC6OHdIHC5jw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 10/21] hw/display/vmware_vga: Replace printf() calls by qemu_log_mask(ERROR) Date: Thu, 28 May 2020 14:35:58 +0200 Message-Id: <20200528123609.27362-11-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Avoid flooding stdio by converting printf() calls to qemu_log_mask(GUEST_ERROR), which are disabled by default. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-11-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/vmware_vga.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 58ea82e3e581..5c0fc49d9d6e 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -26,6 +26,7 @@ #include "qemu/module.h" #include "qemu/units.h" #include "qapi/error.h" +#include "qemu/log.h" #include "hw/loader.h" #include "trace.h" #include "ui/vnc.h" @@ -953,7 +954,8 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_= t address) ret =3D s->scratch[s->index - SVGA_SCRATCH_BASE]; break; } - printf("%s: Bad register %02x\n", __func__, s->index); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad register %02x\n", __func__, s->index); ret =3D 0; break; } @@ -1002,7 +1004,8 @@ static void vmsvga_value_write(void *opaque, uint32_t= address, uint32_t value) s->new_width =3D value; s->invalidated =3D 1; } else { - printf("%s: Bad width: %i\n", __func__, value); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad width: %i\n", __func__, value); } break; =20 @@ -1011,13 +1014,15 @@ static void vmsvga_value_write(void *opaque, uint32= _t address, uint32_t value) s->new_height =3D value; s->invalidated =3D 1; } else { - printf("%s: Bad height: %i\n", __func__, value); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad height: %i\n", __func__, value); } break; =20 case SVGA_REG_BITS_PER_PIXEL: if (value !=3D 32) { - printf("%s: Bad bits per pixel: %i bits\n", __func__, value); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad bits per pixel: %i bits\n", __func__, v= alue); s->config =3D 0; s->invalidated =3D 1; } @@ -1082,7 +1087,8 @@ static void vmsvga_value_write(void *opaque, uint32_t= address, uint32_t value) s->scratch[s->index - SVGA_SCRATCH_BASE] =3D value; break; } - printf("%s: Bad register %02x\n", __func__, s->index); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad register %02x\n", __func__, s->index); } } =20 --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669846; cv=none; d=zohomail.com; s=zohoarc; b=S48ZPmojz00XbBau4Wpx3ZILgLOysIiPipLwu53VtyM6mttagfltOEZuKPUrYVru6nHV+sY0qioikEiGD41dmFy9Jq/5BBnnwf1jiwNNial57t+YWyLJpN2dGFDPKng4ILKOY9CSiPXyEv6RjhVFuthU/jMoLc4EWZBr3m/tERA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669846; 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=8zuMngQZU8wsMJJzzn87mFKfgSzNEuoYrJxuRpPwZpE=; b=TbVRy/Hlxu4oLcnxnXU7tzUgBTG9q88XYDmnRLN0sGH6nWILBnwgVLtGnafwIg4+kJ371lqbXly9L4NO2Q/CazrPle6BJO7osezkcUhde9PakZB3LX7Cd09g7g0ckcMMYgTtR3shUml4xKGiBRpS2fFNXL8idVqFw0MytBQGesQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669846307520.9860623588345; Thu, 28 May 2020 05:44:06 -0700 (PDT) Received: from localhost ([::1]:39614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHtF-0000qx-0W for importer@patchew.org; Thu, 28 May 2020 08:44:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlu-0001ev-Cl for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:30 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32278 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlq-0005BU-57 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:29 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-itd3Z1xaPyCXT-Sct2-5iw-1; Thu, 28 May 2020 08:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28B9D461; Thu, 28 May 2020 12:36:21 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0467F2657D; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BFAA79D5A; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669385; 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=8zuMngQZU8wsMJJzzn87mFKfgSzNEuoYrJxuRpPwZpE=; b=anW+UX7S8As6WzXrOCAwv1XsCYarfucORu99jGu8tN8+SQcYvwv7OsoyoojMRIG6Fitwx2 f5/D1hF7kaRb7BgOJ18yz64XSu1oPko+f3WRqqvHUgJJo978onvSPRzcIW5SHH87xwrUJt 0WmuXBB3oAXM3Ls5kZbRs6nTCnE2ymc= X-MC-Unique: itd3Z1xaPyCXT-Sct2-5iw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 11/21] hw/display/vmware_vga: Let the PCI device own its I/O MemoryRegion Date: Thu, 28 May 2020 14:35:59 +0200 Message-Id: <20200528123609.27362-12-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 To avoid the orphan I/O memory region being added in the /unattached QOM container, register the PCI device as its owner. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20200526062252.19852-12-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 5c0fc49d9d6e..2579f6b218dc 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -1306,7 +1306,7 @@ static void pci_vmsvga_realize(PCIDevice *dev, Error = **errp) dev->config[PCI_LATENCY_TIMER] =3D 0x40; dev->config[PCI_INTERRUPT_LINE] =3D 0xff; /* End */ =20 - memory_region_init_io(&s->io_bar, NULL, &vmsvga_io_ops, &s->chip, + memory_region_init_io(&s->io_bar, OBJECT(dev), &vmsvga_io_ops, &s->chi= p, "vmsvga-io", 0x10); memory_region_set_flush_coalesced(&s->io_bar); pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar); --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669965; cv=none; d=zohomail.com; s=zohoarc; b=nt/UXGwCKjWLK+TBccS/RfXzlf83jTGQE8ULl9iQfm6+YQS4L9dnc0r2GhQ0FrdWk0BPFTyNMIEzOcM5PSYelZXLLkwRwen2vU/wuskwx8bnYcLJeZb/QeIOJqhY93utFd0GOST5jwxGh5FnXfO4mMLU7YuLRxnhUAa2CebwdAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669965; 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=PDmNAE+nCUZciCuaalhJy9w5nGh4jWEWyIn0MRb0hzc=; b=FtkPR9sp/k1AbCF81jbtFHRofKkXKJezLV/KaaChoAZC+e2Gn0KY03IT4lKZ+0DMKMwA4cOW6ZuvVPHw/boBZ5llIygFMx7QgxrBQ3HDT+cw+nH81Fh781D/UqpkDruY5pYW9tH3GWg19qN+vLINZCpABKzHic6H2rjShJ5vyh0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669965259177.84906015780348; Thu, 28 May 2020 05:46:05 -0700 (PDT) Received: from localhost ([::1]:49820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHv9-00055K-VG for importer@patchew.org; Thu, 28 May 2020 08:46:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlw-0001lw-On for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:32 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:41877 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlr-0005C2-G6 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:32 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-p5wut37PNO2EML3fnXlRpg-1; Thu, 28 May 2020 08:36:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9EE33107B7C3; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 094AD7A8A6; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C8B519D5B; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669385; 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=PDmNAE+nCUZciCuaalhJy9w5nGh4jWEWyIn0MRb0hzc=; b=Mayjm75l3EzptvQrnNiH7o3z76VKaF7BtN0A4TgCTcFkQH9A6YxPrWKHiOH4M3KquV9F8+ Db2fwIUnpXyorxAMUqrB4dfMSGfnPApnlKh4LK9G5Qtz7yonQBk/+h1h3KTDK74Kta5A2r oQsvcpyQ1z0zJcmJinNN7rtgWMspf8g= X-MC-Unique: p5wut37PNO2EML3fnXlRpg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 12/21] hw/display/exynos4210_fimd: Use qemu_log_mask(GUEST_ERROR) Date: Thu, 28 May 2020 14:36:00 +0200 Message-Id: <20200528123609.27362-13-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Replace DPRINT_ERROR() by qemu_log_mask(GUEST_ERROR). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-13-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/exynos4210_fimd.c | 46 +++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 1c0266ce9f2d..4b7286b7c948 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -31,6 +31,7 @@ #include "ui/pixel_ops.h" #include "qemu/bswap.h" #include "qemu/module.h" +#include "qemu/log.h" =20 /* Debug messages configuration */ #define EXYNOS4210_FIMD_DEBUG 0 @@ -39,20 +40,15 @@ #if EXYNOS4210_FIMD_DEBUG =3D=3D 0 #define DPRINT_L1(fmt, args...) do { } while (0) #define DPRINT_L2(fmt, args...) do { } while (0) - #define DPRINT_ERROR(fmt, args...) do { } while (0) #elif EXYNOS4210_FIMD_DEBUG =3D=3D 1 #define DPRINT_L1(fmt, args...) \ do {fprintf(stderr, "QEMU FIMD: "fmt, ## args); } while (0) #define DPRINT_L2(fmt, args...) do { } while (0) - #define DPRINT_ERROR(fmt, args...) \ - do {fprintf(stderr, "QEMU FIMD ERROR: "fmt, ## args); } while (0) #else #define DPRINT_L1(fmt, args...) \ do {fprintf(stderr, "QEMU FIMD: "fmt, ## args); } while (0) #define DPRINT_L2(fmt, args...) \ do {fprintf(stderr, "QEMU FIMD: "fmt, ## args); } while (0) - #define DPRINT_ERROR(fmt, args...) \ - do {fprintf(stderr, "QEMU FIMD ERROR: "fmt, ## args); } while (0) #endif =20 #if EXYNOS4210_FIMD_MODE_TRACE =3D=3D 0 @@ -1108,7 +1104,7 @@ static inline int fimd_get_buffer_id(Exynos4210fimdWi= ndow *w) case FIMD_WINCON_BUF2_STAT: return 2; default: - DPRINT_ERROR("Non-existent buffer index\n"); + qemu_log_mask(LOG_GUEST_ERROR, "FIMD: Non-existent buffer index\n"= ); return 0; } } @@ -1160,20 +1156,24 @@ static void fimd_update_memory_section(Exynos4210fi= mdState *s, unsigned win) =20 if (int128_get64(w->mem_section.size) !=3D w->fb_len || !memory_region_is_ram(w->mem_section.mr)) { - DPRINT_ERROR("Failed to find window %u framebuffer region\n", win); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: Failed to find window %u framebuffer region\n= ", + win); goto error_return; } =20 w->host_fb_addr =3D cpu_physical_memory_map(fb_start_addr, &fb_mapped_= len, false); if (!w->host_fb_addr) { - DPRINT_ERROR("Failed to map window %u framebuffer\n", win); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: Failed to map window %u framebuffer\n", win); goto error_return; } =20 if (fb_mapped_len !=3D w->fb_len) { - DPRINT_ERROR("Window %u mapped framebuffer length is less then " - "expected\n", win); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: Window %u mapped framebuffer length is less t= han " + "expected\n", win); cpu_physical_memory_unmap(w->host_fb_addr, fb_mapped_len, 0, 0); goto error_return; } @@ -1490,7 +1490,9 @@ static void exynos4210_fimd_write(void *opaque, hwadd= r offset, break; case 3: if (w !=3D 1 && w !=3D 2) { - DPRINT_ERROR("Bad write offset 0x%08x\n", offset); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: Bad write offset 0x%08"HWADDR_PRIx"\n= ", + offset); return; } s->window[w].osdsize =3D val; @@ -1624,7 +1626,9 @@ static void exynos4210_fimd_write(void *opaque, hwadd= r offset, break; case FIMD_VIDW0ADD0_B2 ... FIMD_VIDW4ADD0_B2: if (offset & 0x0004) { - DPRINT_ERROR("bad write offset 0x%08x\n", offset); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: bad write offset 0x%08"HWADDR_PRIx"\n", + offset); break; } w =3D (offset - FIMD_VIDW0ADD0_B2) >> 3; @@ -1638,14 +1642,18 @@ static void exynos4210_fimd_write(void *opaque, hwa= ddr offset, break; case FIMD_SHD_ADD0_START ... FIMD_SHD_ADD0_END: if (offset & 0x0004) { - DPRINT_ERROR("bad write offset 0x%08x\n", offset); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: bad write offset 0x%08"HWADDR_PRIx"\n", + offset); break; } s->window[(offset - FIMD_SHD_ADD0_START) >> 3].shadow_buf_start = =3D val; break; case FIMD_SHD_ADD1_START ... FIMD_SHD_ADD1_END: if (offset & 0x0004) { - DPRINT_ERROR("bad write offset 0x%08x\n", offset); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: bad write offset 0x%08"HWADDR_PRIx"\n", + offset); break; } s->window[(offset - FIMD_SHD_ADD1_START) >> 3].shadow_buf_end =3D = val; @@ -1665,7 +1673,8 @@ static void exynos4210_fimd_write(void *opaque, hwadd= r offset, s->window[w].palette[i] =3D val; break; default: - DPRINT_ERROR("bad write offset 0x%08x\n", offset); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: bad write offset 0x%08"HWADDR_PRIx"\n", offse= t); break; } } @@ -1715,7 +1724,9 @@ static uint64_t exynos4210_fimd_read(void *opaque, hw= addr offset, break; case 3: if (w !=3D 1 && w !=3D 2) { - DPRINT_ERROR("bad read offset 0x%08x\n", offset); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: bad read offset 0x%08"HWADDR_PRIx"\n", + offset); return 0xBAADBAAD; } ret =3D s->window[w].osdsize; @@ -1809,7 +1820,8 @@ static uint64_t exynos4210_fimd_read(void *opaque, hw= addr offset, return s->window[w].palette[i]; } =20 - DPRINT_ERROR("bad read offset 0x%08x\n", offset); + qemu_log_mask(LOG_GUEST_ERROR, + "FIMD: bad read offset 0x%08"HWADDR_PRIx"\n", offset); return 0xBAADBAAD; } =20 --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669568; cv=none; d=zohomail.com; s=zohoarc; b=bk7aiIweorXCzqbCtqtoQT1+H9IRXibaOWOK9UGKsCHYJzFlyz+1Znio7oRlsDgyABlzXN0T0BRprFqHIkWc4+aZc0PQzkfLeVnU9ZBbwm7V1B1fPBylNS9Y6Zouspb1PpZfLm0TFuVtLq2MrukRncEFEvqHno6qLEHfia+g18I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669568; 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=SmcnOXujQdxKBlY0ohrOanJahBeVviXSktXX+AxdziI=; b=GRcoPTS98KD9ojvQaI0K4ouOUmG9nn2LVCc4hzsaXOsIXvdEihCh/vK+IC1u0Gzf6dsxz91G4oHpwSYlKi1DcqQkC8C9Zqv+CzziRlZcLtePms/vbc/GD/i/cdVxn1tfpNkdvseTmDj42S9kcTtE/7ClkbUjANpOyNdW8+LZDas= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669568512831.4929083921002; Thu, 28 May 2020 05:39:28 -0700 (PDT) Received: from localhost ([::1]:43718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHol-00076W-7d for importer@patchew.org; Thu, 28 May 2020 08:39:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlo-0001SM-UU for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:25 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24526 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHln-000598-OK for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-pSVE4-8gPFa9fZPlJ6mYDQ-1; Thu, 28 May 2020 08:36:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ADC69107ACCA; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 629CB7E467; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D15D59D60; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669382; 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=SmcnOXujQdxKBlY0ohrOanJahBeVviXSktXX+AxdziI=; b=Cg/kh/7TrGEpe+1SvvBgrcc726pwdqvtT2mfCN4whzOVVM3nejAtsf8edD73erTmr4XqP+ EnaL18gbh59bX81vLGd7P4dDI95h+mNUVx9SugXqNKCLZWvJRxgic0CgrVFPxTG5fkORHQ Oa5/ODS/xu2g3mNz+cbwjO6fpOrE/A4= X-MC-Unique: pSVE4-8gPFa9fZPlJ6mYDQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 13/21] hw/display/omap_dss: Replace fprintf() call by qemu_log_mask(LOG_UNIMP) Date: Thu, 28 May 2020 14:36:01 +0200 Message-Id: <20200528123609.27362-14-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Replace fprintf() call by qemu_log_mask(LOG_UNIMP), which is disabled by default. This avoid flooding the terminal when fuzzing the device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-14-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/omap_dss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c index 32dc0d6aa716..21fde58a2602 100644 --- a/hw/display/omap_dss.c +++ b/hw/display/omap_dss.c @@ -619,7 +619,7 @@ static void omap_rfbi_transfer_start(struct omap_dss_s = *s) if (s->rfbi.control & (1 << 1)) { /* BYPASS */ /* TODO: in non-Bypass mode we probably need to just assert the * DRQ and wait for DMA to write the pixels. */ - fprintf(stderr, "%s: Bypass mode unimplemented\n", __func__); + qemu_log_mask(LOG_UNIMP, "%s: Bypass mode unimplemented\n", __func= __); return; } =20 --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669818; cv=none; d=zohomail.com; s=zohoarc; b=XL3wC/Z+jEeDTjE3u7w7Cf8GbW76/hrgk2KB2VPg7Ea0vDxmG/E0HBGfD2WtEZA33h1zkL/KzeiaM5Jaqt8NBNi+gs3Mohayy/aYoFRg6jfYIhVnqVMsgh6FbJZ+Geb9wspfzEX6T1vYgzrnTTBIKAabyff9JvdlbWobEeSh3G4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669818; 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=RfYTyIs8StHB7o2N0JQA2LgTuiRGRst0nDa6SImXiJ0=; b=U4OORUKtcUDCX/La1SKC6mpy9ZgAOsGd6C6z83BsZ6y+86CPdYTSoR/xpTZ75wHlszskKVJK0MlUU6Pikj8R5euBTYw7mJKaui5jZ2ubxQqxxhLz7SqSh2qy6/uGOHq015h1Kaw0DlFXZLS6tuDuVc09cHahVsg3XlvvbN5o/Ys= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669818035487.1267326332536; Thu, 28 May 2020 05:43:38 -0700 (PDT) Received: from localhost ([::1]:38020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHsm-0008H1-QF for importer@patchew.org; Thu, 28 May 2020 08:43:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHm1-0001zU-IC for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:37 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57583 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlt-0005Ff-Mm for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:37 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-dWZhFjqXPP2CTOPKbzhjyw-1; Thu, 28 May 2020 08:36:23 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5DD511855A08; Thu, 28 May 2020 12:36:21 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19E3E2B4CC; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DA5479D61; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669388; 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=RfYTyIs8StHB7o2N0JQA2LgTuiRGRst0nDa6SImXiJ0=; b=BalwCH6Qxn5cfkkuH4UIDXCh7YN0rt+vDF5V7mZRDOKljm29p/Wtq0YmM1On2dekjYkrgL eN5H8kfNKCb/hG5PkcjSPvXTHIzQvN7q0kMKEsz5VRa1Y7zQzSQr/qzcb8Lx14yNS0pkA4 rKVVnytP7AUlNGeVrd65K8CwXEdfFTs= X-MC-Unique: dWZhFjqXPP2CTOPKbzhjyw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 14/21] hw/display/pxa2xx_lcd: Replace printf() call by qemu_log_mask() Date: Thu, 28 May 2020 14:36:02 +0200 Message-Id: <20200528123609.27362-15-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 Replace printf() calls by qemu_log_mask(UNIMP), which is disabled by default. This avoid flooding the terminal when fuzzing the device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-15-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/pxa2xx_lcd.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index d5f2e82a4ec3..ff90104b8011 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -426,9 +426,10 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr off= set, if ((s->control[0] & LCCR0_ENB) && !(value & LCCR0_ENB)) s->status[0] |=3D LCSR0_QD; =20 - if (!(s->control[0] & LCCR0_LCDT) && (value & LCCR0_LCDT)) - printf("%s: internal frame buffer unsupported\n", __func__); - + if (!(s->control[0] & LCCR0_LCDT) && (value & LCCR0_LCDT)) { + qemu_log_mask(LOG_UNIMP, + "%s: internal frame buffer unsupported\n", __fun= c__); + } if ((s->control[3] & LCCR3_API) && (value & LCCR0_ENB) && !(value & LCCR0_LCDT)) s->status[0] |=3D LCSR0_ABC; @@ -462,9 +463,9 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offs= et, break; =20 case OVL1C1: - if (!(s->ovl1c[0] & OVLC1_EN) && (value & OVLC1_EN)) - printf("%s: Overlay 1 not supported\n", __func__); - + if (!(s->ovl1c[0] & OVLC1_EN) && (value & OVLC1_EN)) { + qemu_log_mask(LOG_UNIMP, "%s: Overlay 1 not supported\n", __fu= nc__); + } s->ovl1c[0] =3D value & 0x80ffffff; s->dma_ch[1].up =3D (value & OVLC1_EN) || (s->control[0] & LCCR0_S= DS); break; @@ -474,9 +475,9 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offs= et, break; =20 case OVL2C1: - if (!(s->ovl2c[0] & OVLC1_EN) && (value & OVLC1_EN)) - printf("%s: Overlay 2 not supported\n", __func__); - + if (!(s->ovl2c[0] & OVLC1_EN) && (value & OVLC1_EN)) { + qemu_log_mask(LOG_UNIMP, "%s: Overlay 2 not supported\n", __fu= nc__); + } s->ovl2c[0] =3D value & 0x80ffffff; s->dma_ch[2].up =3D !!(value & OVLC1_EN); s->dma_ch[3].up =3D !!(value & OVLC1_EN); @@ -488,9 +489,10 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr off= set, break; =20 case CCR: - if (!(s->ccr & CCR_CEN) && (value & CCR_CEN)) - printf("%s: Hardware cursor unimplemented\n", __func__); - + if (!(s->ccr & CCR_CEN) && (value & CCR_CEN)) { + qemu_log_mask(LOG_UNIMP, + "%s: Hardware cursor unimplemented\n", __func__); + } s->ccr =3D value & 0x81ffffe7; s->dma_ch[5].up =3D !!(value & CCR_CEN); break; --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669629; cv=none; d=zohomail.com; s=zohoarc; b=biCYpcUL6ZfUZKX4XQMhWazw4Qndep7yOQDq1cNrU1Sb8gu7CQ5VZLMVI/yOQh1zBYDkzr4y4YbrtC5Ce/GIPqeEjZ3h/OuLRSpGgLSNTCMBWGBZwKuR6seCj5GiaoueO+zP3x0+Ciz8YMsFu5fEc3E5+cvqIJwcwIIPio6A8wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669629; 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=YFanjQRCf3qFEQWnXhLdapqjyquW4MPJ3aMF997XDHM=; b=mlbC+aiyC8EEKEWLNHEgmxfS3cLqCTmk8zHGyYlNFnNhw8WdzvF2vB2aNf45+GeRO5EtbPprmv7Tpll/df6ghcfTCEJvCh/XdVYwI6igWlNbnyIolyalnAPwnRa/LRuVzQv7zQzedcFDEubW7pmqLUvfE0QV/3JixL/oqytr/nU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669629831486.84664583661663; Thu, 28 May 2020 05:40:29 -0700 (PDT) Received: from localhost ([::1]:48546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHpk-0001NX-E5 for importer@patchew.org; Thu, 28 May 2020 08:40:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHls-0001ZA-FG for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34731 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlp-00059h-E3 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-p15FU9h1MTOT3ByajxYeWQ-1; Thu, 28 May 2020 08:36:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A457E8018A4; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id D36607E467; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E36269D63; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669383; 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=YFanjQRCf3qFEQWnXhLdapqjyquW4MPJ3aMF997XDHM=; b=jQ/fec9Ql9JbZ9cIT/hQgWHeQ4ZvvVNM0IW3MDXf9qHQuewoG2EECAYvrUt+RHmAltlyeV PAxlvTehe3/+/b5CtNhrxbsMiIWT1M3sE1ljNtWHsz7oPtJNhTwXSu60CBsXyXiDUPCNy2 IfvhcDS6Zqgv8VmO5mPu4TLrPXW9Sgo= X-MC-Unique: p15FU9h1MTOT3ByajxYeWQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 15/21] sm501: Convert printf + abort to qemu_log_mask Date: Thu, 28 May 2020 14:36:03 +0200 Message-Id: <20200528123609.27362-16-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: BALATON Zoltan Some places already use qemu_log_mask() to log unimplemented features or errors but some others have printf() then abort(). Convert these to qemu_log_mask() and avoid aborting to prevent guests to easily cause denial of service. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 305af87f59d81e92f2aaff09eb8a3603b8baa322.1590089984.git.balaton= @eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 57 ++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index acc692531ac7..bd3ccfe311c8 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -727,8 +727,8 @@ static void sm501_2d_operation(SM501State *s) int fb_len =3D get_width(s, crt) * get_height(s, crt) * get_bpp(s, crt= ); =20 if (addressing !=3D 0x0) { - printf("%s: only XY addressing is supported.\n", __func__); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: only XY addressing is supported.\= n"); + return; } =20 if (rop_mode =3D=3D 0) { @@ -754,8 +754,8 @@ static void sm501_2d_operation(SM501State *s) =20 if ((s->twoD_source_base & 0x08000000) || (s->twoD_destination_base & 0x08000000)) { - printf("%s: only local memory is supported.\n", __func__); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: only local memory is supported.\n= "); + return; } =20 switch (operation) { @@ -823,9 +823,9 @@ static void sm501_2d_operation(SM501State *s) break; =20 default: - printf("non-implemented SM501 2D operation. %d\n", operation); - abort(); - break; + qemu_log_mask(LOG_UNIMP, "sm501: not implemented 2D operation: %d\= n", + operation); + return; } =20 if (dst_base >=3D get_fb_addr(s, crt) && @@ -892,9 +892,8 @@ static uint64_t sm501_system_config_read(void *opaque, = hwaddr addr, break; =20 default: - printf("sm501 system config : not implemented register read." - " addr=3D%x\n", (int)addr); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: not implemented system config" + "register read. addr=3D%" HWADDR_PRIx "\n", addr); } =20 return ret; @@ -948,15 +947,15 @@ static void sm501_system_config_write(void *opaque, h= waddr addr, break; case SM501_ENDIAN_CONTROL: if (value & 0x00000001) { - printf("sm501 system config : big endian mode not implemented.= \n"); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: system config big endian mode= not" + " implemented.\n"); } break; =20 default: - printf("sm501 system config : not implemented register write." - " addr=3D%x, val=3D%x\n", (int)addr, (uint32_t)value); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: not implemented system config" + "register write. addr=3D%" HWADDR_PRIx + ", val=3D%" PRIx64 "\n", addr, value); } } =20 @@ -1207,9 +1206,8 @@ static uint64_t sm501_disp_ctrl_read(void *opaque, hw= addr addr, break; =20 default: - printf("sm501 disp ctrl : not implemented register read." - " addr=3D%x\n", (int)addr); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: not implemented disp ctrl registe= r " + "read. addr=3D%" HWADDR_PRIx "\n", addr); } =20 return ret; @@ -1345,9 +1343,9 @@ static void sm501_disp_ctrl_write(void *opaque, hwadd= r addr, break; =20 default: - printf("sm501 disp ctrl : not implemented register write." - " addr=3D%x, val=3D%x\n", (int)addr, (unsigned)value); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: not implemented disp ctrl registe= r " + "write. addr=3D%" HWADDR_PRIx + ", val=3D%" PRIx64 "\n", addr, value); } } =20 @@ -1433,9 +1431,8 @@ static uint64_t sm501_2d_engine_read(void *opaque, hw= addr addr, ret =3D 0; /* Should return interrupt status */ break; default: - printf("sm501 disp ctrl : not implemented register read." - " addr=3D%x\n", (int)addr); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: not implemented disp ctrl registe= r " + "read. addr=3D%" HWADDR_PRIx "\n", addr); } =20 return ret; @@ -1520,9 +1517,9 @@ static void sm501_2d_engine_write(void *opaque, hwadd= r addr, /* ignored, writing 0 should clear interrupt status */ break; default: - printf("sm501 2d engine : not implemented register write." - " addr=3D%x, val=3D%x\n", (int)addr, (unsigned)value); - abort(); + qemu_log_mask(LOG_UNIMP, "sm501: not implemented 2d engine registe= r " + "write. addr=3D%" HWADDR_PRIx + ", val=3D%" PRIx64 "\n", addr, value); } } =20 @@ -1670,9 +1667,9 @@ static void sm501_update_display(void *opaque) draw_line =3D draw_line32_funcs[dst_depth_index]; break; default: - printf("sm501 update display : invalid control register value.\n"); - abort(); - break; + qemu_log_mask(LOG_GUEST_ERROR, "sm501: update display" + "invalid control register value.\n"); + return; } =20 /* set up to draw hardware cursor */ --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669784; cv=none; d=zohomail.com; s=zohoarc; b=EBbXrsfFZuf/T+WLwR45S26hlrzgvqtIXw2rv13sG2hsxreED3ostmsTgb0F7b9ia3eZL9Z5hbqdUVRn6AMFsdrOsHjypeEEvdPkLXflT7m2p9wMjCo0xaPyiSmZy6hzEiZUrtcFPTRE0etOIiSU4/nCwrkYKr63Rp4mBECqZdw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669784; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=U+5RcqhQF93azu6HDbQUS5nmpDhF+70aIhMKbYU+HeM=; b=muLOIfsodexlPO4l0waAq+BCVmqHvvcakg/fd+ltxUA6vWGINmIChNwhu+26Hu1GalBIzDJ7Ze2cSHFsajGm5nhvWzDO7OPo/jn9/EGRKdNPdUF73OhSToR3D1XiGY0g3mxFYU5wNmKH88kOxri82GK+1obGIR8p4D8KIsZYtns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669784102485.62691615795995; Thu, 28 May 2020 05:43:04 -0700 (PDT) Received: from localhost ([::1]:34912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHsE-0006xZ-Sg for importer@patchew.org; Thu, 28 May 2020 08:43:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlx-0001nN-CY for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29032 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlr-0005CI-Jw for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:32 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-VC4AfOvgMHetBxeGS40qpQ-1; Thu, 28 May 2020 08:36:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D2B2107ACF7; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5555A10013C0; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EC7C09D68; Thu, 28 May 2020 14:36:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=U+5RcqhQF93azu6HDbQUS5nmpDhF+70aIhMKbYU+HeM=; b=GoDBnqZJ6rtBT1Qw+UBvB0yYd2bGxbH/XRTWXf9cl0FHmMtXKxuIbiKaGnvHMSLeHJ7De7 FXAOtpkopv07BEXPjBPKsvrQ7/22GAQbgT7g4OZyjZdlkU0oKykIpxnWgOHcCFNgIUg1Z0 GTkbHLohYXI+xCLNqqtBbh4NnOMIesc= X-MC-Unique: VC4AfOvgMHetBxeGS40qpQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 16/21] sm501: Shorten long variable names in sm501_2d_operation Date: Thu, 28 May 2020 14:36:04 +0200 Message-Id: <20200528123609.27362-17-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan This increases readability and cleans up some confusing naming. Signed-off-by: BALATON Zoltan Message-id: b9b67b94c46e945252a73c77dfd117132c63c4fb.1590089984.git.balaton= @eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index bd3ccfe311c8..f42d05e1e4b2 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -700,17 +700,16 @@ static inline void hwc_invalidate(SM501State *s, int = crt) static void sm501_2d_operation(SM501State *s) { /* obtain operation parameters */ - int operation =3D (s->twoD_control >> 16) & 0x1f; + int cmd =3D (s->twoD_control >> 16) & 0x1F; int rtl =3D s->twoD_control & 0x8000000; int src_x =3D (s->twoD_source >> 16) & 0x01FFF; int src_y =3D s->twoD_source & 0xFFFF; int dst_x =3D (s->twoD_destination >> 16) & 0x01FFF; int dst_y =3D s->twoD_destination & 0xFFFF; - int operation_width =3D (s->twoD_dimension >> 16) & 0x1FFF; - int operation_height =3D s->twoD_dimension & 0xFFFF; + int width =3D (s->twoD_dimension >> 16) & 0x1FFF; + int height =3D s->twoD_dimension & 0xFFFF; uint32_t color =3D s->twoD_foreground; - int format_flags =3D (s->twoD_stretch >> 20) & 0x3; - int addressing =3D (s->twoD_stretch >> 16) & 0xF; + int format =3D (s->twoD_stretch >> 20) & 0x3; int rop_mode =3D (s->twoD_control >> 15) & 0x1; /* 1 for rop2, else ro= p3 */ /* 1 if rop2 source is the pattern, otherwise the source is the bitmap= */ int rop2_source_is_pattern =3D (s->twoD_control >> 14) & 0x1; @@ -721,12 +720,12 @@ static void sm501_2d_operation(SM501State *s) /* get frame buffer info */ uint8_t *src =3D s->local_mem + src_base; uint8_t *dst =3D s->local_mem + dst_base; - int src_width =3D s->twoD_pitch & 0x1FFF; - int dst_width =3D (s->twoD_pitch >> 16) & 0x1FFF; + int src_pitch =3D s->twoD_pitch & 0x1FFF; + int dst_pitch =3D (s->twoD_pitch >> 16) & 0x1FFF; int crt =3D (s->dc_crt_control & SM501_DC_CRT_CONTROL_SEL) ? 1 : 0; int fb_len =3D get_width(s, crt) * get_height(s, crt) * get_bpp(s, crt= ); =20 - if (addressing !=3D 0x0) { + if ((s->twoD_stretch >> 16) & 0xF) { qemu_log_mask(LOG_UNIMP, "sm501: only XY addressing is supported.\= n"); return; } @@ -758,20 +757,20 @@ static void sm501_2d_operation(SM501State *s) return; } =20 - switch (operation) { + switch (cmd) { case 0x00: /* copy area */ #define COPY_AREA(_bpp, _pixel_type, rtl) { = \ int y, x, index_d, index_s; = \ - for (y =3D 0; y < operation_height; y++) { = \ - for (x =3D 0; x < operation_width; x++) { = \ + for (y =3D 0; y < height; y++) { \ + for (x =3D 0; x < width; x++) { \ _pixel_type val; = \ = \ if (rtl) { = \ - index_s =3D ((src_y - y) * src_width + src_x - x) * _b= pp; \ - index_d =3D ((dst_y - y) * dst_width + dst_x - x) * _b= pp; \ + index_s =3D ((src_y - y) * src_pitch + src_x - x) * _b= pp; \ + index_d =3D ((dst_y - y) * dst_pitch + dst_x - x) * _b= pp; \ } else { = \ - index_s =3D ((src_y + y) * src_width + src_x + x) * _b= pp; \ - index_d =3D ((dst_y + y) * dst_width + dst_x + x) * _b= pp; \ + index_s =3D ((src_y + y) * src_pitch + src_x + x) * _b= pp; \ + index_d =3D ((dst_y + y) * dst_pitch + dst_x + x) * _b= pp; \ } = \ if (rop_mode =3D=3D 1 && rop =3D=3D 5) { = \ /* Invert dest */ = \ @@ -783,7 +782,7 @@ static void sm501_2d_operation(SM501State *s) } = \ } = \ } - switch (format_flags) { + switch (format) { case 0: COPY_AREA(1, uint8_t, rtl); break; @@ -799,15 +798,15 @@ static void sm501_2d_operation(SM501State *s) case 0x01: /* fill rectangle */ #define FILL_RECT(_bpp, _pixel_type) { = \ int y, x; = \ - for (y =3D 0; y < operation_height; y++) { = \ - for (x =3D 0; x < operation_width; x++) { = \ - int index =3D ((dst_y + y) * dst_width + dst_x + x) * _bpp= ; \ + for (y =3D 0; y < height; y++) { \ + for (x =3D 0; x < width; x++) { \ + int index =3D ((dst_y + y) * dst_pitch + dst_x + x) * _bpp= ; \ *(_pixel_type *)&dst[index] =3D (_pixel_type)color; = \ } = \ } = \ } =20 - switch (format_flags) { + switch (format) { case 0: FILL_RECT(1, uint8_t); break; @@ -824,14 +823,14 @@ static void sm501_2d_operation(SM501State *s) =20 default: qemu_log_mask(LOG_UNIMP, "sm501: not implemented 2D operation: %d\= n", - operation); + cmd); return; } =20 if (dst_base >=3D get_fb_addr(s, crt) && dst_base <=3D get_fb_addr(s, crt) + fb_len) { - int dst_len =3D MIN(fb_len, ((dst_y + operation_height - 1) * dst_= width + - dst_x + operation_width) * (1 << format_flags)); + int dst_len =3D MIN(fb_len, ((dst_y + height - 1) * dst_pitch + + dst_x + width) * (1 << format)); if (dst_len) { memory_region_set_dirty(&s->local_mem_region, dst_base, dst_le= n); } --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669654; cv=none; d=zohomail.com; s=zohoarc; b=UHKVJ3cnmja9qlZGPYBQHsH7rQrA06BTFYew/dQVdZ7jauFtZfLxcLo297Fbxcw3p88ssyISwWbu4OhDTVg5zpK1btmFxRkHWOPzz0fvCKFTOGC3Ayx3E6f0KZdL3xn4xH1AAJ/yAzGogdip7vpaAhuTtA25ZLuRHe+wtnPbhP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669654; 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=278g4ageQCy0goiXt62DoB6ekK6wxlvccTR7+duFaRY=; b=VO+UYOnzFtXSZvFOk74q3TpBIVSC+dj9kRJy2b3X7N9s31DcF83gFIvEptDE893JYgNohDp8rokTgU9B11dqYm7dYiyORwhipoW3GqDI0e0HO9CqZdtjuedPWHjnTpVtfhpBRk5hv8ZoijMb9Dyw7V2kkw/++NvAfjx1eMiSVpk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669654264876.1060386405609; Thu, 28 May 2020 05:40:54 -0700 (PDT) Received: from localhost ([::1]:51316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHq8-0002Pv-Vm for importer@patchew.org; Thu, 28 May 2020 08:40:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlw-0001k0-4N for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:32 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38833 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlp-0005BG-VX for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-320-tJKDLwrJMbWsZWSK5g48YA-1; Thu, 28 May 2020 08:36:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08DE3EC1A3; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id B16F97A8B7; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 012AB9D69; Thu, 28 May 2020 14:36:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669385; 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=278g4ageQCy0goiXt62DoB6ekK6wxlvccTR7+duFaRY=; b=KL+i3BcFWWhDCgks15xo3SE5VYy6pQAJq3QegCpX12eoO2kFcxnassR+hsG/qhP5XmtyAL ei2VPju5UI9rd9lZ65v5/jDYF8J4q8FwRDhA+lho71PaeIOFI2ETB4Z7+rFRroYEg8i4IQ c+AfKxxJIDv+Q1gwddYOYuRs6WKPGCU= X-MC-Unique: tJKDLwrJMbWsZWSK5g48YA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 17/21] sm501: Use BIT(x) macro to shorten constant Date: Thu, 28 May 2020 14:36:05 +0200 Message-Id: <20200528123609.27362-18-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: BALATON Zoltan Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 124bf5de8d7cf503b32b377d0445029a76bfbd49.1590089984.git.balaton= @eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index f42d05e1e4b2..97660090bb20 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -701,7 +701,7 @@ static void sm501_2d_operation(SM501State *s) { /* obtain operation parameters */ int cmd =3D (s->twoD_control >> 16) & 0x1F; - int rtl =3D s->twoD_control & 0x8000000; + int rtl =3D s->twoD_control & BIT(27); int src_x =3D (s->twoD_source >> 16) & 0x01FFF; int src_y =3D s->twoD_source & 0xFFFF; int dst_x =3D (s->twoD_destination >> 16) & 0x01FFF; @@ -751,8 +751,7 @@ static void sm501_2d_operation(SM501State *s) } } =20 - if ((s->twoD_source_base & 0x08000000) || - (s->twoD_destination_base & 0x08000000)) { + if (s->twoD_source_base & BIT(27) || s->twoD_destination_base & BIT(27= )) { qemu_log_mask(LOG_UNIMP, "sm501: only local memory is supported.\n= "); return; } --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669503; cv=none; d=zohomail.com; s=zohoarc; b=awKTUSPup/xUfkMXaw8Itb7Z0+Y/M8l0uI6CqnH/Whusv9iKkjtEQSpAqJAMFkjunddmDRBxQq2Ff0HyHC4zCBhJYomJ6SgJvupiblbZBsMDSV9pXloMpobKaeCsnH91qCY/FrPQ0f26yFBVr3zhFAvPJkOUTLZ6h2a4DoM2iS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669503; 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=LiGn/nHni1Lk3kZNk9PZIsmBEvCzwQMaTtX8WHKOh6U=; b=B6MPC5k6F1vOexV4C6Zqnl84SVwtUkytJwlnwmVtdwCAlS5HcRzT/WOt9Soo7S0wN2HfSsfBPOwOCyxzmk7IgBfGtL4plpzV6qZ91JRUtxvd2uRwFa3DWEdv6SJcA8RZ0h5U5f1V9PKn+nrN2Me0hmzVgp5XzGzy/joxOQ7Xp/A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669503399233.56659347363018; Thu, 28 May 2020 05:38:23 -0700 (PDT) Received: from localhost ([::1]:37656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHni-0004s9-4r for importer@patchew.org; Thu, 28 May 2020 08:38:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHls-0001Zx-Oi for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30534 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlp-0005AA-C9 for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-CF5a3oIbM0y9Ji1ME4fAVA-1; Thu, 28 May 2020 08:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80EA31855A0E; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id B83449E0E8; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 09EDA9D6A; Thu, 28 May 2020 14:36:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669384; 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=LiGn/nHni1Lk3kZNk9PZIsmBEvCzwQMaTtX8WHKOh6U=; b=VBojf8Q+6+M1UpnfC3u4iCAIfEtlK6/q35Q1z7f/9K+t3tFFOFADICVYNFnBVKCCIkiI+o 2Uk1G34o0Hkg8nYbcHEIunFPCVx38pa2179DLt+L69LjoaJ1Rg0t+Ukl8sjrYIKjLz+GnC V7d1iXKWelhDOCUO/ZAp32p2Efeoc1c= X-MC-Unique: CF5a3oIbM0y9Ji1ME4fAVA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 18/21] sm501: Clean up local variables in sm501_2d_operation Date: Thu, 28 May 2020 14:36:06 +0200 Message-Id: <20200528123609.27362-19-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: BALATON Zoltan Make variables local to the block they are used in to make it clearer which operation they are needed for. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: ae59f8138afe7f6a5a4a82539d0f61496a906b06.1590089984.git.balaton= @eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 97660090bb20..5ed57703d811 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -699,28 +699,19 @@ static inline void hwc_invalidate(SM501State *s, int = crt) =20 static void sm501_2d_operation(SM501State *s) { - /* obtain operation parameters */ int cmd =3D (s->twoD_control >> 16) & 0x1F; int rtl =3D s->twoD_control & BIT(27); - int src_x =3D (s->twoD_source >> 16) & 0x01FFF; - int src_y =3D s->twoD_source & 0xFFFF; - int dst_x =3D (s->twoD_destination >> 16) & 0x01FFF; - int dst_y =3D s->twoD_destination & 0xFFFF; - int width =3D (s->twoD_dimension >> 16) & 0x1FFF; - int height =3D s->twoD_dimension & 0xFFFF; - uint32_t color =3D s->twoD_foreground; int format =3D (s->twoD_stretch >> 20) & 0x3; int rop_mode =3D (s->twoD_control >> 15) & 0x1; /* 1 for rop2, else ro= p3 */ /* 1 if rop2 source is the pattern, otherwise the source is the bitmap= */ int rop2_source_is_pattern =3D (s->twoD_control >> 14) & 0x1; int rop =3D s->twoD_control & 0xFF; - uint32_t src_base =3D s->twoD_source_base & 0x03FFFFFF; + int dst_x =3D (s->twoD_destination >> 16) & 0x01FFF; + int dst_y =3D s->twoD_destination & 0xFFFF; + int width =3D (s->twoD_dimension >> 16) & 0x1FFF; + int height =3D s->twoD_dimension & 0xFFFF; uint32_t dst_base =3D s->twoD_destination_base & 0x03FFFFFF; - - /* get frame buffer info */ - uint8_t *src =3D s->local_mem + src_base; uint8_t *dst =3D s->local_mem + dst_base; - int src_pitch =3D s->twoD_pitch & 0x1FFF; int dst_pitch =3D (s->twoD_pitch >> 16) & 0x1FFF; int crt =3D (s->dc_crt_control & SM501_DC_CRT_CONTROL_SEL) ? 1 : 0; int fb_len =3D get_width(s, crt) * get_height(s, crt) * get_bpp(s, crt= ); @@ -758,6 +749,13 @@ static void sm501_2d_operation(SM501State *s) =20 switch (cmd) { case 0x00: /* copy area */ + { + int src_x =3D (s->twoD_source >> 16) & 0x01FFF; + int src_y =3D s->twoD_source & 0xFFFF; + uint32_t src_base =3D s->twoD_source_base & 0x03FFFFFF; + uint8_t *src =3D s->local_mem + src_base; + int src_pitch =3D s->twoD_pitch & 0x1FFF; + #define COPY_AREA(_bpp, _pixel_type, rtl) { = \ int y, x, index_d, index_s; = \ for (y =3D 0; y < height; y++) { \ @@ -793,8 +791,11 @@ static void sm501_2d_operation(SM501State *s) break; } break; - + } case 0x01: /* fill rectangle */ + { + uint32_t color =3D s->twoD_foreground; + #define FILL_RECT(_bpp, _pixel_type) { = \ int y, x; = \ for (y =3D 0; y < height; y++) { \ @@ -819,7 +820,7 @@ static void sm501_2d_operation(SM501State *s) break; } break; - + } default: qemu_log_mask(LOG_UNIMP, "sm501: not implemented 2D operation: %d\= n", cmd); --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669746; cv=none; d=zohomail.com; s=zohoarc; b=YhKqa5IjE6YfQsAylIZ0J+viZVS9/c6t1wixe/9+l5ko3S5yC0iMH0usxc5CATbJepI1Bx39yo8PLsiCcpqw5+tX4XXgk1FZ9ESBKGQq6nulxQym1XSFxL70ryR0i9/DJiiClxP0UyBrHxg2cVwsC9mmh177oegwGy3c+/lY+N0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669746; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=kl0xBtkQvSUQVd60CS6Y6dEgde7UHK4QkuNltk2B7pU=; b=HSa+bh4UtkK0Akan4KfbQ2xO2hjJd19LfSkj+fMaKZoHWDLBlJuFlwDrLD+gTwbw7oTnfjyTjs7tngO5slE25tdaekvLWSUjA/qF1kmXdnFfMJhrEuaHurZJsN+kv3Spr+uJ6Qt0P42Bhg79nRbJL1waacFr6fFn5bYM7V+RpJw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669746840353.9935559553012; Thu, 28 May 2020 05:42:26 -0700 (PDT) Received: from localhost ([::1]:58704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHrd-0005IR-Fq for importer@patchew.org; Thu, 28 May 2020 08:42:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlt-0001cH-IE for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:29 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:59034 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlp-00059w-FO for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:29 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-320-O7_HnLG7PO67Hlo35-CL6A-1; Thu, 28 May 2020 08:36:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7924EC1A2; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21D547A8B4; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 130659D71; Thu, 28 May 2020 14:36:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=kl0xBtkQvSUQVd60CS6Y6dEgde7UHK4QkuNltk2B7pU=; b=CXxfpclXo8KOeUmq+GqcMRqXRLs7F0Eu14Xui6qDVJn6f0CE1o6DqgmWObrGuhDWqzlH1e U6rAxKKul95FjzN7LQLKcp6ATsiGlhDNr3k3Jklf2xq/nXeWcXsPm/ybrEcrJCQ4B/t+8y gSckLJgejL7fRkirH0Evp4bwmZ2NI9M= X-MC-Unique: O7_HnLG7PO67Hlo35-CL6A-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 19/21] sm501: Replace hand written implementation with pixman where possible Date: Thu, 28 May 2020 14:36:07 +0200 Message-Id: <20200528123609.27362-20-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 06:31:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Besides being faster this should also prevent malicious guests to abuse 2D engine to overwrite data or cause a crash. Signed-off-by: BALATON Zoltan Message-id: 58666389b6cae256e4e972a32c05cf8aa51bffc0.1590089984.git.balaton= @eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 205 ++++++++++++++++++++++++++------------------- 1 file changed, 118 insertions(+), 87 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 5ed57703d811..8bf4d111f4b3 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -706,13 +706,12 @@ static void sm501_2d_operation(SM501State *s) /* 1 if rop2 source is the pattern, otherwise the source is the bitmap= */ int rop2_source_is_pattern =3D (s->twoD_control >> 14) & 0x1; int rop =3D s->twoD_control & 0xFF; - int dst_x =3D (s->twoD_destination >> 16) & 0x01FFF; - int dst_y =3D s->twoD_destination & 0xFFFF; - int width =3D (s->twoD_dimension >> 16) & 0x1FFF; - int height =3D s->twoD_dimension & 0xFFFF; + unsigned int dst_x =3D (s->twoD_destination >> 16) & 0x01FFF; + unsigned int dst_y =3D s->twoD_destination & 0xFFFF; + unsigned int width =3D (s->twoD_dimension >> 16) & 0x1FFF; + unsigned int height =3D s->twoD_dimension & 0xFFFF; uint32_t dst_base =3D s->twoD_destination_base & 0x03FFFFFF; - uint8_t *dst =3D s->local_mem + dst_base; - int dst_pitch =3D (s->twoD_pitch >> 16) & 0x1FFF; + unsigned int dst_pitch =3D (s->twoD_pitch >> 16) & 0x1FFF; int crt =3D (s->dc_crt_control & SM501_DC_CRT_CONTROL_SEL) ? 1 : 0; int fb_len =3D get_width(s, crt) * get_height(s, crt) * get_bpp(s, crt= ); =20 @@ -721,104 +720,136 @@ static void sm501_2d_operation(SM501State *s) return; } =20 - if (rop_mode =3D=3D 0) { - if (rop !=3D 0xcc) { - /* Anything other than plain copies are not supported */ - qemu_log_mask(LOG_UNIMP, "sm501: rop3 mode with rop %x is not " - "supported.\n", rop); - } - } else { - if (rop2_source_is_pattern && rop !=3D 0x5) { - /* For pattern source, we support only inverse dest */ - qemu_log_mask(LOG_UNIMP, "sm501: rop2 source being the pattern= and " - "rop %x is not supported.\n", rop); - } else { - if (rop !=3D 0x5 && rop !=3D 0xc) { - /* Anything other than plain copies or inverse dest is not - * supported */ - qemu_log_mask(LOG_UNIMP, "sm501: rop mode %x is not " - "supported.\n", rop); - } - } - } - if (s->twoD_source_base & BIT(27) || s->twoD_destination_base & BIT(27= )) { qemu_log_mask(LOG_UNIMP, "sm501: only local memory is supported.\n= "); return; } =20 + if (!dst_pitch) { + qemu_log_mask(LOG_GUEST_ERROR, "sm501: Zero dest pitch.\n"); + return; + } + + if (!width || !height) { + qemu_log_mask(LOG_GUEST_ERROR, "sm501: Zero size 2D op.\n"); + return; + } + + if (rtl) { + dst_x -=3D width - 1; + dst_y -=3D height - 1; + } + + if (dst_base >=3D get_local_mem_size(s) || dst_base + + (dst_x + width + (dst_y + height) * (dst_pitch + width)) * + (1 << format) >=3D get_local_mem_size(s)) { + qemu_log_mask(LOG_GUEST_ERROR, "sm501: 2D op dest is outside vram.= \n"); + return; + } + switch (cmd) { - case 0x00: /* copy area */ + case 0: /* BitBlt */ { - int src_x =3D (s->twoD_source >> 16) & 0x01FFF; - int src_y =3D s->twoD_source & 0xFFFF; + unsigned int src_x =3D (s->twoD_source >> 16) & 0x01FFF; + unsigned int src_y =3D s->twoD_source & 0xFFFF; uint32_t src_base =3D s->twoD_source_base & 0x03FFFFFF; - uint8_t *src =3D s->local_mem + src_base; - int src_pitch =3D s->twoD_pitch & 0x1FFF; + unsigned int src_pitch =3D s->twoD_pitch & 0x1FFF; =20 -#define COPY_AREA(_bpp, _pixel_type, rtl) { = \ - int y, x, index_d, index_s; = \ - for (y =3D 0; y < height; y++) { \ - for (x =3D 0; x < width; x++) { \ - _pixel_type val; = \ - = \ - if (rtl) { = \ - index_s =3D ((src_y - y) * src_pitch + src_x - x) * _b= pp; \ - index_d =3D ((dst_y - y) * dst_pitch + dst_x - x) * _b= pp; \ - } else { = \ - index_s =3D ((src_y + y) * src_pitch + src_x + x) * _b= pp; \ - index_d =3D ((dst_y + y) * dst_pitch + dst_x + x) * _b= pp; \ - } = \ - if (rop_mode =3D=3D 1 && rop =3D=3D 5) { = \ - /* Invert dest */ = \ - val =3D ~*(_pixel_type *)&dst[index_d]; = \ - } else { = \ - val =3D *(_pixel_type *)&src[index_s]; = \ - } = \ - *(_pixel_type *)&dst[index_d] =3D val; = \ - } = \ - } = \ - } - switch (format) { - case 0: - COPY_AREA(1, uint8_t, rtl); - break; - case 1: - COPY_AREA(2, uint16_t, rtl); - break; - case 2: - COPY_AREA(4, uint32_t, rtl); - break; + if (!src_pitch) { + qemu_log_mask(LOG_GUEST_ERROR, "sm501: Zero src pitch.\n"); + return; + } + + if (rtl) { + src_x -=3D width - 1; + src_y -=3D height - 1; + } + + if (src_base >=3D get_local_mem_size(s) || src_base + + (src_x + width + (src_y + height) * (src_pitch + width)) * + (1 << format) >=3D get_local_mem_size(s)) { + qemu_log_mask(LOG_GUEST_ERROR, + "sm501: 2D op src is outside vram.\n"); + return; + } + + if ((rop_mode && rop =3D=3D 0x5) || (!rop_mode && rop =3D=3D 0x55)= ) { + /* Invert dest, is there a way to do this with pixman? */ + unsigned int x, y, i; + uint8_t *d =3D s->local_mem + dst_base; + + for (y =3D 0; y < height; y++) { + i =3D (dst_x + (dst_y + y) * dst_pitch) * (1 << format); + for (x =3D 0; x < width; x++, i +=3D (1 << format)) { + switch (format) { + case 0: + d[i] =3D ~d[i]; + break; + case 1: + *(uint16_t *)&d[i] =3D ~*(uint16_t *)&d[i]; + break; + case 2: + *(uint32_t *)&d[i] =3D ~*(uint32_t *)&d[i]; + break; + } + } + } + } else { + /* Do copy src for unimplemented ops, better than unpainted ar= ea */ + if ((rop_mode && (rop !=3D 0xc || rop2_source_is_pattern)) || + (!rop_mode && rop !=3D 0xcc)) { + qemu_log_mask(LOG_UNIMP, + "sm501: rop%d op %x%s not implemented\n", + (rop_mode ? 2 : 3), rop, + (rop2_source_is_pattern ? + " with pattern source" : "")); + } + /* Check for overlaps, this could be made more exact */ + uint32_t sb, se, db, de; + sb =3D src_base + src_x + src_y * (width + src_pitch); + se =3D sb + width + height * (width + src_pitch); + db =3D dst_base + dst_x + dst_y * (width + dst_pitch); + de =3D db + width + height * (width + dst_pitch); + if (rtl && ((db >=3D sb && db <=3D se) || (de >=3D sb && de <= =3D se))) { + /* regions may overlap: copy via temporary */ + int llb =3D width * (1 << format); + int tmp_stride =3D DIV_ROUND_UP(llb, sizeof(uint32_t)); + uint32_t *tmp =3D g_malloc(tmp_stride * sizeof(uint32_t) * + height); + pixman_blt((uint32_t *)&s->local_mem[src_base], tmp, + src_pitch * (1 << format) / sizeof(uint32_t), + tmp_stride, 8 * (1 << format), 8 * (1 << format= ), + src_x, src_y, 0, 0, width, height); + pixman_blt(tmp, (uint32_t *)&s->local_mem[dst_base], + tmp_stride, + dst_pitch * (1 << format) / sizeof(uint32_t), + 8 * (1 << format), 8 * (1 << format), + 0, 0, dst_x, dst_y, width, height); + g_free(tmp); + } else { + pixman_blt((uint32_t *)&s->local_mem[src_base], + (uint32_t *)&s->local_mem[dst_base], + src_pitch * (1 << format) / sizeof(uint32_t), + dst_pitch * (1 << format) / sizeof(uint32_t), + 8 * (1 << format), 8 * (1 << format), + src_x, src_y, dst_x, dst_y, width, height); + } } break; } - case 0x01: /* fill rectangle */ + case 1: /* Rectangle Fill */ { uint32_t color =3D s->twoD_foreground; =20 -#define FILL_RECT(_bpp, _pixel_type) { = \ - int y, x; = \ - for (y =3D 0; y < height; y++) { \ - for (x =3D 0; x < width; x++) { \ - int index =3D ((dst_y + y) * dst_pitch + dst_x + x) * _bpp= ; \ - *(_pixel_type *)&dst[index] =3D (_pixel_type)color; = \ - } = \ - } = \ - } - - switch (format) { - case 0: - FILL_RECT(1, uint8_t); - break; - case 1: - color =3D cpu_to_le16(color); - FILL_RECT(2, uint16_t); - break; - case 2: + if (format =3D=3D 2) { color =3D cpu_to_le32(color); - FILL_RECT(4, uint32_t); - break; + } else if (format =3D=3D 1) { + color =3D cpu_to_le16(color); } + + pixman_fill((uint32_t *)&s->local_mem[dst_base], + dst_pitch * (1 << format) / sizeof(uint32_t), + 8 * (1 << format), dst_x, dst_y, width, height, color); break; } default: --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590670033; cv=none; d=zohomail.com; s=zohoarc; b=bbWi/M0rAweti4uuFtFWD9H047LEbhV0PynRawq+zG5b3AtNGaUcko0uhBsF54k05299v6VImjb4LIglTCb9LgYQ00jAMnyQSmX84NLnAQIDgM6x0oL835ITjpM9zUFHNp1jI4i/UTBg2pi+bugTzcDhAoGiZ8bdH+S812DfE3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590670033; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=2IsMfaxaTTz5vy0Vupg6v30s/PyqIpQcE0ZMO3BCp/U=; b=aunWZMv3N9Uk76H9uAmzHr5po31Im3J/97DkyZ+QEU+j1XqaPQI1H/15o5EAWLYEL1HdvIbt77KYVMZAGlrR6mEijPa6xjD46fmGKBxwnqsm9rCT2KTqCYQ4R//cXjqHGt9UCr7+DlyJz2BRfRKkO1Ey7l/rCTKO5e7THXgiH5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590670033095903.1221017899092; Thu, 28 May 2020 05:47:13 -0700 (PDT) Received: from localhost ([::1]:55082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHwF-0006yz-MM for importer@patchew.org; Thu, 28 May 2020 08:47:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlx-0001nq-Jq for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:33 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:39993 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlr-0005Cj-KN for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:33 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-emKINCxxMzis6e2BQMv_Wg-1; Thu, 28 May 2020 08:36:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 485001855A0D; Thu, 28 May 2020 12:36:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF37E10013C3; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1BBB39D72; Thu, 28 May 2020 14:36:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=2IsMfaxaTTz5vy0Vupg6v30s/PyqIpQcE0ZMO3BCp/U=; b=GhEDAWtjbee60KMUwh8g3U2dA0pp+RRijlzNZOatiGJ28nGvQyq2P8M8Hu3oA6MBNjyIvi 9JP91q4NbCKT3UGqstKivGf80vB46qtzcI7yTJpTii1RQXCSYSgeRisRo2Ep+ZsrGn3ght 01YAXbakAgGH2ufOu/blmCEt/3mz7RA= X-MC-Unique: emKINCxxMzis6e2BQMv_Wg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 20/21] sm501: Optimize small overlapping blits Date: Thu, 28 May 2020 14:36:08 +0200 Message-Id: <20200528123609.27362-21-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan AmigaOS tends to do a lot of small blits (even 1 pixel). Avoid malloc overhead by keeping around a buffer for this and only alloc when blitting larger areas. Signed-off-by: BALATON Zoltan Message-id: 7946852258d528497e85f465327fc90b5c3b59fb.1590089984.git.balaton= @eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 8bf4d111f4b3..e7a9f77de7bc 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -750,6 +750,7 @@ static void sm501_2d_operation(SM501State *s) switch (cmd) { case 0: /* BitBlt */ { + static uint32_t tmp_buf[16384]; unsigned int src_x =3D (s->twoD_source >> 16) & 0x01FFF; unsigned int src_y =3D s->twoD_source & 0xFFFF; uint32_t src_base =3D s->twoD_source_base & 0x03FFFFFF; @@ -812,10 +813,14 @@ static void sm501_2d_operation(SM501State *s) de =3D db + width + height * (width + dst_pitch); if (rtl && ((db >=3D sb && db <=3D se) || (de >=3D sb && de <= =3D se))) { /* regions may overlap: copy via temporary */ - int llb =3D width * (1 << format); + int free_buf =3D 0, llb =3D width * (1 << format); int tmp_stride =3D DIV_ROUND_UP(llb, sizeof(uint32_t)); - uint32_t *tmp =3D g_malloc(tmp_stride * sizeof(uint32_t) * - height); + uint32_t *tmp =3D tmp_buf; + + if (tmp_stride * sizeof(uint32_t) * height > sizeof(tmp_bu= f)) { + tmp =3D g_malloc(tmp_stride * sizeof(uint32_t) * heigh= t); + free_buf =3D 1; + } pixman_blt((uint32_t *)&s->local_mem[src_base], tmp, src_pitch * (1 << format) / sizeof(uint32_t), tmp_stride, 8 * (1 << format), 8 * (1 << format= ), @@ -825,7 +830,9 @@ static void sm501_2d_operation(SM501State *s) dst_pitch * (1 << format) / sizeof(uint32_t), 8 * (1 << format), 8 * (1 << format), 0, 0, dst_x, dst_y, width, height); - g_free(tmp); + if (free_buf) { + g_free(tmp); + } } else { pixman_blt((uint32_t *)&s->local_mem[src_base], (uint32_t *)&s->local_mem[dst_base], --=20 2.18.4 From nobody Wed May 15 14:16:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590669776; cv=none; d=zohomail.com; s=zohoarc; b=OHsIDSK8Zs/iHoaPgwv8Z1f249Qnecsu5aOBluLanuuhZQbP9jcc3djO0pRjoz62yUsno4txaFbiSJyTykYNCNErtr4YBPqKfjy4pGl4ViEGoZzPVz9b2WfQ+3LphUOthH2814Y9kWszs5fehB+1E65xbAU+HSmdMBSjQIyWgL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590669776; 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=qCserRm6LGGKnOhbm/aA4nJ9cIaPvBWaUlZ+xbYriKs=; b=D8gid/ImGMHI8FLfAk8KGtULRm+OLnEKOXQTB34QnyLWGiLVXdUodhXhyaSRlZA346WPs/K/AgqHIp4jO9eKj2AMqYYAiGC4YpUFuW0KbPV4eEMbHuMN71k5BS7yB5bHp8AY/221Q2KJkA4RrXGJMlz1jSdZhWtAVxmnATaFefQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590669776811307.054973456865; Thu, 28 May 2020 05:42:56 -0700 (PDT) Received: from localhost ([::1]:33966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHs7-0006cD-9Z for importer@patchew.org; Thu, 28 May 2020 08:42:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlu-0001fk-NX for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:30 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:50483 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlq-0005Be-Bm for qemu-devel@nongnu.org; Thu, 28 May 2020 08:36:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-ZDQLi1kENzqir-b0k2G2xg-1; Thu, 28 May 2020 08:36:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1845EC1A0; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45650A099A; Thu, 28 May 2020 12:36:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 24C2F9D73; Thu, 28 May 2020 14:36:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669385; 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=qCserRm6LGGKnOhbm/aA4nJ9cIaPvBWaUlZ+xbYriKs=; b=YUlMa7AlcKG6xNRecTbLgvsB8KNCZ+hVFp5VdokXpdIn5RlxqE+nO53ElU+dbn5XWy35y9 dsAu73+tO+IGZrmJKUrwmRe/Iv8Qbu5ipAFvtJz4ir7MKY4pC/ApvS5RRfvnn02Fmdu6nv n+xwb28qUC0b5QvUN1wiyb471IiqPY0= X-MC-Unique: ZDQLi1kENzqir-b0k2G2xg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 21/21] sm501: Remove obsolete changelog and todo comment Date: Thu, 28 May 2020 14:36:09 +0200 Message-Id: <20200528123609.27362-22-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 06:31:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: BALATON Zoltan Also update copyright year for latest changes Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 1392cad2ad1315a5a50409970e0af061821462e6.1590089984.git.balaton= @eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index e7a9f77de7bc..edd8d24a76c1 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -2,7 +2,7 @@ * QEMU SM501 Device * * Copyright (c) 2008 Shin-ichiro KAWASAKI - * Copyright (c) 2016 BALATON Zoltan + * Copyright (c) 2016-2020 BALATON Zoltan * * Permission is hereby granted, free of charge, to any person obtaining a= copy * of this software and associated documentation files (the "Software"), t= o deal @@ -40,23 +40,6 @@ #include "ui/pixel_ops.h" #include "qemu/bswap.h" =20 -/* - * Status: 2010/05/07 - * - Minimum implementation for Linux console : mmio regs and CRT layer. - * - 2D graphics acceleration partially supported : only fill rectangle. - * - * Status: 2016/12/04 - * - Misc fixes: endianness, hardware cursor - * - Panel support - * - * TODO: - * - Touch panel support - * - USB support - * - UART support - * - More 2D graphics engine support - * - Performance tuning - */ - /*#define DEBUG_SM501*/ /*#define DEBUG_BITBLT*/ =20 --=20 2.18.4