dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Mario Limonciello" <mario.limonciello@amd.com>
Cc: Daniel Vetter <daniel@ffwll.ch>,
	Alex Deucher <alexander.deucher@amd.com>,
	Hans de Goede <hdegoede@redhat.com>,
	"open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
	amd-gfx@lists.freedesktop.org,
	"open list:USB SUBSYSTEM" <linux-usb@vger.kernel.org>,
	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" <linux-acpi@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Melissa Wen <mwen@igalia.com>,
	Mark Pearson <mpearson-lenovo@squebb.ca>
Subject: Re: [PATCH v6 3/5] drm: Add support to get EDID from ACPI
Date: Thu, 15 Feb 2024 16:13:50 +0200	[thread overview]
Message-ID: <877cj56cip.fsf@intel.com> (raw)
In-Reply-To: <Zc1JEg5mC0ww_BeU@intel.com>

On Thu, 15 Feb 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> 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 = data;
>> +	struct drm_device *ddev = connector->dev;
>> +	struct acpi_device *acpidev = ACPI_COMPANION(ddev->dev);
>> +	unsigned char start = 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 = NULL;
>> +
>>  	if (drm_WARN_ON(connector->dev, !connector->ddc))
>>  		return NULL;
>>  
>> -	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


-- 
Jani Nikula, Intel

  reply	other threads:[~2024-02-15 14:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 21:57 [PATCH v6 0/5] Add support for getting EDID over ACPI to DRM Mario Limonciello
2024-02-14 21:57 ` [PATCH v6 1/5] drm: Stop using `select ACPI_VIDEO` in all drivers Mario Limonciello
2024-02-15 20:47   ` kernel test robot
2024-02-15 20:59   ` kernel test robot
2024-02-16  0:49   ` kernel test robot
2024-02-16  0:49   ` kernel test robot
2024-02-16  5:03   ` kernel test robot
2024-02-16  9:03   ` kernel test robot
2024-02-16  9:24   ` kernel test robot
2024-02-16 13:01   ` kernel test robot
2024-02-16 17:11   ` kernel test robot
2024-02-16 21:18   ` kernel test robot
2024-02-17  1:34   ` kernel test robot
2024-02-17  5:36   ` kernel test robot
2024-02-17  9:51   ` kernel test robot
2024-02-14 21:57 ` [PATCH v6 2/5] drm: Stop using `select BACKLIGHT_CLASS_DEVICE` Mario Limonciello
2024-02-14 21:57 ` [PATCH v6 3/5] drm: Add support to get EDID from ACPI Mario Limonciello
2024-02-14 23:13   ` Ville Syrjälä
2024-02-15 14:13     ` Jani Nikula [this message]
2024-02-15 18:20     ` Mario Limonciello
2024-02-15 18:47       ` Ville Syrjälä
2024-02-15 19:03         ` Mario Limonciello
2024-04-17 14:18           ` Geert Uytterhoeven
2024-02-15 14:09   ` Jani Nikula
2024-02-14 21:57 ` [PATCH v6 4/5] drm/amd: Fetch the EDID from _DDC if available for eDP Mario Limonciello
2024-02-14 21:57 ` [PATCH v6 5/5] drm/nouveau: Use drm_edid_read_acpi() helper Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cj56cip.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=mwen@igalia.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).