From patchwork Mon Sep 29 22:39:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 4999181 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0F21DBEEA6 for ; Mon, 29 Sep 2014 22:39:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 486DD201EC for ; Mon, 29 Sep 2014 22:39:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4F921201CE for ; Mon, 29 Sep 2014 22:39:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D483C6E1FA; Mon, 29 Sep 2014 15:39:10 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by gabe.freedesktop.org (Postfix) with ESMTP id F2C126E1FA for ; Mon, 29 Sep 2014 15:39:08 -0700 (PDT) Received: by mail-pa0-f43.google.com with SMTP id hz1so5284873pad.2 for ; Mon, 29 Sep 2014 15:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:thread-index :content-language; bh=oEuKt5J7TN6H6hs5miWJ+FDFHjFy21ojXlmuNkoPuLs=; b=XMFU5jDo+B44ZDaynwha01COzH2po32fo5sotPvm0GIB0ESWrPjphPyMpMUXkXJM51 8Ggh/34jggjQun3ZkpBSZbUEGe+lk7yskwgX4F7/iDY0ofiM+Nm0y0BlDkSm5Gb7WwH2 SdvwnvIBwkwNQ6a3gGQwsLbQPFmOFJt5KknMh8v71aIwfOG1dqHuYB2EEHR3k+qQZ86s t8LaxM450a/kPKt5i2WB4JdLRq/dW45gE5b9+DxDo1OH7KRe5OX0+EIcptRJLZLXSmlB Ciax4jG5xzmlaNxoqO0btDEvu9W4yZ5k/W2zHUsA0ayYGlUxWfVKQwsH40WDBGZ5w1TA Vbjw== X-Received: by 10.66.124.202 with SMTP id mk10mr1882642pab.1.1412030348754; Mon, 29 Sep 2014 15:39:08 -0700 (PDT) Received: from Panzer (ip72-201-95-47.ph.ph.cox.net. [72.201.95.47]) by mx.google.com with ESMTPSA id oz6sm13315061pdb.38.2014.09.29.15.39.06 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Sep 2014 15:39:07 -0700 (PDT) From: "Todd Previte" To: "'Rodrigo Vivi'" , References: <1412029792-1992-1-git-send-email-rodrigo.vivi@intel.com> In-Reply-To: <1412029792-1992-1-git-send-email-rodrigo.vivi@intel.com> Date: Mon, 29 Sep 2014 15:39:06 -0700 Message-ID: <009801cfdc36$2f1454c0$8d3cfe40$@gmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQJy6dSXmikvv3HN3jBbjqTTsKTrJprSmIHQ Content-Language: en-us Subject: Re: [Intel-gfx] [PATCH] drm/i915: preserve other DP_TEST_SINK bits. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Hi Rodrigo, Looks good. Only thing that needs to be removed is that extra blank line between the last part of the function and the return statement. Otherwise... Reviewed-by: Todd Previte -----Original Message----- From: Rodrigo Vivi [mailto:rodrigo.vivi@intel.com] Sent: Monday, September 29, 2014 3:30 PM To: intel-gfx@lists.freedesktop.org Cc: Rodrigo Vivi; Todd Previte Subject: [PATCH] drm/i915: preserve other DP_TEST_SINK bits. Sink crc was implemented based on dp 1.1 spec that had all TEST_SINK bits reserved reading all 0s. But when reviewing my latest changes on sink crc Todd warned me that on new specs we have other valid bits on this reg that we might want to preserve. Cc: Todd Previte Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/intel_dp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf); @@ -3841,7 +3842,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc) if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0) return -EIO; - drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK, 0); + drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf); + drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK, + buf & ~DP_TEST_SINK_START); + return 0; } -- 1.9.3 diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index b8699b0..7d5fa2f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -3821,8 +3821,9 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc) if (!(buf & DP_TEST_CRC_SUPPORTED)) return -ENOTTY; + drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf); if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK, - DP_TEST_SINK_START) < 0) + buf | DP_TEST_SINK_START) < 0) return -EIO;