From patchwork Thu May 1 23:01:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 886455 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp547903wrq; Thu, 1 May 2025 16:02:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW6ScdarYPk1W3kCQhs36Q1K7Lt819zQNLfQmlDBBpL6Zu0Rv2KwNjFGLpzej5vJrgpltWE2w==@linaro.org X-Google-Smtp-Source: AGHT+IGg6LiRcWhhABNA7lF/LZZgUIHudOU2E1Y8o98+0dcJvXJf8PfydzFd51IaRautzr/155WW X-Received: by 2002:a05:620a:410c:b0:7c5:467f:d131 with SMTP id af79cd13be357-7cad5b8ce80mr145809385a.36.1746140542126; Thu, 01 May 2025 16:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746140542; cv=none; d=google.com; s=arc-20240605; b=I2mPPlWDgih6I2s559zHOmOHsNRDQF+r8k3DrW5RRyLC75ZbtGfklFdoU3EQ09ioA4 EC9Vgl+J8FY5Y7y46fYHJLufG8dZe1tu8VM4zCU6LzK6mZy9PYQ2ddFQBdojbiAWdmwV PiSgdV6B3maLQ03HGLJ5GGQicKXPeC5FYdbhiNC1GnkWmbj0xY/n5zWC8FYip6nv9aSY 30KISldYtMPLH212LRIbQY2QLyTFkp1ANRpdfxmDJoBFZe7oQqpoPkI87Yv7bbLUXf17 IhSbfZR/YUWywCP4gwq1AnhzdildRW1khzxRTOcD6PawkLjzf0Mk2T6pzRPj87yWMOtl t9wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F6iyIP6KaylLefLyBXHs1NcGKwBb7ZXW8SZqY1Ujxgs=; fh=Je0Fu6WOva9CO7x05EmtzN8739OQv5Rr57VCUmCpFeg=; b=GcNvWQNFoB5TAb3UfB093K506Fp83Ad0bz7JDk/8GXp+vg7HVKji5nNaJCMWAZu/8j PQ+XcZEHmkiiPL/aSTAQ2xei6t6qAtIsPlmO7/jrdL9hSp4qVpWImeNmRePG9t1TScDI ZgZjlRnfGQd5GPKpz/2ZmWJiEyyB73zWkymqjQZSCE/KBuO9RFi7gmG/suJ9ia0JlWtd twntz8JEDUOByZTUglpQ0sYrKbMSngSpyNxzr5t6ebEcPkN3f9+iiv+tvdFqNTv/uYH5 JZcWP/Xt4wGIBkgYtXcom3y36DmRJzYulCmbKZBmSMXlUXEK9JX0BLlNSbYTQwWlaSrw TWsQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NqJtI6WP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cad241bd3dsi171833485a.244.2025.05.01.16.02.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 May 2025 16:02:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NqJtI6WP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uAcut-0008UQ-UY; Thu, 01 May 2025 19:02:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uAcuq-0008TI-J8 for qemu-devel@nongnu.org; Thu, 01 May 2025 19:02:04 -0400 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uAcuo-0002En-Du for qemu-devel@nongnu.org; Thu, 01 May 2025 19:02:04 -0400 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-3d8020ba858so16405765ab.0 for ; Thu, 01 May 2025 16:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746140521; x=1746745321; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F6iyIP6KaylLefLyBXHs1NcGKwBb7ZXW8SZqY1Ujxgs=; b=NqJtI6WPG61O0gHWSJlB+iHHyqUvyVR1ZkW25/cY/hnNLjfXnHD7N/6j8anyiSuaFU YuZZ8n0SewUFinmyUu2MZIny4hcJoy0YeKiUBeRMLv1f1JZOjhfED1l9GC+qzP1mY0Jn IlYvoqtsCI4u6akvV1jgyqXxKZUOZ7Xn2jjxqkuVilfMZu693BPsai1G3BgMNhS7iT+q KUqQ+sXvqGtwo7/IS4cQP4LtPQ+3zLGAS+WzziMFjSC3RIRubiYA1PEm++fyp7pH3DXf O48JkvK9N26G73d1ngQQsNXNGeyN588B7ne0MD6eGHpGHPi8vzUt0+o+7Bn9c2cK9fKO Ef9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746140521; x=1746745321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F6iyIP6KaylLefLyBXHs1NcGKwBb7ZXW8SZqY1Ujxgs=; b=AXVvJws6G/jrNXwq/pOkKPG9PrDThN/ckG8Ega85Rc5SOBUwpg55TE2XXglaZ75wKd Qw83O7ZMu3xLC5tGBt//lTZbxn0ywoiQi3rb0jfR0NCR3wh76iGXjPrbHXitozKJpypk TG7mVEGB8EsLrGaALb6jTM4YaGp+Uxm18U9fEMNADzz0s4cOBif5aplHYqfzSz/76zMZ LjH4g4nbWpQ46oucjtLMuyDkNqn8k555BTjkQg4pR2dV5HlEszG4+4xwHgQFojromzyl zNaVnZ3nkgTGxNDSN0dT+9+3OczQZQU2HUVJPfU0ZkCmPpaI4Pg4xhrkFY126J7I42f5 f3Lg== X-Gm-Message-State: AOJu0Yym4kcqd3pUzA01dj035KOd4TkxhY8N1eBvTf8CxBJvxywnzpQX 35In0Wuthe+9n3liUrFs/hLkWuSGClmc2uW+RG8//kHyWIIWOfgQ2u6pngbIv/QuzE/cJkjrYOt P X-Gm-Gg: ASbGncvMRM+B5J8VtTPlshn6gyQrxxal16PkbKG612m0/N12lEW84Aa8gxhpbkqm8VB 3yBbcFavKWgGiG1HzdUS2WiLkKWAi3kjHD/0ywwxg+qVM/WXMczJ9mhDmUsFeWnhzpm6glbK/H+ NHzu88Adf7L0uvvkbbK7a+D0L73LwvHk4AdZN7sprCk4TiFnHdLnDfhRX8hDH7we0CESDnj28p+ /Yxh6b992Cw+SOWx3T9NL9BIpTvyIbsijLhxdRGmcWAenyYNng2fclv9djrf+0qCJdfhNAkB0W8 J4QV/hxAYcYVUxmbo7HJeNDbT6JphVBF44E8wMn6OpmUhlCmCNFir++2uKcbyuVzoeywfc+b2uC onidy8BAqwzfYcV38/Wqo X-Received: by 2002:a05:6e02:1a8f:b0:3d8:1d7c:e192 with SMTP id e9e14a558f8ab-3d97c196082mr10106525ab.7.1746140520957; Thu, 01 May 2025 16:02:00 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4f88aac7e1asm87042173.135.2025.05.01.16.01.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 May 2025 16:02:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yanan Wang , Paolo Bonzini , Gerd Hoffmann , Thomas Huth , Halil Pasic , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , qemu-rust@nongnu.org, Zhao Liu , Eric Farman , Ilya Leoshkevich , Eduardo Habkost , Jason Wang , David Hildenbrand , Dmitry Fleytman , Richard Henderson , "Michael S. Tsirkin" , qemu-s390x@nongnu.org, Christian Borntraeger Subject: [PATCH 03/10] hw/input/virtio-input: Remove VirtIOInputHID::wheel_axis field Date: Fri, 2 May 2025 01:01:21 +0200 Message-ID: <20250501230129.2596-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250501230129.2596-1-philmd@linaro.org> References: <20250501230129.2596-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-il1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The VirtIOInputHID::wheel_axis boolean was only set in the hw_compat_2_10[] array, via the 'wheel-axis=false' property. We removed all machines using that array, lets remove that property and all the code around it. There is only one virtio_input_config[] version for each device, rename it removing the '_v2' suffix. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/virtio/virtio-input.h | 1 - hw/input/virtio-input-hid.c | 102 ++----------------------------- 2 files changed, 5 insertions(+), 98 deletions(-) diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h index e097b0b5217..1e94f8a03db 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -89,7 +89,6 @@ struct VirtIOInputHID { const QemuInputHandler *handler; QemuInputHandlerState *hs; int ledstate; - bool wheel_axis; }; struct VirtIOInputHost { diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index d986c3c16e3..a89a5b10c63 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -81,7 +81,6 @@ static void virtio_input_extend_config(VirtIOInput *vinput, static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src, InputEvent *evt) { - VirtIOInputHID *vhid = VIRTIO_INPUT_HID(dev); VirtIOInput *vinput = VIRTIO_INPUT(dev); virtio_input_event event; int qcode; @@ -109,8 +108,7 @@ static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src, break; case INPUT_EVENT_KIND_BTN: btn = evt->u.btn.data; - if (vhid->wheel_axis && - (btn->button == INPUT_BUTTON_WHEEL_UP || + if ((btn->button == INPUT_BUTTON_WHEEL_UP || btn->button == INPUT_BUTTON_WHEEL_DOWN) && btn->down) { event.type = cpu_to_le16(EV_REL); @@ -328,32 +326,7 @@ static const QemuInputHandler virtio_mouse_handler = { .sync = virtio_input_handle_sync, }; -static struct virtio_input_config virtio_mouse_config_v1[] = { - { - .select = VIRTIO_INPUT_CFG_ID_NAME, - .size = sizeof(VIRTIO_ID_NAME_MOUSE), - .u.string = VIRTIO_ID_NAME_MOUSE, - },{ - .select = VIRTIO_INPUT_CFG_ID_DEVIDS, - .size = sizeof(struct virtio_input_devids), - .u.ids = { - .bustype = const_le16(BUS_VIRTUAL), - .vendor = const_le16(0x0627), /* same we use for usb hid devices */ - .product = const_le16(0x0002), - .version = const_le16(0x0001), - }, - },{ - .select = VIRTIO_INPUT_CFG_EV_BITS, - .subsel = EV_REL, - .size = 1, - .u.bitmap = { - (1 << REL_X) | (1 << REL_Y), - }, - }, - { /* end of list */ }, -}; - -static struct virtio_input_config virtio_mouse_config_v2[] = { +static struct virtio_input_config virtio_mouse_config[] = { { .select = VIRTIO_INPUT_CFG_ID_NAME, .size = sizeof(VIRTIO_ID_NAME_MOUSE), @@ -379,26 +352,13 @@ static struct virtio_input_config virtio_mouse_config_v2[] = { { /* end of list */ }, }; -static const Property virtio_mouse_properties[] = { - DEFINE_PROP_BOOL("wheel-axis", VirtIOInputHID, wheel_axis, true), -}; - -static void virtio_mouse_class_init(ObjectClass *klass, const void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - - device_class_set_props(dc, virtio_mouse_properties); -} - static void virtio_mouse_init(Object *obj) { VirtIOInputHID *vhid = VIRTIO_INPUT_HID(obj); VirtIOInput *vinput = VIRTIO_INPUT(obj); vhid->handler = &virtio_mouse_handler; - virtio_input_init_config(vinput, vhid->wheel_axis - ? virtio_mouse_config_v2 - : virtio_mouse_config_v1); + virtio_input_init_config(vinput, virtio_mouse_config); virtio_input_extend_config(vinput, keymap_button, ARRAY_SIZE(keymap_button), VIRTIO_INPUT_CFG_EV_BITS, EV_KEY); @@ -409,7 +369,6 @@ static const TypeInfo virtio_mouse_info = { .parent = TYPE_VIRTIO_INPUT_HID, .instance_size = sizeof(VirtIOInputHID), .instance_init = virtio_mouse_init, - .class_init = virtio_mouse_class_init, }; /* ----------------------------------------------------------------- */ @@ -421,44 +380,7 @@ static const QemuInputHandler virtio_tablet_handler = { .sync = virtio_input_handle_sync, }; -static struct virtio_input_config virtio_tablet_config_v1[] = { - { - .select = VIRTIO_INPUT_CFG_ID_NAME, - .size = sizeof(VIRTIO_ID_NAME_TABLET), - .u.string = VIRTIO_ID_NAME_TABLET, - },{ - .select = VIRTIO_INPUT_CFG_ID_DEVIDS, - .size = sizeof(struct virtio_input_devids), - .u.ids = { - .bustype = const_le16(BUS_VIRTUAL), - .vendor = const_le16(0x0627), /* same we use for usb hid devices */ - .product = const_le16(0x0003), - .version = const_le16(0x0001), - }, - },{ - .select = VIRTIO_INPUT_CFG_EV_BITS, - .subsel = EV_ABS, - .size = 1, - .u.bitmap = { - (1 << ABS_X) | (1 << ABS_Y), - }, - },{ - .select = VIRTIO_INPUT_CFG_ABS_INFO, - .subsel = ABS_X, - .size = sizeof(virtio_input_absinfo), - .u.abs.min = const_le32(INPUT_EVENT_ABS_MIN), - .u.abs.max = const_le32(INPUT_EVENT_ABS_MAX), - },{ - .select = VIRTIO_INPUT_CFG_ABS_INFO, - .subsel = ABS_Y, - .size = sizeof(virtio_input_absinfo), - .u.abs.min = const_le32(INPUT_EVENT_ABS_MIN), - .u.abs.max = const_le32(INPUT_EVENT_ABS_MAX), - }, - { /* end of list */ }, -}; - -static struct virtio_input_config virtio_tablet_config_v2[] = { +static struct virtio_input_config virtio_tablet_config[] = { { .select = VIRTIO_INPUT_CFG_ID_NAME, .size = sizeof(VIRTIO_ID_NAME_TABLET), @@ -503,26 +425,13 @@ static struct virtio_input_config virtio_tablet_config_v2[] = { { /* end of list */ }, }; -static const Property virtio_tablet_properties[] = { - DEFINE_PROP_BOOL("wheel-axis", VirtIOInputHID, wheel_axis, true), -}; - -static void virtio_tablet_class_init(ObjectClass *klass, const void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - - device_class_set_props(dc, virtio_tablet_properties); -} - static void virtio_tablet_init(Object *obj) { VirtIOInputHID *vhid = VIRTIO_INPUT_HID(obj); VirtIOInput *vinput = VIRTIO_INPUT(obj); vhid->handler = &virtio_tablet_handler; - virtio_input_init_config(vinput, vhid->wheel_axis - ? virtio_tablet_config_v2 - : virtio_tablet_config_v1); + virtio_input_init_config(vinput, virtio_tablet_config); virtio_input_extend_config(vinput, keymap_button, ARRAY_SIZE(keymap_button), VIRTIO_INPUT_CFG_EV_BITS, EV_KEY); @@ -533,7 +442,6 @@ static const TypeInfo virtio_tablet_info = { .parent = TYPE_VIRTIO_INPUT_HID, .instance_size = sizeof(VirtIOInputHID), .instance_init = virtio_tablet_init, - .class_init = virtio_tablet_class_init, }; /* ----------------------------------------------------------------- */