From patchwork Wed Feb 3 16:49:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 8205271 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3BBE5BEEE5 for ; Wed, 3 Feb 2016 16:47:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D95B20266 for ; Wed, 3 Feb 2016 16:47:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9C5CC201ED for ; Wed, 3 Feb 2016 16:47:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00CF26E3EC; Wed, 3 Feb 2016 08:47:42 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DA2E6E3EC for ; Wed, 3 Feb 2016 08:47:40 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 03 Feb 2016 08:47:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,391,1449561600"; d="scan'208";a="907768098" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by fmsmga002.fm.intel.com with ESMTP; 03 Feb 2016 08:47:39 -0800 From: Marius Vlad To: intel-gfx@lists.freedesktop.org Date: Wed, 3 Feb 2016 18:49:09 +0200 Message-Id: <1454518149-10421-1-git-send-email-marius.c.vlad@intel.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454418061-10178-1-git-send-email-marius.c.vlad@intel.com> References: <1454418061-10178-1-git-send-email-marius.c.vlad@intel.com> Subject: [Intel-gfx] [PATCH v2] drm/i915: Support HDMI EDID injection X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make a copy of drm_property_blob data for user-supplied EDID blobs. v2: Allocate and memcopy drm_property_blob->data instead of pointing to it. Signed-off-by: Marius Vlad --- drivers/gpu/drm/i915/intel_hdmi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 8698a64..4c9bb5f 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -1355,6 +1355,16 @@ intel_hdmi_set_edid(struct drm_connector *connector, bool force) intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus)); + /* + * Use the user-supplied EDID blob in case we don't have an + * EDID from the display. + */ + if (!edid && connector->override_edid) { + edid = kmemdup(connector->edid_blob_ptr->data, + connector->edid_blob_ptr->length, + GFP_KERNEL); + } + intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); }