From patchwork Mon Jul 15 06:33:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13732966 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F081C1836E9 for ; Mon, 15 Jul 2024 06:33:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721025201; cv=none; b=rQl35G6pEGjsBGslbDGLdu/5fqsCkVpsqJelKD058zVnfgcK4wdwD2o1lLgSPHlvaJ7I0HFRx08CjxXDw0PPAeWnMf+MK6JFWOtRkwRgEaT25uLL5SHtqvvV0pi4h8EKt3swBlo08fDec/xyGiSv1PpnnoiHVh6/R9xulnDuIKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721025201; c=relaxed/simple; bh=Ogj1qgSBFy5LiaMGrph8HSRVcootU6FeEO747BTFj9E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L8LJEWijRKeV7h+Hm7jiX40mCd/V6bRG7LqQKo7r5VhkvWIQduta4eKGmBfP6505MGXlTdOORklpBD3WLg51MGXM1k5VFB9WN9bIp/Zy7YmTPjHEKfX13HIjTzvOw2SobOmXX1gRDmfSHaTTV0PZC/o9WgGSBy0YX5zhkzcR54c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LQim0mJR; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LQim0mJR" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-52ea0f18500so4021776e87.3 for ; Sun, 14 Jul 2024 23:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721025197; x=1721629997; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hbJUOmvW24quAtGM4HEWCKTnos6XbtfhPM+nK5+e2Tw=; b=LQim0mJRWd5rvDUFaWwmmHCWUMo3xWg2kGWn25ITHqIvsTIHzKAgfJ3jGO6X0K2bEz xWdKZhKdEcNiYTwb8EcaTsHpZLmcJSt6m227bfwKdjzKtGwcijqapztei3DNafulQTbh NiiO/0dVYwLbYAH9zGmEx5S7CWMIu/WqVcaM//eeHNXqaq54C5TM9CnSNdRryzJ5xvf0 W0fihO7QrVgxtSfiaDIQMEY8jnXJ+towzgPT3iVv/Fii/g51FgDdGW4mK7e1aw7IfZJx K1maPjClp9I9xvWgyBlJhJ4x7ve8sIsNAx2/Ds6pN8YoXiMK7//foaeXIMwwED+VZM9P H5qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721025197; x=1721629997; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hbJUOmvW24quAtGM4HEWCKTnos6XbtfhPM+nK5+e2Tw=; b=YzeQ5Y1MZXfeElFqsJUHpvwnHEokCXMX8aAd1BsH6UxljUK08lri0ve+7N+IMaMk/H e4wB6sQnFYut1td7ikm219LKUzl7k08Ngg8uwnXbuGh5RXu8eas7zcFW9QHL5WcdV1rE Lp44agT9v2anBrImSZwD+/pzJBhzPxScAeKO+BtQH37fD33Y4f/YW1L+d02w5JFvc3z9 cqvfBjidYOnLe3ScCicrRQgUtgmhAC6EiQYmtJuNlOsobZOVpayfSy7a6SoZ78q1cVsq fJW4lE82RjWOH/DXkDQXWOAH1UhwImRNX9WFQvRAkLGC1d53Lw6da4gXfZmPhyDlQcct hy3A== X-Forwarded-Encrypted: i=1; AJvYcCWm/VyNMahEjt/RcU49+RYSeDYYrMtNh/oDmttcjI4At70rX90KVXWrSLoAHknZY6hwYJX06Jt+DvWzeg8xETlDECPZ X-Gm-Message-State: AOJu0Ywt14miSSpijf3bUSiA7L060RLBWiGnjKedu8q74muj9VzJVSJ0 yhmMZZoaFZU8Ev7VlgLAu63KmDvZ/dA2Vk8bMqBRSbZpuXaEKkGAz6w9LzJLh98= X-Google-Smtp-Source: AGHT+IF+V86J6/2ZIQK/CmixClQVdJF7hjnWLmCjjdRBB6FFYX5j0s7A+kP4jnSIFrfgBCt8vnJuQA== X-Received: by 2002:a19:f706:0:b0:52c:c9d3:a30c with SMTP id 2adb3069b0e04-52eb99a0639mr9397218e87.29.1721025197267; Sun, 14 Jul 2024 23:33:17 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52ed24e188esm743543e87.47.2024.07.14.23.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 23:33:16 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 15 Jul 2024 09:33:03 +0300 Subject: [PATCH v4 3/5] drm/connector: automatically set immutable flag for max_bpc property Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240715-drm-bridge-connector-fix-hdmi-reset-v4-3-61e6417cfd99@linaro.org> References: <20240715-drm-bridge-connector-fix-hdmi-reset-v4-0-61e6417cfd99@linaro.org> In-Reply-To: <20240715-drm-bridge-connector-fix-hdmi-reset-v4-0-61e6417cfd99@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Dave Stevenson , Laurentiu Palcu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Paul Cercueil , Anitha Chrisanthus , Edmund Dea , Chun-Kuang Hu , Philipp Zabel , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Sean Paul , Marijn Suijten , Tomi Valkeinen , Kieran Bingham , Biju Das , Geert Uytterhoeven , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Jyri Sarha , Matthias Brugger , AngeloGioacchino Del Regno Cc: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , dri-devel@lists.freedesktop.org, igt-dev@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1164; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Ogj1qgSBFy5LiaMGrph8HSRVcootU6FeEO747BTFj9E=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ9qUQysu/J/Xl5n/9o/EfmHLmdY1x3fJXa8q/t5631Izp 6VP4f30TkZjFgZGLgZZMUUWn4KWqTGbksM+7JhaDzOIlQlkCgMXpwBMRPg8B8NKPS4j53+nGRhP VBcpNN70edCVY/lnJcPcZSbfTc/NZDjqy6J4IKKOJ5lRyqf+pLljwNWcn8dbq5ta/jC3fL5Surt 8VnHwiZ8ube0uSdOfHZtUofj4yj2FJZ909eR959nxx9g9rdtcmORwy69fzvGuf/mlJ9ITLxRdKU /VyNt9e8HWnyJSNaJvsvvjVOZ/8xJcrea+Le6pdpiL04no7ZG5l+apXb1wf90jpyWPt1z035Z38 UmCspiUQ5HjJzXNXLbKp8oVKQ0yzQwbTWba5eanp9nPFBKUKtof79uV/nmO00QFK+krh9kFBW1Z lM+2PipLcPhrUlgXZKBucDBt5ZLW8y+WpX08IzaNs3cFAA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A With the introduction of the HDMI Connector framework the driver might end up creating the max_bpc property with min = max = 8. IGT insists that such properties carry the 'immutable' flag. Automatically set the flag if the driver asks for the max_bpc property with min == max. Fixes: aadb3e16b8f3 ("drm/connector: hdmi: Add output BPC to the connector state") Signed-off-by: Dmitry Baryshkov Acked-by: Maxime Ripard --- drivers/gpu/drm/drm_connector.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index ab6ab7ff7ea8..33847fd63628 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2610,7 +2610,12 @@ int drm_connector_attach_max_bpc_property(struct drm_connector *connector, prop = connector->max_bpc_property; if (!prop) { - prop = drm_property_create_range(dev, 0, "max bpc", min, max); + u32 flags = 0; + + if (min == max) + flags |= DRM_MODE_PROP_IMMUTABLE; + + prop = drm_property_create_range(dev, flags, "max bpc", min, max); if (!prop) return -ENOMEM;