From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 08/15] drm/probe-helper: add drm_connector_helper_get_modes()
Date: Fri, 10 Jun 2022 22:44:11 +0300 [thread overview]
Message-ID: <YqOfC4xJ5IV4fec1@intel.com> (raw)
In-Reply-To: <977ae3f897f41ce69e091e38706ca841900c31b5.1654674560.git.jani.nikula@intel.com>
On Wed, Jun 08, 2022 at 10:50:38AM +0300, Jani Nikula wrote:
> Add a helper function to be used as the "default" .get_modes()
> hook. This also works as an example of what the driver .get_modes()
> hooks are supposed to do regarding the new drm_edid_read*() and
> drm_edid_connector_update() calls.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_probe_helper.c | 34 ++++++++++++++++++++++++++++++
> include/drm/drm_probe_helper.h | 1 +
> 2 files changed, 35 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index a8d26b29bfa0..e6b8f2923aa7 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -1049,3 +1049,37 @@ int drm_connector_helper_get_modes_from_ddc(struct drm_connector *connector)
> return count;
> }
> EXPORT_SYMBOL(drm_connector_helper_get_modes_from_ddc);
> +
> +/**
> + * drm_connector_helper_get_modes - Read EDID and update connector.
> + * @connector: The connector
> + *
> + * Read the EDID using drm_edid_read() (which requires that connector->ddc is
> + * set), and update the connector using the EDID.
> + *
> + * This can be used as the "default" connector helper .get_modes() hook if the
> + * driver does not need any special processing. This is sets the example what
> + * custom .get_modes() hooks should do regarding EDID read and connector update.
> + *
> + * Returns: Number of modes.
> + */
> +int drm_connector_helper_get_modes(struct drm_connector *connector)
> +{
> + const struct drm_edid *drm_edid;
> + int count;
> +
> + drm_edid = drm_edid_read(connector);
> +
> + /*
> + * Unconditionally update the connector. If the EDID was read
> + * succesfully, fill in the connector information derived from the
> + * EDID. Otherwise, if the EDID is NULL, clear the connector
> + * information.
> + */
> + count = drm_edid_connector_update(connector, drm_edid);
> +
> + drm_edid_free(drm_edid);
> +
> + return count;
> +}
> +EXPORT_SYMBOL(drm_connector_helper_get_modes);
> diff --git a/include/drm/drm_probe_helper.h b/include/drm/drm_probe_helper.h
> index c80cab7a53b7..8075e02aa865 100644
> --- a/include/drm/drm_probe_helper.h
> +++ b/include/drm/drm_probe_helper.h
> @@ -27,5 +27,6 @@ void drm_kms_helper_poll_enable(struct drm_device *dev);
> bool drm_kms_helper_is_poll_worker(void);
>
> int drm_connector_helper_get_modes_from_ddc(struct drm_connector *connector);
> +int drm_connector_helper_get_modes(struct drm_connector *connector);
>
> #endif
> --
> 2.30.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2022-06-10 19:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-08 7:50 [Intel-gfx] [PATCH v2 00/15] drm/edid: expand on struct drm_edid usage Jani Nikula
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 01/15] drm/edid: fix CTA data block collection size for CTA version 3 Jani Nikula
2022-06-10 18:56 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 02/15] drm/edid: abstract cea data block collection size Jani Nikula
2022-06-10 18:58 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 03/15] drm/edid: add block count and data helper functions for drm_edid Jani Nikula
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 04/15] drm/edid: keep track of alloc size in drm_do_get_edid() Jani Nikula
2022-06-10 19:35 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 05/15] drm/edid: add new interfaces around struct drm_edid Jani Nikula
2022-06-10 19:35 ` Ville Syrjälä
2022-06-10 19:43 ` Ville Syrjälä
2022-06-13 8:37 ` Jani Nikula
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 06/15] drm/edid: add drm_edid_connector_update() Jani Nikula
2022-06-10 19:15 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 07/15] drm/probe-helper: abstract .get_modes() connector helper call Jani Nikula
2022-06-10 19:36 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 08/15] drm/probe-helper: add drm_connector_helper_get_modes() Jani Nikula
2022-06-10 19:44 ` Ville Syrjälä [this message]
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 09/15] drm/edid: add drm_edid_raw() to access the raw EDID data Jani Nikula
2022-06-10 19:29 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 10/15] drm/i915/edid: convert DP, HDMI and LVDS to drm_edid Jani Nikula
2022-06-10 19:21 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 11/15] drm/i915/bios: convert intel_bios_init_panel() " Jani Nikula
2022-06-10 19:29 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 12/15] drm/edid: do invalid block filtering in-place Jani Nikula
2022-06-10 19:30 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 13/15] drm/edid: add HF-EEODB support to EDID read and allocation Jani Nikula
2022-06-10 19:30 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 14/15] drm/edid: take HF-EEODB extension count into account Jani Nikula
2022-06-10 19:34 ` Ville Syrjälä
2022-06-08 7:50 ` [Intel-gfx] [PATCH v2 15/15] drm/todo: add entry for converting the subsystem to struct drm_edid Jani Nikula
2022-06-08 8:30 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: expand on struct drm_edid usage (rev3) Patchwork
2022-06-08 8:30 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-06-08 11:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-06-08 19:23 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-06-13 9:37 ` [Intel-gfx] [PATCH v2 00/15] drm/edid: expand on struct drm_edid usage Jani Nikula
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=YqOfC4xJ5IV4fec1@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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