From patchwork Tue Oct 7 15:09:44 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: 5046591 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 60C5BC11AB for ; Tue, 7 Oct 2014 14:56:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AF2920222 for ; Tue, 7 Oct 2014 14:56:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2D5682021F for ; Tue, 7 Oct 2014 14:56:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B3B2589C0D; Tue, 7 Oct 2014 07:56:05 -0700 (PDT) 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 620716E114 for ; Tue, 7 Oct 2014 07:56:03 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 07 Oct 2014 07:55:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,670,1406617200"; d="scan'208";a="610839873" Received: from vkannan-desktop.iind.intel.com ([10.223.25.137]) by fmsmga002.fm.intel.com with ESMTP; 07 Oct 2014 07:54:56 -0700 From: Vandana Kannan To: intel-gfx@lists.freedesktop.org Date: Tue, 7 Oct 2014 20:39:44 +0530 Message-Id: <1412694584-743-7-git-send-email-vandana.kannan@intel.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1412694584-743-1-git-send-email-vandana.kannan@intel.com> References: <1412694584-743-1-git-send-email-vandana.kannan@intel.com> Subject: [Intel-gfx] [RFC 6/6] drm/i915: Modify refs to intel dp timestamps 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Moving timestamp values to intel_panel as part of moving all refs of PPS to intel_panel. Signed-off-by: Vandana Kannan --- drivers/gpu/drm/i915/intel_dp.c | 31 ++++++++++++++++--------------- drivers/gpu/drm/i915/intel_drv.h | 12 ++++++++---- drivers/gpu/drm/i915/intel_panel.c | 9 +++++++++ 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 36c6b3b..4959c86 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1326,7 +1326,8 @@ static void wait_panel_power_cycle(struct intel_dp *intel_dp) /* 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, + wait_remaining_ms_from_jiffies( + intel_connector->panel.pps.last_power_cycle, intel_connector->panel.pps.panel_power_cycle_delay); wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE); @@ -1335,14 +1336,18 @@ static void wait_panel_power_cycle(struct intel_dp *intel_dp) 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, + + wait_remaining_ms_from_jiffies( + intel_connector->panel.pps.last_power_on, 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, + + wait_remaining_ms_from_jiffies( + intel_connector->panel.pps.last_backlight_off, intel_connector->panel.pps.backlight_off_delay); } @@ -1448,6 +1453,7 @@ static void edp_panel_vdd_off_sync(struct intel_dp *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; enum intel_display_power_domain power_domain; u32 pp; u32 pp_stat_reg, pp_ctrl_reg; @@ -1475,7 +1481,7 @@ static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp) I915_READ(pp_stat_reg), I915_READ(pp_ctrl_reg)); if ((pp & POWER_TARGET_ON) == 0) - intel_dp->last_power_cycle = jiffies; + intel_connector->panel.pps.last_power_cycle = jiffies; power_domain = intel_display_port_power_domain(intel_encoder); intel_display_power_put(dev_priv, power_domain); @@ -1552,6 +1558,7 @@ void intel_edp_panel_on(struct intel_dp *intel_dp) { 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; u32 pp_ctrl_reg; @@ -1586,7 +1593,7 @@ void intel_edp_panel_on(struct intel_dp *intel_dp) POSTING_READ(pp_ctrl_reg); wait_panel_on(intel_dp); - intel_dp->last_power_on = jiffies; + intel_connector->panel.pps.last_power_on = jiffies; if (IS_GEN5(dev)) { pp |= PANEL_POWER_RESET; /* restore panel reset bit */ @@ -1602,6 +1609,7 @@ void intel_edp_panel_off(struct intel_dp *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_device *dev = intel_dp_to_dev(intel_dp); struct drm_i915_private *dev_priv = dev->dev_private; enum intel_display_power_domain power_domain; @@ -1630,7 +1638,7 @@ void intel_edp_panel_off(struct intel_dp *intel_dp) I915_WRITE(pp_ctrl_reg, pp); POSTING_READ(pp_ctrl_reg); - intel_dp->last_power_cycle = jiffies; + intel_connector->panel.pps.last_power_cycle = jiffies; wait_panel_off(intel_dp); /* We got a reference when we enabled the VDD. */ @@ -1687,6 +1695,7 @@ static void _intel_edp_backlight_off(struct intel_dp *intel_dp) { 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; u32 pp_ctrl_reg; @@ -1705,7 +1714,7 @@ static void _intel_edp_backlight_off(struct intel_dp *intel_dp) pps_unlock(intel_dp); - intel_dp->last_backlight_off = jiffies; + intel_connector->panel.pps.last_backlight_off = jiffies; edp_wait_backlight_off(intel_dp); } @@ -4647,13 +4656,6 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect } } -static void intel_dp_init_panel_power_timestamps(struct intel_dp *intel_dp) -{ - intel_dp->last_power_cycle = jiffies; - intel_dp->last_power_on = jiffies; - intel_dp->last_backlight_off = jiffies; -} - void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate) { struct drm_i915_private *dev_priv = dev->dev_private; @@ -4854,7 +4856,6 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, } pps_lock(intel_dp); - intel_dp_init_panel_power_timestamps(intel_dp); intel_panel_setup_panel_power_sequencer(intel_connector); intel_panel_set_pps_registers(intel_connector, port); pps_unlock(intel_dp); diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 687d581..1718510 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -191,6 +191,10 @@ struct intel_panel { int panel_power_cycle_delay; int backlight_on_delay; int backlight_off_delay; + /* timestamps */ + unsigned long last_power_cycle; + unsigned long last_power_on; + unsigned long last_backlight_off; } pps; }; @@ -578,16 +582,16 @@ 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_up_delay; int panel_power_down_delay; int panel_power_cycle_delay; int backlight_on_delay; - int backlight_off_delay; + int backlight_off_delay;*/ struct delayed_work panel_vdd_work; bool want_panel_vdd; - unsigned long last_power_cycle; + /*unsigned long last_power_cycle; unsigned long last_power_on; - unsigned long last_backlight_off; + unsigned long last_backlight_off;*/ struct notifier_block edp_notifier; diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 9f7cb7a..6104273 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -1427,6 +1427,13 @@ static struct edp_power_seq vlv_setup_pps(struct intel_connector *connector) pp_off_reg, pp_div_reg); } +static void intel_panel_init_pps_timestamps(struct intel_panel *panel) +{ + panel->pps.last_power_cycle = jiffies; + panel->pps.last_power_on = jiffies; + panel->pps.last_backlight_off = jiffies; +} + void intel_panel_setup_panel_power_sequencer(struct intel_connector *connector) { struct drm_device *dev = connector->base.dev; @@ -1434,6 +1441,8 @@ void intel_panel_setup_panel_power_sequencer(struct intel_connector *connector) struct intel_panel *panel = &connector->panel; struct edp_power_seq cur, spec, vbt, final; + intel_panel_init_pps_timestamps(panel); + /* Get chip specific register values */ cur = dev_priv->display.setup_panel_power_seq(connector);