From patchwork Wed May 29 08:41:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2628201 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 0DCBFDF24C for ; Wed, 29 May 2013 08:41:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1EBE5E63D1 for ; Wed, 29 May 2013 01:41:51 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ea0-f176.google.com (mail-ea0-f176.google.com [209.85.215.176]) by gabe.freedesktop.org (Postfix) with ESMTP id BCC26E5DE5 for ; Wed, 29 May 2013 01:41:38 -0700 (PDT) Received: by mail-ea0-f176.google.com with SMTP id k11so4954656eaj.7 for ; Wed, 29 May 2013 01:41:37 -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=3ndmy3b0yjamYvDctt2nDcli/HrxujV7KKxazvsFgNI=; b=FkF9+AteNtRogd7O7lMxkFMI8gaXDZKF7BcqsGTTgg9ASHkfhpg+cti7Cov4pdq6Lw 4bqIuNlzEFaB6ByxvqfKnZucvJ60Dhc3niFMrAw+p+Di6NDhqTMdH3N43yxmUUmW6ICt bNC4bUeFWTuSVRqMMolF7TxmhIwgDMIJDxlbI= 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=3ndmy3b0yjamYvDctt2nDcli/HrxujV7KKxazvsFgNI=; b=YDmI1TmivoPPJZAHuiD/nd2d/TiwaTVGODcCAyLv2B4GE31iSiWcIyiwPvrcYJMx4o fqLcigbT4xkA8LTQVk8OSzYB3vm65dDqT5xxnEAkE1U2US4tMXfHmHfxL153BMdZIiL/ AxZp7UMuIDbec/A0GlZVhKYDfoEGLIE1kZ8Lt8tSTqsWpCKgpssafMR6YWTmzwqa5e2R Kkrq3V5p67soBYNSYjnsBc+fq085nVj7S9+xLZ3B4O0uPhR9ur9T3iRY+3csDP+fbTvd xIiflw7jEmSv9M03vCwaEUWSKR5P1f9uiIhyEOoAd4xyogcAezSYc4pr3MYL2cyorp3R 85rw== X-Received: by 10.14.241.139 with SMTP id g11mr1454940eer.78.1369816897606; Wed, 29 May 2013 01:41:37 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id w43sm23147202eel.0.2013.05.29.01.41.35 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 01:41:36 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 29 May 2013 10:41:29 +0200 Message-Id: <1369816889-22871-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369812502-12999-1-git-send-email-daniel.vetter@ffwll.ch> References: <1369812502-12999-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQlDhcl3yysCree8mbmojRgZZLxh/ttt3FjDQj8873PG82gMuKF98tyvlupRDvfcQ28B94uh Cc: Daniel Vetter , stable@vger.kernel.org Subject: [Intel-gfx] [PATCH] drm/i915: Quirk the pipe A quirk in the modeset state checker 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 If we always force the pipe A to on we can't use the hw state to decide whether it should be on. Hence quirk the quirk. The problem is that crtc->active tracks the state of the entire display pipe, i.e. including planes, encoders and all. But our hw state readout simply looks at the pipe. But with the pipe A quirk we force-enable that (together with it's pll). To fix that mismatch we have two options: - Quirk the checked state to match what our sw tracking states if the pipe A quirk is in effect. - Improve the hw state readout to not get fooled by the pipe A quirk. Since we already have similar state clamping in e.g. assert_pipe I've opted for the first variant. Also note that we don't really loose any state checking: Individual pieces of the abstract crtc pipe are checked in the enable/disable functions with the various asssert_* checks we have, and the hw state check code doesn't check anything if the pipe is off anyway. v2: Pimp commit message after discussion with Chris and only apply the quirk for the quirk if we're checking pipe A. Otherwise we'll miss state checking for pipe B on i830M ... v3: Make the code comment consistent with the improved commit message, too (Chris). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64764 Cc: stable@vger.kernel.org Cc: Chris Wilson Reported-and-Tested-by: mlsemon35@gmail.com (v1) Signed-off-by: Daniel Vetter Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/intel_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d63bb3fa..09eedfa 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -8099,6 +8099,11 @@ intel_modeset_check_state(struct drm_device *dev) pipe_config.cpu_transcoder = crtc->config.cpu_transcoder; active = dev_priv->display.get_pipe_config(crtc, &pipe_config); + + /* hw state is inconsistent with the pipe A quirk */ + if (crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) + active = crtc->active; + WARN(crtc->active != active, "crtc active state doesn't match with hw state " "(expected %i, found %i)\n", crtc->active, active);