Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1539443rdb; Thu, 7 Dec 2023 01:54:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAPLyCdWNvhaJ/b7zuPYiyisVwMz2XXXFdRD64jr7NthHAuU94zXvQo2QM6ydk2BMgfnhj X-Received: by 2002:a17:90b:3c45:b0:286:6cc0:b914 with SMTP id pm5-20020a17090b3c4500b002866cc0b914mr1688076pjb.75.1701942893107; Thu, 07 Dec 2023 01:54:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701942893; cv=none; d=google.com; s=arc-20160816; b=sOFxCms73KHzmLL1kq1v/ONftzJ+uWPmxTgPVSSNq946YHC/oYlBY6AKDhVcdYyZ14 KWb58ao/vx4jJukxT4FWrKWrdNaJO11bLgJCv5tJ0RGYDLB0bi+xPVzfhkOsbQGhr/Jp F8jGFsHKLsBMFPaRFAvS4MFOEh3+KfuW6LuioN5Y6Kt+/Sj3Bld0M8yE7Kkr9FgGtfhT 7qKYKuX/ugxVCTPRHKjUfQCJQ+Zb14P3mNTrzY4LjnozR9WPNBk38Mj2JpZjN3zZ3Ku9 24IqGL9nbjHOTaQzrfvkEgvljYQntCHfofirweInMPgIuExYAd/81nrC9jUlmOPZqtnF Kcww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=0P4YH7SlXQj7XglMbn+yvpMz38cDHv9olx9NENLBTAs=; fh=xW0g8RggYh1LnSwtY18ZG5RK6EmDm/AkxgyVOK6l4EA=; b=01Y6djm7Lh5GH5hkG9eC7ia0kQvnNHUVYBDCinpaO72F8y+R7sc/hiKRuUZPnJsaVx t6vvmSi0qwyeCBs3X4aGvZmIQCrEqpWYxFN06UZOB2jCau9VNOKyqy6IsXguVGxfNqVC MS+4IvJt/ScF/wc5xEzVyV5fSW0k/O8kuerP70zslJ/B57qCd6AbDdmOPBX/zP5RXxdb LLCPEaYfiZlx6F7hHYCSbnfirXSS2+18Qwb1a/TgBmwOVurtRqREqKghn5JvA1+U9xJY uxPCVZteje2kM0+udqhPIavFPQ5mR5//uhdSWugKNV8Fj/yWMIF12PO64+reHCl7daxd qcOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GzRfHfff; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id n10-20020a170902d2ca00b001cffce39be3si916211plc.218.2023.12.07.01.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 01:54:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GzRfHfff; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 409FA8087257; Thu, 7 Dec 2023 01:54:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378767AbjLGJyf (ORCPT + 99 others); Thu, 7 Dec 2023 04:54:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378695AbjLGJye (ORCPT ); Thu, 7 Dec 2023 04:54:34 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8794DD for ; Thu, 7 Dec 2023 01:54:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701942881; x=1733478881; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=JVg+YFeylE5751j053diLSsB0HH6ZRmcj2hNvpngTOM=; b=GzRfHfffA8FvJ+pvSU2p1kDPkdBVovKmkQDYOoCj4Q10PJtXdWs9sPPI qDkIDwI+2lbFRPJgM6pQOItNO6wNZwT4r/Dfb24yRMGm5S4ZTSi72uPzl PRE0GQm3N1jkIKZbXiwiiiY2VL8JLrHRwSJdU8WHkSnyEvnhFjB2OwkkX cmHd4PakdjPS3n1qPvu49U30dQcA22EbvHv1B3WGe9wKoKCZJJn5+qrZ/ xPHCLtNi1lwsNzvXC8I0BJTtE7hD8ssLq1i86okUuykpCSzMfW0sTsm9S l5IiJE5QKpecmJEPNB1nBm6WKDySMc1RsQgsjMkRkQrqBbviuy1r4/1op A==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="12920383" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="12920383" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 01:54:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="895078971" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="895078971" Received: from mrehana-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.62.169]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 01:54:36 -0800 From: Jani Nikula To: bbaa , maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [Bug Report] drm/edid: drm_edid_override_connector_update returns a incorrect value In-Reply-To: <930E9B4C7D91FDFF+29b34d89-8658-4910-966a-c772f320ea03@bbaa.fun> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <930E9B4C7D91FDFF+29b34d89-8658-4910-966a-c772f320ea03@bbaa.fun> Date: Thu, 07 Dec 2023 11:54:34 +0200 Message-ID: <87jzpq1go5.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 01:54:50 -0800 (PST) On Thu, 07 Dec 2023, bbaa wrote: > Hello everyone, > > drm_edid_override_connector_update seem return a incorrect value. > > drivers/gpu/drm/drm_edid.c (Linux 6.7-rc4) > 2294 /** > 2295 * drm_edid_override_connector_update - add modes from override/f= irmware EDID > 2296 * @connector: connector we're probing > 2297 * > 2298 * Add modes from the override/firmware EDID, if available. Only = to be used from > 2299 * drm_helper_probe_single_connector_modes() as a fallback for wh= en DDC probe > 2300 * failed during drm_get_edid() and caused the override/firmware = EDID to be > 2301 * skipped. > 2302 * > 2303 * Return: The number of modes added or 0 if we couldn't find any. > 2304 */ Thanks for the report. I've sent a patch to hopefully fix this [1]. [1] https://patchwork.freedesktop.org/patch/msgid/20231207093821.2654267-1-= jani.nikula@intel.com However, please read the documentation comment above: "Only to be used from drm_helper_probe_single_connector_modes() ..." The function is a fallback for a *very* specific and rare scenario. > This will break the EDID override behavior on Nvidia graphics cards. > > NVIDIA/open-gpu-kernel-modules: > kernel-open/nvidia-drm/nvidia-drm-connector.c: > =C2=A0=C2=A0103 =C2=A0#if defined(NV_DRM_CONNECTOR_HAS_OVERRIDE_EDID) = =C2=A0=C2=A0104 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if=20 > (connector->override_edid) { =C2=A0=C2=A0105 =C2=A0#else =C2=A0=C2=A0106 = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if=20 > (drm_edid_override_connector_update(connector) > 0) { =C2=A0=C2=A0107 =C2= =A0#endif=20 > =C2=A0=C2=A0108 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0co= nst struct drm_property_blob *edid =3D=20 > connector->edid_blob_ptr; =C2=A0=C2=A0109=20 > drm_edid_override_connector_update(connector) will return zero here. That's an out-of-tree driver that doesn't follow the documentation above. Drivers have no business calling the function. All of the override/firmware EDID handling should be covered transparently via the drm_edid_read*() and drm_get_edid() functions, and the drivers shouldn't have to ever care about overrides, at all. Drivers shouldn't really use connector->edid_blob_ptr directly either. Please report and get that fixed downstream. BR, Jani. --=20 Jani Nikula, Intel