From patchwork Sun Aug 19 19:12:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1345061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id DB09CDF264 for ; Sun, 19 Aug 2012 20:42:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C05E8A1044 for ; Sun, 19 Aug 2012 13:42:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id 59149A1017 for ; Sun, 19 Aug 2012 13:20:59 -0700 (PDT) Received: by wibhm2 with SMTP id hm2so2677086wib.0 for ; Sun, 19 Aug 2012 13:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=u8rGiuyMP6iPeHwVzcFRhjSQqGujSpbNRiuqgD/SEBE=; b=Fzq+ez9lpaKeplbQ6YwsBgulfbxLxkjAc9w0DNp0teZrn9pkmvZ2BKHt4rEi/CB7Km DGfn+NGst2FJCo2+MkAGHUp4J4jS4OxpK0Eb4ikvVwEGfpxqh9fRTdmDqL4y1jkUs338 QhhRioyth1Cide2hfy+ngRVumA+soQAUuq40Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=u8rGiuyMP6iPeHwVzcFRhjSQqGujSpbNRiuqgD/SEBE=; b=PFkFamA+xbwlgsPaW3cptsKYzXGFCPYDofz77jVjBiciEU7fYi8lPaCWqmpt0boOaF HYA6AIend2QNCwy/ame9vsqUx5cbPcNhUDDroyEGpCyIQesbgRv3iwlyTVKBpdhI9Fbg f0fejitL6xS9DC/Z6F61RsUoUbl04oUkWQZoR7gTyw8tVo21lQwfAYRCBcGo9jyulBNp ZMktqa8UkOQDbeGeQ70EONHgp8ACfPea5Elk0K1rzoZ6OsXmkAIZOEyCuoosayrai9og pFxHU3UFnQl0qTP6hoxC8Jz84Q1h3c7mCCp5Mes/JvNLdKsmG5BfdNNE9JlfbUgApqeo peJw== Received: by 10.180.85.167 with SMTP id i7mr22916348wiz.8.1345407658412; Sun, 19 Aug 2012 13:20:58 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id fu8sm24194367wib.5.2012.08.19.13.20.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 13:20:57 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sun, 19 Aug 2012 21:12:50 +0200 Message-Id: <1345403595-9678-34-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1345403595-9678-1-git-send-email-daniel.vetter@ffwll.ch> References: <1345403595-9678-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQnVJ5Gg1+yPEU4/bOLiww2HdyMl6/YNmMezFkCOsR6sf+o8Neehne0UalCc1Eeo47uEXYbL Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 33/58] drm/i915: rip out intel_dp->dpms_mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org We now track the connector state in encoder->connectors_active, and because the DP output can't be cloned, that is sufficient to track the link state. Hence use this instead of adding yet another modeset state variable with dubious semantics at driver load and resume time. Also, connectors_active should only ever be set when the encoder is linked to a crtc, hence convert that crtc test into a WARN. v2: Rebase on top of struct intel_dp moving. v3: The rebase accidentally killed the newly-introduced intel_dp->port Noticed by Paulo Zanoni. Signed-Off-by: Daniel Vetter Reviewed-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_dp.c | 11 ++--------- drivers/gpu/drm/i915/intel_drv.h | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 96fd1e7..b07d4b4 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1309,8 +1309,6 @@ static void intel_disable_dp(struct intel_encoder *encoder) intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); ironlake_edp_panel_off(intel_dp); intel_dp_link_down(intel_dp); - - intel_dp->dpms_mode = DRM_MODE_DPMS_OFF; } static void intel_enable_dp(struct intel_encoder *encoder) @@ -1330,8 +1328,6 @@ static void intel_enable_dp(struct intel_encoder *encoder) } else ironlake_edp_panel_vdd_off(intel_dp, false); ironlake_edp_backlight_on(intel_dp); - - intel_dp->dpms_mode = DRM_MODE_DPMS_ON; } static void @@ -1356,7 +1352,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode) if (mode != DRM_MODE_DPMS_ON) { intel_encoder_dpms(&intel_dp->base, mode); - WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_OFF); if (is_cpu_edp(intel_dp)) ironlake_edp_pll_off(&intel_dp->base.base); @@ -1365,7 +1360,6 @@ intel_dp_dpms(struct drm_connector *connector, int mode) ironlake_edp_pll_on(&intel_dp->base.base); intel_encoder_dpms(&intel_dp->base, mode); - WARN_ON(intel_dp->dpms_mode != DRM_MODE_DPMS_ON); } intel_connector_check_state(to_intel_connector(connector)); @@ -2069,10 +2063,10 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) u8 sink_irq_vector; u8 link_status[DP_LINK_STATUS_SIZE]; - if (intel_dp->dpms_mode != DRM_MODE_DPMS_ON) + if (!intel_dp->base.connectors_active) return; - if (!intel_dp->base.base.crtc) + if (WARN_ON(!intel_dp->base.base.crtc)) return; /* Try to read receiver status if the link appears to be up */ @@ -2490,7 +2484,6 @@ intel_dp_init(struct drm_device *dev, int output_reg, enum port port) intel_dp->output_reg = output_reg; intel_dp->port = port; - intel_dp->dpms_mode = -1; intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); if (!intel_connector) { diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index a7d79de..c080c829 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -324,7 +324,6 @@ struct intel_dp { enum hdmi_force_audio force_audio; enum port port; uint32_t color_range; - int dpms_mode; uint8_t link_bw; uint8_t lane_count; uint8_t dpcd[DP_RECEIVER_CAP_SIZE];