From patchwork Sun Jun 2 12:04:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13682808 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 4BAB3C27C4F for ; Sun, 2 Jun 2024 12:05:12 +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=/8wdhCGldKZ560hJikZaN0An5yOc9OlN7nAP1RPTo08=; b=IW3t88wwMAO5WU vahqyBV4IWnLp9c8E8C7v5srXKwTZQd/BKo8cQOZaw5jU7PAcFQxhHaSza3GhTwQMLfUrNNwhtRNa dqkElmY8cWd5TzILq+2hx5WnqgeKU+tdN0m5MC9bcvEEqeZYfbGJKT1zS+l2hyaS5vhE/kwwfVxLc Gt0YHj+CkgEzIwchEHzCiI8dIfHq7salRyRzHAog5xiQxtMrELJRO4FjGF9RDJIZZCZUpHPFcnil6 Db0WP6V8UNgZr/sg8BE495Yeu/aiJmACAuBFAyde/9l+xmv0BNTngIX3V5y3O6R44smSdQ0cYkk7W Z7ApSil/YHgEmkGz5vog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDjxN-0000000EBTg-35xh; Sun, 02 Jun 2024 12:05:01 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDjxF-0000000EBMR-2WbJ for linux-arm-kernel@lists.infradead.org; Sun, 02 Jun 2024 12:04:55 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-52b93370ad0so1210154e87.2 for ; Sun, 02 Jun 2024 05:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717329891; x=1717934691; 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=ahx0B7IRhOU2KryLmin5A3x+RBjSRe40YtgpLFgn8h8=; b=hVtLueDN7YgOekBS3LkgUsoxNdGJSjq6GT8OG64YnVWTinS46rbUEb+ag3KCgyhewg c9TTjz/HayDc/sEbSpkXixq6ZW3qD3fziJiUegHhLezAk/i/RsQ7Kgn1A+t8gxr2nE6A H79OIPVibnluMbkK0RhhtZiR7hJwfcpvJEJ5bfOhUVuIrQMtIa/eFD8QWvpT1m/usM4J sU8sJO34bXsE2z1PU05EpZSLUXHicXpAq1fua3reR/l9qfNSIw62xxpCJLdq7zeswGrd 1SZqj50eZvnEHMySKYKsP9G0PYih9PAdkrRiREye+3fF5UFnreZUhNwJN84jV/6dmrak u/Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717329891; x=1717934691; 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=ahx0B7IRhOU2KryLmin5A3x+RBjSRe40YtgpLFgn8h8=; b=mFIcC31UFKpvn5hWe/6zu54pgnda0/c+XaTlUySONohPkbXoXQYJs6rOAKN34+sdU2 Tx+H8jW0Md1v8VRevhV2ASrBTbmAmbIGyPKAI4Lqk6y9+JkgYOT2Kb5FKGbGRC9syemp mjk9Lk2O8HU48UISz+aEEpPLC0Vlzbo/3q7D+rBYJiFGGzYTFk8N7UoUKEhotBdenS2c kwmGd84csV6ofkPRi3qS0oTQ8iAdnip52q0C566duRRvf0Zn/EFcPoGlRvyJev5Pg0le FAZnT3YCxjtccmEZ6lFhOCsykfWVOJ0b22n6KBaTI/86aEwSEPGRbcGL1ia0ORPwNKIS 7ADw== X-Forwarded-Encrypted: i=1; AJvYcCVDDwDGf2zPg6B2LMhO5V9REyngbIZIQTmjcfu7bSJURB4sbXC8ER0iMIjZF9AMaN9bmqFhw46sB8qKXi5otlPOG4/bKwK2W6SlqNxR/JR8Pjrwpr0= X-Gm-Message-State: AOJu0Yy7hENIHHOYR0f0lagRNnSyiuKJW+lAV+GELqUlWkT2eUZK4BzH 51wtDXgOvkp4575uv1PyQtQp3Sme53NOEt6cE5xg3qObypKbLhRDQWRzF194+7k= X-Google-Smtp-Source: AGHT+IE9DlkDZJ/q6anZcEZCR4WzqVIVNYRa7q0Ns7NW+snWcKddBdYHt8pvqycOhI6UxRrnqrZ28A== X-Received: by 2002:a19:f603:0:b0:52a:e7c7:4ce6 with SMTP id 2adb3069b0e04-52b895633dbmr5188478e87.39.1717329890815; Sun, 02 Jun 2024 05:04:50 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b8b56867fsm759398e87.44.2024.06.02.05.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 05:04:50 -0700 (PDT) From: Dmitry Baryshkov Date: Sun, 02 Jun 2024 15:04:45 +0300 Subject: [PATCH v3 05/12] drm/imx: ldb: drop custom EDID support MIME-Version: 1.0 Message-Id: <20240602-drm-imx-cleanup-v3-5-e549e2a43100@linaro.org> References: <20240602-drm-imx-cleanup-v3-0-e549e2a43100@linaro.org> In-Reply-To: <20240602-drm-imx-cleanup-v3-0-e549e2a43100@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=2531; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=l7M3G39iu9nNrCk8sJLPBZk54Nd8nGO4KLe4Ou6kT5o=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmXF/dci5cApIh4CbjmDaF29E9SsPPCAy9IC1BP ookreVYSv6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlxf3QAKCRCLPIo+Aiko 1cwKB/4xCsYHUgD+LgO7CvPxVhR6dSFIH9rYipIXrsQtH3yVtnXKxqJVgzCEVAa05JbbXYH4ozm RGrPvgpfVs5QGXj/4+MKxODCFxUFgqKcXQVdlh7exxMGFAAXoc1FMl7K7Kscd59HZM9ALmd95jO nkRvO0T+JiSJhIy4mucD6HAXICDqQ9iH64hAwCiC+og87UzNN4W4uWK+Qn5WpFYsn9h9eCL0GR5 8Aa0ZHfyxbhjEw4Tpo5oN3TLUtg/FfUdILUEkXtOi4Dzy8tLxkjc7eP84g4JYJrwZytzOUmXqlo cj1OsANGFG1AJ4XbaaYw73OVV6ibGtMWOB3FKoFa7K2w3JKK 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-20240602_050453_735332_8C2853D1 X-CRM114-Status: GOOD ( 16.74 ) 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. Reviewed-by: Philipp Zabel Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c index 793dfb1a3ed0..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; - const struct drm_edid *drm_edid; struct drm_display_mode mode; int mode_valid; u32 bus_format; @@ -142,14 +141,17 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) if (num_modes > 0) return num_modes; - if (!imx_ldb_ch->drm_edid && imx_ldb_ch->ddc) { - imx_ldb_ch->drm_edid = drm_edid_read_ddc(connector, - imx_ldb_ch->ddc); - drm_edid_connector_update(connector, imx_ldb_ch->drm_edid); - } + if (imx_ldb_ch->ddc) { + const struct drm_edid *edid = drm_edid_read_ddc(connector, + imx_ldb_ch->ddc); - if (imx_ldb_ch->drm_edid) - num_modes = drm_edid_connector_add_modes(connector); + 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) { struct drm_display_mode *mode; @@ -566,18 +568,10 @@ static int imx_ldb_panel_ddc(struct device *dev, } if (!channel->ddc) { - const void *edidp; - 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->drm_edid = drm_edid_alloc(edidp, edid_len); - if (!channel->drm_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]; - drm_edid_free(channel->drm_edid); i2c_put_adapter(channel->ddc); }