From nobody Tue Nov 26 20:04:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1705712038; cv=none; d=zohomail.com; s=zohoarc; b=bTfwGSLYIh4hG2XIQ8ib5VrHvm3XgKdeG3fJm+SQN3xLUVSonsIaINPTp97wMh3N3kKtwjHjugrx1IG+hajb065EXMxfyYZDch4+lxF9LvCE6z2Cl7SM387lHbl+q0pBmxDUNmLgVbo7BMgkiV2Bs3ra17aHGH2HJO5cguflWr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705712038; 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=En+NQ9P7CRsI0TkLfzyE1yf6nOfP/sy1xXmnXpF2MVc=; b=k30wCXPFEwt1HNSn4P0iyu9ZwsW48n5vxXH/W945nGRiK4emYCJ/TVGDYb6KABxaDMfvJsYvB/RB3VcymgbG4ylVmiizdt7fFcyz+1NLmY558FeShwh4RUPR9jLk7X3KjK1KAE2vx0pc67zbukM+lotx+/0ybQXHA3PzXKgbLv8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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 1705712038432464.2170372820732; Fri, 19 Jan 2024 16:53:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQzbe-0001rr-4z; Fri, 19 Jan 2024 19:53:06 -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 1rQzbb-0001rB-PE for qemu-devel@nongnu.org; Fri, 19 Jan 2024 19:53:03 -0500 Received: from mgamail.intel.com ([192.55.52.120]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQzba-0000HA-1R for qemu-devel@nongnu.org; Fri, 19 Jan 2024 19:53:03 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2024 16:52:52 -0800 Received: from vkasired-desk2.fm.intel.com ([10.105.128.132]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2024 16:52:52 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705711982; x=1737247982; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w6zsMuKR5+dos2BSIN9Npc/spxx3lltKpXTlvh/rSkg=; b=dyGbyXxfsN3GGJdRD7svG8LKuvZOXpeb1P7MEOfmyGzncU4LZjbrfJ+c eVvpDE2OxFkEmBGqkl5w1nup4eGlSR+5fjFpDyGLO6SFXZ9/AUuHLpXB8 mjqlopVcq0iIgoXpMJeeaXm73y5aX/+g6JC3+Dq+Tlx45N2LFvQ0F/dba mNp9TMSBBcCSIsEguRptoFuwldJW/evXb1C1H6vVhvyB8JHOMLgNNiE9r AOV5gVLJndu/SRuHe3yDvwOmYHl28dzjxxEmcjht50p7zEHKYVbQaWglY nq4Oo+Mx8A77icWz1O3rS5szbY59QBNNHJes/3M/IfZvPrQCOSX6EMUEJ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10957"; a="399763762" X-IronPort-AV: E=Sophos;i="6.05,206,1701158400"; d="scan'208";a="399763762" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10957"; a="904297445" X-IronPort-AV: E=Sophos;i="6.05,206,1701158400"; d="scan'208";a="904297445" From: Vivek Kasireddy To: qemu-devel@nongnu.org Cc: Vivek Kasireddy , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Frediano Ziglio , Dongwon Kim Subject: [PATCH v1 4/7] ui/console-gl: Add an option to override a surface's glformat Date: Fri, 19 Jan 2024 16:30:10 -0800 Message-Id: <20240120003013.1829757-5-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240120003013.1829757-1-vivek.kasireddy@intel.com> References: <20240120003013.1829757-1-vivek.kasireddy@intel.com> 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=192.55.52.120; envelope-from=vivek.kasireddy@intel.com; helo=mgamail.intel.com X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.519, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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 @intel.com) X-ZM-MESSAGEID: 1705712040324100003 In some cases where a UI component (e.g, Spice) needs to choose a particular glformat for a surface while creating a texture, this new GLenum provides an option to do so. One situation where this needs to be done is when the Host endianness is causing issues such as interchanged R and B channels. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Frediano Ziglio Cc: Dongwon Kim Signed-off-by: Vivek Kasireddy --- include/ui/surface.h | 1 + ui/console-gl.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/ui/surface.h b/include/ui/surface.h index 4244e0ca4a..a39fee55a2 100644 --- a/include/ui/surface.h +++ b/include/ui/surface.h @@ -20,6 +20,7 @@ typedef struct DisplaySurface { uint8_t flags; #ifdef CONFIG_OPENGL GLenum glformat; + GLenum target_glformat; GLenum gltype; GLuint texture; #endif diff --git a/ui/console-gl.c b/ui/console-gl.c index 103b954017..dee317f42c 100644 --- a/ui/console-gl.c +++ b/ui/console-gl.c @@ -72,6 +72,12 @@ void surface_gl_create_texture(QemuGLShader *gls, g_assert_not_reached(); } =20 + /* The caller wants to override the glformat in some specific cases */ + if (surface->target_glformat && + surface->target_glformat !=3D surface->glformat) { + surface->glformat =3D surface->target_glformat; + } + glGenTextures(1, &surface->texture); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, surface->texture); --=20 2.39.2