Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3964389ioo; Wed, 25 May 2022 11:39:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7AP2joS8OmOgGHGwv0MePr5xCq9jNnIT67LJeX5n2OxTuMTV6ZaKWCO5sjk0Z2w67up0k X-Received: by 2002:a05:6402:354c:b0:42b:4e22:203b with SMTP id f12-20020a056402354c00b0042b4e22203bmr21669457edd.308.1653503958591; Wed, 25 May 2022 11:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653503958; cv=none; d=google.com; s=arc-20160816; b=npOGFQhFHis7xcdBv12X/IO7nAxS1K+uExcRftDJnUm6sCYy9E1z02VFrfCbMfOIoL JvK60DuSIGLSLjdAC7SVgyUkL6Dbbzp10HSzCFgUBtah0Eyj0x4ooZmttDe+nxReXue3 S2ItZkZxmV7zYlUdjh+C4Rz/M4Mo5tBHwSwXYckLi+LOMGIL3TQJghsC8T3q9eEwjGmg I6b2Lzam4U3eJvolSjltMhSXktVtLi16Cy5QubNLWhHXXEDh/80bHww+RVKwPEosQ/r3 RC8yM3wV6IHK4PR6OsJkQ3yzoqtgmboH9lQScdfqCeKTZpqmtQzOCe91OgJ0/FSObOW3 5NYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=MpAJjoRKwGLkh3LcW90CCOydeHbiAiNXwW2FaiG7+5Y=; b=e4lo04u55fTxYtwqy/ZF8Chxq3zgp4whgvA+bF9aa/0j1ISaWLUNMCeEfJ1Jatkofy m+L2A2uQdl1xvkBK5clRjeJSdDYElylvlO2oUq8NnmF8ig48eXGOeCkWd0P08dpH9cwy NbOo7eGo4HPMkwxHeECa6eGDSyHueUy/wwSKt4k2ythz/CMrrgMg6MkWaGgIDlVzcw+i aAVzfSefAXkqQaixvUqrOL0/nCtkNd7qZpIBJnlpQkfhOlEauWXpj08eHBCHJF7aPWlQ bDBCQkFQj9zSjVinawG0KoeI30d+Ola1kdia+3ZF1trXGNYvyuzqy5Pj0gkjCZzoIPam zTVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="QQ8HN/d+"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg4-20020a1709072cc400b006e8424d10f3si21387255ejc.169.2022.05.25.11.38.52; Wed, 25 May 2022 11:39:18 -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=@ffwll.ch header.s=google header.b="QQ8HN/d+"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242619AbiEYN0g (ORCPT + 99 others); Wed, 25 May 2022 09:26:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232261AbiEYN00 (ORCPT ); Wed, 25 May 2022 09:26:26 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7AF3466C for ; Wed, 25 May 2022 06:26:25 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id p5-20020a1c2905000000b003970dd5404dso3367347wmp.0 for ; Wed, 25 May 2022 06:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=MpAJjoRKwGLkh3LcW90CCOydeHbiAiNXwW2FaiG7+5Y=; b=QQ8HN/d+PVpdcmWvwIk13yOR6arO1frU91StcQ9M/kCJ8FdOEutASVqNnl0oFm/EZH tEt0nVXQW764JiFG5GFiAGbr/Es2hBMAJ0BqVNCWdma0pXaFu0SUXYi0eyKowEidI3w3 7p7kfRhKxEPT55ahiSMGxdfw22s2xnhjVcBrc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=MpAJjoRKwGLkh3LcW90CCOydeHbiAiNXwW2FaiG7+5Y=; b=o+RDD++qC4sbgHScuvUB+8gfWHgHvajnsCzJeksZ2ephR7BZ2K35nDieaiFD8FFRtV Fhxn1Il8jH5SJrOsxaYpq/LwKqnwO35VFYowJuVDeDl8q7xkBLz3/p57RD16yKBnHMio OTDDC+E4UO9ew7nSqWue2iHvW3kWFmYE7vSE0BANmIFuMW/SDbiQT+opCvp3PVgOCjQx /Egpkl1hAPSKPbhShODlNmWS7VftzuPHTm1+GuPdixNXSvpiXGxzcf5vphBdrEJdK8wx W61a22vFrmZtqvz0A0ECfxs85GSXozp3Kr7OUKglFZn7fc6Zx+GwK8vPiVmnboZGEbkx gUNg== X-Gm-Message-State: AOAM531QHTVNMtFxxp8r46I1VIDKNIn+k3tiBtoBNi084nRAlvXOkG96 p+GgxGWculHfcWMsBnlW/PAIhQ== X-Received: by 2002:a05:600c:3b20:b0:397:6311:c0c7 with SMTP id m32-20020a05600c3b2000b003976311c0c7mr5836015wms.69.1653485184116; Wed, 25 May 2022 06:26:24 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t22-20020a1c7716000000b0039749bab534sm5164109wmi.1.2022.05.25.06.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 06:26:23 -0700 (PDT) Date: Wed, 25 May 2022 15:26:21 +0200 From: Daniel Vetter To: Doug Anderson Cc: Thomas Zimmermann , =?iso-8859-1?Q?St=E9phane?= Marchesin , dri-devel , "Aravind Venkateswaran (QUIC)" , "Kuogee Hsieh (QUIC)" , Jani Nikula , Rob Clark , Sankeerth Billakanti , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , "Abhinav Kumar (QUIC)" , Dmitry Baryshkov , Stephen Boyd , freedreno , linux-arm-msm , Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , LKML , Sean Paul Subject: Re: [PATCH v3] drm/probe-helper: Make 640x480 first if no EDID Message-ID: Mail-Followup-To: Doug Anderson , Thomas Zimmermann , =?iso-8859-1?Q?St=E9phane?= Marchesin , dri-devel , "Aravind Venkateswaran (QUIC)" , "Kuogee Hsieh (QUIC)" , Jani Nikula , Rob Clark , Sankeerth Billakanti , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , "Abhinav Kumar (QUIC)" , Dmitry Baryshkov , Stephen Boyd , freedreno , linux-arm-msm , David Airlie , Maarten Lankhorst , Maxime Ripard , LKML , Sean Paul References: <20220513130533.v3.1.I31ec454f8d4ffce51a7708a8092f8a6f9c929092@changeid> <5857c510-9783-a483-8414-65d7350618d6@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux phenom 5.10.0-8-amd64 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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 modelist has > > > been made up, but it's not something that should be done via fragile > > > heuristics IMHO. > > > > > > I looked at the Chromium source code that you linked, but I cannot say > > > whether it's doing the correct thing. It all depends on what your > > > program needs. > > > > > > In that function, you could also search for 'DRM_MODE_TYPE_USERDEF'. > > > It's the mode that the user specified on the kernel command line. If > > > Chromium's automatic mode selection fails, you'd give your users 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 appropriate order. > > > > So "no flagged" means that nothing is marked as preferred, correct? > > > > ...so I guess what you're suggesting is that the order that the kernel > > 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 that if > > there is no preferred mode then the mode list is made up and it should > > 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?phane Marchesin to this thread in case he 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 make 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 change > > the resolution of the primary display even if you can't see anything. > > > > * 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 spec. 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?phane a little while in 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. :-) Yeah it sucks a bit but I'm mildly afraid that if we muck around with the absolute fallback mode list in upstream we get whacked by a regression report :-/ There's the additional fun that on modern displays probably 720p (or maybe 720i) is a lot more likely to work than anything else really, so best we can do here maybe is to make it an uapi guarantee that if there's no preferred mode, then most likely the kernel invent random noise out of thin air, and userspace has to be careful and do its own magic heuristics. Or maybe we should add a flag for "this stuff is invented, buyer beware". I think clarifying that would be good. Changing defaults feels a bit too risky, we had some really hilarious regression reports in the past along the lines of the infamous xkcd. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch