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 v3 01/13] drm/edid: move drm_connector_update_edid_property() to drm_edid.c
Date: Wed, 22 Jun 2022 17:37:23 +0300 [thread overview]
Message-ID: <YrMpIzEcgDYsvMtN@intel.com> (raw)
In-Reply-To: <205b3b8905375506dc9f508fe18652c226cc6a50.1655895388.git.jani.nikula@intel.com>
On Wed, Jun 22, 2022 at 01:59:15PM +0300, Jani Nikula wrote:
> The function needs access to drm_edid.c internals more than
> drm_connector.c. We can make drm_reset_display_info(),
> drm_add_display_info() and drm_update_tile_info() static. There will be
> more benefits with follow-up struct drm_edid refactoring.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_connector.c | 74 -------------------------
> drivers/gpu/drm/drm_crtc_internal.h | 3 -
> drivers/gpu/drm/drm_edid.c | 86 +++++++++++++++++++++++++++--
> 3 files changed, 81 insertions(+), 82 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 28ea0f8196b9..2b9a8972eff1 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -2078,80 +2078,6 @@ int drm_connector_set_tile_property(struct drm_connector *connector)
> }
> EXPORT_SYMBOL(drm_connector_set_tile_property);
>
> -/**
> - * drm_connector_update_edid_property - update the edid property of a connector
> - * @connector: drm connector
> - * @edid: new value of the edid property
> - *
> - * This function creates a new blob modeset object and assigns its id to the
> - * connector's edid property.
> - * Since we also parse tile information from EDID's displayID block, we also
> - * set the connector's tile property here. See drm_connector_set_tile_property()
> - * for more details.
> - *
> - * Returns:
> - * Zero on success, negative errno on failure.
> - */
> -int drm_connector_update_edid_property(struct drm_connector *connector,
> - const struct edid *edid)
> -{
> - struct drm_device *dev = connector->dev;
> - size_t size = 0;
> - int ret;
> - const struct edid *old_edid;
> -
> - /* ignore requests to set edid when overridden */
> - if (connector->override_edid)
> - return 0;
> -
> - if (edid)
> - size = EDID_LENGTH * (1 + edid->extensions);
> -
> - /* Set the display info, using edid if available, otherwise
> - * resetting the values to defaults. This duplicates the work
> - * done in drm_add_edid_modes, but that function is not
> - * consistently called before this one in all drivers and the
> - * computation is cheap enough that it seems better to
> - * duplicate it rather than attempt to ensure some arbitrary
> - * ordering of calls.
> - */
> - if (edid)
> - drm_add_display_info(connector, edid);
> - else
> - drm_reset_display_info(connector);
> -
> - drm_update_tile_info(connector, edid);
> -
> - if (connector->edid_blob_ptr) {
> - old_edid = (const struct edid *)connector->edid_blob_ptr->data;
> - if (old_edid) {
> - if (!drm_edid_are_equal(edid, old_edid)) {
> - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Edid was changed.\n",
> - connector->base.id, connector->name);
> -
> - connector->epoch_counter += 1;
> - DRM_DEBUG_KMS("Updating change counter to %llu\n",
> - connector->epoch_counter);
> - }
> - }
> - }
> -
> - drm_object_property_set_value(&connector->base,
> - dev->mode_config.non_desktop_property,
> - connector->display_info.non_desktop);
> -
> - ret = drm_property_replace_global_blob(dev,
> - &connector->edid_blob_ptr,
> - size,
> - edid,
> - &connector->base,
> - dev->mode_config.edid_property);
> - if (ret)
> - return ret;
> - return drm_connector_set_tile_property(connector);
> -}
> -EXPORT_SYMBOL(drm_connector_update_edid_property);
> -
> /**
> * drm_connector_set_link_status_property - Set link status property of a connector
> * @connector: drm connector
> diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h
> index 63279e984342..aecab5308bae 100644
> --- a/drivers/gpu/drm/drm_crtc_internal.h
> +++ b/drivers/gpu/drm/drm_crtc_internal.h
> @@ -286,6 +286,3 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
>
> /* drm_edid.c */
> void drm_mode_fixup_1366x768(struct drm_display_mode *mode);
> -void drm_reset_display_info(struct drm_connector *connector);
> -u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
> -void drm_update_tile_info(struct drm_connector *connector, const struct edid *edid);
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 2bdaf1e34a9d..36bf7b0fe8d9 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -5928,8 +5928,7 @@ static void drm_update_mso(struct drm_connector *connector,
> /* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
> * all of the values which would have been set from EDID
> */
> -void
> -drm_reset_display_info(struct drm_connector *connector)
> +static void drm_reset_display_info(struct drm_connector *connector)
> {
> struct drm_display_info *info = &connector->display_info;
>
> @@ -6043,7 +6042,7 @@ static u32 update_display_info(struct drm_connector *connector,
> return quirks;
> }
>
> -u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
> +static u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
> {
> struct drm_edid drm_edid;
>
> @@ -6207,6 +6206,83 @@ static int drm_edid_connector_update(struct drm_connector *connector,
> return num_modes;
> }
>
> +static void drm_update_tile_info(struct drm_connector *connector,
> + const struct edid *edid);
> +
> +/**
> + * drm_connector_update_edid_property - update the edid property of a connector
> + * @connector: drm connector
> + * @edid: new value of the edid property
> + *
> + * This function creates a new blob modeset object and assigns its id to the
> + * connector's edid property.
> + * Since we also parse tile information from EDID's displayID block, we also
> + * set the connector's tile property here. See drm_connector_set_tile_property()
> + * for more details.
> + *
> + * Returns:
> + * Zero on success, negative errno on failure.
> + */
> +int drm_connector_update_edid_property(struct drm_connector *connector,
> + const struct edid *edid)
> +{
> + struct drm_device *dev = connector->dev;
> + size_t size = 0;
> + int ret;
> + const struct edid *old_edid;
> +
> + /* ignore requests to set edid when overridden */
> + if (connector->override_edid)
> + return 0;
> +
> + if (edid)
> + size = EDID_LENGTH * (1 + edid->extensions);
> +
> + /*
> + * Set the display info, using edid if available, otherwise resetting
> + * the values to defaults. This duplicates the work done in
> + * drm_add_edid_modes, but that function is not consistently called
> + * before this one in all drivers and the computation is cheap enough
> + * that it seems better to duplicate it rather than attempt to ensure
> + * some arbitrary ordering of calls.
> + */
> + if (edid)
> + drm_add_display_info(connector, edid);
> + else
> + drm_reset_display_info(connector);
> +
> + drm_update_tile_info(connector, edid);
> +
> + if (connector->edid_blob_ptr) {
> + old_edid = (const struct edid *)connector->edid_blob_ptr->data;
> + if (old_edid) {
> + if (!drm_edid_are_equal(edid, old_edid)) {
> + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Edid was changed.\n",
> + connector->base.id, connector->name);
> +
> + connector->epoch_counter += 1;
> + DRM_DEBUG_KMS("Updating change counter to %llu\n",
> + connector->epoch_counter);
> + }
> + }
> + }
> +
> + drm_object_property_set_value(&connector->base,
> + dev->mode_config.non_desktop_property,
> + connector->display_info.non_desktop);
> +
> + ret = drm_property_replace_global_blob(dev,
> + &connector->edid_blob_ptr,
> + size,
> + edid,
> + &connector->base,
> + dev->mode_config.edid_property);
> + if (ret)
> + return ret;
> + return drm_connector_set_tile_property(connector);
> +}
> +EXPORT_SYMBOL(drm_connector_update_edid_property);
> +
> /**
> * drm_add_edid_modes - add modes from EDID data, if available
> * @connector: connector we're probing
> @@ -6645,8 +6721,8 @@ static void _drm_update_tile_info(struct drm_connector *connector,
> }
> }
>
> -void drm_update_tile_info(struct drm_connector *connector,
> - const struct edid *edid)
> +static void drm_update_tile_info(struct drm_connector *connector,
> + const struct edid *edid)
> {
> struct drm_edid drm_edid;
>
> --
> 2.30.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2022-06-22 14:37 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 10:59 [Intel-gfx] [PATCH v3 00/13] drm/edid: expand on struct drm_edid usage Jani Nikula
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 01/13] drm/edid: move drm_connector_update_edid_property() to drm_edid.c Jani Nikula
2022-06-22 14:37 ` Ville Syrjälä [this message]
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 02/13] drm/edid: convert drm_connector_update_edid_property() to struct drm_edid Jani Nikula
2022-06-22 14:38 ` Ville Syrjälä
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 03/13] drm/edid: clean up connector update error handling and debug logging Jani Nikula
2022-06-22 14:40 ` Ville Syrjälä
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 04/13] drm/edid: abstract debugfs override EDID set/reset Jani Nikula
2022-06-22 14:41 ` Ville Syrjälä
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 05/13] drm/edid: add drm_edid_connector_update() Jani Nikula
2022-06-22 15:17 ` Ville Syrjälä
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 06/13] drm/probe-helper: add drm_connector_helper_get_modes() Jani Nikula
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 07/13] drm/edid: add drm_edid_raw() to access the raw EDID data Jani Nikula
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 08/13] drm/i915/edid: convert DP, HDMI and LVDS to drm_edid Jani Nikula
2022-06-22 15:05 ` Ville Syrjälä
2022-06-23 7:29 ` Jani Nikula
2022-06-23 7:27 ` [Intel-gfx] [PATCH] " Jani Nikula
2022-06-23 9:20 ` Ville Syrjälä
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 09/13] drm/i915/bios: convert intel_bios_init_panel() " Jani Nikula
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 10/13] drm/edid: do invalid block filtering in-place Jani Nikula
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 11/13] drm/edid: add HF-EEODB support to EDID read and allocation Jani Nikula
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 12/13] drm/edid: take HF-EEODB extension count into account Jani Nikula
2022-06-22 10:59 ` [Intel-gfx] [PATCH v3 13/13] drm/todo: add entry for converting the subsystem to struct drm_edid Jani Nikula
2022-06-22 21:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: expand on struct drm_edid usage (rev4) Patchwork
2022-06-22 21:38 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-06-22 21:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-06-23 7:56 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: expand on struct drm_edid usage (rev5) Patchwork
2022-06-23 8:18 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-06-23 8:59 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: expand on struct drm_edid usage (rev6) Patchwork
2022-06-23 9:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-06-27 10:41 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/edid: expand on struct drm_edid usage (rev4) Patchwork
2022-06-27 13:15 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/edid: expand on struct drm_edid usage (rev6) Patchwork
2022-06-28 20:49 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: expand on struct drm_edid usage (rev7) Patchwork
2022-06-28 20:49 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-06-28 21:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-06-29 13:28 ` [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=YrMpIzEcgDYsvMtN@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