From patchwork Mon Oct 20 12:50:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vandana.kannan@intel.com X-Patchwork-Id: 5105251 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 224C6C11AC for ; Mon, 20 Oct 2014 12:35:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EC44201F2 for ; Mon, 20 Oct 2014 12:35:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EC6B420142 for ; Mon, 20 Oct 2014 12:35:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D5A16E01E; Mon, 20 Oct 2014 05:35:55 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id D36896E012 for ; Mon, 20 Oct 2014 05:35:53 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 20 Oct 2014 05:35:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,756,1406617200"; d="scan'208";a="621838706" Received: from vkannan-desktop.iind.intel.com ([10.223.25.137]) by orsmga002.jf.intel.com with ESMTP; 20 Oct 2014 05:34:53 -0700 From: Vandana Kannan To: intel-gfx@lists.freedesktop.org Date: Mon, 20 Oct 2014 18:20:08 +0530 Message-Id: <1413809409-8569-7-git-send-email-vandana.kannan@intel.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1413809409-8569-1-git-send-email-vandana.kannan@intel.com> References: <1413809409-8569-1-git-send-email-vandana.kannan@intel.com> Subject: [Intel-gfx] [RFC 6/7] drm/i915: Replace all refs to intel_dp delays 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.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 Removing delays from intel_dp. Replacing intel_dp PPS delays with intel_panel PPS delays. This is part of removing all refs to PPS in intel_dp and moving it to PPS in intel_panel. Signed-off-by: Vandana Kannan --- drivers/gpu/drm/i915/intel_dp.c | 22 +++++++++++++++------- drivers/gpu/drm/i915/intel_drv.h | 5 ----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index ca11eb1..bdb8317 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -497,6 +497,7 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code, edp_notifier); struct drm_device *dev = intel_dp_to_dev(intel_dp); struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_connector *intel_connector = intel_dp->attached_connector; u32 pp_div; u32 pp_ctrl_reg, pp_div_reg; @@ -516,7 +517,7 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code, /* 0x1F write to PP_DIV_REG sets max cycle delay */ I915_WRITE(pp_div_reg, pp_div | 0x1F); I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF); - msleep(intel_dp->panel_power_cycle_delay); + msleep(intel_connector->panel.pps.panel_power_cycle_delay); } pps_unlock(intel_dp); @@ -1321,26 +1322,29 @@ static void wait_panel_off(struct intel_dp *intel_dp) static void wait_panel_power_cycle(struct intel_dp *intel_dp) { + struct intel_connector *intel_connector = intel_dp->attached_connector; DRM_DEBUG_KMS("Wait for panel power cycle\n"); /* When we disable the VDD override bit last we have to do the manual * wait. */ wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle, - intel_dp->panel_power_cycle_delay); + intel_connector->panel.pps.panel_power_cycle_delay); wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE); } static void wait_backlight_on(struct intel_dp *intel_dp) { + struct intel_connector *intel_connector = intel_dp->attached_connector; wait_remaining_ms_from_jiffies(intel_dp->last_power_on, - intel_dp->backlight_on_delay); + intel_connector->panel.pps.backlight_on_delay); } static void edp_wait_backlight_off(struct intel_dp *intel_dp) { + struct intel_connector *intel_connector = intel_dp->attached_connector; wait_remaining_ms_from_jiffies(intel_dp->last_backlight_off, - intel_dp->backlight_off_delay); + intel_connector->panel.pps.backlight_off_delay); } /* Read the current pp_control value, unlocking the register if it @@ -1371,6 +1375,7 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp) struct drm_device *dev = intel_dp_to_dev(intel_dp); struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct intel_encoder *intel_encoder = &intel_dig_port->base; + struct intel_connector *intel_connector = intel_dp->attached_connector; struct drm_i915_private *dev_priv = dev->dev_private; enum intel_display_power_domain power_domain; u32 pp; @@ -1410,7 +1415,7 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp) */ if (!edp_have_panel_power(intel_dp)) { DRM_DEBUG_KMS("eDP was not running\n"); - msleep(intel_dp->panel_power_up_delay); + msleep(intel_connector->panel.pps.panel_power_up_delay); } return need_to_disable; @@ -1490,6 +1495,7 @@ static void edp_panel_vdd_work(struct work_struct *__work) static void edp_panel_vdd_schedule_off(struct intel_dp *intel_dp) { + struct intel_connector *intel_connector = intel_dp->attached_connector; unsigned long delay; /* @@ -1497,7 +1503,8 @@ static void edp_panel_vdd_schedule_off(struct intel_dp *intel_dp) * down delay) to keep the panel power up across a sequence of * operations. */ - delay = msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5); + delay = msecs_to_jiffies( + intel_connector->panel.pps.panel_power_cycle_delay * 5); schedule_delayed_work(&intel_dp->panel_vdd_work, delay); } @@ -3702,6 +3709,7 @@ static void intel_dp_link_down(struct intel_dp *intel_dp) { struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); + struct intel_connector *intel_connector = intel_dp->attached_connector; enum port port = intel_dig_port->port; struct drm_device *dev = intel_dig_port->base.base.dev; struct drm_i915_private *dev_priv = dev->dev_private; @@ -3760,7 +3768,7 @@ intel_dp_link_down(struct intel_dp *intel_dp) DP &= ~DP_AUDIO_OUTPUT_ENABLE; I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); POSTING_READ(intel_dp->output_reg); - msleep(intel_dp->panel_power_down_delay); + msleep(intel_connector->panel.pps.panel_power_down_delay); } static bool diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 4ae913c..f99cbc5 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -581,11 +581,6 @@ struct intel_dp { uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS]; struct drm_dp_aux aux; uint8_t train_set[4]; - int panel_power_up_delay; - int panel_power_down_delay; - int panel_power_cycle_delay; - int backlight_on_delay; - int backlight_off_delay; struct delayed_work panel_vdd_work; bool want_panel_vdd; unsigned long last_power_cycle;