From patchwork Wed Oct 24 18:09:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 1639971 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 23CFD3FCF7 for ; Wed, 24 Oct 2012 18:09:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FED6A0209 for ; Wed, 24 Oct 2012 11:09:41 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gh0-f177.google.com (mail-gh0-f177.google.com [209.85.160.177]) by gabe.freedesktop.org (Postfix) with ESMTP id C132B9E9C3 for ; Wed, 24 Oct 2012 11:09:30 -0700 (PDT) Received: by mail-gh0-f177.google.com with SMTP id f20so155161ghb.36 for ; Wed, 24 Oct 2012 11:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=tD8aGhTyK/Uv/zzqHS8xwEcqBz6zyay73ELlLp4xAsA=; b=Q0DQ3keNT3IKC280ItXmEiMlzOfghpurXh9OGqVJR4AmpP5PQ5O8V432ceJLvbyNH+ vlFf+mirQffvHb7enlwyEoVwJEMhkZigz8JK7ZTgMvLLU9k0aIPVaGmJyxdCmlJ/gmeJ O5F2dCRJHvHq8HE4T633L2uGsK0lt7e6SI7axxi8oMWQFJeCQkL6lV/IDRN0K4iqhdVT 0IzDL7JRipZrJ0a3YuVqMFqiw1zxR7DBaC2/sUDZvqdZbe2fxk9loJ5g8jRwsBSXjdKj I5gD6DE/jOVoWtc1/kv50xyt6UfPPVk4ru7g2JmJ5r9ywXq/su6HCN0u891djVZbMy9i AFqg== Received: by 10.100.231.3 with SMTP id d3mr5108417anh.49.1351102170281; Wed, 24 Oct 2012 11:09:30 -0700 (PDT) Received: from vicky.domain.invalid ([177.42.14.236]) by mx.google.com with ESMTPS id o66sm15449246yhi.19.2012.10.24.11.09.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 11:09:29 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Wed, 24 Oct 2012 16:09:25 -0200 Message-Id: <1351102165-10870-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1351024208-3489-9-git-send-email-przanoni@gmail.com> References: <1351024208-3489-9-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 08/18] drm/i915: check TRANSCODER_EDP on intel_modeset_setup_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 From: Paulo Zanoni We need to check if any of the pipes is using TRANSCODER_EDP. V2: DDI_BUF_CTL was renamed, so fix the usage here. Signed-off-by: Paulo Zanoni Reviewed-by: Damien Lespiau --- drivers/gpu/drm/i915/intel_display.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b4cceaf..b164ecf 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -8693,6 +8693,31 @@ void intel_modeset_setup_hw_state(struct drm_device *dev) struct intel_encoder *encoder; struct intel_connector *connector; + if (IS_HASWELL(dev)) { + tmp = I915_READ(TRANS_DDI_FUNC_CTL(TRANSCODER_EDP)); + + if (tmp & TRANS_DDI_FUNC_ENABLE) { + switch (tmp & TRANS_DDI_EDP_INPUT_MASK) { + case TRANS_DDI_EDP_INPUT_A_ON: + case TRANS_DDI_EDP_INPUT_A_ONOFF: + pipe = PIPE_A; + break; + case TRANS_DDI_EDP_INPUT_B_ONOFF: + pipe = PIPE_B; + break; + case TRANS_DDI_EDP_INPUT_C_ONOFF: + pipe = PIPE_C; + break; + } + + crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); + crtc->cpu_transcoder = TRANSCODER_EDP; + + DRM_DEBUG_KMS("Pipe %c using transcoder EDP\n", + pipe_name(pipe)); + } + } + for_each_pipe(pipe) { crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);