From nobody Tue Nov 26 19:56:52 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=1705712021; cv=none; d=zohomail.com; s=zohoarc; b=ULmLF3iNMjdCBG09T35rpfKzzQIUytKjUIX5MyYmDDsEEYJPhCYzdG7scuJsae4/1VzE1JZcuczFshfApDy6G8zRsDcAaFNtRgICSfQsQHm4okuhVDm9ZbNTw/Nk5tXyuQCKOEbRoS6PuXdg5oLr/A9Vxu5xDLp64ZC959XBkOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705712021; 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=Omt1pKTbizm61Z/51d53xq8np4tAndYOcQcnKdYWJG8=; b=FV9e6UIOiZfXHf30fgifXsRME75FdeDfGutiYZBIPXvFRjahbL2qT++zGX/lcXS0xk7q2N0A6SVGmOlig8tB/5n27/GAmJ0OBHGlBZfwBz3MPdb/iRlYd5RGqnfbw8VMz55qm4Y0BjArx5I6V+ph5j9cE6OGmInOq41NuRHv6tM= 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 1705712021909616.7996883692341; Fri, 19 Jan 2024 16:53:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQzbb-0001rE-Sj; Fri, 19 Jan 2024 19:53:03 -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 1rQzbZ-0001qh-MB for qemu-devel@nongnu.org; Fri, 19 Jan 2024 19:53:02 -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 1rQzbX-0000HA-SX for qemu-devel@nongnu.org; Fri, 19 Jan 2024 19:53:01 -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=1705711979; x=1737247979; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VhMoDg2Dfnr8VM+IjInSXHA29VWyPI/mwx53F/p9aJY=; b=hM1TerbUVWkZDHdAyba3nD5IA2j3dHSVEvKOaDTqqFn5zAHzHrRu+pSb yJlaZJmva/Vb2jv53t2/gk4VXmoyDZ3F5JzfJiltShAPr+KPORw1lqAw8 hNwaitC1BnCHGn8jvyKYkTtXJpffmoTcbzvDr6beBabrtI4xMrbE3L1oS vdaSFtF+YAm24bgEVqR4NnJ/5v9DGFcHJNpUcLb6kt7/ULGPZnFgQeT8K zjbVa4IIZTcm3f/fzkKCPrgL7Xkn85uUWqoFniEKcPTd3vHGVhiAtkZuC GIciFiHho33TZz/lKJXHr/ASlmtWhVGoaj90YhOmS5Xmk5IRd9AjU7mXj A==; X-IronPort-AV: E=McAfee;i="6600,9927,10957"; a="399763752" X-IronPort-AV: E=Sophos;i="6.05,206,1701158400"; d="scan'208";a="399763752" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10957"; a="904297436" X-IronPort-AV: E=Sophos;i="6.05,206,1701158400"; d="scan'208";a="904297436" 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 1/7] ui/spice: Add an option for users to provide a preferred codec Date: Fri, 19 Jan 2024 16:30:07 -0800 Message-Id: <20240120003013.1829757-2-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: 1705712022739100003 Giving users an option to choose a particular codec will enable them to make an appropriate decision based on their hardware and use-case. Cc: Gerd Hoffmann Cc: Marc-Andr=C3=A9 Lureau Cc: Frediano Ziglio Cc: Dongwon Kim Signed-off-by: Vivek Kasireddy --- v2: - Don't override the default Spice codec if preferred-codec is not provided (Frediano) --- qemu-options.hx | 5 +++++ ui/spice-core.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index b66570ae00..caaafe01d5 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2260,6 +2260,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice, " [,streaming-video=3D[off|all|filter]][,disable-copy-paste=3Don= |off]\n" " [,disable-agent-file-xfer=3Don|off][,agent-mouse=3D[on|off]]\n" " [,playback-compression=3D[on|off]][,seamless-migration=3D[on|o= ff]]\n" + " [,preferred-codec=3D:\n" " [,gl=3D[on|off]][,rendernode=3D]\n" " enable spice\n" " at least one of {port, tls-port} is mandatory\n", @@ -2348,6 +2349,10 @@ SRST ``seamless-migration=3D[on|off]`` Enable/disable spice seamless migration. Default is off. =20 + ``preferred-codec=3D:`` + Provide the preferred codec the Spice server should use. + Default would be spice:mjpeg. + ``gl=3D[on|off]`` Enable/disable OpenGL context. Default is off. =20 diff --git a/ui/spice-core.c b/ui/spice-core.c index db21db2c94..13bfbe4e89 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -488,6 +488,9 @@ static QemuOptsList qemu_spice_opts =3D { },{ .name =3D "streaming-video", .type =3D QEMU_OPT_STRING, + },{ + .name =3D "preferred-codec", + .type =3D QEMU_OPT_STRING, },{ .name =3D "agent-mouse", .type =3D QEMU_OPT_BOOL, @@ -663,6 +666,7 @@ static void qemu_spice_init(void) char *x509_key_file =3D NULL, *x509_cert_file =3D NULL, *x509_cacert_file =3D NULL; + const char *preferred_codec =3D NULL; int port, tls_port, addr_flags; spice_image_compression_t compression; spice_wan_compression_t wan_compr; @@ -802,6 +806,14 @@ static void qemu_spice_init(void) spice_server_set_streaming_video(spice_server, SPICE_STREAM_VIDEO_= OFF); } =20 + preferred_codec =3D qemu_opt_get(opts, "preferred-codec"); + if (preferred_codec) { + if (spice_server_set_video_codecs(spice_server, preferred_codec)) { + error_report("Preferred codec name is not valid"); + exit(1); + } + } + spice_server_set_agent_mouse (spice_server, qemu_opt_get_bool(opts, "agent-mouse", 1)); spice_server_set_playback_compression --=20 2.39.2