From patchwork Mon Apr 25 08:24:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhangi Shrivastava X-Patchwork-Id: 8924131 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 268DBBF29F for ; Mon, 25 Apr 2016 08:22:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D585E20173 for ; Mon, 25 Apr 2016 08:21:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E0F6720165 for ; Mon, 25 Apr 2016 08:21:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 721E66E50A; Mon, 25 Apr 2016 08:21:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 4EDF56E45D for ; Mon, 25 Apr 2016 08:21:20 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 25 Apr 2016 01:21:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,532,1455004800"; d="scan'208";a="952257104" Received: from shubhangi-desktop.iind.intel.com ([10.223.25.115]) by fmsmga001.fm.intel.com with ESMTP; 25 Apr 2016 01:21:18 -0700 From: Shubhangi Shrivastava To: intel-gfx@lists.freedesktop.org Date: Mon, 25 Apr 2016 13:54:29 +0530 Message-Id: <1461572670-32421-4-git-send-email-shubhangi.shrivastava@intel.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1461572670-32421-1-git-send-email-shubhangi.shrivastava@intel.com> References: <1461572670-32421-1-git-send-email-shubhangi.shrivastava@intel.com> Cc: Shubhangi Shrivastava Subject: [Intel-gfx] [PATCH 4/5] drm/i915: Extract test reply to separate function 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=-5.2 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 Replying for automated test request must be done only when we are ready for the request. This patch extracts this reply to separate function as it is needed in other places in the upcoming patches. Signed-off-by: Sivakumar Thulasimani Signed-off-by: Shubhangi Shrivastava --- drivers/gpu/drm/i915/intel_dp.c | 18 ++++++++++-------- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index de9ea18..77882ac 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4099,6 +4099,15 @@ static uint8_t intel_dp_autotest_phy_pattern(struct intel_dp *intel_dp) return test_result; } +int intel_dp_write_test_reply(struct intel_dp *intel_dp, uint8_t reply) +{ + /* Clear interrupt first */ + drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR, + DP_AUTOMATED_TEST_REQUEST); + + return drm_dp_dpcd_write(&intel_dp->aux, DP_TEST_RESPONSE, &reply, 1); +} + static void intel_dp_handle_test_request(struct intel_dp *intel_dp, bool short_pulse) { @@ -4144,14 +4153,7 @@ static void intel_dp_handle_test_request(struct intel_dp *intel_dp, } update_status: - /* Clear interrupt first */ - drm_dp_dpcd_writeb(&intel_dp->aux, - DP_DEVICE_SERVICE_IRQ_VECTOR, - DP_AUTOMATED_TEST_REQUEST); - status = drm_dp_dpcd_write(&intel_dp->aux, - DP_TEST_RESPONSE, - &response, 1); - + status = intel_dp_write_test_reply(intel_dp, response); if (status <= 0) DRM_DEBUG_KMS("Could not write test response to sink\n"); } diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index b9f1304..7da13b5 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -1335,6 +1335,7 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock, bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp); bool intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]); +int intel_dp_write_test_reply(struct intel_dp *intel_dp, uint8_t reply); /* intel_dp_mst.c */ int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);