Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp849229iof; Mon, 6 Jun 2022 13:47:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysObf0Bn+PDsi6z7vidimQl9EorjDaGjPVv6aTel9mlIncpszei/Ew6XkJXvo8Kzu8s+0F X-Received: by 2002:a63:d44:0:b0:3fa:e913:6640 with SMTP id 4-20020a630d44000000b003fae9136640mr22207085pgn.551.1654548420747; Mon, 06 Jun 2022 13:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654548420; cv=none; d=google.com; s=arc-20160816; b=MqYXvjh9J+pYMuvsrEMO60D29eGCR1ztZYenzTJRIQZjWeOrp5QzLpgLeyjMl5Meot VnKqi/csz6JbMj2o3Ge6Jq5WTs6OYjuMliLpOcaw2FmDSeXGp1x4y8VWynEbvMxAlw3m W8uadsl3uj2LT+BV7/2ePcRWZ+qV1TW2+6CjrbnCY8GKU6J1Rp0nA3NQIwASVYXhEwH8 tJSJHrM083/qH8NRUJHoFimzCZfWbR9mGAKaFlGl5mQaDUwWne09w6cG5HgbmRNZSfa9 kx0nfD/7VFg00NivtTBRAiM8IOQm7F9ms8z7POdCaJSC+nvXuXqx38j33dHVUKtc06hZ tFOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HCWIcD+SfRMw/M9RRt+jg58AphPseq4gfsJ1F6OVZZU=; b=1BNruRZgUjBEBLsomkgve2/uecrdk1prV6J4L27oPixvuV+gW/Etq5WkTJqwNyFEAo drERDsAKUnVZ7jQFEAB9TOoX42cIEa4RAq+hk64T0WLyh3NvHe5rltrp6zg+LqgCD+LY pFeKM4eoqT8ErYLZBBnE3PGRnWUHa/2K4bCKRjUO/U9wOWAbn7qD8VIjds2y+KXrqwdJ elzMrxDYz5Do7zaBGnHSWVhvrFgeT4OcgYm74hdOssTYSgFLMDXisa2axgSgNoxYEZjS zPax5NiRKiKFXhWlPTlOnw1K8NxSyvHKXvXTtFD7B5SOgg2ZWDvePN4GYOIWStdqts35 Jdzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L64JkmvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oc2-20020a17090b1c0200b001e26ef28512si22010466pjb.189.2022.06.06.13.46.47; Mon, 06 Jun 2022 13:47:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L64JkmvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233055AbiFFUMO (ORCPT + 99 others); Mon, 6 Jun 2022 16:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233171AbiFFUMH (ORCPT ); Mon, 6 Jun 2022 16:12:07 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 055C7108F for ; Mon, 6 Jun 2022 13:12:03 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id me5so30557105ejb.2 for ; Mon, 06 Jun 2022 13:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HCWIcD+SfRMw/M9RRt+jg58AphPseq4gfsJ1F6OVZZU=; b=L64JkmvDNh1FIACsNToXduJszZ5RYI3mnVnXlEJgBMBcVUIJznBmtDp/P0EKumXSX/ zad6k3tZainA3cYz+aKtsb03+xotN0Og3MtfFmorTrxvRWwPwuEKwx8H4Vj5ghwhAf3G CWzDhBbC4GdfPTWfSGrqktycegGjlYT4PyutU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HCWIcD+SfRMw/M9RRt+jg58AphPseq4gfsJ1F6OVZZU=; b=H4vtqqT0dSobNmRxor8HINObXpnonUADc9XcKjcB96E5SjUT0qwXzmts+U1qTaoZmM Tn5+Kcy0ifDSVwNO8dGhnc3zk4jKNE8nyB58Un2rBXlRaoHhKB2dECyKOFSrUgBlsP+6 nlwtXs3rKgiQ8tenUh55fPB/dyjAGMahxj5ioYie5qPj0rGOGd9Ow6ObmEe5bWs0u4F5 UWsoCKBtpAiCl+i3yYE3KdDk6T8L/WFxf0mQ/hQxfym3YBurSJt6JM9ZhlGioKgS8j07 D+Hn+mt83sOg3vANZL6CIs+IqKIZyKWgxhW0qF/CbXPzM/U4FHJ0e1uFA8FivfgNwxtt IzMQ== X-Gm-Message-State: AOAM532p4w6V5fBmcWQzkiiPNlCqt0ZLzQezWJf+koRCwpTjA4WR4uOa ENJAICq++FLc/+dv1nppWqhyjOBub1XeFdARJ/Q= X-Received: by 2002:a17:907:7294:b0:6ff:200e:8d62 with SMTP id dt20-20020a170907729400b006ff200e8d62mr23124456ejc.719.1654546320956; Mon, 06 Jun 2022 13:12:00 -0700 (PDT) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com. [209.85.128.53]) by smtp.gmail.com with ESMTPSA id be5-20020a0564021a2500b0042e09f44f81sm7845341edb.38.2022.06.06.13.11.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jun 2022 13:12:00 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id r123-20020a1c2b81000000b0039c1439c33cso8440583wmr.5 for ; Mon, 06 Jun 2022 13:11:59 -0700 (PDT) X-Received: by 2002:a05:600c:591:b0:39c:4544:b814 with SMTP id o17-20020a05600c059100b0039c4544b814mr14648542wmd.118.1654546319242; Mon, 06 Jun 2022 13:11:59 -0700 (PDT) MIME-Version: 1.0 References: <20220601112302.v4.1.I31ec454f8d4ffce51a7708a8092f8a6f9c929092@changeid> In-Reply-To: <20220601112302.v4.1.I31ec454f8d4ffce51a7708a8092f8a6f9c929092@changeid> From: Doug Anderson Date: Mon, 6 Jun 2022 13:11:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4] drm/probe-helper: Default to 640x480 if no EDID on DP To: dri-devel , Daniel Vetter Cc: Dmitry Baryshkov , Thomas Zimmermann , linux-arm-msm , Stephen Boyd , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Sankeerth Billakanti , "Kuogee Hsieh (QUIC)" , "Abhinav Kumar (QUIC)" , Rob Clark , freedreno , Jani Nikula , "Aravind Venkateswaran (QUIC)" , David Airlie , Maarten Lankhorst , Maxime Ripard , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Jun 1, 2022 at 11:23 AM Douglas Anderson wrote: > > If we're unable to read the EDID for a display because it's corrupt / > bogus / invalid then we'll add a set of standard modes for the > display. Since we have no true information about the connected > display, these modes are essentially guesses but better than nothing. > At the moment, none of the modes returned is marked as preferred, but > the modes are sorted such that the higher resolution modes are listed > first. > > When userspace sees these modes presented by the kernel it needs to > figure out which one to pick. At least one userspace, ChromeOS [1] > seems to use the rules (which seem pretty reasonable): > 1. Try to pick the first mode marked as preferred. > 2. Try to pick the mode which matches the first detailed timing > descriptor in the EDID. > 3. If no modes were marked as preferred then pick the first mode. > > Unfortunately, userspace's rules combined with what the kernel is > doing causes us to fail section 4.2.2.6 (EDID Corruption Detection) of > the DP 1.4a Link CTS. That test case says that, while it's OK to allow > some implementation-specific fall-back modes if the EDID is bad that > userspace should _default_ to 640x480. > > Let's fix this by marking 640x480 as default for DP in the no-EDID > case. > > NOTES: > - In the discussion around v3 of this patch [2] there was talk about > solving this in userspace and I even implemented a patch that would > have solved this for ChromeOS, but then the discussion turned back > to solving this in the kernel. > - Also in the discussion of v3 [2] it was requested to limit this > 83;40900;0c change to just DP since folks were worried that it would break some > subtle corner case on VGA or HDMI. > > [1] https://source.chromium.org/chromium/chromium/src/+/a051f741d0a15caff2251301efe081c30e0f4a96:ui/ozone/platform/drm/common/drm_util.cc;l=488 > [2] https://lore.kernel.org/r/20220513130533.v3.1.I31ec454f8d4ffce51a7708a8092f8a6f9c929092@changeid > > Signed-off-by: Douglas Anderson > Reviewed-by: Abhinav Kumar > --- > I put Abhinav's Reviewed-by tag from v2 here since this is nearly the > same as v2. Hope this is OK. > > Changes in v4: > - Code is back to v2, but limit to just DP. > - Beefed up the commit message. > > Changes in v3: > - Don't set preferred, just disable the sort. > > Changes in v2: > - Don't modify drm_add_modes_noedid() 'cause that'll break others > - Set 640x480 as preferred in drm_helper_probe_single_connector_modes() > > drivers/gpu/drm/drm_probe_helper.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) Pushed to drm-misc-next after cleaning up the turd that I somehow left in the commit message. fae7d186403e drm/probe-helper: Default to 640x480 if no EDID on DP -Doug