From patchwork Wed Jul 11 14:28:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1183601 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 3F580DF25A for ; Wed, 11 Jul 2012 15:50:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B229E9EED8 for ; Wed, 11 Jul 2012 08:50:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A13A9E8A8 for ; Wed, 11 Jul 2012 08:35:31 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id dr1so946426wgb.12 for ; Wed, 11 Jul 2012 08:35:31 -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=EIRdHUrTumTQbc20hZrzaXETaEki2kbYl158N3whKic=; b=gnt6oGjOcJL3StoXyo5Wq4uMF28x/FsGW5t9KvWUtnDXy6BB0PNgdHVFu2ST2UMw+e Gi0CHUitpt2+WLzDY4iGPfv3nXP5VRGkNKPzqfjRrcADzMHivu0qbb0C68S3H3D7e8oe W040hbEY2Yt1kFXTyIGUnSh0T0ub3dpLLd6Tc= 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=EIRdHUrTumTQbc20hZrzaXETaEki2kbYl158N3whKic=; b=WcG8ueXFhwcUGJtsxX3AbGTrLFNxh+m01s6wOwlP6dywqh85PT0SSXkcdmbkp0+Tt9 4HeBiODJ5gyCsLTfWVCmAEVFUuwxNhXWImaf9AaZ6PGrihBqKleWEWk/9e9VL9OuwgW6 omFSq32vHzLsjom+V54fml0Px7efa6QytiG7lUPYLPjMkQlZiVfWFS7//v50gymmzYNz Fp/InlE0CYaLjjBOWodJFoZmPxR8lROQsUNM+H47D723AT23VQE5RJR3fGIUslmSP7hm 2uYszdjweFw0z8MhZb7IYsYA7w0TqYJI5GAz2xFaw088Imv+/z0a2HhjA+Mq/cky/8RJ 1bcw== Received: by 10.216.180.197 with SMTP id j47mr8265087wem.35.1342020931278; Wed, 11 Jul 2012 08:35:31 -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 bc2sm5777080wib.0.2012.07.11.08.35.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 08:35:30 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 11 Jul 2012 16:28:01 +0200 Message-Id: <1342016944-23395-19-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1342016944-23395-1-git-send-email-daniel.vetter@ffwll.ch> References: <1342016944-23395-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQkGTomGME4irWArYWp5pPKahDlaM7WSr5N1dum3mF6xNd1FUNY9GPQFARuoLQpouTjUIZ3Y Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 18/81] 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 --- drivers/gpu/drm/i915/intel_dvo.c | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index d72584a..756e977 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c @@ -97,6 +97,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; @@ -269,9 +293,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 = { @@ -364,6 +389,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;