From patchwork Tue Mar 31 15:10:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6137121 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C2AD39F1BE for ; Wed, 1 Apr 2015 02:02:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5889201E4 for ; Wed, 1 Apr 2015 02:02:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D491C201BC for ; Wed, 1 Apr 2015 02:02:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D8AD6E7AB; Tue, 31 Mar 2015 19:02:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 824206E13F; Tue, 31 Mar 2015 08:10:42 -0700 (PDT) Received: by patj18 with SMTP id j18so22401945pat.2; Tue, 31 Mar 2015 08:10:42 -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; bh=V7W4TfvjmCvQRALu0SlhuaIdU8LviE4a12hctybYQbk=; b=RZto045mVsU6R6wCCiRW1BOH1oe4rq4fdKuezI7FAmhTqSkMPgb6ULZ/mEIeXuhptZ wkXD7A9aJpmfOWXF3oFmHuuG+7oJuspgHcuMb3hWyOST+nynMWM3TuzskoMfH1nGDTw3 H5q92/qbOnJTgSe1fzJ22O87JHzuScjG5Qxc8PC8km/WvqgMydtfxS54pFbKskjojcvA tH9eCDjThu2OubQ6BKlnUtGWzJFx6iyPWjTKfCZ2AUuuB8zMKUhhq7dhkShl4mMIR+BX e8pnINJHmbSc/zop/ueha8DlWkcdNvxJbcOiYAWHQEwNedeJmobqwE9vBjjGdokNg/es UJAA== X-Received: by 10.66.118.198 with SMTP id ko6mr69967289pab.16.1427814642235; Tue, 31 Mar 2015 08:10:42 -0700 (PDT) Received: from localhost.localdomain ([122.169.164.199]) by mx.google.com with ESMTPSA id zd14sm13629813pab.20.2015.03.31.08.10.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 31 Mar 2015 08:10:41 -0700 (PDT) From: Sudip Mukherjee To: Daniel Vetter , Jani Nikula , David Airlie , Chris Wilson , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , huax.lu@intel.com, Daniel Vetter Subject: [PATCH] Revert "drm/i915: Performed deferred clflush inside set-cache-level" Date: Tue, 31 Mar 2015 20:40:12 +0530 Message-Id: <1427814612-4157-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 X-Mailman-Approved-At: Tue, 31 Mar 2015 19:02:52 -0700 Cc: intel-gfx@lists.freedesktop.org, Sudip Mukherjee , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit <0f71979ab7fbd0c71c41c2798de3d33937915434>. my display was getting garbled for a moment very frequently. it looked like when the screen was getting refreshed then something was going wrong. git bisect gave this as the first bad commit, and after reverting it now display is not having that problem. Signed-off-by: Sudip Mukherjee --- my system is x86_64. lspci -k gives: "VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09) Subsystem: Foxconn International, Inc. Device 0d74 Kernel driver in use: i915" This is my bisect log: # bad: [e42391cd048809d903291d07f86ed3934ce138e9] Linux 4.0-rc6 # good: [b7392d2247cfe6771f95d256374f1a8e6a6f48d6] Linux 3.19-rc2 git bisect start 'v4.0-rc6' 'v3.19-rc2' '--' 'drivers/gpu/drm/i915/' # good: [d2182a660808d9053a605e3ebc8c46a323ec6e5d] drm/i915: Don't register HDMI connectors for eDP ports on VLV/CHV git bisect good d2182a660808d9053a605e3ebc8c46a323ec6e5d # bad: [36d21f4c557a2b18ed7c9d254060d4ca07a6c5c7] drm/i915/dsi: remove unnecessary dsi device callbacks git bisect bad 36d21f4c557a2b18ed7c9d254060d4ca07a6c5c7 # good: [72f95afa5faaf899f7344879b6ccd5f0cb271b28] drm/i915: Removed duplicate members from submit_request git bisect good 72f95afa5faaf899f7344879b6ccd5f0cb271b28 # good: [2844a9214759901f382086644842e39ad6f7d894] drm/i915: Use pipe_name() in the get_plane_config() functions git bisect good 2844a9214759901f382086644842e39ad6f7d894 # bad: [1b842c89bd8eb0e9619e1aba071c9a5529b7a179] drm/i915: Fix kzalloc() smatch warnings in get_initial_plane_config() git bisect bad 1b842c89bd8eb0e9619e1aba071c9a5529b7a179 # good: [8d360dffd6d8634868e433128d5178bea14cc42c] drm/i915: Specify bsd rings through exec flag git bisect good 8d360dffd6d8634868e433128d5178bea14cc42c # good: [1197b4f230fb7c8fe3a9b549596fe130b09a0db2] drm/i915: Balance context pinning on reset cleanup git bisect good 1197b4f230fb7c8fe3a9b549596fe130b09a0db2 # bad: [0f71979ab7fbd0c71c41c2798de3d33937915434] drm/i915: Performed deferred clflush inside set-cache-level git bisect bad 0f71979ab7fbd0c71c41c2798de3d33937915434 # good: [a7cbedec8317a5cacecb567674fdbc1c3fb22de8] drm/i915: Rename unpin_count to pin_count git bisect good a7cbedec8317a5cacecb567674fdbc1c3fb22de8 drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/i915_gem.c | 31 ++++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 8727086..abe6c16 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2054,7 +2054,6 @@ struct drm_i915_gem_object { */ unsigned long gt_ro:1; unsigned int cache_level:3; - unsigned int cache_dirty:1; unsigned int has_dma_mapping:1; diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 27ea6bd..e9341e9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3647,14 +3647,11 @@ i915_gem_clflush_object(struct drm_i915_gem_object *obj, * snooping behaviour occurs naturally as the result of our domain * tracking. */ - if (!force && cpu_cache_is_coherent(obj->base.dev, obj->cache_level)) { - obj->cache_dirty = true; + if (!force && cpu_cache_is_coherent(obj->base.dev, obj->cache_level)) return false; - } trace_i915_gem_object_clflush(obj); drm_clflush_sg(obj->pages); - obj->cache_dirty = false; return true; } @@ -3836,11 +3833,27 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj, vma->node.color = cache_level; obj->cache_level = cache_level; - if (obj->cache_dirty && - obj->base.write_domain != I915_GEM_DOMAIN_CPU && - cpu_write_needs_clflush(obj)) { - if (i915_gem_clflush_object(obj, true)) - i915_gem_chipset_flush(obj->base.dev); + if (cpu_write_needs_clflush(obj)) { + u32 old_read_domains, old_write_domain; + + /* If we're coming from LLC cached, then we haven't + * actually been tracking whether the data is in the + * CPU cache or not, since we only allow one bit set + * in obj->write_domain and have been skipping the clflushes. + * Just set it to the CPU cache for now. + */ + i915_gem_object_retire(obj); + WARN_ON(obj->base.write_domain & ~I915_GEM_DOMAIN_CPU); + + old_read_domains = obj->base.read_domains; + old_write_domain = obj->base.write_domain; + + obj->base.read_domains = I915_GEM_DOMAIN_CPU; + obj->base.write_domain = I915_GEM_DOMAIN_CPU; + + trace_i915_gem_object_change_domain(obj, + old_read_domains, + old_write_domain); } return 0;