All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Marius Vlad <marius.c.vlad@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Support HDMI EDID injection
Date: Tue, 02 Feb 2016 17:32:21 +0200	[thread overview]
Message-ID: <87h9hr2kmy.fsf@intel.com> (raw)
In-Reply-To: <1454418061-10178-1-git-send-email-marius.c.vlad@intel.com>

On Tue, 02 Feb 2016, Marius Vlad <marius.c.vlad@intel.com> wrote:
> Use the drm_property_blob data for user-supplied EDID blobs.
>
> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 8698a64..a10f3d9 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1336,7 +1336,8 @@ intel_hdmi_unset_edid(struct drm_connector *connector)
>  	intel_hdmi->has_audio = false;
>  	intel_hdmi->rgb_quant_range_selectable = false;
>  
> -	kfree(to_intel_connector(connector)->detect_edid);
> +	if (!connector->override_edid)
> +		kfree(to_intel_connector(connector)->detect_edid);
>  	to_intel_connector(connector)->detect_edid = NULL;
>  }
>  
> @@ -1355,6 +1356,9 @@ intel_hdmi_set_edid(struct drm_connector *connector, bool force)
>  				    intel_gmbus_get_adapter(dev_priv,
>  				    intel_hdmi->ddc_bus));
>  
> +		if (!edid && connector->override_edid)
> +			edid = (struct edid *) connector->edid_blob_ptr->data;
> +

If the user goes on to update the edid by hand, ->detect_edid will end
up pointing at released memory. You should probably kmemdup the edid
(like some other drivers do, git grep for edid_blob_ptr), even though
that will lead to using a stale edid until intel_hdmi_set_edid is called
again.

The other question is, why do you base the decision to use override edid
on whether we can get the actual edid or not?

/me thinks this is all really messy at the drm level, including the
handling of edid firmware.

BR,
Jani.



>  		intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS);
>  	}

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-02-02 15:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 13:01 [PATCH] drm/i915: Support HDMI EDID injection Marius Vlad
2016-02-02 13:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-02-02 15:32 ` Jani Nikula [this message]
2016-02-02 16:00   ` [PATCH] " Marius Vlad
2016-02-03 16:49 ` [PATCH v2] " Marius Vlad
2016-02-03 17:15 ` ✗ Fi.CI.BAT: warning for drm/i915: Support HDMI EDID injection (rev2) Patchwork
     [not found] <1454344533-30325-1-git-send-email-marius.c.vlad@intel.com>
2016-02-11  9:07 ` [PATCH] drm/i915: Support HDMI EDID injection Daniel Vetter
     [not found] <1454411107-30206-1-git-send-email-marius.c.vlad@intel.com>
2016-02-11  9:09 ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2017-02-16  6:43 Abdiel Janulgue
2017-02-16 10:39 ` 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=87h9hr2kmy.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=marius.c.vlad@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.