From patchwork Thu Sep 29 16:31:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12994366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08C0AC433FE for ; Thu, 29 Sep 2022 16:31:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 449CB10EACA; Thu, 29 Sep 2022 16:31:28 +0000 (UTC) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id B850E10EAC3; Thu, 29 Sep 2022 16:31:23 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 24E8F580807; Thu, 29 Sep 2022 12:31:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 29 Sep 2022 12:31:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1664469083; x= 1664476283; bh=rTOBq8QGMua1UdWDwtRy1+1XF/qwLkxTvj5XyWChYOU=; b=V A8dVBoaOGjOmzcekTj8ntJ41Ignd1JLvDBDECPqqQPT4Ud0znz8euixiMfCaLuU0 fhNllfsg0CzEN7D3CT++pHBgL38mY+kfq84wVN3uTAQ8t4YX7jM7Q2Ot6dsuqGRF uldYgtj/UrM6Asm7thsRGqwfmTqfXJUNg2iMEsEzd1pv0cs5YQCPMLQrx8mBul3T 9PbdOV7VM6uNjjTumslc2Q5wrTZMDMdGJeOGMwJ9QilYP5kp+3Wavl06CP6qUUgU qx5uxDNp/sXI4olO91AxKuTu0TzDpbxEZuio8dGO2Bt8P1U0IdGd0yjd0ba3So+S WoVciM0G7W2aPN+42q3Eg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1664469083; x= 1664476283; bh=rTOBq8QGMua1UdWDwtRy1+1XF/qwLkxTvj5XyWChYOU=; b=V tgRIJDGTfzy4Vn4D+bmgdep7cuPGaPs+wJTsz1cOrm0saJ8XJAciBChsGLx4Kq8g dxFKdXfOOPo8sfshPvgldlSK3kYqS96/z04MY9dCk3fFwfc+5nM8NtT2dS7B8OPX PRbxDScCVcxBSan4b5gvopTUtLDQgfFBM13L49cbbLYz6vDUGx7xH4wH6FLMcfjM 6gFSk87dZu1O9ku6BS0scfMNpdOvNYavYIrXvuZxeeKekvUHgeUlb23EXOpyvxFX eErKozx9aLxL/HgoszUqMW23sBRbN9w6O+tRmyx6nOqcjeDX/sTzIfL5Spj7JBxa uTrSGkwNVKgLGBwyXj3Uw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeehtddguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhfffuggfgtgfkfhgjvfevofesthekredtredtjeenucfhrhhomhepofgr gihimhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtf frrghtthgvrhhnpedvgfevjefhtdetveevhfelieeuueetgfdvgeevkeegudejffegfffg tedtleelhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 29 Sep 2022 12:31:22 -0400 (EDT) From: Maxime Ripard Date: Thu, 29 Sep 2022 18:31:00 +0200 MIME-Version: 1.0 Message-Id: <20220728-rpi-analog-tv-properties-v4-6-60d38873f782@cerno.tech> References: <20220728-rpi-analog-tv-properties-v4-0-60d38873f782@cerno.tech> In-Reply-To: <20220728-rpi-analog-tv-properties-v4-0-60d38873f782@cerno.tech> To: Jernej Skrabec , Chen-Yu Tsai , Karol Herbst , Samuel Holland , Lyude Paul , Jani Nikula , Daniel Vetter , Thomas Zimmermann , Emma Anholt , Joonas Lahtinen , Ben Skeggs , David Airlie , Rodrigo Vivi , Tvrtko Ursulin , Maarten Lankhorst , Maxime Ripard X-Mailer: b4 0.11.0-dev-7da52 X-Developer-Signature: v=1; a=openpgp-sha256; l=2448; i=maxime@cerno.tech; h=from:subject:message-id; bh=PNmBXeBj29NmRDCOP2DsHEX0rVfAqy911+SVom6dnZI=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMmmJ9wcdCXFVYMN2z+tfTSnb9ehcA0f8xcrYywTy6bL/Je/ 1d/aUcrCIMbFICumyBIjbL4k7tSs151sfPNg5rAygQxh4OIUgIkEPmRkOHKAz0NtRghPVaj7w5nLJP 1Pl4Z5vpp3LdX7Ts5+xTNcigz/C+cwO59bcMV8c/jDuI2rUxYlP+Piij7okLfVTla8VbOUCQA= X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D Subject: [Intel-gfx] [PATCH v4 06/30] drm/atomic: Add TV subconnector property to get/set_property X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?unknown-8bit?q?Dom_Cobley_=3Cdom=40raspberrypi=2Ecom=3E=2C_Dave_Steven?= =?unknown-8bit?q?son_=3Cdave=2Estevenson=40raspberrypi=2Ecom=3E=2C_Phil_Elw?= =?unknown-8bit?q?ell_=3Cphil=40raspberrypi=2Ecom=3E=2C_nouveau=40lists=2Efr?= =?unknown-8bit?q?eedesktop=2Eorg=2C_intel-gfx=40lists=2Efreedesktop=2Eorg?= =?unknown-8bit?q?=2C_linux-kernel=40vger=2Ekernel=2Eorg=2C_dri-devel=40list?= =?unknown-8bit?q?s=2Efreedesktop=2Eorg=2C_Mateusz_Kwiatkowski_=3Ckfyatek+pu?= =?unknown-8bit?q?blicgit=40gmail=2Ecom=3E=2C_Hans_de_Goede_=3Chdegoede=40re?= =?unknown-8bit?q?dhat=2Ecom=3E=2C_Noralf_Tr=C3=B8nnes_=3Cnoralf=40tronnes?= =?unknown-8bit?q?=2Eorg=3E=2C_Geert_Uytterhoeven_=3Cgeert=40linux-m68k=2Eor?= =?unknown-8bit?q?g=3E=2C_Maxime_Ripard_=3Cmaxime=40cerno=2Etech=3E=2C_linux?= =?unknown-8bit?q?-sunxi=40lists=2Elinux=2Edev=2C_linux-arm-kernel=40lists?= =?unknown-8bit?q?=2Einfradead=2Eorg?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The subconnector property was created by drm_mode_create_tv_properties(), but wasn't exposed to the userspace through the generic atomic_get/set_property implementation, and wasn't stored in any generic state structure. Let's solve this. Reviewed-by: Noralf Trønnes Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_atomic_uapi.c | 4 ++++ include/drm/drm_connector.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index c74c78a28171..c06d0639d552 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -688,6 +688,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, return -EINVAL; } else if (property == config->tv_select_subconnector_property) { state->tv.select_subconnector = val; + } else if (property == config->tv_subconnector_property) { + state->tv.subconnector = val; } else if (property == config->tv_left_margin_property) { state->tv.margins.left = val; } else if (property == config->tv_right_margin_property) { @@ -796,6 +798,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = connector->dpms; } else if (property == config->tv_select_subconnector_property) { *val = state->tv.select_subconnector; + } else if (property == config->tv_subconnector_property) { + *val = state->tv.subconnector; } else if (property == config->tv_left_margin_property) { *val = state->tv.margins.left; } else if (property == config->tv_right_margin_property) { diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 60b5662dec7c..1d5e3cccb9e3 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -693,6 +693,7 @@ struct drm_connector_tv_margins { /** * struct drm_tv_connector_state - TV connector related states * @select_subconnector: selected subconnector + * @subconnector: detected subconnector * @margins: TV margins * @mode: TV mode * @brightness: brightness in percent @@ -704,6 +705,7 @@ struct drm_connector_tv_margins { */ struct drm_tv_connector_state { enum drm_mode_subconnector select_subconnector; + enum drm_mode_subconnector subconnector; struct drm_connector_tv_margins margins; unsigned int mode; unsigned int brightness;