From: Daniel Vetter Subject: Re: [PATCH 2/2] drm/radeon: use a fetch function to get the edid Date: Tue, 15 Jul 2014 17:18:51 +0200 Message-ID: <20140715151851.GX15237@phenom.ffwll.local> References: <1405436891-18544-1-git-send-email-alexander.deucher@amd.com> <1405436891-18544-2-git-send-email-alexander.deucher@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTP id C36FB6E137 for ; Tue, 15 Jul 2014 08:18:41 -0700 (PDT) Received: by mail-wi0-f176.google.com with SMTP id bs8so4553168wib.3 for ; Tue, 15 Jul 2014 08:18:40 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1405436891-18544-2-git-send-email-alexander.deucher@amd.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Alex Deucher Cc: Alex Deucher , Thomas Wood , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Jul 15, 2014 at 11:08:11AM -0400, Alex Deucher wrote: > We keep a cached version of the edid in radeon_connector which > we use for determining connectedness and when to enable certain > features like hdmi audio, etc. When the user uses the firmware > interface to override the driver with some other edid the driver's > copy is never updated. The fetch function will check if there > is a user supplied edid and update the driver's copy if there > is. > > bug: > https://bugs.freedesktop.org/show_bug.cgi?id=80691 > > Signed-off-by: Alex Deucher [snip] > +struct edid *radeon_connector_edid(struct drm_connector *connector) > +{ > + struct radeon_connector *radeon_connector = to_radeon_connector(connector); > + struct drm_property_blob *edid_blob = connector->edid_blob_ptr; > + > + if (radeon_connector->edid) { > + return radeon_connector->edid; > + } else if (edid_blob) { > + struct edid *edid = kmemdup(edid_blob->data, edid_blob->length, GFP_KERNEL); > + if (edid) > + radeon_connector->edid = edid; > + } > + return radeon_connector->edid; > +} We have similar issues on intel now that we use the debugfs interface to force certain edids (for validating e.g. 4k or 3d) - our code doesn't see the forced edid. Should we have a helper somewhere or just change drm_get_edid to dtrt here? Adding Thomas who's working on this. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch