dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully
Date: Wed, 28 Feb 2018 14:28:41 +0530	[thread overview]
Message-ID: <f349499d-9784-8a65-fa17-b3eb367e0476@intel.com> (raw)
In-Reply-To: <20180227125700.6527-6-ville.syrjala@linux.intel.com>

Regards

Shashank


On 2/27/2018 6:26 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Now that we have split the display info into static and dynamic parts,
> we can just zero out the entire dynamic part with memset(). Previously
> we were just clearing parts of it, leaving stale data in other parts
> (eg. HDMI SCDC capabilities).
>
> Also when the edid is NULL drm_add_edid_modes() bails out early skipping
> the call to drm_add_display_info(). Thus we would again leave stale
> data behind. To avoid that let's clear out the display info at the
> very start of drm_add_edid_modes().
>
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/drm_connector.c |  3 +--
>   drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
>   2 files changed, 4 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index d73e97ed7dff..ddd7d978f462 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1389,10 +1389,9 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
>   	 * duplicate it rather than attempt to ensure some arbitrary
>   	 * ordering of calls.
>   	 */
> +	drm_reset_display_info(connector);
>   	if (edid)
>   		drm_add_display_info(connector, edid);
> -	else
> -		drm_reset_display_info(connector);
>   
>   	drm_object_property_set_value(&connector->base,
>   				      dev->mode_config.non_desktop_property,
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 788fee4b4bf9..78c1f37be3db 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4443,37 +4443,18 @@ drm_reset_display_info(struct drm_connector *connector)
>   {
>   	struct drm_display_info *info = &connector->display_info;
>   
> -	info->width_mm = 0;
> -	info->height_mm = 0;
> -
> -	info->bpc = 0;
> -	info->color_formats = 0;
> -	info->cea_rev = 0;
> -	info->max_tmds_clock = 0;
> -	info->dvi_dual = false;
> -	info->has_hdmi_infoframe = false;
> -
> -	info->non_desktop = 0;
> +	memset(info, 0, sizeof(*info));
>   }
>   EXPORT_SYMBOL_GPL(drm_reset_display_info);
>   
>   u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
>   {
>   	struct drm_display_info *info = &connector->display_info;
> -
>   	u32 quirks = edid_get_quirks(edid);
>   
>   	info->width_mm = edid->width_cm * 10;
>   	info->height_mm = edid->height_cm * 10;
>   
> -	/* driver figures it out in this case */
> -	info->bpc = 0;
> -	info->color_formats = 0;
> -	info->cea_rev = 0;
> -	info->max_tmds_clock = 0;
> -	info->dvi_dual = false;
> -	info->has_hdmi_infoframe = false;
> -
>   	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
>   
>   	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
> @@ -4684,6 +4665,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
>   	int num_modes = 0;
>   	u32 quirks;
>   
> +	drm_reset_display_info(connector);
How about if we move the call to drm_reset_display_info() within 
drm_add_display_info() ?
something like:
drm_add_display_info()
{
     struct drm_display_info *info = &connector->display_info;
     u32 quirks = edid_get_quirks(edid);

     drm_reset_display_info();

     info->width_mm = edid->width_cm * 10;
     info->height_mm = edid->height_cm * 10;
     info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);

     ......
}

- Shashank
> +
>   	if (edid == NULL) {
>   		clear_eld(connector);
>   		return 0;

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-02-28  8:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 12:56 [RFC][PATCH 00/11] drm: Try to make display info less nuts Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 01/11] drm/gma500: Fill display_info.{width, height}_mm from .get_modes() Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 02/11] drm/i915: " Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 03/11] drm/shmobile: Don't fill display_info.{width, height}_mm at init time Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts Ville Syrjala
2018-02-27 13:08   ` Maxime Ripard
2018-02-27 13:23   ` Philipp Zabel
2018-02-28  4:58   ` Archit Taneja
2018-02-28  8:46   ` Sharma, Shashank
2018-02-28  9:17   ` Stefan Agner
2018-02-28 21:11   ` Alex Deucher
2018-03-02  7:59   ` Linus Walleij
2018-03-06  9:41   ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 05/11] drm/edid: Clear display info fully Ville Syrjala
2018-02-28  8:58   ` Sharma, Shashank [this message]
2018-03-06  9:33   ` Daniel Vetter
2018-03-06  9:42     ` Daniel Vetter
2018-03-06  9:52     ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 06/11] drm/edid: Don't call drm_add_display_info() with an invalid EDID Ville Syrjala
2018-03-06  9:45   ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff Ville Syrjala
2018-03-06  9:49   ` Daniel Vetter
2018-03-06 11:48     ` Ville Syrjälä
2018-02-27 12:56 ` [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes() Ville Syrjala
2018-03-06 10:00   ` Daniel Vetter
2018-03-06 10:30     ` Ville Syrjälä
2018-02-27 12:56 ` [RFC][PATCH 09/11] drm: Fix getconnector locking Ville Syrjala
2018-03-06  9:55   ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 10/11] drm: Fix debugfs edid_override locking Ville Syrjala
2018-03-06  9:56   ` Daniel Vetter
2018-02-27 12:57 ` [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info Ville Syrjala
2018-03-06  9:31   ` Daniel Vetter
2018-03-06 12:18     ` Ville Syrjälä
2018-03-06 16:23       ` Harry Wentland
2018-03-06 17:13         ` Daniel Vetter
2018-03-06 18:32           ` Harry Wentland
2018-03-07 16:26             ` Daniel Vetter

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=f349499d-9784-8a65-fa17-b3eb367e0476@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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