From patchwork Sun Mar 31 20:29:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13612295 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 282E9CD1291 for ; Sun, 31 Mar 2024 20:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MY4CCTfk191YaxGhk6h/P2gycRkGkSX1X+AjE8Z92kE=; b=Ffc30l9dKTXduA avyMLnMKWut3z9juwM93p1oOheVHp26fFOsxnuPn0UrRaqTbbYxtcXtI280ZgSPsV5H7rN32pdViB 3+gzEft+uyRc477yeYWkZYLAnd9Qap6BnzqkY/DNXT8LCVRCIgNKcIib3EzlTwzrVjbqQyOWz0T+s F6NdB71jGmzdA5bMpTEmNlHw4FJGzuLBGeaXW33c1vOG3kjGROTvHpT6d307YD769pIvkChX0VJT/ Q85O1+fFBewPQnJZlYU0jOEU3etiQ8gp9rhc/TMkVQ7o2t4MEigOOSsT+rSKvdCpnY+qubr62JmZF dQaTyyQQPFTlmkm8TSJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rr1oU-00000006GFQ-1cCT; Sun, 31 Mar 2024 20:29:58 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rr1nl-00000006FpZ-3mCc for linux-arm-kernel@lists.infradead.org; Sun, 31 Mar 2024 20:29:17 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2d6a1ad08b8so35091401fa.1 for ; Sun, 31 Mar 2024 13:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711916950; x=1712521750; darn=lists.infradead.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=Wz3UhJ4xYSdgm48WihXb5Ur775HB6HGFpy/cnlygSBk=; b=q1UCEbCoLmoFXwPeD0Q7Ant97HWU+2qLWTPGeeQ0tHhKVwNW399sA2JAcQ781QWBeq iYZTSi+Sqdp8/kmmUzG7ZBGbhH6MuFIMnaQIpDJn+L/LnRL/jNupjIg7161Q32Z3UNE1 9TjZ5hQMVq4LoT5xKO6WAqzXM0KpBwpKG2tp6dvxTyKb/nrIPhuK7LA2QJLUNtO2sFS8 ZdpXTkgHKO55+lq4pNw9zm7K7Jx3MYYR1BvRcIxLhbITW1V9sOuyrOAjxNczTGSDRUhn r+vhjlUXZhHUbWuOFfCR57P+M32eUyp9sM9sCOQLmsu3tTnlrKWQqe3OcLWXXbiVmTLK C7aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711916950; x=1712521750; 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=Wz3UhJ4xYSdgm48WihXb5Ur775HB6HGFpy/cnlygSBk=; b=aD+hNkaPRKuT/LoWjsIlSkrvE/RBNE0vPAckaZcyn+1zgwn1ZRH7tt/0HEOgMiMH2/ v0CNDmAv4HNL3wReR/G9GRyMhaPbwnflMOq4nDr2pNE+GJBfzq68lTHFRw/031wQevsi TsiuVYlgwdYC8Ozuz+Rhuw25xIIfR0n0QzJIQItrX9T38ChtU9Jv/OitxVNN+rJ22svy 6mbzV0ob/jk+jGMncyLKo9yoTaCjdCslCymLpb4chAEmwnELuykhPs54n2NEBtfQnQ1o R9ehGrnFhoHNBls6PNu2quc1EX/EMkXCELXHobvCYWshcDwGnkvCL6FZPugzB53xhw/x 6wYg== X-Forwarded-Encrypted: i=1; AJvYcCUYyRJrxRKu0Jfe9t4w1X0Hrr7pcYTcuTL9L/oh0zEJ3aMJpMyJSvrnjSzQOQPK6RJQ4ec0IBKtHXCyKJJaggxA5ll6+urKfmtTj65yb5INY3tRTfo= X-Gm-Message-State: AOJu0Yz6AxmUJFHDSdJG/0lI1N+Scu0F7L4Ndquq3kudSJyT+xiqIr2+ yWcszuLAwHcxGvou0IIK5EBgMUi3Rnee8ktGux/5B9wnzbOWvAirenoAvaSvKnU= X-Google-Smtp-Source: AGHT+IEHzVhYaRRfQunRUBg2nCTXUyrkKpKE02mf9SlmjzQqNUi1YakpduPB5hr25gvxrP4GEqAn5A== X-Received: by 2002:a05:6512:3102:b0:515:a360:1d92 with SMTP id n2-20020a056512310200b00515a3601d92mr6829117lfb.67.1711916950154; Sun, 31 Mar 2024 13:29:10 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id y25-20020a197519000000b00513cfc2a7aesm1237276lfe.71.2024.03.31.13.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 13:29:09 -0700 (PDT) From: Dmitry Baryshkov Date: Sun, 31 Mar 2024 23:29:02 +0300 Subject: [PATCH v2 05/12] drm/imx: ldb: drop custom EDID support MIME-Version: 1.0 Message-Id: <20240331-drm-imx-cleanup-v2-5-d81c1d1c1026@linaro.org> References: <20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org> In-Reply-To: <20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org> To: Philipp Zabel , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Chris Healy , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2635; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=yY+O3A74gJfvweSEVBsGsRQtsdkU2oXgLZzLvkdvTv4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmCcePbH5Zjxnk0aodoAfmic8b1WXU85H/o8MAs QI1cw0GV9KJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgnHjwAKCRCLPIo+Aiko 1eExB/9cHiJt7nCx5nPTg7TnqIDd4FGePmdaBsugHRvPqtnlcVLqQdlMqObc2812P0w01JTq4wx FGg2hfiOrpEzl7cNzqiXOeUbLkjCUG9nR78g74zKhuQM/OdwCSbiZ13rXNdWsDTheAeKPgWI0VY k4SMxFvLfT5xNiILgF5szhgNToFdF7Qsji5jH52IHwvWRnnkXvQS2jZnY0fv4NTgkryrDK7QcN4 ETbkPipoMRHe8pVtl2vYcqyTCh75mwlkUrQBRLiyoC71/K15SIcl8KMvH2038c2KeetqGZEGDFD 3V878u/Mos78tzrehAXNkCNSNFiS/wlAbD/ZvShtWwTiB/GX X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240331_132914_334174_CB91849C X-CRM114-Status: GOOD ( 16.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Bindings for the imx-ldb never allowed specifying the EDID in DT. None of the existing DT files use it. Drop it now in favour of using debugfs overrides or the drm.edid_firmware support. Signed-off-by: Dmitry Baryshkov Reviewed-by: Philipp Zabel --- drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c index 71d70194fcbd..1924d8921c62 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c +++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c @@ -72,7 +72,6 @@ struct imx_ldb_channel { struct device_node *child; struct i2c_adapter *ddc; int chno; - void *edid; struct drm_display_mode mode; int mode_valid; u32 bus_format; @@ -142,13 +141,16 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) if (num_modes > 0) return num_modes; - if (!imx_ldb_ch->edid && imx_ldb_ch->ddc) - imx_ldb_ch->edid = drm_get_edid(connector, imx_ldb_ch->ddc); + if (imx_ldb_ch->ddc) { + const struct drm_edid *edid = drm_edid_read_ddc(connector, + imx_ldb_ch->ddc); - if (imx_ldb_ch->edid) { - drm_connector_update_edid_property(connector, - imx_ldb_ch->edid); - num_modes = drm_add_edid_modes(connector, imx_ldb_ch->edid); + if (edid) { + drm_edid_connector_update(connector, edid); + drm_edid_free(edid); + + return drm_edid_connector_add_modes(connector); + } } if (imx_ldb_ch->mode_valid) { @@ -553,7 +555,6 @@ static int imx_ldb_panel_ddc(struct device *dev, struct imx_ldb_channel *channel, struct device_node *child) { struct device_node *ddc_node; - const u8 *edidp; int ret; ddc_node = of_parse_phandle(child, "ddc-i2c-bus", 0); @@ -567,17 +568,10 @@ static int imx_ldb_panel_ddc(struct device *dev, } if (!channel->ddc) { - int edid_len; - /* if no DDC available, fallback to hardcoded EDID */ dev_dbg(dev, "no ddc available\n"); - edidp = of_get_property(child, "edid", &edid_len); - if (edidp) { - channel->edid = kmemdup(edidp, edid_len, GFP_KERNEL); - if (!channel->edid) - return -ENOMEM; - } else if (!channel->panel) { + if (!channel->panel) { /* fallback to display-timings node */ ret = of_get_drm_display_mode(child, &channel->mode, @@ -744,7 +738,6 @@ static void imx_ldb_remove(struct platform_device *pdev) for (i = 0; i < 2; i++) { struct imx_ldb_channel *channel = &imx_ldb->channel[i]; - kfree(channel->edid); i2c_put_adapter(channel->ddc); }