From: Ramalingam C <ramalingam.c@intel.com>
To: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: simon.ser@intel.com, daniel.vetter@ffwll.ch,
intel-gfx@lists.freedesktop.org, martin.peres@intel.com,
dri-devel@lists.freedesktop.org, paul.kocialkowski@bootlin.com,
ppaalanen@gmail.com
Subject: Re: [PATCH v2 2/3] drm: Introduce change counter to drm_connector
Date: Fri, 28 Jun 2019 09:46:13 +0530 [thread overview]
Message-ID: <20190628041613.GC24852@intel.com> (raw)
In-Reply-To: <20190628082454.16345-3-stanislav.lisovskiy@intel.com>
On 2019-06-28 at 11:24:53 +0300, Stanislav Lisovskiy wrote:
> This counter will be used by drm_helper_probe_detect caller to determine
> if something else had changed except connection status,
> like for example edid. Hardware specific drivers are responsible
> for updating this counter when some change is detected to notify
> the drm part, which can trigger for example hotplug event.
>
> Currently there is no way to propagate that to a calling layer,
> as we send only connection_status update, however as we see with
> edid the changes can be broader.
>
> v2: Added documentation for the new counter. Rename change_counter to
> epoch_counter.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105540
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
> drivers/gpu/drm/drm_connector.c | 1 +
> drivers/gpu/drm/drm_probe_helper.c | 29 +++++++++++++++++++++++++++--
> include/drm/drm_connector.h | 3 +++
> 3 files changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 3ccdcf3dfcde..065eee61859e 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -245,6 +245,7 @@ int drm_connector_init(struct drm_device *dev,
> INIT_LIST_HEAD(&connector->modes);
> mutex_init(&connector->mutex);
> connector->edid_blob_ptr = NULL;
> + connector->epoch_counter = 0;
> connector->tile_blob_ptr = NULL;
> connector->status = connector_status_unknown;
> connector->display_info.panel_orientation =
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index ef2c468205a2..5857053174da 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -776,6 +776,7 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev)
> struct drm_connector_list_iter conn_iter;
> enum drm_connector_status old_status;
> bool changed = false;
> + uint64_t old_epoch_counter;
>
> if (!dev->mode_config.poll_enabled)
> return false;
> @@ -789,20 +790,44 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev)
>
> old_status = connector->status;
>
> + old_epoch_counter = connector->epoch_counter;
> +
> + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Old change counter %llu\n", connector->base.id,
> + connector->name,
> + old_epoch_counter);
> +
> connector->status = drm_helper_probe_detect(connector, NULL, false);
> DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
> connector->base.id,
> connector->name,
> drm_get_connector_status_name(old_status),
> drm_get_connector_status_name(connector->status));
> - if (old_status != connector->status)
> +
> + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] New change counter %llu\n",
> + connector->base.id,
> + connector->name,
> + connector->epoch_counter);
> +
> + if (old_status != connector->status) {
{} is not required here.
> changed = true;
> + }
> +
> + /* Check changing of edid when a connector status still remains
> + * as "connector_status_connected".
> + */
> + if (connector->status == connector_status_connected &&
> + old_status == connector_status_connected &&
> + old_epoch_counter != connector->epoch_counter) {
> + changed = true;
> + }
> }
> drm_connector_list_iter_end(&conn_iter);
> mutex_unlock(&dev->mode_config.mutex);
>
> - if (changed)
> + if (changed) {
> drm_kms_helper_hotplug_event(dev);
> + DRM_DEBUG_KMS("Sent hotplug event\n");
> + }
>
> return changed;
> }
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index c6f8486d8b8f..a296bdac085f 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1155,6 +1155,9 @@ struct drm_connector {
> /** @override_edid: has the EDID been overwritten through debugfs for testing? */
> bool override_edid;
>
> + /** @epoch_counter: used to detect any other changes in connector, besides status */
Might want to wrap at 80char.
-Ram
> + uint64_t epoch_counter;
> +
> #define DRM_CONNECTOR_MAX_ENCODER 3
> /**
> * @encoder_ids: Valid encoders for this connector. Please only use
> --
> 2.17.1
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-06-28 4:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 8:24 [PATCH v2 0/3] Send a hotplug when edid changes Stanislav Lisovskiy
2019-06-28 8:24 ` [PATCH v2 1/3] drm: Add helper to compare edids Stanislav Lisovskiy
2019-06-28 4:13 ` Ramalingam C
2019-07-01 19:52 ` Lyude Paul
2019-06-28 8:24 ` [PATCH v2 2/3] drm: Introduce change counter to drm_connector Stanislav Lisovskiy
2019-06-28 4:16 ` Ramalingam C [this message]
2019-06-28 8:24 ` [PATCH v2 3/3] drm/i915: Send hotplug event if edid had changed Stanislav Lisovskiy
2019-06-28 4:24 ` Ramalingam C
2019-06-28 11:36 ` Lisovskiy, Stanislav
2019-06-28 4:50 ` Ramalingam C
2019-06-28 8:48 ` ✗ Fi.CI.CHECKPATCH: warning for Send a hotplug when edid changes (rev2) Patchwork
2019-06-28 15:49 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-28 23:11 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-07-22 11:25 ` ✗ Fi.CI.BAT: failure for Send a hotplug when edid changes (rev3) 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=20190628041613.GC24852@intel.com \
--to=ramalingam.c@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=martin.peres@intel.com \
--cc=paul.kocialkowski@bootlin.com \
--cc=ppaalanen@gmail.com \
--cc=simon.ser@intel.com \
--cc=stanislav.lisovskiy@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