From nobody Sat May 11 06:27:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1710761545; cv=none; d=zohomail.com; s=zohoarc; b=DkNaFamDXRcgDLBFg60ti54Hm8C8HtSTMW9i6P/QlvfaumGa/obIR7if/+3fmMijMu7iOMjYCVKCAxsmAfhMBJVKkFS1g36QtrMCxaAaFUB4pevs4hsffXOW6aa36w4wm+PSKTLvNCRy2EqE8f4uAX1pAZmerZ0gPzJ4bSzubEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710761545; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CYjr201DlEJ4l0jHNZURE4npfEFxYjcehCBVscFCuRE=; b=TyzRPVVLUpNH/zTk77ATCx/IUllc57nB4avLd+VUPgewIxEtj1GjLB7XCvnZxl1IFNY1A/QqGIUu5MjiudgMBPPi+JPhwRDcMcVWfv2Ou+YMr3TI3PLdpEGxDhjdE/8XwrD1yxVxuAwoCKyKgV+SpEh16EYwRGVHpVZAYKLJMgs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710761545587258.6416009730211; Mon, 18 Mar 2024 04:32:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmBDe-00086b-Gi; Mon, 18 Mar 2024 07:31:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmBDc-000865-SG for qemu-devel@nongnu.org; Mon, 18 Mar 2024 07:31:52 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmBDb-00073e-61 for qemu-devel@nongnu.org; Mon, 18 Mar 2024 07:31:52 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33e672e10cfso2125108f8f.0 for ; Mon, 18 Mar 2024 04:31:50 -0700 (PDT) Received: from m1x-phil.lan (vit94-h02-176-184-29-165.dsl.sta.abo.bbox.fr. [176.184.29.165]) by smtp.gmail.com with ESMTPSA id bq24-20020a5d5a18000000b0033ed8643638sm6202549wrb.106.2024.03.18.04.31.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Mar 2024 04:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710761509; x=1711366309; 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=CYjr201DlEJ4l0jHNZURE4npfEFxYjcehCBVscFCuRE=; b=JqpNx0VCRlsxEdNDVGEWoRghM25n95vy7Q03+PhyY2LFAFSNm6x3Zppkv++hRQ4B/X BkcI6OrsbWsY3XMyt1uP9f82UK0PMTC8fm6k080K8qo8kTaXIUc+AaKw/29xzgt4U5df LMeLQnpwUVG15ts0sgCZVv8IbtOouX9lizCbJRj9QUHllQjmzPuBtGXxULIIGevPbxA8 AYPlB3BwucCLn33QR45C6uBXMCLxCxFBBKeYep1NFC4mmecy853gSUdA3nDqwSOPIeHV sI2lg/XB4KDxr9vF9s12e3WxP8xYYKTPcijmLhMAPT+VCa8RZNiO3XraKbS7pzTBRGnm mQZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710761509; x=1711366309; 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=CYjr201DlEJ4l0jHNZURE4npfEFxYjcehCBVscFCuRE=; b=OhZgMF18T6uOqbAgEy7QHpfR0IxSJb8Re6lGv+BdwOA+gD9StZBFsUCNql76KFs2/L zmdUhR11/tQ2BIy1bzJgqbqLB5V2rYiVX9BkdGZ44NJlRNXqaFt00qydBJYTTtp5MzO8 YJJWCIW8Kd+XEXfflObqi/xNy+N8kphUeKZ5F2LAELyPdpAbLY7DqVOoePXfQpV4Us5Y AkVJbI8Wm/wmSnHxqOXuoa79DYXdvrn2v/OipoeOTN08xcd2Wnvq/XVM0VXOWiVK7YVe CWhtNg9pppDOGnsC3puVSZppNJfW0z//80O2twudTXTNrEqJi05TZbwcEGZnH18mwwcS 7ACA== X-Gm-Message-State: AOJu0Yx2Y00qpv+V3SPZYKq44tHOPc5tRY+LDTGN5C7xaGXoXUWvG94i n0OZKoU+McsrvlIorPoH1v/gBIKtyFEKghPpGzoBJFZc8RA7k4KX/crmH+0TeC4wLUs9dmP3hJ5 k X-Google-Smtp-Source: AGHT+IG/2EVJ24DevrMPRBFPRiSgSpHflZeAlmL5yV5SZ1Aic73791HSZjxNeVl5k+ywBGIxfjwvOw== X-Received: by 2002:adf:ca88:0:b0:33e:6495:3273 with SMTP id r8-20020adfca88000000b0033e64953273mr8314765wrh.4.1710761509290; Mon, 18 Mar 2024 04:31:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Akihiko Odaki , qemu-arm@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 v2 1/3] ui/console: Introduce API to change console orientation Date: Mon, 18 Mar 2024 12:31:38 +0100 Message-ID: <20240318113140.88151-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240318113140.88151-1-philmd@linaro.org> References: <20240318113140.88151-1-philmd@linaro.org> MIME-Version: 1.0 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=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1710761547495100001 Extract the following methods: - qemu_console_set_rotate() - qemu_console_is_rotated() - qemu_console_get_rotate_arcdegree() Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki --- include/ui/console.h | 3 +++ ui/console.c | 16 ++++++++++++++++ ui/input.c | 9 ++++----- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index a4a49ffc64..86ba36e391 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -422,15 +422,18 @@ bool qemu_console_is_visible(QemuConsole *con); bool qemu_console_is_graphic(QemuConsole *con); bool qemu_console_is_fixedsize(QemuConsole *con); bool qemu_console_is_gl_blocked(QemuConsole *con); +bool qemu_console_is_rotated(QemuConsole *con); char *qemu_console_get_label(QemuConsole *con); int qemu_console_get_index(QemuConsole *con); uint32_t qemu_console_get_head(QemuConsole *con); int qemu_console_get_width(QemuConsole *con, int fallback); int qemu_console_get_height(QemuConsole *con, int fallback); +unsigned qemu_console_get_rotate_arcdegree(QemuConsole *con); /* Return the low-level window id for the console */ int qemu_console_get_window_id(QemuConsole *con); /* Set the low-level window id for the console */ void qemu_console_set_window_id(QemuConsole *con, int window_id); +void qemu_console_set_rotate(QemuConsole *con, unsigned arcdegree); =20 void console_select(unsigned int index); void qemu_console_resize(QemuConsole *con, int width, int height); diff --git a/ui/console.c b/ui/console.c index 832055675c..84aee76846 100644 --- a/ui/console.c +++ b/ui/console.c @@ -37,6 +37,7 @@ #include "trace.h" #include "exec/memory.h" #include "qom/object.h" +#include "sysemu/sysemu.h" =20 #include "console-priv.h" =20 @@ -207,6 +208,21 @@ void qemu_console_set_window_id(QemuConsole *con, int = window_id) con->window_id =3D window_id; } =20 +void qemu_console_set_rotate(QemuConsole *con, unsigned arcdegree) +{ + graphic_rotate =3D arcdegree; +} + +bool qemu_console_is_rotated(QemuConsole *con) +{ + return graphic_rotate !=3D 0; +} + +unsigned qemu_console_get_rotate_arcdegree(QemuConsole *con) +{ + return graphic_rotate; +} + void graphic_hw_invalidate(QemuConsole *con) { if (!con) { diff --git a/ui/input.c b/ui/input.c index dc745860f4..951806bf05 100644 --- a/ui/input.c +++ b/ui/input.c @@ -1,5 +1,4 @@ #include "qemu/osdep.h" -#include "sysemu/sysemu.h" #include "qapi/error.h" #include "qapi/qapi-commands-ui.h" #include "trace.h" @@ -179,10 +178,10 @@ static int qemu_input_transform_invert_abs_value(int = value) return (int64_t)INPUT_EVENT_ABS_MAX - value + INPUT_EVENT_ABS_MIN; } =20 -static void qemu_input_transform_abs_rotate(InputEvent *evt) +static void qemu_input_transform_abs_rotate(QemuConsole *src, InputEvent *= evt) { InputMoveEvent *move =3D evt->u.abs.data; - switch (graphic_rotate) { + switch (qemu_console_get_rotate_arcdegree(src)) { case 90: if (move->axis =3D=3D INPUT_AXIS_X) { move->axis =3D INPUT_AXIS_Y; @@ -341,8 +340,8 @@ void qemu_input_event_send_impl(QemuConsole *src, Input= Event *evt) qemu_input_event_trace(src, evt); =20 /* pre processing */ - if (graphic_rotate && (evt->type =3D=3D INPUT_EVENT_KIND_ABS)) { - qemu_input_transform_abs_rotate(evt); + if (qemu_console_is_rotated(src) && (evt->type =3D=3D INPUT_EVENT_KIND= _ABS)) { + qemu_input_transform_abs_rotate(src, evt); } =20 /* send event */ --=20 2.41.0 From nobody Sat May 11 06:27:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1710761586; cv=none; d=zohomail.com; s=zohoarc; b=kj00uIgUvk2cGJwmpn2esBLiSjWgbk7ILLIhk8weherbTpQ38LlY2uL0pxPa5uo/HMLTCH171UK2Zqx3zQFD2geY9l/Ep6D7YSYy2d3SkI2dqOWUIc0/9fBJnyRDSJDqOw5YcDi4iek+4120zXMlOdOr0Poedy7QYwIfDyP4EKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710761586; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SFthmmsYp+m5f9owLwx+hyTocTKSDvu4WqZSfWH+cu8=; b=PhQ7etc+T1Gz1V4I50pvpMoGLakytQgOGID5Xp+E0hUuWGXaS9gzFhbPW3T6oBBmP6+5kAmurADFJV9/rgt3bbIzW5L0fCTrRRmVn3+RPZhVKa8YxlAnZU5wq8szpp2C+OrUjxfEnMSDAJBXN6DdBdswQvtSKxfzNT0t0XPaLkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710761586980400.8856531617183; Mon, 18 Mar 2024 04:33:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmBDm-0008BF-MF; Mon, 18 Mar 2024 07:32:02 -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 1rmBDj-00087i-Cx for qemu-devel@nongnu.org; Mon, 18 Mar 2024 07:31:59 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmBDh-00077S-5Q for qemu-devel@nongnu.org; Mon, 18 Mar 2024 07:31:59 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-512ed314881so2887667e87.2 for ; Mon, 18 Mar 2024 04:31:56 -0700 (PDT) Received: from m1x-phil.lan (vit94-h02-176-184-29-165.dsl.sta.abo.bbox.fr. [176.184.29.165]) by smtp.gmail.com with ESMTPSA id m10-20020adffe4a000000b0033de10c9efcsm9536719wrs.114.2024.03.18.04.31.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Mar 2024 04:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710761515; x=1711366315; 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=SFthmmsYp+m5f9owLwx+hyTocTKSDvu4WqZSfWH+cu8=; b=M/kUTwkPeboXlUZublF5oMUWc/IoCL9w5+sb05yAxzdFHilC5Rs9LJdUHtkhHEgtgF 4nFtjgh6nTMEt9MkNO+pk2pyon4wFbzjyfyscx2r6syPJBZyflZ4Zm/sYaZI5k7J2mxF ARIvup7v1S+3OW8YYb+QfF+ac7ICmxPUoFP0mm0OwtIX5hLOB7rso+DkgBg0bgsx00GG QtdsLxyJD0s1B+h0UPSOAtBfv0FV2O+ES7KOveXk8shEzTr8MDiuBXnzobK0hfRiq14w giTbUOEL3cU8chozV/dzeYVRSx6HsDaTvJrEfWnclYmPjohciKKyDR6F+yHUHLr4BbAP nriA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710761515; x=1711366315; 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=SFthmmsYp+m5f9owLwx+hyTocTKSDvu4WqZSfWH+cu8=; b=nm7qQ1g7q47onP0VuvxqpEad+ZxOel5FqIEQAYCLYlxVju4CpjdXuf4/J7njF1SyND FZj4Z/6zCg9/WmFEDJfaknACD0RJySNCHuuB7UMJuT7o5WiihF9R3doq2rgiqL4hHObc JZNVdlkloLUomEXjZCyWDLik8KfECa877dZ4MiRJQridRuItEwrkV9tPtWcMQoPXFbtC tZo9BCTvrejamUVtu8BZXPIYQ18Lu1l5Fk5V/91vtyp+K9CRDPLVrxtZq2v6bfF6W6X5 u4NkMEfNvpCCbJZoOuwij37UjZkDYtBF8VfpX0hfLmoGao86TEYjhOzcRkQadc76LruS UOGw== X-Gm-Message-State: AOJu0Yww1szOdI0fKCVzhDxd4I3VXOnT1Q5bCLdaM2oG+0etek+33Wkk xs82PEjqhxIOD84FNLGG4n3Glpm4nR6by8vDIcfQqFr7mNf4rjLxnJuMiCW3udTqrGuf8QYYPAY z X-Google-Smtp-Source: AGHT+IFCHrUdNk0CpDc5uSQe3U4CVEm1dq2RK69dI4IRZK1XR3oim8G9ZRVa41AMLZhKA0VoYJmNWw== X-Received: by 2002:a05:6512:2205:b0:513:e7ff:15b8 with SMTP id h5-20020a056512220500b00513e7ff15b8mr2758956lfu.51.1710761515074; Mon, 18 Mar 2024 04:31:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Akihiko Odaki , qemu-arm@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 v2 2/3] hw/display/pxa2xx_lcd: Set rotation angle using qemu_console_set_rotate Date: Mon, 18 Mar 2024 12:31:39 +0100 Message-ID: <20240318113140.88151-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240318113140.88151-1-philmd@linaro.org> References: <20240318113140.88151-1-philmd@linaro.org> MIME-Version: 1.0 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=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1710761587514100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki --- hw/display/pxa2xx_lcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index a9d0d981a0..7d03fa57d0 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -1439,6 +1439,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem, memory_region_add_subregion(sysmem, base, &s->iomem); =20 s->con =3D graphic_console_init(NULL, 0, &pxa2xx_ops, s); + qemu_console_set_rotate(s->con, graphic_rotate); =20 vmstate_register(NULL, 0, &vmstate_pxa2xx_lcdc, s); =20 --=20 2.41.0 From nobody Sat May 11 06:27:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1710761615; cv=none; d=zohomail.com; s=zohoarc; b=dG0sTDOtExL/OW7ZRaiC/GVBWCwEehGFB1ytUNRj98/hcyllgHZWnwR1BaLBr9SEj/CWw4vLqPuIAUxNIyWj2PrdE8FWaSt4Vdsjqb83m4KU+koGBpDuYSlSCak7Tq5D8uBqksrE0r+hhQtsJGyxqi8ENkRiilfGLjsdit4MeiI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710761615; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=awIh3lBTG+gHE0lcYbdt4h6RpA3aL2oraGQ+LIq+QwM=; b=fn1Ar8gVTDkg07ZuwMrggBqBe5l1g+qqbVB1oYaeZCQ7eEAS4KInhzaiEMd7/faUodSOtjA6hn0PKKHZD4oC+0XF+7dc0d+XiaLiR0XRwOmzGTsRMqrfGLKdM0K9xAjv48mCun30NWHcgQp5E/EYDP0BAgdZap1geUwMiwtl/Yk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710761615859824.8083791685849; Mon, 18 Mar 2024 04:33:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmBDs-0008GH-92; Mon, 18 Mar 2024 07:32: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 1rmBDp-0008F4-Ae for qemu-devel@nongnu.org; Mon, 18 Mar 2024 07:32:05 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmBDm-000783-LD for qemu-devel@nongnu.org; Mon, 18 Mar 2024 07:32:05 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4140eb3aeb9so7320575e9.3 for ; Mon, 18 Mar 2024 04:32:02 -0700 (PDT) Received: from m1x-phil.lan (vit94-h02-176-184-29-165.dsl.sta.abo.bbox.fr. [176.184.29.165]) by smtp.gmail.com with ESMTPSA id y10-20020a5d4aca000000b0033e03d37685sm9617334wrs.55.2024.03.18.04.31.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Mar 2024 04:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710761520; x=1711366320; 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=awIh3lBTG+gHE0lcYbdt4h6RpA3aL2oraGQ+LIq+QwM=; b=t6abnBkU2XUWkGK6POZGY+MO2BQ8GqPy+hx7OVZfjAC0kQNJCFXLmqz0nlhL//8otC XVzdFxDO50LZCyHfZLeOXwTwz3NcBfHLhK5KtsxxjmjmPX2z4miJyYcCfFzqx8sKhawy V5gduQN5/+FpaMjB1qAVBUEpYKb9D2/c/q0su/C3GQOIPNIvGICUBd5bif8Uffy69w3u N1PNxlch6v8Ns0kgr6Ih7PWther1bQdc5VToG7piQ1V4uWgA2WYJwtz9KCk/ENObCjso D/QPNf6kDFaMKMp2CcNPxBL0+FuHVcOHlltrtpMnk691vWALI67vl3vhxVbEUF+swwk4 g95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710761520; x=1711366320; 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=awIh3lBTG+gHE0lcYbdt4h6RpA3aL2oraGQ+LIq+QwM=; b=q9prbPnbNR14SBnB09v8pEAd0Hf/tKUemVuQiUcOVJWLeHiB4JxxlU/sleKpCyf3lH fG5OZNGo5TEcYqFe8Ib7oXyT1k2hppkTrWcUSCLEwzZXayZ4iEtgamIrNry5zORazlR1 sf6CjeCreUdZW8s24MJiBJ3h6n+avILWi7x/Q5/AaeoAMN27jvr7XOzQZxd0QZDaBfRw xL7DUzglediPbtP1ICxQXl2Q8BX79txcbs5SRW+O+xGCtw9Xd65Zvc4QqLRW+PQD+R+u cdRTb2KjuCourycGkmxvnT+NBp8FV6StO4LwWSGcxMFR7Z5TDr0vjADn+YyHPkSdkuuW Vypw== X-Gm-Message-State: AOJu0YzH8zM8GS4/rxVP24q+Wz/ML+kQydbbRMvN59le9/PMA4zx6NQp 7Lpa1q3IHxqNG2M2ninn6fF4DNZA2Q6oqXSPFWx4z9LKGWHVQGwQLGn7/qO9R2xnkmOM4TA661X 3 X-Google-Smtp-Source: AGHT+IFBv/J5i4OUDpYrV9YnY22ZnLpSkvv5jZxo8t6ebFFJX+TXkbUcPArGKgCh7aMLaxZtd4uUJw== X-Received: by 2002:a05:6000:18ce:b0:341:715e:36d6 with SMTP id w14-20020a05600018ce00b00341715e36d6mr2144217wrq.34.1710761520731; Mon, 18 Mar 2024 04:32:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Akihiko Odaki , qemu-arm@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 v2 3/3] ui/console: Add 'rotate_arcdegree' field to allow per-console rotation Date: Mon, 18 Mar 2024 12:31:40 +0100 Message-ID: <20240318113140.88151-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240318113140.88151-1-philmd@linaro.org> References: <20240318113140.88151-1-philmd@linaro.org> MIME-Version: 1.0 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=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1710761617624100001 Add the 'rotate_arcdegree' field to QemuGraphicConsole and remove the use of the 'graphic_rotate' global. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki --- ui/console.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ui/console.c b/ui/console.c index 84aee76846..94624c37ae 100644 --- a/ui/console.c +++ b/ui/console.c @@ -37,7 +37,6 @@ #include "trace.h" #include "exec/memory.h" #include "qom/object.h" -#include "sysemu/sysemu.h" =20 #include "console-priv.h" =20 @@ -51,6 +50,8 @@ typedef struct QemuGraphicConsole { =20 QEMUCursor *cursor; int cursor_x, cursor_y, cursor_on; + + unsigned rotate_arcdegree; } QemuGraphicConsole; =20 typedef QemuConsoleClass QemuGraphicConsoleClass; @@ -210,17 +211,23 @@ void qemu_console_set_window_id(QemuConsole *con, int= window_id) =20 void qemu_console_set_rotate(QemuConsole *con, unsigned arcdegree) { - graphic_rotate =3D arcdegree; + QemuGraphicConsole *gc =3D QEMU_GRAPHIC_CONSOLE(con); + + gc->rotate_arcdegree =3D arcdegree; } =20 bool qemu_console_is_rotated(QemuConsole *con) { - return graphic_rotate !=3D 0; + QemuGraphicConsole *gc =3D QEMU_GRAPHIC_CONSOLE(con); + + return gc->rotate_arcdegree !=3D 0; } =20 unsigned qemu_console_get_rotate_arcdegree(QemuConsole *con) { - return graphic_rotate; + QemuGraphicConsole *gc =3D QEMU_GRAPHIC_CONSOLE(con); + + return gc->rotate_arcdegree; } =20 void graphic_hw_invalidate(QemuConsole *con) --=20 2.41.0