Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp479989rdb; Thu, 15 Feb 2024 06:14:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJEKXKFY1R7dtgRuoGXbAyDUX+1QSXMbcBjzPpi4Zzfpdy+QOzW9NhEunINH0VF6Abtn9P6qmgJnl+N1uFyeWdpoKC31cWn3RyzLnrdA== X-Google-Smtp-Source: AGHT+IFJvPo1Kp1rBsx4IJGSLC8B8tIpo3mQR7uuQYvycudqvOL6bKfcMjL/iqI8SUo4Wg+JkroN X-Received: by 2002:a05:6808:140d:b0:3c0:3d52:1d74 with SMTP id w13-20020a056808140d00b003c03d521d74mr2254462oiv.0.1708006450753; Thu, 15 Feb 2024 06:14:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006450; cv=pass; d=google.com; s=arc-20160816; b=XVzD8/40KH2yxjt7Beg1naMbGkGPJlt/Hx7UvKhOLndVtTuudoe02Z9ZzECifOw2Wz 446cztiLNPt/t4x0T01IcYW2YBseeDvT+rDF2Ljcr84NhYG0mc9B+s7eyRvh5V/r/N2O u4HVRmSQbE7wjHg0O2V+Z18xm1Xgn0Jh0mGcja9B0T9MrecjSv1V/ATBj7NxPyKqkTDh ty7BRa5uD0IpBUKEN4tfS9pUsUmngi3pgYtifWy+rtQ0tnisEkteqM0D5jJz7/cks7W+ guLLD9EqCq/HgNbcGyLQfeoTzheluJKWDPfH8QG0pFP05MulbXAaJ+Y9DJpdEURDR3lq U/xw== 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=I31CaKRv5wKLHBTg0LQMeR+VdCSrRmgxUDj3yiPaY8w=; fh=Sap/VgkFBnyWdljwR+0azWiwa0BV/TAk2tw1mKlMhmo=; b=be1sOziY9r36v+lVnOTmrghJ2c7LY30XjNkyUWGO5nzOv72T7wNVhEsad0X92vzS30 AYsISaOeJe/0Idz7cTXZ0BXwujBoqFP058f4qoE+wxp/+zfM3P5qzcEJzQa3q+aNUi1W WECqI4LB8CiMAprctwq7mHYXLmzI2PajTTBKPZlULXo3gicwi5Iuuzrt0Ga7ZrBM6ykn 16g/EJsz45OZohjEEPun9QZTDszyWKqAWATDfwjfnTb3HA1G+JWQ5PDmLo2vOfPrckuI 4nkjLJWFmxFs6MX9f/0dzO22Z7J8ORgBysDhN08ipyCxdC74xkDey9xW9D6IYnZCFhP0 6e2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rhdf2j7e; 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-67064-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67064-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p30-20020ab0549e000000b007d58b4f8f70si187537uaa.43.2024.02.15.06.14.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:14:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67064-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rhdf2j7e; 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-67064-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67064-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5E93E1C21BF4 for ; Thu, 15 Feb 2024 14:14:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CCAE131E52; Thu, 15 Feb 2024 14:14:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Rhdf2j7e" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 7764A131727; Thu, 15 Feb 2024 14:13:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006440; cv=none; b=FXJZiziTBEiJhX6LTiDSj+0Ngeb8Pmdk0QPGo/ZqQsX9a+0NOm3h8P+OVz6Rv1zydHMk6ll+PDJdvUsVFKqBx6xv+0ectdAVUe8OH433hbMfbppMhL2UfiF4c2HQfkwXj+eTKk//e+BVEubDa2F2vdX175Zo8hYfA6XKfV1nFJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006440; c=relaxed/simple; bh=kQtfjGGHL//RaWDiYtL8dqPa6sivLw8vj+nf2o9x1CE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=WFDb2c+LDFS3M4xtksxDJqSow9nu9w74DXScVSVC7HPlrKbtflTxA3YxqfiTLKJzIz1coCj2FnXGlBnBujQ3tftqH4dbKufjoF64hGosYBh6VYC7l+gTW2r2vDArByw4MI130tLPhJHY/GecMGDLiM2qB32MMFTmnBrLKnB1asQ= 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=Rhdf2j7e; arc=none smtp.client-ip=198.175.65.14 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=1708006439; x=1739542439; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=kQtfjGGHL//RaWDiYtL8dqPa6sivLw8vj+nf2o9x1CE=; b=Rhdf2j7e7l4i4S0cKLYFUeQoleabgVjaQY3Rm+f3can2FL8sgPD9KYjZ W8a10O4evRN8mPS3dbepLfI9tTAfpn4euQa766g9FgRpxJmybsLxQDRzu 1tqmPrb7oTMNRbTMurHHF0wcuE2vJUpHB3hymDTkRbuRdqHhWQ4z3CpTj 4uHNc7qExPAI4+45reGiP3vI2pUdvrp9HC3+AUpSGzxa354tkcY25PSPr suSIqQYShMuoAjJqCFzKUKMlUak9rxOeBqyAeh/TC+h8ix4n0k3ql2EGO fblBmDnkDb/c5+YDASfFv3oZJEuPnaxpyOs5yyv+UZPdkuf5vxaJ7t9oq g==; X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="5905629" X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="5905629" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 06:13:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="8149317" Received: from kraszkow-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.44.13]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 06:13:52 -0800 From: Jani Nikula To: Ville =?utf-8?B?U3lyasOkbMOk?= , Mario Limonciello Cc: Daniel Vetter , Alex Deucher , Hans de Goede , "open list:DRM DRIVERS" , amd-gfx@lists.freedesktop.org, "open list:USB SUBSYSTEM" , linux-fbdev@vger.kernel.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, intel-xe@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, "open list:ACPI" , open list , Melissa Wen , Mark Pearson Subject: Re: [PATCH v6 3/5] drm: Add support to get EDID from ACPI In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20240214215756.6530-1-mario.limonciello@amd.com> <20240214215756.6530-4-mario.limonciello@amd.com> Date: Thu, 15 Feb 2024 16:13:50 +0200 Message-ID: <877cj56cip.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 Thu, 15 Feb 2024, Ville Syrj=C3=A4l=C3=A4 wrote: > On Wed, Feb 14, 2024 at 03:57:54PM -0600, Mario Limonciello wrote: >> +static int >> +drm_do_probe_acpi_edid(void *data, u8 *buf, unsigned int block, size_t = len) >> +{ >> + struct drm_connector *connector =3D data; >> + struct drm_device *ddev =3D connector->dev; >> + struct acpi_device *acpidev =3D ACPI_COMPANION(ddev->dev); >> + unsigned char start =3D block * EDID_LENGTH; >> + void *edid; >> + int r; >> + >> + if (!acpidev) >> + return -ENODEV; >> + >> + switch (connector->connector_type) { >> + case DRM_MODE_CONNECTOR_LVDS: >> + case DRM_MODE_CONNECTOR_eDP: >> + break; >> + default: >> + return -EINVAL; >> + } > > We could have other types of connectors that want this too. > I don't see any real benefit in having this check tbh. Drivers > should simply notset the flag on connectors where it won't work, > and only the driver can really know that. Agreed. >> const struct drm_edid *drm_edid_read(struct drm_connector *connector) >> { >> + const struct drm_edid *drm_edid =3D NULL; >> + >> if (drm_WARN_ON(connector->dev, !connector->ddc)) >> return NULL; >>=20=20 >> - return drm_edid_read_ddc(connector, connector->ddc); >> + if (connector->acpi_edid_allowed) > > That should probably be called 'prefer_acpi_edid' or something > since it's the first choice when the flag is set. > > But I'm not so sure there's any real benefit in having this > flag at all. You anyway have to modify the driver to use this, > so why not just have the driver do the call directly instead of > adding this extra detour via the flag? Heh, round and round we go [1]. BR, Jani. [1] https://lore.kernel.org/r/87sf23auxv.fsf@intel.com --=20 Jani Nikula, Intel