From patchwork Wed Jul 11 14:28:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1183861 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 82F7ADF25A for ; Wed, 11 Jul 2012 16:05:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ECEDA0DB1 for ; Wed, 11 Jul 2012 09:05:50 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 92C229E8A8 for ; Wed, 11 Jul 2012 08:35:58 -0700 (PDT) Received: by mail-we0-f177.google.com with SMTP id r3so960506wey.36 for ; Wed, 11 Jul 2012 08:35:58 -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=jevZr6QgluBe/k5tiVzgT17Jb4gAP8wEoQk7ohXg+Tg=; b=da3gTczHc3mx6MjAoWwLgMs+PtmQh410V+owS1nzXrZDRCqkUPZjE86MxHcSe9220S iZ+NlCcJ1gCT6JyqLAOP4cVh7fvT2W1NWjGn3a5Ey52IEIP5SlUtuSOKQTzJOy5dyA7e 8C/vunuh6PgGrcuA5v79WxY3cBjjTzdjO7IOA= 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=jevZr6QgluBe/k5tiVzgT17Jb4gAP8wEoQk7ohXg+Tg=; b=ms6/rL0Sz8Ffbz7ZvyL6aTNZrG6tJQEFLddCAygYRyHbFnLcdJppeITRzXqJeOMJ+0 i7HtIC5HQUxfuOna7+4aqb4Wf6f9i03Y7LRz4sjh5QWoAE0K6/LT26kd10D3gaMwHDpN D0l0CbPp4LHnOL82IVQLrJElbMC2VF7PAxJ6FEHc/y39Of5CXCGHZtkTKiUT/cu64D+r pDK7pAg/MHWQ11J0OZZz2icg94nmXWnSlZi01Gcbs7EfPPWjgbww1+K4DKAu0k4v1TOt eREiwTk2WKi3CWN1kCJg4qYuo4I2suPvXN/AYbcujx9jPcIKZz7z6kjcanJhxBJZev3c 0TGg== Received: by 10.216.226.32 with SMTP id a32mr18115670weq.190.1342020958360; Wed, 11 Jul 2012 08:35:58 -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.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 08:35:57 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 11 Jul 2012 16:28:20 +0200 Message-Id: <1342016944-23395-38-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: ALoCoQlVMTQ095L/iJZy8DZ+7GWzgtHPQ5KIh1g4YrROdkD/0uBYC8Jb/gJt+FuoOVKvUwrz+MGo Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 37/81] 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 --- drivers/gpu/drm/i915/intel_tv.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 3136f56..aa9beaa 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) { @@ -1618,6 +1633,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;