From patchwork Tue Jul 3 09:28:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1150471 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 43D36DFF72 for ; Tue, 3 Jul 2012 11:03:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15F4BA0244 for ; Tue, 3 Jul 2012 04:03:42 -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 03116A01F6 for ; Tue, 3 Jul 2012 03:35:14 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id dr1so4714410wgb.12 for ; Tue, 03 Jul 2012 03:35:14 -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=G5GuB1YmO7Dmdru3R7BAU1zfZK/6wyql+c6+vVGTqO8=; b=SxW67m6Itsd45WnM2kHio2IPfGAGoe+zspvh/j6a/E9AHVG9FWtyVJiN6EhEG2tlX4 DzE85vPFOjkBbzxPvwzJEhLK1rL8QpK7assnVsKfZm4RLK0GplEF9OedKmCN/JvQr+Xs P6cG1tYXFMEU64dC40rWsubWDPW6U0XMQb2gU= 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=G5GuB1YmO7Dmdru3R7BAU1zfZK/6wyql+c6+vVGTqO8=; b=dV6JxKxuUq05tHxmo7A3owf3cOTeMNFecLm+R2nL2gs5kWhlUuePaZ+a4U3YlRJIHP 6I2CL9AzCengocfuAVg9xdb9yoN6f8mgQOQLP5z0da8gJf8GycsvHj2ghjYGfezpQ1BS JIeplKvzsHFH6uaaB9Sz0l5iMxD/GBClPZxNmSgaR/Mkn2LThmmsTVt6cefQZ3gr3WiR nAm/cmixBZma3qHmvs4PBKIFcmDpbhe4CXisphT8NIcramYJ+ufgwjDMjMCMobJNxDfb aR9CE1COUe+sWzCcY1GqNv7COkGv+nUYqY2ouxFOrT5ILwiX50qeWWH4TM8zxPX+x51h 4sQg== Received: by 10.216.240.79 with SMTP id d57mr3604768wer.3.1341311714626; Tue, 03 Jul 2012 03:35:14 -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 e9sm14845138wiw.10.2012.07.03.03.35.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 03:35:14 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Tue, 3 Jul 2012 11:28:29 +0200 Message-Id: <1341307715-3886-38-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1341307715-3886-1-git-send-email-daniel.vetter@ffwll.ch> References: <1341307715-3886-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQmcaGxAyEaGOSkM+RdQ92jnVYOgufbJuPipKrXKVPUho0V8t0+M23x9fYbvb0+5EIXrCTfj Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 37/43] 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 2fce753..5920c5f 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) { @@ -1622,6 +1637,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;