From patchwork Sun Aug 19 19:12:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1344981 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 7E7353FC33 for ; Sun, 19 Aug 2012 20:37:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78C64A1036 for ; Sun, 19 Aug 2012 13:37:44 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DEB9A103C for ; Sun, 19 Aug 2012 13:20:48 -0700 (PDT) Received: by wibhq4 with SMTP id hq4so2753404wib.12 for ; Sun, 19 Aug 2012 13:20:47 -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=+6NJvmd+Y+b6bVeZH+ch7Ta+CE6m9uGHnpfJVT5XzsU=; b=Tyopfj9HbPB2k6DSNYCjCk3J77QbHgMh9iXYOhvOut+mRvP38bOuHVzEgsOY54w5Uc 5vnF/jQR3F0WF70ZuSFxzpGS6Fa1MQ3bIbXKTj0qLrwZA+cX0M+0357vnWHHPG69ulmI sXy0R/VKS1kbtM6P3+dwWgWJFeNEvN+/Cg1AU= 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=+6NJvmd+Y+b6bVeZH+ch7Ta+CE6m9uGHnpfJVT5XzsU=; b=pZuTynxUyDASULA73rcXgRN9AREBzHLqr7eCYI7a9WiXvJ3TAAbMnOQw1RjwnoIGj/ OY5LCy0HgjSfZz43ERhetAK8PlrLmUljV7PJoT0QHKqAWsR9lbeHq5C7VVZzonh+bTbc OHlxNzTLz/KDdCjI9PqT4/aZzGGzVm8V6IG2jQYl98Lr7y02yRLTQdmHjv0rtzlavhBJ ep1xag7L4eTDZf36h55J1xxc9xsscL8MLFqZooVspxmSZXhIjlHQl+RH5LUqX6l7q0b8 3G/EAHAL1kt3Pn0wx+LG2Ss6c53NHPH1LH9Krvq/8UjBn3VTfcaS1jlXVRD1IhFduFZs PwYA== Received: by 10.180.74.131 with SMTP id t3mr19058907wiv.7.1345407647375; Sun, 19 Aug 2012 13:20:47 -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.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 13:20:46 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sun, 19 Aug 2012 21:12:42 +0200 Message-Id: <1345403595-9678-26-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: ALoCoQmOq834dgKKDnuSYHXbKuDEqalZXw8Ob3ICtx/IbqBngZTi1leVAokbNPhTtQkZ75NCsMyJ Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 25/58] drm/i915/tv: implement get_hw_state 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 Signed-Off-by: Daniel Vetter Reviewed-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_tv.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 5dc08b9..98ad7fd 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -836,6 +836,21 @@ static struct intel_tv *intel_attached_tv(struct drm_connector *connector) base); } +static bool +intel_tv_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) +{ + struct drm_device *dev = encoder->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + u32 tmp = I915_READ(TV_CTL); + + if (!(tmp & TV_ENC_ENABLE)) + return false; + + *pipe = PORT_TO_PIPE(tmp); + + return true; +} + static void intel_enable_tv(struct intel_encoder *encoder) { @@ -1616,6 +1631,8 @@ intel_tv_init(struct drm_device *dev) intel_encoder->enable = intel_enable_tv; intel_encoder->disable = intel_disable_tv; + intel_encoder->get_hw_state = intel_tv_get_hw_state; + intel_connector->get_hw_state = intel_connector_get_hw_state; intel_connector_attach_encoder(intel_connector, intel_encoder); intel_encoder->type = INTEL_OUTPUT_TVOUT;