Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp1990436lfo; Sat, 28 May 2022 12:55:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi5FCKn9vi/9pCjkYyncL/XRKf4r6FiZZfpjppKlswui/mwtsO3e8hCtsKI7x7+TZ4ItFr X-Received: by 2002:a63:5:0:b0:3c6:dcb2:428 with SMTP id 5-20020a630005000000b003c6dcb20428mr42224053pga.73.1653767709801; Sat, 28 May 2022 12:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653767709; cv=none; d=google.com; s=arc-20160816; b=X76m3JBmMw2Odk9u++nHJ+jT13alo1FoGa4DustfJELGPqC+azNbbr1r2X069ii5FB 5vu69YiFg6m8CBNZhTdbV6O7rXZ+UwyMwl6idHW0/4VgUZ83P0T8qBMsr3yTq1PKlAgw WHAmDr72LJJxbY2JwlBxzhQYXBAu/6cW8SPthWuD/vjVbXlnLFBSwJQ3lzsjrXK6Rhh2 bmUjGcLbdzUJ8h5M20eh6n+yV5E8q5ScddVCsrFSqFEgjEUY+u64pPhyFpnhs6A6iMsv U+yuXJlzg0mmiiwmUqNDMzDN/9WGZrttQA5g/y7uRikSTUbfkO/cov4nIvV4FK+Oceo2 KuGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=muVoFK53cly8UGkO/IVCCGOOWf4SlvW8Ah8wz/JuMYA=; b=CJ621bNbYbxu5/6DDUF7lm/vX7sQkeemjrvO9iAGj5RWXMZl2XlmochG0ty9WK80Mh FHIfbWZWhZh/ckhIxuLG27cGXfThIWkDffJM6J1vwt4Zu1utFv3Z5ROn9uf4QBJiK2oE jhGMEvDXQ6RoXiQIXSc2SUuEXQQ2ybRASxCKHYGa8Swt7B85ZZxK3z68kpVMP8+1YM8B HhDE0cRAs9ArYhhoXRDrbAsIc/IHzIkS64nNrA2ggUsN04ImhnWGDbfDEUS4VvbC8HgE pEqed0f1dUfkK2MUDcfWQV9MgzrWUZvjQqEy/GiNMqoRXS2x04nmfPD5Q6c1/kRjgyTe v8ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AxVXi03p; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i66-20020a625445000000b0051897ee8630si8834435pfb.297.2022.05.28.12.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:55:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AxVXi03p; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9485D8AE40; Sat, 28 May 2022 12:15:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348049AbiEZQBa (ORCPT + 99 others); Thu, 26 May 2022 12:01:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240022AbiEZQB1 (ORCPT ); Thu, 26 May 2022 12:01:27 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB35BB8 for ; Thu, 26 May 2022 09:01:25 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id f21so3762955ejh.11 for ; Thu, 26 May 2022 09:01:25 -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:content-transfer-encoding; bh=muVoFK53cly8UGkO/IVCCGOOWf4SlvW8Ah8wz/JuMYA=; b=AxVXi03p5UNt0Fr/8FDLRPX5zQexwuRutI6hUxd4KJvSUBo+WTG0kvpmKKylKzPIqu 1lWSrumYqzhq0Cvn7on/Uq/4WfbWeYVdE7dtbnD8vjC/Wi9w3PVjCHwFmAPpsJsqZJqp jcyV/+yVBLz9Ii3IVSUC8uEj79X4+PYhrVtbg= 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:content-transfer-encoding; bh=muVoFK53cly8UGkO/IVCCGOOWf4SlvW8Ah8wz/JuMYA=; b=aw0nS+RVykevnxjVdW3LcBLV6ZR3D4I0jvULrG7bVAmKE2obS6SN+DwGLG4uaRrbPj FnFjplUCntcemArtwzw+mWkggWIOqHuM5kwxQp/0epCjWwWFPBg5b7qW9d5blXQyJsNs aHrNwn1BatsCjwwYiBwbbCtKI75Y3cOV32B3gmuwMQkTM32Y9Ae4idCYfuMVlcxAhT75 pUuECq1q4nT4qN90E0zxvvCXn1ZpqD2a4rLnlgTUo2aQBjlx1mkLKMsFMe42vyEuJXrN 9jWvEwmHZb5I7HsRuic5jxzpIM4X6MV0xRgRmuJAsVkTniv247RFX5drwwt6jrM4NScB 8gdA== X-Gm-Message-State: AOAM530IF47IhXXvEM0iUlQt53k3u2y/ZORWWnaoRZZ0Zj0UdKT3wzFm 38m4Bl8jwoqPWe8q7I4dgpyrnSovPHjlwsrH4uo= X-Received: by 2002:a17:907:9686:b0:6ff:d7c:8717 with SMTP id hd6-20020a170907968600b006ff0d7c8717mr9245988ejc.171.1653580883389; Thu, 26 May 2022 09:01:23 -0700 (PDT) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com. [209.85.221.51]) by smtp.gmail.com with ESMTPSA id s20-20020a508d14000000b0042aba7ed532sm960818eds.41.2022.05.26.09.01.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 May 2022 09:01:18 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id t6so2700678wra.4 for ; Thu, 26 May 2022 09:01:16 -0700 (PDT) X-Received: by 2002:a5d:5085:0:b0:20d:5f6:63fa with SMTP id a5-20020a5d5085000000b0020d05f663famr31419542wrt.679.1653580875415; Thu, 26 May 2022 09:01:15 -0700 (PDT) MIME-Version: 1.0 References: <20220513130533.v3.1.I31ec454f8d4ffce51a7708a8092f8a6f9c929092@changeid> <5857c510-9783-a483-8414-65d7350618d6@suse.de> In-Reply-To: From: Doug Anderson Date: Thu, 26 May 2022 09:01:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] drm/probe-helper: Make 640x480 first if no EDID To: Daniel Vetter Cc: Sean Paul , Thomas Zimmermann , =?UTF-8?Q?St=C3=A9phane_Marchesin?= , dri-devel , "Aravind Venkateswaran (QUIC)" , "Kuogee Hsieh (QUIC)" , Jani Nikula , Rob Clark , Sankeerth Billakanti , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , "Abhinav Kumar (QUIC)" , Dmitry Baryshkov , Stephen Boyd , freedreno , linux-arm-msm , David Airlie , Maarten Lankhorst , Maxime Ripard , LKML , Sean Paul Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 Thu, May 26, 2022 at 8:42 AM Daniel Vetter wrote: > > On Thu, 26 May 2022 at 03:28, Sean Paul wrote: > > > > On Wed, May 25, 2022 at 9:26 AM Daniel Vetter wrote: > > > > > > On Mon, May 23, 2022 at 05:59:02PM -0700, Doug Anderson wrote: > > > > Hi, > > > > > > > > On Fri, May 20, 2022 at 5:01 PM Doug Anderson wrote: > > > > > > > > > > Hi, > > > > > > > > > > On Mon, May 16, 2022 at 3:28 AM Thomas Zimmermann wrote: > > > > > > > > > > > > Hi Douglas, > > > > > > > > > > > > I understand that you're trying to tell userspace that the mode= list has > > > > > > been made up, but it's not something that should be done via fr= agile > > > > > > heuristics IMHO. > > > > > > > > > > > > I looked at the Chromium source code that you linked, but I can= not say > > > > > > whether it's doing the correct thing. It all depends on what yo= ur > > > > > > program needs. > > > > > > > > > > > > In that function, you could also search for 'DRM_MODE_TYPE_USER= DEF'. > > > > > > It's the mode that the user specified on the kernel command lin= e. If > > > > > > Chromium's automatic mode selection fails, you'd give your user= s direct > > > > > > control over it. > > > > > > > > > > That doesn't really work for Chrome OS. Certainly a kernel hacker > > > > > could do this, but it's not something I could imagine us exposing= to > > > > > an average user of a Chromebook. > > > > > > > > > > > > > > > > When there's no flagged mode or if > > > > > > /sys/class/drm/card<...>/status contains "unconnected", you can= assume > > > > > > that the modelist is artificial and try the modes in an appropr= iate order. > > > > > > > > > > So "no flagged" means that nothing is marked as preferred, correc= t? > > > > > > > > > > ...so I guess what you're suggesting is that the order that the k= ernel > > > > > is presenting the modes to userspace is not ABI. If there are no > > > > > preferred modes then userspace shouldn't necessarily assume that = the > > > > > first mode returned is the best mode. Instead it should assume th= at if > > > > > there is no preferred mode then the mode list is made up and it s= hould > > > > > make its own decisions about the best mode to start with. If this= is > > > > > the ABI from the kernel then plausibly I could convince people to > > > > > change userspace to pick 640x480 first in this case. > > > > > > > > > > > If we really want the kernel to give additional guarantees, we = should > > > > > > have a broader discussion about this topic IMHO. > > > > > > > > > > Sure. I've added St=C3=A9phane Marchesin to this thread in case h= e wants to > > > > > chime in about anything. > > > > > > > > > > Overall, my take on the matter: > > > > > > > > > > * Mostly I got involved because, apparently, a DP compliance test= was > > > > > failing. The compliance test was upset that when it presented us = with > > > > > no EDID that we didn't default to 640x480. There was a push to ma= ke a > > > > > fix for this in the Qualcomm specific driver but that didn't sit = right > > > > > with me. > > > > > > > > > > * On all devices I'm currently working with (laptops), the DP is = a > > > > > secondary display. If a user was trying to plug in a display with= a > > > > > bad EDID and the max mode (1024x768) didn't work, they could just= use > > > > > the primary display to choose a different resolution. It seems > > > > > unlikely a user would truly be upset and would probably be happy = they > > > > > could get their broken display to work at all. Even if this is a > > > > > primary display, I believe there are documented key combos to cha= nge > > > > > the resolution of the primary display even if you can't see anyth= ing. > > > > > > > > > > * That all being said, defaulting to 640x480 when there's no EDID= made > > > > > sense to me, especially since it's actually defined in the DP spe= c. So > > > > > I'm trying to do the right thing and solve this corner case. That > > > > > being said, if it's truly controversial I can just drop it. > > > > > > > > > > > > > > > So I guess my plan will be to give St=C3=A9phane a little while i= n case he > > > > > wants to chime in. If not then I guess I'll try a Chrome patch... > > > > > ...and if that doesn't work, I'll just drop it. > > > > > > > > OK, this userspace code seems to work: > > > > > > > > https://crrev.com/c/3662501 - ozone/drm: Try 640x480 before picking > > > > the first mode if no EDID > > > > > > > > ...so we'll see how review of that goes. :-) > > > > Mirroring some of my comments on that review here :-) > > > > IMO, this should be addressed in the kernel, or not at all. The kernel > > ensures other aspects of DisplayPort implementation are compliant, so > > I don't think this would be any exception. Further, the kernel is the > > one creating the "safe" mode list, so it seems odd that userspace > > would override that. Finally, relying on every userspace to do the > > right thing is asking for trouble (we have 3 places which would need > > this logic in CrOS). > > Oh I missed the part that this is defined in the DP spec as _the_ fallbac= k mode. > > I think the probe helpers could check whether it's a DP connector and > then dtrt per DP spec? I think that should have a solid chance of > avoiding the regression mess, since the really shoddy stuff tends to > be VGA/HDMI. I'm fine with making this DP-specific if that's what people think is best. > Also if DP says only 640x480 should be the fallback if there's no > other mode list source, then I think we should trim it down to only > that. But also only for DP. So the DP spec says that 640x480 is _the_ default fallback, but it also says that we're also allowed to have some implementation-specific fall-back modes as well, so I'd rather not fully trim the list and just make it clear (somehow) that 640x480 ought to be the default. Would you be OK going back to v2 of this patch [1] but adding a check that the connector type is DP and also making sure that the spec is referenced? > Also ofc that patch should reference the right DP spec sections :-) My original patch description for this patch (v3) did reference section 4.2.2.6 (EDID Corruption Detection) of the DP 1.4a Link CTS. ...or did you want this in inline comments in the patch itself? [1] https://lore.kernel.org/r/20220510135101.v2.1.I31ec454f8d4ffce51a7708a8= 092f8a6f9c929092@changeid