From patchwork Thu Oct 4 17:20:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1547221 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 01EC040D2D for ; Thu, 4 Oct 2012 17:20:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C48C0A1086 for ; Thu, 4 Oct 2012 10:20:29 -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 7AA729ECE0 for ; Thu, 4 Oct 2012 10:20:11 -0700 (PDT) Received: by mail-we0-f177.google.com with SMTP id u50so491262wey.36 for ; Thu, 04 Oct 2012 10:20:10 -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; bh=y6RqBW5G9jqXSGpFPXGBxhfs4wY+pKGOkrAl8OQDHOw=; b=SSZpaXnzXVYuhU/rye+QoyJpvNasqVh1mMYk4/PbjUUytHu0l/P6G0gDGnSyhbR2In KNEddUM4VuZkes9ffyzYyq0gjTmQPtULjVaR9rLrzXZB7exNfLNS5aGhSRV5KB4tel28 EOtB94q8hMP01yxaslWsVsw/lEMUl7xUaCLEY= 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:x-gm-message-state; bh=y6RqBW5G9jqXSGpFPXGBxhfs4wY+pKGOkrAl8OQDHOw=; b=T4ut6eRgTqJv+uCAZhqevUYyjUfjNxRwkgoLO9lbGLFQHm+3rZt2EqY5U6vHaXbqBS 0QfM1+6nbp8T++wMT8+YmD6XIy5Guy2RH3Sy9S9kq6OiZ7HsdjO4xBcwCoVT+ebYScjK 8YrzOQwRYhDGNBVToewbTs089NqNC1CHDZqGH13pJSXnGBEXt9h/rN+zRMdsbSlFYEq3 9pEuHoVv6PrMGygy8S59QEHemMCeYcDTeqhYqEL+5qoogbPzubkTwVvjUKFxDWNkz6pn Ys8VWEaM/1SGRujmKS+G5GqDQPdi3D5Xgg7/Kojeh1s88Gz7jLoRMlwMCISpKeKGJymi N1yQ== Received: by 10.216.150.197 with SMTP id z47mr3565233wej.221.1349371210536; Thu, 04 Oct 2012 10:20:10 -0700 (PDT) Received: from aaron.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id v3sm33336393wiw.7.2012.10.04.10.20.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Oct 2012 10:20:09 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 4 Oct 2012 19:20:03 +0200 Message-Id: <1349371203-15130-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmh7gWdyyoKTFS6HM+EZwMI2couRRkooTSOC1fYXdwsIKcR7V4DAVkCiwVQk5xP658mFJA2 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH] drm/i915: paper over a pipe-enable vs pageflip race 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 I've discovered this on my ivb machine while stress-testing the new flip_tests. Only harmful effect observed is that the timestamp is a bit bogus. Signed-off-by: Daniel Vetter Tested-by: Imre Deak --- drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 67912fe..9cecfd7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3253,6 +3253,16 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) if (HAS_PCH_CPT(dev)) intel_cpt_verify_modeset(dev, intel_crtc->pipe); + + /* + * There seems to be a race in PCH platform hw (at least on some + * outputs) where an enabled pipe still completes any pageflip right + * away (as if the pipe is off) instead of waiting for vblank. As soon + * as the first vblank happend, everything works as expected. Hence just + * wait for one vblank before returning to avoid strange things + * happening. + */ + intel_wait_for_vblank(dev, intel_crtc->pipe); } static void ironlake_crtc_disable(struct drm_crtc *crtc)