Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2359380rdf; Mon, 6 Nov 2023 11:41:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6HcdrSc1NHy0OeiZ43lakqRSiLpQciE8kF25kNeChVIj2M/OzE5arcwq5NIeG6Y0hKLNI X-Received: by 2002:a17:90b:3601:b0:27d:839:52ae with SMTP id ml1-20020a17090b360100b0027d083952aemr25490035pjb.32.1699299693733; Mon, 06 Nov 2023 11:41:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699299693; cv=none; d=google.com; s=arc-20160816; b=OLzwDfu1kt7CDg+/bNJPO64FwMy1QTnpZxGnvyfRmr192vchqHuHQUXJZz80YRfzi8 tSI0xAWdhTOzjvF99QgcBhNgoyDwtyv5p8reDiwnE47XrgOWaY/77DLU3H0ggriI04dY 5wT/S2MKNGCCCtZ5oGlxd1Mxfr7RUwvekDdO2uBxQyXH2u5kvlHkgZXHYojrykTpuLeV BWP9L79kzEsrvKFjdbiGkH1N503ucimKqdzmcTl6fCHejhCvSp2osT1vtYcJhtheSOwX 8rusQrOczy+xUZG27eQf2da2VgX21QP2ypXXLzOC+cqDCf7IqrRbn3kpAZYR0g2Odvwd X+cQ== 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=QLjTTp2u01IElZGHml90XkiK04GyI0lhbaUbWi23A5s=; fh=BussOnpnYONCCAP9DFnEY+SRxkG2v4mqXO1S56mtOYs=; b=qYPsZRD9hrkH0l4bIMagl5SLLTD/Y9MoCRIz0U6hHTiBlCO4h5G8OrzM3n4+uvfzHh Ugoc1b7foVXA+cLG55GKTYQ6SNH/KJXjZMEEFYVKOfv9/2qEa9pbgmyicHAZOXpJP7BN mTjKeOOOPd7UDawLgUk/zWMeGFXqfnZeM8M4Mb6I3RMRnvWW3xKvXXBxrAXSV7tlFkoO agchlOZBJaZDoHQeCO5PKYPK2tp+ce8R6kdfnsfMb9OiG5yS3NyqCHPiVshhxHbuXafc E6UxcX1zuoLHw/vRTeBBuIr7dXdfMXs6wpDr6oWJxS4VAUsrvKMVM5eWaFgGkJ4K6Nha uwgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mcoF9QvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j15-20020a17090a738f00b0027740192bc9si8676440pjg.152.2023.11.06.11.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 11:41:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mcoF9QvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E42A58069D82; Mon, 6 Nov 2023 11:40:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232721AbjKFTkr (ORCPT + 99 others); Mon, 6 Nov 2023 14:40:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232939AbjKFTkc (ORCPT ); Mon, 6 Nov 2023 14:40:32 -0500 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E343210EC for ; Mon, 6 Nov 2023 11:39:40 -0800 (PST) Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6ce2b6b3cb6so3187496a34.3 for ; Mon, 06 Nov 2023 11:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1699299580; x=1699904380; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QLjTTp2u01IElZGHml90XkiK04GyI0lhbaUbWi23A5s=; b=mcoF9QvQxOlafc8+y0gD5eocqr/jpT6TBj3bCMeC+5gXgIrDxELH60E/Lc9Uc4kImD XzR9SfF175WO572Kce0A0bl+zVdBMtJM5j33nEwiNX6aP8EurmujsWidrik1ZxmWZOlr kkx2KDDzwn64BUY9ry2ea8GHA1AIlQlHr0viM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699299580; x=1699904380; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QLjTTp2u01IElZGHml90XkiK04GyI0lhbaUbWi23A5s=; b=QSHkNbg6BEHzb/6POihHBW+QR2142I7aohNajUJx/J1AiNftr8WjlNcmHP4LVhYyz1 Br6tyH+mXRUDojB5+6AttoSZueBgz8o86GvvdRpR7ceYwZmWjy9dMg5a0f3fes3Y+vbd GcVCm5GLqSeJs8b39OXrBYBfGm/J0XRoVLFJovXPByqwhK6iq3TplCF+xv/S1Rtn+Jwl d9z8OjwPuVXVOVs18kyLwklUU6ovuItEFYDb3SBdmf9yDYctTdGvCpDO/2eJLbbSmKkn bblPRujXe5Ku4G20At5F4IwSI+g7pnjyn6v85MfwBuZJUsTHtL/ao6hANqJaLrFi34uQ lAFw== X-Gm-Message-State: AOJu0YzNtcItai+o0CffmJMHqsvyN+ziJc2gAdHyOuurqxkJqXpEKSgx 5TcYeGBeZcDUV/f+zKjC3yxT/dPdHr1UuogWYqhvDQ== X-Received: by 2002:a05:6830:3105:b0:6bc:c542:6f75 with SMTP id b5-20020a056830310500b006bcc5426f75mr42805371ots.0.1699299580218; Mon, 06 Nov 2023 11:39:40 -0800 (PST) MIME-Version: 1.0 References: <20231101212604.1636517-1-hsinyi@chromium.org> <20231101212604.1636517-4-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Mon, 6 Nov 2023 11:39:14 -0800 Message-ID: Subject: Re: [PATCH 3/3] drm/panel-edp: Choose correct preferred mode To: Doug Anderson Cc: Maxime Ripard , Dmitry Baryshkov , Neil Armstrong , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Jessica Zhang , Sam Ravnborg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 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=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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 11:40:50 -0800 (PST) On Mon, Nov 6, 2023 at 8:21=E2=80=AFAM Doug Anderson wrote: > > Hi, > > On Mon, Nov 6, 2023 at 12:06=E2=80=AFAM Maxime Ripard wrote: > > > > On Thu, Nov 02, 2023 at 07:33:48AM -0700, Doug Anderson wrote: > > > Hi, > > > > > > On Wed, Nov 1, 2023 at 11:31=E2=80=AFPM Dmitry Baryshkov > > > wrote: > > > > > > > > On Wed, 1 Nov 2023 at 23:26, Hsin-Yi Wang wro= te: > > > > > > > > > > If a non generic edp-panel is under aux-bus, the mode read from e= did would > > > > > still be selected as preferred and results in multiple preferred = modes, > > > > > which is ambiguous. > > > > > > > > > > If a hard-coded mode is present, unset the preferred bit of the m= odes read > > > > > from edid. > > > > > > > > Can we skip the EDID completely if the hardcoded override is presen= t? > > > > > > Yeah, I wondered about that too. The blending of the hardcoded with > > > the EDID predates my involvement with the driver. You can see even as > > > of commit 280921de7241 ("drm/panel: Add simple panel support") that > > > the driver would start with the EDID modes (if it had them) and then > > > go onto add the hardcoded modes. At least for eDP panels, though, > > > nobody (or almost nobody?) actually provided panel-simple a DDC bus a= t > > > the same time it was given a hardcoded panel. > > > > > > I guess I could go either way, but I have a slight bias to adding the > > > extra modes and just making it clear to userspace that none of them > > > are "preferred". That seems like it would give userspace the most > > > flexibility > > > > I disagree. "Flexibility" here just means "the way to shoot itself in > > the foot without knowing it's aiming at its foot". > > > > If a mode is broken, we shouldn't expose it, just like we don't for all > > modes that require a maximum frequency higher than what the controller > > can provide on HDMI for example. > > In this particular case we aren't saying that modes are broken. There > are two (somewhat separate) things in Hsin-Yi's series. > > The first thing is a quirk for panels with incorrect modes in their > EDID when using the generic "edp-panel" compatible. In that case we > now _replace_ the broken mode with a more correct one because, as you > say, we shouldn't be telling userspace about a broken mode. > > The second thing in Hsin-Yi's series is for when we're _not_ using the > generic "edp-panel". In that case we have a hardcoded mode from the > "compatible" string but we also have modes from the EDID and that's > what ${SUBJECT} patch is about. Here we don't truly know that the > modes in the EDID are broken. > > > > > and also is closer to what we've historically done (though, > > > historically, we just allowed there to be more than one "preferred" > > > mode). > > > > I have no idea what history you're referring to here > > History =3D historical behavior? As above, I pointed out that the kernel > has been merging the hardcoded and EDID modes as far back as commit > 280921de7241 ("drm/panel: Add simple panel support") in 2013. > > That being said, the historical behavior has more than one mode marked > preferred which is bad, so we're changing the behavior anyway. I'm not > against changing it to just have the hardcoded mode if that's what > everyone else wants (and it sounds like it is). I'll change the behavior to: if hard-coded mode presents, don't add edid mode since it will result in multiple preferred modes.