From patchwork Thu Jul 26 18:48:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1244731 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 37E86DFFCE for ; Thu, 26 Jul 2012 20:10:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B5C09F4C1 for ; Thu, 26 Jul 2012 13:10:00 -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 397909E790 for ; Thu, 26 Jul 2012 12:56:23 -0700 (PDT) Received: by mail-wg0-f41.google.com with SMTP id ds1so69885wgb.0 for ; Thu, 26 Jul 2012 12:56:23 -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=8BnsBRuGSMYcoCgNs45r+YXWvUjuzICqBmgoua1yQDA=; b=Pcq1qWobQwy3F1Bn4yq9bCe2pHKSHR8CBj+VSXjvr5+TsvdV04viVt6TaFvjprqGIR tYwXUdmcgmRkSGlrHGwmwfKtBLV5qiWDL8qHfBhgI/xpgsXKxvkogUI2VIx0KhS26spW qNNbryZfF4qFlzITdqhK2GDA8/YRHrATvqag0= 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=8BnsBRuGSMYcoCgNs45r+YXWvUjuzICqBmgoua1yQDA=; b=XpkJNt/+kN1CR2Xfye2g9KUWN7GEMSNINDb2AXmZHAxJJz+5pn7gd2QKAUN3xdgPsu yIn/b//Hi7xGNS5azgRKNlRZC95nDvf5UKbFQVrcLlcTvGhs8xf+yHxA/jwsiXt/KCSl RUZfIHnn6Pm93/wWXrzHGB1CwUurOGayQHk2mHvmoqSIxqV0keDUFNpFqrAkNBl4QrqM yGC03TrjJabQPF9GHgZd7tP2EZl+kRfx50gSF4we9jCFh5Ywud7gyqZCfsrNHhrWAflm +7q9nN8RJsxEFXm0nKnLEgrlGzEYSwt13Pz2+gpRbnfOJFX+jom1F85IjkLmTPLsOEHc 1FXw== Received: by 10.180.100.133 with SMTP id ey5mr170638wib.4.1343332582949; Thu, 26 Jul 2012 12:56:22 -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 fr4sm391403wib.8.2012.07.26.12.56.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jul 2012 12:56:22 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 26 Jul 2012 20:48:38 +0200 Message-Id: <1343328581-2324-14-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> References: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQkF0q0+lb9vvX+esMQn0XpXYtVzAX9SU2afROeN8SGWSqG9v/4AhFoOBfE/y2jp4HHTXsP4 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 13/76] drm/i915/tv: convert to encoder enable/disable 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 Like hdmi tv outputs are simple: They only have 2 states and can't be cloned. Hence give it the same treatment. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_tv.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 1a0bab0..4855bf3 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -837,21 +837,21 @@ static struct intel_tv *intel_attached_tv(struct drm_connector *connector) } static void -intel_tv_dpms(struct drm_encoder *encoder, int mode) +intel_enable_tv(struct intel_encoder *encoder) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = dev->dev_private; - switch (mode) { - case DRM_MODE_DPMS_ON: - I915_WRITE(TV_CTL, I915_READ(TV_CTL) | TV_ENC_ENABLE); - break; - case DRM_MODE_DPMS_STANDBY: - case DRM_MODE_DPMS_SUSPEND: - case DRM_MODE_DPMS_OFF: - I915_WRITE(TV_CTL, I915_READ(TV_CTL) & ~TV_ENC_ENABLE); - break; - } + I915_WRITE(TV_CTL, I915_READ(TV_CTL) | TV_ENC_ENABLE); +} + +static void +intel_disable_tv(struct intel_encoder *encoder) +{ + struct drm_device *dev = encoder->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + + I915_WRITE(TV_CTL, I915_READ(TV_CTL) & ~TV_ENC_ENABLE); } static const struct tv_mode * @@ -1481,15 +1481,15 @@ out: } static const struct drm_encoder_helper_funcs intel_tv_helper_funcs = { - .dpms = intel_tv_dpms, .mode_fixup = intel_tv_mode_fixup, - .prepare = intel_encoder_prepare, + .prepare = intel_encoder_noop, .mode_set = intel_tv_mode_set, - .commit = intel_encoder_commit, + .commit = intel_encoder_noop, + .disable = intel_encoder_disable, }; static const struct drm_connector_funcs intel_tv_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = intel_connector_dpms, .detect = intel_tv_detect, .destroy = intel_tv_destroy, .set_property = intel_tv_set_property, @@ -1619,6 +1619,9 @@ intel_tv_init(struct drm_device *dev) drm_encoder_init(dev, &intel_encoder->base, &intel_tv_enc_funcs, DRM_MODE_ENCODER_TVDAC); + intel_encoder->enable = intel_enable_tv; + intel_encoder->disable = intel_disable_tv; + intel_connector_attach_encoder(intel_connector, intel_encoder); intel_encoder->type = INTEL_OUTPUT_TVOUT; intel_encoder->crtc_mask = (1 << 0) | (1 << 1);