Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp610322rbe; Thu, 29 Feb 2024 08:43:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWIiq4UlBg64qA+/Nk92B1HThpblktsiR9sgcCANRORIw/CTz1mNDe/o5Yl7wtYU8nbROe8/ErPwCde1uLd7sfl9CO2/rtoOIKCrJZNig== X-Google-Smtp-Source: AGHT+IH1Ni9YKr6uZdy//Ik8vgYB+mdyZ0JtZMShpUAxbeSjH3lp6aGgvtuWPsFncskL7gKYE3fB X-Received: by 2002:a17:906:3950:b0:a44:a5a:30c5 with SMTP id g16-20020a170906395000b00a440a5a30c5mr1481939eje.41.1709225019942; Thu, 29 Feb 2024 08:43:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709225019; cv=pass; d=google.com; s=arc-20160816; b=HToG+RXUqr33n3dMvCZuFb8RPWwJJTFEn0szzQ2Eryo9wd2BmB0cdWSboGSm0HaFA7 ScDcwvVa7Ti+GGUooxyUJGQYCr3/WqY+yiEAgxXXWEQUAQvI2CzUV1KXrmNAEUsKn9v4 SGZ3ZIj0XcTWcIc01eEwtxWIa8cd8uEa4MzPiWjY/I8jIqIMp/3QT4KxGtGzQKWkX5CW CpkJVFDYOL2GiIS98XlCHsbunFK5vZs3bFahV/HUPKFDxBWAO8g4gcbmxyAEy0uRPYJw c06hRKNPpFf+7a0Pm6hivrP2hF6ObxSOv/0yyrv0qJo9cqo5he9E35TEkvwk/uf8ex74 ckqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=Meztgok6VeiRAEUxUyRFOoAlopWttrRKwb9O1s8Qcw8=; fh=zX5EmcZPaHGl9sCwgwQNx6BYgNixXRlCapTTiNJqDmY=; b=ragSgC7En6Z6MxE1cMKxxtpkIih7uGyFex+Zd4SiheoMwopxE5RrQDyP7KYtx1+iU2 r5epRoMfBEugnvhlyEyV3XdxdEZxjQ7RQv1u1Gmml4+MMLn19/dkKeC7vZC2So37nObE cOPhH+fK70LA18x75gMZTdRBDLv00zIhlLSKCmC4fUALrORGJxBj+xTgJBm3KeToaxPA hVbCqWz12F8BfMSZ4Tt7F4jDCmPgwrgfEqC1zTs/bA0Vx/swEqPJds6FG1loIOl7o+cq umfqNqF1RrbawJMbk3np06EeOJk28rt+c/X7ohjvPfqpvLdWvKkEzpUTd8NChQFvjadi seVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NwPsqj5e; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-87098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jg5-20020a170907970500b00a4300fd3a57si746832ejc.850.2024.02.29.08.43.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 08:43:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NwPsqj5e; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-87098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B2FF91F24696 for ; Thu, 29 Feb 2024 16:43:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 785EA2D05D; Thu, 29 Feb 2024 16:43:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NwPsqj5e" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2210716063C for ; Thu, 29 Feb 2024 16:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709225013; cv=none; b=q/pmlt3tvd2nP+IpVarPSLyzGgoYEDCWjudsQ9UU+TsDNyHkmOyeDAvMY+cujxsN2PRSlbXwOeaHlLECRhny6Y82TLrDdYs4so5K3tJYLDHjAJSIRaCIHNyGSJ13PlmyGWTu/+ShgJMBz+eG/hEf3NaYHXeeBrg/Pgc+RQOHHLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709225013; c=relaxed/simple; bh=O64Lz4VhVZbPupITA0ycZpRV1MrL3MtI2W4plGilPig=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=gdJl0FGZIBrhIwcP2g2KfmnS8Bm9ZmjI4uiOAQPkGrt++Cynjvn9BJ9Ga8J3ih3OCETOJAc+TtaKbyvco029TwrlJsTr4rfKVbfuuDQfg9hKLKrX5Tzq4GRdzLhhYfGxl/Fka60apNX8Anjz0KsnWz4Sswqfo3QSVVJa65B8ADs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NwPsqj5e; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709225012; x=1740761012; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=O64Lz4VhVZbPupITA0ycZpRV1MrL3MtI2W4plGilPig=; b=NwPsqj5e8KhorGVY+7hp72eSGWGseaKpBbcOHKOd1ZNvI7RC+CiaG273 Y/sJPli/Pg72a1shAW5rjXLSsaoTvJBjg1KiAwvHfWHLom/Zdr6bhdIS8 cZDtYNMRhpOCeVgd0jOpWfVwrz+I1sbN9QuvaFxuWJijYlR8p4B7lpFus dylRcKISAlRu3G+y/bEbgwGcfQQdeT3m/cSVwwqVgq/GduKkVNOOdiX9L w+bTJc6ZifRv7KBJlQZtfQkgqjhbXzkKfOhIUiClmghxlAGi4FpywrpbS RuOyLMTjFBeLjXXjjb4Ha+PAOEOrSRf3mfnS+CpD2YDZ03AxZ0cEnPg+k Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10999"; a="3827678" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="3827678" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 08:43:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="7828309" Received: from unknown (HELO localhost) ([10.237.66.160]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 08:43:26 -0800 From: Jani Nikula To: Doug Anderson , Hsin-Yi Wang Cc: Neil Armstrong , Jessica Zhang , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] drm_edid: Add a function to get EDID base block In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20240223223958.3887423-1-hsinyi@chromium.org> <20240223223958.3887423-2-hsinyi@chromium.org> <87wmqqjmt9.fsf@intel.com> Date: Thu, 29 Feb 2024 18:43:23 +0200 Message-ID: <87bk7z6x1w.fsf@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, 28 Feb 2024, Doug Anderson wrote: > Hi, > > On Tue, Feb 27, 2024 at 5:27=E2=80=AFPM Hsin-Yi Wang wrote: >> >> On Tue, Feb 27, 2024 at 1:09=E2=80=AFAM Jani Nikula wrote: >> > >> > On Fri, 23 Feb 2024, Hsin-Yi Wang wrote: >> > > It's found that some panels have variants that they share the same p= anel id >> > > although their EDID and names are different. Besides panel id, now w= e need >> > > the hash of entire EDID base block to distinguish these panel varian= ts. >> > > >> > > Add drm_edid_get_base_block to returns the EDID base block, so calle= r can >> > > further use it to get panel id and/or the hash. >> > >> > Please reconsider the whole approach here. >> > >> > Please let's not add single-use special case functions to read an EDID >> > base block. >> > >> > Please consider reading the whole EDID, using the regular EDID reading >> > functions, and use that instead. >> > >> > Most likely you'll only have 1-2 blocks anyway. And you might consider >> > caching the EDID in struct panel_edp if reading the entire EDID is too >> > slow. (And if it is, this is probably sensible even if the EDID only >> > consists of one block.) >> > >> > Anyway, please do *not* merge this as-is. >> > >> >> hi Jani, >> >> I sent a v2 here implementing this method: >> https://lore.kernel.org/lkml/20240228011133.1238439-2-hsinyi@chromium.or= g/ >> >> We still have to read edid twice due to: >> 1. The first caller is in panel probe, at that time, connector is >> still unknown, so we can't update connector status (eg. update >> edid_corrupt). >> 2. It's possible that the connector can have some override >> (drm_edid_override_get) to EDID, that is still unknown during the >> first read. > > I'll also comment in Hsin-Yi's v2, but given Hsin-Yi's digging and the > fact that we can't cache the EDID (because we don't yet have a > "drm_connector"), I'd much prefer Hsin-Yi's solution here from v1 that > allows reading just the first block. If we try to boot a device with a > multi-block EDID we're now wastefully reading all the blocks of the > EDID twice at bootup which will slow boot time. > > If you can see a good solution to avoid reading the EDID twice then > that would be amazing, but if not it seems like we should go back to > what's here in v1. What do you think? Anyone else have any opinions? I haven't replied so far, because I've been going back and forth with this. I'm afraid I don't really like either approach now. Handling the no connector case in v2 is a bit ugly too. :( Seems like you only need this to extend the panel ID with a hash. And panel-edp.c is the only user of drm_edid_get_panel_id(). And EDID quirks in drm_edid.c could theoretically hit the same problem you're solving. So maybe something like: u32 drm_edid_get_panel_id(struct i2c_adapter *adapter, u32 *hash); or if you want to be fancy add a struct capturing both id and hash: bool drm_edid_get_panel_id(struct i2c_adapter *adapter, struct drm_edid_pa= nel_id *id); And put the hash (or whatever mechanism you have) computation in drm_edid.c. Just hide it all in drm_edid.c, and keep the EDID interfaces neat. How would that work for you? BR, Jani. --=20 Jani Nikula, Intel