From patchwork Sun Aug 19 19:12:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1344831 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id CF0283FC64 for ; Sun, 19 Aug 2012 20:28:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C538AA103D for ; Sun, 19 Aug 2012 13:28:09 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id E7445A103D for ; Sun, 19 Aug 2012 13:20:26 -0700 (PDT) Received: by mail-wg0-f41.google.com with SMTP id ds1so2669716wgb.0 for ; Sun, 19 Aug 2012 13:20:26 -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=EVAuQBpmKmzU5T15TlEM2lU7gFNxqTV7d5px3PmcJcY=; b=MMhd93g8T8o4raF2KYtQzA037aUBU6+JqwhK4NuSiIKGhRYA8DhklvCLX22jd0G0E1 Ki6+Tvyfwo5r7nUcusKfKnIHBrFXMez6EPQNkb54UIFHbLIvNGvHMnltykT01uzlvWQH 9/TC9iAvhd0DPKDkk9Ou/iD5if+VwPKkCJCGY= 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=EVAuQBpmKmzU5T15TlEM2lU7gFNxqTV7d5px3PmcJcY=; b=GBgSwAnfGqC6kONk6BZ/tmhK3uj+qCfyfFYEuSplsjiO69m8GVlVrGFqSY8DzkWl+o LcPFefs3OBvr86PeLZJvAdVjFDWis9V8xVjX1z8NAJtNVtdaHdCx+MACYrqrTVdl3He1 kjekIq3e/nnLsVojFiUKfwO1T273QsScssOJS3JcEKX/ho4fO/qxEYbJ+HQo2ZEWOfJm 7aJqxKdmS8PqEn6BBJAqHtc90LPYvQajQDQak59YoAVWbiJZzkVxcN2Ah+P+/7xfoKmS 48unEz7uzq50R22h3WRSvYUmcJg+sBHPtFMdQ6SRLsp9EzqVZ0dibuIhC3VdIQNYfzhS Bsfg== Received: by 10.180.91.1 with SMTP id ca1mr21981507wib.8.1345407626431; Sun, 19 Aug 2012 13:20:26 -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.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 13:20:25 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sun, 19 Aug 2012 21:12:27 +0200 Message-Id: <1345403595-9678-11-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: ALoCoQmkaldnnIRGLrDEHQn0FSDuT6Gj2shdpB2Il0g8CdlQE89zv+FM4I8RxsL7nu1gwVO4kZNb Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 10/58] drm/i915/dvo: convert to encoder disable/enable 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 Similar to the sdvo conversion. Signed-off-by: Daniel Vetter Reviewed-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_dvo.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index 227551f..4ad988f 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c @@ -105,6 +105,30 @@ static struct intel_dvo *intel_attached_dvo(struct drm_connector *connector) struct intel_dvo, base); } +static void intel_disable_dvo(struct intel_encoder *encoder) +{ + struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; + struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base); + u32 dvo_reg = intel_dvo->dev.dvo_reg; + u32 temp = I915_READ(dvo_reg); + + intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false); + I915_WRITE(dvo_reg, temp & ~DVO_ENABLE); + I915_READ(dvo_reg); +} + +static void intel_enable_dvo(struct intel_encoder *encoder) +{ + struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; + struct intel_dvo *intel_dvo = enc_to_intel_dvo(&encoder->base); + u32 dvo_reg = intel_dvo->dev.dvo_reg; + u32 temp = I915_READ(dvo_reg); + + I915_WRITE(dvo_reg, temp | DVO_ENABLE); + I915_READ(dvo_reg); + intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); +} + static void intel_dvo_dpms(struct drm_encoder *encoder, int mode) { struct drm_i915_private *dev_priv = encoder->dev->dev_private; @@ -277,9 +301,10 @@ static void intel_dvo_destroy(struct drm_connector *connector) static const struct drm_encoder_helper_funcs intel_dvo_helper_funcs = { .dpms = intel_dvo_dpms, .mode_fixup = intel_dvo_mode_fixup, - .prepare = intel_encoder_prepare, + .prepare = intel_encoder_noop, .mode_set = intel_dvo_mode_set, - .commit = intel_encoder_commit, + .commit = intel_encoder_noop, + .disable = intel_encoder_disable, }; static const struct drm_connector_funcs intel_dvo_connector_funcs = { @@ -372,6 +397,9 @@ void intel_dvo_init(struct drm_device *dev) drm_encoder_init(dev, &intel_encoder->base, &intel_dvo_enc_funcs, encoder_type); + intel_encoder->disable = intel_disable_dvo; + intel_encoder->enable = intel_enable_dvo; + /* Now, try to find a controller */ for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { struct drm_connector *connector = &intel_connector->base;