From patchwork Wed Jul 11 14:27:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1183451 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 1C50FDF25A for ; Wed, 11 Jul 2012 15:42:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E3368A0E80 for ; Wed, 11 Jul 2012 08:42:39 -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 E74549E94F for ; Wed, 11 Jul 2012 08:35:17 -0700 (PDT) Received: by wibhm2 with SMTP id hm2so4270351wib.0 for ; Wed, 11 Jul 2012 08:35:17 -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=PfAwRoVUKj8IX7fSPWwl+8akKvCqMizqTrrZWCOz9L8=; b=QeQzQX0xe0q3y4Iy2Z5oD7R1OBxBCQ4N2VUt1pxhRMrAANagbUOd+OKvVpw8/J4Shf outsYQ5gLP/MIElKQhq1IM2SWwTACfMvzPyd26FEeCPM0Puml3pdmvXpy680YkZgTt2v iSBpiO74Ayy/nhCXsGehppn2l2gQxuXCUjkjU= 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=PfAwRoVUKj8IX7fSPWwl+8akKvCqMizqTrrZWCOz9L8=; b=ELFSgVmcXkHW3+6fHoIfM6GTrUkJ6iiQ32GRU5JI4cBavRJ6LX23p44RxTr/jGXRBZ 2dk/OnfKWUCiH/XFQjLAYTUgFkdmd4lFvpu+WFqObMpvyyfn6MGeM7kyXoBzPZpyaoOx Ona8YH15EigU6UhNBxu5kz2DcarsUBW32fcdq1AWL++vO/rgEy0Y7uipBhDdQCYz8jt2 grWAQEci0lbB98AOir62bkHKIfIsUviZ7sZ8H+fvBRJ8/bNRxmO7g0IXNm9r8PUtqNRh qT2yjbqmLcRkpRzwqHJVwx1c1v7Yf0xYu3z3kV2Sw+O9EF7M6Mh1W13OUAQNCB42xs6d 0kPQ== Received: by 10.216.81.7 with SMTP id l7mr5260201wee.23.1342020917126; Wed, 11 Jul 2012 08:35:17 -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.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 08:35:16 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 11 Jul 2012 16:27:51 +0200 Message-Id: <1342016944-23395-9-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: ALoCoQm+XCq7goo+oocSEPzyZPnBlUfwg1tfFY+6fVQHEc9aCZgzy3gLbZRtkGI/vfl3MgjqdkOe Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 08/81] 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 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 3b413c9..a0ec1eb 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 * @@ -1480,15 +1480,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, @@ -1618,6 +1618,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);