From patchwork Mon Mar 25 21:56:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13603030 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 60E0AC54E58 for ; Mon, 25 Mar 2024 21:57:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 979EC10EB2C; Mon, 25 Mar 2024 21:57:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KoPTLsLi"; dkim-atps=neutral Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C36110EB15 for ; Mon, 25 Mar 2024 21:57:00 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-5dca1efad59so2841868a12.2 for ; Mon, 25 Mar 2024 14:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1711403819; x=1712008619; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5bVuVcBwYjbmIMugv7i5Wq0OqJpJ+55dldjg1iRzEkE=; b=KoPTLsLieUnAlpkNnmGKj4Qf4iwUyfLQ6v4q88KTEOrPMbixEdjKkdYcNLrAePNDdh jbyLjhjbWXF0TKmGJ/qHBXMjIZHT/dBclwjAdq3KYfwTLfsZz9Kbw9H03BgdLXMpIMn4 NMaRe8RZWMxzeDakyBrUBfT4yNPS6wThQe+h8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711403819; x=1712008619; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5bVuVcBwYjbmIMugv7i5Wq0OqJpJ+55dldjg1iRzEkE=; b=cRsHiTU9cqunESBqdLcuU8e0ywBIHSxmq8KSkXY+skTGIgxPNsoRya7tfUoOsmC3Xw 3i1+prKAeKsfbMMGJT1vOn+HMJqZAk9bGYSI0TAKFPJxeBawW6fqFV+wwPBsVOxni2pZ ISIljZVSKyU2XQS727CzKwBsj/Wcj1r6HXrVrm++4NjqDHbKhvdCCuMv2MvaZRcS2AUC 7Iuqq/c2qTeMRayugFs2iAPGiKGOZCTUiup8iGXdWXv0Ndw6+ZLuA3OKpfYPfjb8k5pM 8muBxJjNRS/K93kkZ0tPQY5m45+jkHJ8/ascQLP2fgxt8k2Foi6X+ex7yjxZM+quyBc4 SK+Q== X-Gm-Message-State: AOJu0Yz9evuppfP9u/TfV0UUiEj9PSn4aIQS+RGuojNVga2AHKEzSvhf aNqgEVNMZ2j3VhDMfusQ+/XX7kS11rIvFktaV6AC41bZPv81d2SuYsgY7YbV64QFOc095t001nU = X-Google-Smtp-Source: AGHT+IFeEjtB0EjG3yoGX3VoRn27+gcFHG2pO1/kdc6fNCLKOImMjn5d9qKrY7U83VyykAGWyY6r3Q== X-Received: by 2002:a17:902:eb8d:b0:1e0:10c1:6288 with SMTP id q13-20020a170902eb8d00b001e010c16288mr7281408plg.51.1711403819205; Mon, 25 Mar 2024 14:56:59 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:f21b:7dde:93cc:b987]) by smtp.gmail.com with ESMTPSA id n6-20020a170902e54600b001def0897284sm5207866plf.76.2024.03.25.14.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 14:56:58 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org Cc: Pin-yen Lin , Prahlad Kilambi , Hsin-Yi Wang , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] drm/panel-edp: Abstract out function to set conservative timings Date: Mon, 25 Mar 2024 14:56:25 -0700 Message-ID: <20240325145626.1.I659b2517d9f619d09e804e071591ecab76335dfb@changeid> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog In-Reply-To: <20240325215631.3804796-1-dianders@chromium.org> References: <20240325215631.3804796-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If we're using the generic "edp-panel" compatible string and we fail to detect an eDP panel then we fall back to conservative timings for powering up and powering down the panel. Abstract out the function for setting these timings so it can be used in future patches. No functional change expected--just code movement. Signed-off-by: Douglas Anderson Reviewed-by: Hsin-Yi Wang --- drivers/gpu/drm/panel/panel-edp.c | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index c4f851200aa2..8a19fea90ddf 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -760,6 +760,25 @@ static void panel_edp_parse_panel_timing_node(struct device *dev, static const struct edp_panel_entry *find_edp_panel(u32 panel_id, const struct drm_edid *edid); +static void panel_edp_set_conservative_timings(struct panel_edp *panel, struct panel_desc *desc) +{ + /* + * It's highly likely that the panel will work if we use very + * conservative timings, so let's do that. + * + * Nearly all panels have a "unprepare" delay of 500 ms though + * there are a few with 1000. Let's stick 2000 in just to be + * super conservative. + * + * An "enable" delay of 80 ms seems the most common, but we'll + * throw in 200 ms to be safe. + */ + desc->delay.unprepare = 2000; + desc->delay.enable = 200; + + panel->detected_panel = ERR_PTR(-EINVAL); +} + static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel) { struct panel_desc *desc; @@ -816,26 +835,7 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel) dev_warn(dev, "Unknown panel %s %#06x, using conservative timings\n", vend, product_id); - - /* - * It's highly likely that the panel will work if we use very - * conservative timings, so let's do that. We already know that - * the HPD-related delays must have worked since we got this - * far, so we really just need the "unprepare" / "enable" - * delays. We don't need "prepare_to_enable" since that - * overlaps the "enable" delay anyway. - * - * Nearly all panels have a "unprepare" delay of 500 ms though - * there are a few with 1000. Let's stick 2000 in just to be - * super conservative. - * - * An "enable" delay of 80 ms seems the most common, but we'll - * throw in 200 ms to be safe. - */ - desc->delay.unprepare = 2000; - desc->delay.enable = 200; - - panel->detected_panel = ERR_PTR(-EINVAL); + panel_edp_set_conservative_timings(panel, desc); } else { dev_info(dev, "Detected %s %s (%#06x)\n", vend, panel->detected_panel->ident.name, product_id); From patchwork Mon Mar 25 21:56:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13603032 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 C948CC54E64 for ; Mon, 25 Mar 2024 21:57:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 345F710EB1E; Mon, 25 Mar 2024 21:57:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gXRUO4xh"; dkim-atps=neutral Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id D801710EB25 for ; Mon, 25 Mar 2024 21:57:02 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1de0f92e649so33940285ad.0 for ; Mon, 25 Mar 2024 14:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1711403821; x=1712008621; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QYCN6skM6Cit5WksDlDniZ8/1IrFMtsoAd0yueuyJuk=; b=gXRUO4xhpL6PwfErK7n5xEe5pdYMYoNg0HI46SmCERl2yBsFgo2FsEiCtVUkmVGUCH VSE3qm3z7EF2KZ0kE23VDCd8irgVy6X8IUOd7leJONg5ZtfkhRM7L87Mr0s7WDMTzp/+ WT/JuGSdlxPG4l4kwDfTf6q9FK89r3JPqG7eA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711403821; x=1712008621; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QYCN6skM6Cit5WksDlDniZ8/1IrFMtsoAd0yueuyJuk=; b=SdXlPox5G+j1zawPRRWMgTemtW5LxvJV2N3TFpSlaKC9VZCOncu/y1G3wCna9agAk7 11E4sXWlf4mak95ZY2thwzQsq5++YPbRal4Den4EFC5m9b3n+0iCiMDbcOHJh60P1fGC DFzsD4z40kmmisJJijbOkW1bvBT66Ok1rEgzMeCBJrArPCDRhHyzYWmlOJJKY503xV+6 mkfZvqaH4YxCr/an1zNFTZ+XCZNF4Lt1KnPTzKFscoMezM5/93F+e71Zr2F/Y+//MYKQ VuBjcif3zaYjiAP7jS43nP/UXIao1AMSxbP+NlHr/PbfWzlt6EhWRTAAaFJIsrlRV+MW ihLg== X-Gm-Message-State: AOJu0YyxZk/OV21/oHJnGaae0Bw5cY6NmatAfWOn+CuxQeMHj+MqnCUw vrBoA2KAgu31Lg6f4j2G2wF7RY6q9uoZdcV3u1xExWykmpt1WFLoSw9940ycpz5jRgVp0x16aNo = X-Google-Smtp-Source: AGHT+IEh+en9BRxmGIP3JNI1cG6+0j/qIqp4F0gaYXJA4luV0U4Ir1VjAwt2ENf87iBuWCJ8iqhbqQ== X-Received: by 2002:a17:903:987:b0:1e0:cd8a:58c with SMTP id mb7-20020a170903098700b001e0cd8a058cmr1285329plb.1.1711403821345; Mon, 25 Mar 2024 14:57:01 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:f21b:7dde:93cc:b987]) by smtp.gmail.com with ESMTPSA id n6-20020a170902e54600b001def0897284sm5207866plf.76.2024.03.25.14.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 14:57:00 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org Cc: Pin-yen Lin , Prahlad Kilambi , Hsin-Yi Wang , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] drm/panel-edp: If we fail to powerup/get EDID, use conservative timings Date: Mon, 25 Mar 2024 14:56:26 -0700 Message-ID: <20240325145626.2.Ia7a55a9657b0b6aa4644fd497a0bc595a771258c@changeid> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog In-Reply-To: <20240325215631.3804796-1-dianders@chromium.org> References: <20240325215631.3804796-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If at boot we fail to power up the eDP panel (most often happens if the eDP panel never asserts HPD to us) or if we are unable to read the EDID at bootup to figure out the panel's ID then let's use the conservative eDP panel powerup/powerdown timings but _not_ fail the probe. It might seem strange to _not_ fail the probe in this case since we were unable to powerup the panel and confirm it's there. However, there is a reason to do this. Specifically, if we fail to probe the panel then it really throws the whole display pipeline for loop. Most DRM subsystems are written so that they wait until all components (including the panel) have probed before they set everything up. When the panel doesn't come up then this never happens. As a side effect of not setting everything up then other display adapters don't get initialized. As a practical example, I can see that if I open up a sc7180-trogdor based Chromebook that's using the generic "edp-panel" and unplug the eDP panel that it causes the _external_ DP monitor not to function. This is obviously bad because it means that a device with a dead eDP panel becomes e-waste when it could instead still be given useful life with an external display. NOTES: - When we fail to probe like this, boot is a bit slow because we try several times to power the panel up. This doesn't feel horrible because it'll eventually work and the retries are known to help bring some panels up. - In the case where we hit the condition of failing to power up, the display will likely _never_ have a chance to work again until reboot. Once the panel-edp pm_runtime resume function fails it doesn't ever seem to retry. This is probably for the best given that we don't have any real timing/modes. eDP isn't expected to be "hotplugged" so this makes some sense. - It turns out that this makes panel-edp behave more similarly for users of the generic "edp-panel" compatible string and the old fixed panel compatible string. With the old fixed panel compatible string we don't talk to the panel during probe so we'd actually behave much the same way that we'll now behave for the generic "edp-panel". Signed-off-by: Douglas Anderson Reviewed-by: Hsin-Yi Wang --- drivers/gpu/drm/panel/panel-edp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 8a19fea90ddf..607cdd6feda9 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -808,7 +808,10 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel) /* Power the panel on so we can read the EDID */ ret = pm_runtime_get_sync(dev); if (ret < 0) { - dev_err(dev, "Couldn't power on panel to read EDID: %d\n", ret); + dev_err(dev, + "Couldn't power on panel to ID it; using conservative timings: %d\n", + ret); + panel_edp_set_conservative_timings(panel, desc); goto exit; } @@ -816,8 +819,8 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel) if (base_block) { panel_id = drm_edid_get_panel_id(base_block); } else { - dev_err(dev, "Couldn't identify panel via EDID\n"); - ret = -EIO; + dev_err(dev, "Couldn't read EDID for ID; using conservative timings\n"); + panel_edp_set_conservative_timings(panel, desc); goto exit; } drm_edid_decode_panel_id(panel_id, vend, &product_id); @@ -844,12 +847,11 @@ static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel) desc->delay = *panel->detected_panel->delay; } - ret = 0; exit: pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); - return ret; + return 0; } static int panel_edp_probe(struct device *dev, const struct panel_desc *desc, From patchwork Mon Mar 25 21:56:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13603031 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 0335AC54E64 for ; Mon, 25 Mar 2024 21:57:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4778C10EB25; Mon, 25 Mar 2024 21:57:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CjibLeRm"; dkim-atps=neutral Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by gabe.freedesktop.org (Postfix) with ESMTPS id C9BEC10EB1C for ; Mon, 25 Mar 2024 21:57:04 +0000 (UTC) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1e0511a4383so34716665ad.2 for ; Mon, 25 Mar 2024 14:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1711403823; x=1712008623; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NhZQWaJshhfD9wSXRNVLw92v4FQ+jJkjj3c/jVf2VJg=; b=CjibLeRmz9+tEUbFgsvT7XEYnL5dKUZPXUhHP3F5E1xWvZV+sfRns67dTgjIFYjVSs vRknGGhNI8sC8J7+1OCzOV017GUb+2pwXiG8z4YrIqg3V13JvkV4CdomgiGYLXW8xljS UxQjfVPS1goACwiaMnV2x1mL9F7ANF3shcAes= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711403823; x=1712008623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NhZQWaJshhfD9wSXRNVLw92v4FQ+jJkjj3c/jVf2VJg=; b=Xu6OsCMs6w6QBDOkqUzsA02SneclcLApfTl5hO1wzHM97RjGzCRe8I7IOugysCR8gq CvJN/Hi1yj61mTpRzCjqRGGEkAY2oM0HoOAhkDNzvMLAGosw5iPqtF8YkT+kvHex8QKP 7ZuIcdMT9259qL2ZrUymwGLMoBuC9fjbXhcJfkRH0IGNaKKqlHk67YQakHDmp7HLK/YM mD1dS7FuoAEXaHZUVzGVb/LwOsL910cHa10guLfgwEZsa6Z9tnnfR6Bolyza2/lDQDVI 7Cy/SWLL3rCFHmpl5Gce81n/S+GtKrmQqpa66ck0JEUevUMjTGE1BsC6JzaTnlvANieu sYOA== X-Gm-Message-State: AOJu0Yy/ln5B50EAxsiI3uaeQBOv8P6xYtXusCZsuD7ByuFAhpVpEjy8 lrxj5EQrxfYnAfYkhq9prwbpxTTACEnSuc1ifa0v3NEh8+k4P7azo3Oml+DUkC3URtXlhE+3mhY = X-Google-Smtp-Source: AGHT+IG1pvV8JIModEf24NBBDg2YYgu41Tt2PrJ+H3EuIJzXqbRq4KaflfyB/AcYHVm8d9sODDNTeg== X-Received: by 2002:a17:902:cecb:b0:1e0:a678:5b55 with SMTP id d11-20020a170902cecb00b001e0a6785b55mr7152128plg.11.1711403823404; Mon, 25 Mar 2024 14:57:03 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:f21b:7dde:93cc:b987]) by smtp.gmail.com with ESMTPSA id n6-20020a170902e54600b001def0897284sm5207866plf.76.2024.03.25.14.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 14:57:02 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org Cc: Pin-yen Lin , Prahlad Kilambi , Hsin-Yi Wang , Douglas Anderson , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] drm-panel: If drm_panel_dp_aux_backlight() fails, don't fail panel probe Date: Mon, 25 Mar 2024 14:56:27 -0700 Message-ID: <20240325145626.3.I552e8af0ddb1691cc0fe5d27ea3d8020e36f7006@changeid> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog In-Reply-To: <20240325215631.3804796-1-dianders@chromium.org> References: <20240325215631.3804796-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If we're using the AUX channel for eDP backlight and it fails to probe for some reason, let's _not_ fail the panel probe. At least one case where we could fail to init the backlight is because of a dead or physically missing panel. As talked about in detail in the earlier patch in this series, ("drm/panel-edp: If we fail to powerup/get EDID, use conservative timings"), this can cause the entire system's display pipeline to fail to come up and that's non-ideal. If we fail to init the backlight for some transitory reason, we should dig in and see if there's a way to fix this (perhaps retries?). Even in that case, though, having a panel whose backlight is stuck at 100% (the default, at least in the panel Samsung ATNA33XC20 I tested) is better than having no panel at all. Signed-off-by: Douglas Anderson Reviewed-by: Hsin-Yi Wang --- If needed, I could split this into two patches: one for each of the two panels that use drm_panel_dp_aux_backlight(). Since they both go through drm-misc, though, it doesn't feel worth it. drivers/gpu/drm/panel/panel-edp.c | 8 +++++++- drivers/gpu/drm/panel/panel-samsung-atna33xc20.c | 9 +++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index 607cdd6feda9..0bf66d9dd5b8 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -944,8 +944,14 @@ static int panel_edp_probe(struct device *dev, const struct panel_desc *desc, err = drm_panel_dp_aux_backlight(&panel->base, panel->aux); pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); + + /* + * Warn if we get an error, but don't consider it fatal. Having + * a panel where we can't control the backlight is better than + * no panel. + */ if (err) - goto err_finished_pm_runtime; + dev_warn(dev, "failed to register dp aux backlight: %d\n", err); } drm_panel_add(&panel->base); diff --git a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c b/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c index 9c336c71562b..6828a4f24d14 100644 --- a/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c +++ b/drivers/gpu/drm/panel/panel-samsung-atna33xc20.c @@ -328,9 +328,14 @@ static int atana33xc20_probe(struct dp_aux_ep_device *aux_ep) ret = drm_panel_dp_aux_backlight(&panel->base, aux_ep->aux); pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); + + /* + * Warn if we get an error, but don't consider it fatal. Having + * a panel where we can't control the backlight is better than + * no panel. + */ if (ret) - return dev_err_probe(dev, ret, - "failed to register dp aux backlight\n"); + dev_warn(dev, "failed to register dp aux backlight: %d\n", ret); drm_panel_add(&panel->base);