From patchwork Thu Nov 21 13:09:39 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: 844673 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:8b:b0:382:43a8:7b94 with SMTP id m11csp2251429wrx; Thu, 21 Nov 2024 05:10:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXUmWEps3zANjvj8jCLBqoryi53XmALXQL65W+FaQ1WEMvpTgFAWX4Zeq8Bwt5GeXZNR48bSg==@linaro.org X-Google-Smtp-Source: AGHT+IGWPJzjSbl58ncyDPLmQAvqTAzf2363wpd26cHBmwY0B6nPaO2gU1EappPqzNGfXbgborsT X-Received: by 2002:a05:620a:370b:b0:7af:cb6b:b4fb with SMTP id af79cd13be357-7b42eec2e33mr840565785a.52.1732194618326; Thu, 21 Nov 2024 05:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732194618; cv=none; d=google.com; s=arc-20240605; b=cZP8LfWgM8XT6aUhbs3cz/cBcenvHraLdS9/i63WFG8ujP28gq+WmWi5zpbvfU+5PC 7vqrhK0mBWQMH4z/qZDD6Xvw4kyVvD5kVU/dBGrv6UdqM9b1EnhwnfjsRU5ytJUZT+O/ TUfhndXPVBkyGxVWXhm0Qv9TVGqMLEZ+bJrL9yp8ZqNYzKcyIXBD48dQLqTf/rocjEzB B/HNHAaB4NFCJCeWlp9/yEhgk4Q09sd7ROYc2CzpKwYbaFFQJvlRHpzIF1NqO7mLWP/f BU6c4Y+8LqLgunD3FcBtlEPuMWBE9L4aBM9yELNAsgR5uXTw0ouGwzm8ajCenQUpFhQZ pzZQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=lVqSf6tRgP2wjiZ5qyh5pJyYLA55IGXtorUGMNDvwL4=; fh=acojT/7iXtgkNOR/S3SKxQd/zh/HkUBwUPBbLrIacyY=; b=k5NXPkR0LXsbm+81c4aSsgPy11ou6KLPIzVoUOWhtx4fCTwtiKE2qdFqU7r0uq42+b WAvVjZrrZG2GoyBfrFs255R2ZQaBJOGsevhe12Lx5VzA1xjXGmk4vNZ11Me5cSyvHDKQ 8tHVApO0qCVseBi6kuacSIdMERQXX0KG3+auBJEECm3/w/u6a+q8AuV0NPG238Gu6mfv l+GXC0SX3LrLzDxBOhhOQ1pUjAXVojM5f25z4lB+NKuVETE8BdNqlUWnDXtlS40rND/c Ybu9u1ogopPyxECbJi5uvpHrtp2s1Yb2J1/99x4W4E+0FIUrpgzZ3i6+PgjByfEeJ0kf ZEXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQ2Qcczs; 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 6a1803df08f44-6d438159a35si41033566d6.457.2024.11.21.05.10.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Nov 2024 05:10:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQ2Qcczs; 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 1tE6wX-0001g1-Vt; Thu, 21 Nov 2024 08:09:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tE6wM-0001fD-Bj for qemu-devel@nongnu.org; Thu, 21 Nov 2024 08:09:46 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tE6wK-0003kw-NH for qemu-devel@nongnu.org; Thu, 21 Nov 2024 08:09:46 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43169902057so7372175e9.0 for ; Thu, 21 Nov 2024 05:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732194582; x=1732799382; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lVqSf6tRgP2wjiZ5qyh5pJyYLA55IGXtorUGMNDvwL4=; b=nQ2QcczsfkNu2mkhMNrYMrC4qLoHUbK/5RNovYEM/oTDT1n4KwYUUZoKxGXDkWzAln lqXGwvEulmpnTQbdWd9Oz8YJW0K6E6Tt43zNcy3RiVyosTIJsN1Eml8RIqRsNcIrJtZi PWyBjfMGeOoUgqXqdDbZBNgDvpo5IRvuYpdmMGuEou1seMxwI1yf08LierVgx+4DQEyD oAZ6pQDSQ1A6nHGpF4fFxlZvg8eRoqLfRqMqr3Kg1sH/tDkk5VFcQ7LSx1bTeF4tNEit 5XjC0Pbp1CSLXCqcQ/R3Xolvu62DarHneCMDdzHLWT1K7pVgkz6CYpWsSAXAYX87TFf4 Itbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732194582; x=1732799382; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lVqSf6tRgP2wjiZ5qyh5pJyYLA55IGXtorUGMNDvwL4=; b=Eo1bbvyZ9cBoOxguBZU1FNQ7lvFc3qD9hSs2/DQhyAMRPu757Un29vEx0dwDyKApLA e9alBN4OAIue8mK3mc2PVVu9wmEk3fFzLdoSJLL8CBzPqdfYjv/ivLtdhW+72gWZCANb ca1qp781Un2VkzBoYn+GpxRPjMVtESUkV9xV+b4H9gSNi4UQNkegDvc7Pp28tFMDk4zd dKntI+9/c7e94WeV4Ugmq2VyDlukhI0oq5CHw5cuCLqiaNGa7PJJ7Fr9MhGO5JBp2LyW PDkGa4KyEaZv11j+pLwd6k4jp7rF498oEjbdo7q2/cgY5o90HCLmpEt7wSIcBSQeOlHN Z4QA== X-Gm-Message-State: AOJu0Yw8xw4LcwlhxDmMw+B50hUzh2w8ChGQ8N4zGeZnlzur+sJj9gEj qfmdkCXwKctVDX6SShjtkIg95pRDrZAJnuTSEEmfGcBq1gwwV7081JXS9yvW42w6jvPCZ4/EWX3 D X-Received: by 2002:a05:600c:34cf:b0:431:5a93:4e3c with SMTP id 5b1f17b1804b1-433489d4d84mr63821425e9.16.1732194582407; Thu, 21 Nov 2024 05:09:42 -0800 (PST) Received: from localhost.localdomain ([176.187.204.90]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b45d1aedsm54376575e9.1.2024.11.21.05.09.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 21 Nov 2024 05:09:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Volker_R=C3=BCmelin?= , Phil Dennis-Jordan , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [RFC PATCH] ui/gtk: ??? Remove dead code around X11 ??? Date: Thu, 21 Nov 2024 14:09:39 +0100 Message-ID: <20241121130939.97212-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 I have no clue about what this code does, but gtk_widget_set_double_buffered() is deprecated since GTK 3.14 and we require 3.22 since more than 4 years, commit 7b23d121f9 ("ui: increase min required GTK version to 3.22.0"). Assert gtk_use_gl_area is set and remove the dead code. Signed-off-by: Philippe Mathieu-Daudé --- ui/gtk.c | 46 +++++++++------------------------------------- 1 file changed, 9 insertions(+), 37 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index bf9d3dd679..d968cf3de1 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -809,17 +809,9 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque) #if defined(CONFIG_OPENGL) if (vc->gfx.gls) { - if (gtk_use_gl_area) { - /* invoke render callback please */ - return FALSE; - } else { -#ifdef CONFIG_X11 - gd_egl_draw(vc); - return TRUE; -#else - abort(); -#endif - } + assert(gtk_use_gl_area); + /* invoke render callback please */ + return FALSE; } #endif @@ -2156,32 +2148,12 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, #if defined(CONFIG_OPENGL) if (display_opengl) { - if (gtk_use_gl_area) { - vc->gfx.drawing_area = gtk_gl_area_new(); - g_signal_connect(vc->gfx.drawing_area, "realize", - G_CALLBACK(gl_area_realize), vc); - vc->gfx.dcl.ops = &dcl_gl_area_ops; - vc->gfx.dgc.ops = &gl_area_ctx_ops; - } else { -#ifdef CONFIG_X11 - vc->gfx.drawing_area = gtk_drawing_area_new(); - /* - * gtk_widget_set_double_buffered() was deprecated in 3.14. - * It is required for opengl rendering on X11 though. A - * proper replacement (native opengl support) is only - * available in 3.16+. Silence the warning if possible. - */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE); -#pragma GCC diagnostic pop - vc->gfx.dcl.ops = &dcl_egl_ops; - vc->gfx.dgc.ops = &egl_ctx_ops; - vc->gfx.has_dmabuf = qemu_egl_has_dmabuf(); -#else - abort(); -#endif - } + assert(gtk_use_gl_area); + vc->gfx.drawing_area = gtk_gl_area_new(); + g_signal_connect(vc->gfx.drawing_area, "realize", + G_CALLBACK(gl_area_realize), vc); + vc->gfx.dcl.ops = &dcl_gl_area_ops; + vc->gfx.dgc.ops = &gl_area_ctx_ops; } else #endif {