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: 812871 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 0743D1836F0 for ; Mon, 15 Jul 2024 06:33:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721025201; cv=none; b=iOZUP/DxczL9aAvFkWqo/xxNHyARsB7I1vpvpsoW7YF3vY56C5DHSW55SGkIJ/qqcuZjSZPsubJMTbToS9wgYdH5LenUoPiq6CNSar1QWk736R01I7yTu0Oagb/l/T6+LJA9AWljbJxs5bbU6swm9p18xh5HbVw5RC7Ky+Do8hY= 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=CYsu9ouG; arc=none smtp.client-ip=209.85.208.181 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="CYsu9ouG" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2eee1384e0aso17787591fa.1 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=vger.kernel.org; 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=CYsu9ouGp/Ws+ikvSCe3Sl7IjS42dcIy1gcMJ27Ly/vcfvaZjSvli8f9N4kpYHpBPc wKhh+sL7wJKlvpuku2liBJob2Z7lAQONG900n5h3fMxg+Wrt+6wUsEieYXBLU2Qdeeoc hcLVdD+u4yGLopDRJk14gvqNDAj94Hqc3Og5qy8BrChSsW79yp62o4dYUq6hz9JX2MbN POxgf18id/jbuMl9VD3zuM+CXVHKCvmRGi4dOdfFinIPNIb5VCqheIiYuor+CVlTw0Xd H7c9oeiRFEuh5KFknfIGmNIgWAVVNPTaPNm56dWQ9gOsFXkrEgrpc2/Zoce36eCEC6lZ np3w== 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=CPHiwCJefHkULzaRCun5rPUkU33GCZOr2hAfqG3I2WGyp3VEc2cvbU99DFeGGrhTXS 4MLjqBgl1oedFen0nDyfcLEEPY2cPakuOukSDf1iSyT5yvGYOe0TDLQEU/xjKkiujROm 3rMHnaPCQgLcedkki29s/ekkHdGd1nMqW3RLuKHM3wdK8cUenpPCWNPcoRwFAPps0FEu gs4AET3rasAJHSSHChyVawzEfIFMOux/3JfYc/7srTJKFn1priz+BuvN+81XjKqxE9WN rIkMwKGYXsp0AiBepiFvrgDfWjhi6AgSt5S6ZXSUE8GxZJltGnFuwKBIL7P6JDcm1mmI O95w== X-Forwarded-Encrypted: i=1; AJvYcCWQH36brEOFXNkgMS5QEXy0XlmMBcMeu4xwBDGC24CnB8yQ3/kRwS1W+MrkpIkxyyVhZk8V1pBxDSEfGk4PZlM1p+z3Zkl0uD5VqUrfXw== X-Gm-Message-State: AOJu0YyXyUbccT/7ua4gteMfwAvyk723dAk3ZsBYfra6C7rBBJgXmMMi ZRClBVPy2PeZa4bYDYR/rGP7uLqJ7xF4BQvmUZ1AK5NU6KDPjzOm79seHQA5U3Q= 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: linux-arm-msm@vger.kernel.org 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 --- 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;