From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: cache the EDID for eDP panels Date: Fri, 15 Jun 2012 11:55:15 +0100 Message-ID: <1339757729_25104@CP5-2952> References: <1339702113-2961-1-git-send-email-jbarnes@virtuousgeek.org> <1339748484-31201-1-git-send-email-chris@chris-wilson.co.uk> <87bokk7sq3.fsf@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 74EAFA0A07 for ; Fri, 15 Jun 2012 03:55:33 -0700 (PDT) In-Reply-To: <87bokk7sq3.fsf@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jani Nikula , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, 15 Jun 2012 13:52:04 +0300, Jani Nikula wrote: > On Fri, 15 Jun 2012, Chris Wilson wrote: > > They aren't going anywhere, and probing on DDC can cause the panel to > > blank briefly, so read them up front and cache them for later queries. > > > > Jesse's patch revamped. Gotta love those display_info.raw_edid = NULL! > > --- > > drivers/gpu/drm/i915/intel_dp.c | 48 +++++++++++++++++++++++++++--------- > > drivers/gpu/drm/i915/intel_drv.h | 1 + > > drivers/gpu/drm/i915/intel_modes.c | 24 ++++++++++++------ > > 3 files changed, 54 insertions(+), 19 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > > index eb57ec7..207e25f 100644 > > --- a/drivers/gpu/drm/i915/intel_dp.c > > +++ b/drivers/gpu/drm/i915/intel_dp.c > > @@ -67,6 +67,7 @@ struct intel_dp { > > struct drm_display_mode *panel_fixed_mode; /* for eDP */ > > struct delayed_work panel_vdd_work; > > bool want_panel_vdd; > > + struct edid *edid; /* cached for eDP */ > > }; > > > > /** > > @@ -2095,26 +2096,50 @@ g4x_dp_detect(struct intel_dp *intel_dp) > > } > > > > static struct edid * > > -intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) > > +_drm_edid_duplicate(struct edid *edid) > > +{ > > + struct edid *copy; > > + int size; > > + > > + if (edid == NULL) > > + return NULL; > > + > > + size = EDID_LENGTH * (1 + edid->extensions); > > + *copy = kmalloc(size, GFP_KERNEL); > > You may want to remove that '*' there... And free the cached edid upon destroy. :) Mainly seeing if I could convince Jesse that we could do a nice patch for -fixes. -Chris -- Chris Wilson, Intel Open Source Technology Centre