From patchwork Mon Mar 18 11:31:40 2024 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: 780914 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1377746wrs; Mon, 18 Mar 2024 04:33:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXvTbOiLG0l5Dzh+0AiTk28+u+BL0Qhu4L3YcjPQuee4QGUxu4jgrXrjvnUfZqWf8QHo36F+92wP5GqU3IQPOvj X-Google-Smtp-Source: AGHT+IEoHUv99l7qat29H2WQ7qQziUTiuZ3daU5dUzLp3faGH8ecry/n4b3QC92zbSVAhI1MVfsM X-Received: by 2002:ae9:c005:0:b0:788:4bfd:7be6 with SMTP id u5-20020ae9c005000000b007884bfd7be6mr12349729qkk.65.1710761615560; Mon, 18 Mar 2024 04:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710761615; cv=none; d=google.com; s=arc-20160816; b=l8j/wfzfKoeoMLlqEoQQqu2cEkxH0v16ahOSAjKs4PHHt2JASR6ypxna4ll2sNTDtM RppBfAfVNBhAskAxnhDriQa2XZ4PUdtYvKSPThmXZbS4cNT9GEhxPpfS+4SdiioGso2v 8gl/d1SVjXV1wKfkOKTBEgtP3tqPzm0Psp3qAKF8ska3FueLbWWuDiaDGcVN+tZMxFYl 3WBVAR6+x5YuyRBDoQe8tN71jD9OSPFgF2ijf9m2x4vmata+rQ1yrzcp4DStLofxglFX gYF4MlD/3BfhMT6DqcApVLvxRmQi/VtiyFGwCDpgBKKZ9sJoJ+4QAigN504cF/0BXLEp zgMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=awIh3lBTG+gHE0lcYbdt4h6RpA3aL2oraGQ+LIq+QwM=; fh=ZHIWNRx+rEvHyVsyvIT+SxJMVv6/ti8EiM9uHXaYuG4=; b=qFCzWOJ2a7GjXfJCUGOZkNIjg6caMfPhJ0gSRCS5ETdlZg5bmNTwT2mUOm96vPY5vg gofQxWUIfOaG/WBwO/gOw5slkHdlejUGZS0tp7BOMS1yPANMcpJ+KuVGba6eWFaDaEqN ZmLnrTehaK4F3QLyoEkuFbjxKyoJAgQIlysL0S33GEFArBV/RMjGDH0ucKC7Bm837yDY IeLUyzV/1+0KaDTEEnIqBetAcRkdvT5gj6u9Ki4zj6N/lIyFepazck7wx9AS7SPC6ips vlPtEbUQt3Vg61JeAyjtQsxvZSMJ77Hb5joXCvBSe3hufs1SupQKAwKvkzvAfXsfPUZk PzdA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t6abnBkU; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c28-20020a05620a201c00b00789e725e890si6155203qka.476.2024.03.18.04.33.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Mar 2024 04:33:35 -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=t6abnBkU; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Akihiko Odaki , qemu-arm@nongnu.org, =?utf-8?q?Mar?= =?utf-8?q?c-Andr=C3=A9_Lureau?= , Gerd Hoffmann , Peter Maydell , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Add the 'rotate_arcdegree' field to QemuGraphicConsole and remove the use of the 'graphic_rotate' global. Signed-off-by: Philippe Mathieu-Daudé 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" #include "console-priv.h" @@ -51,6 +50,8 @@ typedef struct QemuGraphicConsole { QEMUCursor *cursor; int cursor_x, cursor_y, cursor_on; + + unsigned rotate_arcdegree; } QemuGraphicConsole; typedef QemuConsoleClass QemuGraphicConsoleClass; @@ -210,17 +211,23 @@ void qemu_console_set_window_id(QemuConsole *con, int window_id) void qemu_console_set_rotate(QemuConsole *con, unsigned arcdegree) { - graphic_rotate = arcdegree; + QemuGraphicConsole *gc = QEMU_GRAPHIC_CONSOLE(con); + + gc->rotate_arcdegree = arcdegree; } bool qemu_console_is_rotated(QemuConsole *con) { - return graphic_rotate != 0; + QemuGraphicConsole *gc = QEMU_GRAPHIC_CONSOLE(con); + + return gc->rotate_arcdegree != 0; } unsigned qemu_console_get_rotate_arcdegree(QemuConsole *con) { - return graphic_rotate; + QemuGraphicConsole *gc = QEMU_GRAPHIC_CONSOLE(con); + + return gc->rotate_arcdegree; } void graphic_hw_invalidate(QemuConsole *con)