From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 09/13] drm/edid: add drm_edid_read_switcheroo()
Date: Tue, 30 May 2023 09:39:11 +0530 [thread overview]
Message-ID: <5e55093f-3c7b-5b9c-2ed7-0f106db3d70a@intel.com> (raw)
In-Reply-To: <edf72904bc3bfcb9471cda19f6ef725c722e3f21.1682077472.git.jani.nikula@intel.com>
LGTM.
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
On 4/21/2023 5:17 PM, Jani Nikula wrote:
> Add a switcheroo variant to the struct drm_edid based EDID read
> functions.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 29 +++++++++++++++++++++++++++++
> include/drm/drm_edid.h | 2 ++
> 2 files changed, 31 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 813ce00a106a..941f3d53a701 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2844,6 +2844,35 @@ struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
> }
> EXPORT_SYMBOL(drm_get_edid_switcheroo);
>
> +/**
> + * drm_edid_read_switcheroo - get EDID data for a vga_switcheroo output
> + * @connector: connector we're probing
> + * @adapter: I2C adapter to use for DDC
> + *
> + * Wrapper around drm_edid_read_ddc() for laptops with dual GPUs using one set
> + * of outputs. The wrapper adds the requisite vga_switcheroo calls to
> + * temporarily switch DDC to the GPU which is retrieving EDID.
> + *
> + * Return: Pointer to valid EDID or %NULL if we couldn't find any.
> + */
> +const struct drm_edid *drm_edid_read_switcheroo(struct drm_connector *connector,
> + struct i2c_adapter *adapter)
> +{
> + struct drm_device *dev = connector->dev;
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
> + const struct drm_edid *drm_edid;
> +
> + if (drm_WARN_ON_ONCE(dev, !dev_is_pci(dev->dev)))
> + return NULL;
> +
> + vga_switcheroo_lock_ddc(pdev);
> + drm_edid = drm_edid_read_ddc(connector, adapter);
> + vga_switcheroo_unlock_ddc(pdev);
> +
> + return drm_edid;
> +}
> +EXPORT_SYMBOL(drm_edid_read_switcheroo);
> +
> /**
> * drm_edid_duplicate - duplicate an EDID and the extensions
> * @edid: EDID to duplicate
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 571885d32907..169755d3de19 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -613,6 +613,8 @@ const struct drm_edid *drm_edid_read_ddc(struct drm_connector *connector,
> const struct drm_edid *drm_edid_read_custom(struct drm_connector *connector,
> int (*read_block)(void *context, u8 *buf, unsigned int block, size_t len),
> void *context);
> +const struct drm_edid *drm_edid_read_switcheroo(struct drm_connector *connector,
> + struct i2c_adapter *adapter);
> int drm_edid_connector_update(struct drm_connector *connector,
> const struct drm_edid *edid);
> int drm_edid_connector_add_modes(struct drm_connector *connector);
next prev parent reply other threads:[~2023-05-30 4:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 11:47 [Intel-gfx] [PATCH 00/13] drm/display & drm/i915: more struct drm_edid conversions Jani Nikula
2023-04-21 11:47 ` [Intel-gfx] [PATCH 01/13] drm/edid: parse display info has_audio similar to is_hdmi Jani Nikula
2023-05-29 4:56 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 02/13] drm/display/dp_mst: drop has_audio from struct drm_dp_mst_port Jani Nikula
2023-05-29 5:10 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 03/13] drm/i915/dp: stop caching has_audio in struct intel_dp Jani Nikula
2023-05-29 5:15 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 04/13] drm/i915/dp: stop caching has_hdmi_sink " Jani Nikula
2023-05-29 5:22 ` Nautiyal, Ankit K
2023-05-29 5:32 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 05/13] drm/i915/hdmi: stop caching has_audio in struct intel_hdmi Jani Nikula
2023-05-29 5:43 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 06/13] drm/i915/hdmi: stop caching has_hdmi_sink " Jani Nikula
2023-05-29 5:49 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 07/13] drm/i915/sdvo: stop caching has_hdmi_monitor in struct intel_sdvo Jani Nikula
2023-05-29 6:05 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 08/13] drm/i915/sdvo: stop caching has_hdmi_audio " Jani Nikula
2023-05-29 6:06 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 09/13] drm/edid: add drm_edid_read_switcheroo() Jani Nikula
2023-05-30 4:09 ` Nautiyal, Ankit K [this message]
2023-04-21 11:47 ` [Intel-gfx] [PATCH 10/13] drm/i915/lvds: switch to drm_edid_read_switcheroo() Jani Nikula
2023-04-23 8:10 ` Lukas Wunner
2023-04-21 11:47 ` [Intel-gfx] [PATCH 11/13] drm/edid: make drm_edid_duplicate() safe to call with NULL parameter Jani Nikula
2023-05-29 13:11 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 12/13] drm/display/dp_mst: convert to struct drm_edid Jani Nikula
2023-05-29 13:08 ` Nautiyal, Ankit K
2023-04-21 11:47 ` [Intel-gfx] [PATCH 13/13] drm/i915/display: switch the rest of the connectors " Jani Nikula
2023-05-30 4:38 ` Nautiyal, Ankit K
2023-04-21 14:11 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/display & drm/i915: more struct drm_edid conversions Patchwork
2023-04-21 14:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-21 22:34 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
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=5e55093f-3c7b-5b9c-2ed7-0f106db3d70a@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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