From patchwork Fri Jul 19 05:51:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Xiong Y" X-Patchwork-Id: 2830232 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7E2709F4D4 for ; Fri, 19 Jul 2013 05:50:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B26F0203D9 for ; Fri, 19 Jul 2013 05:50:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id ED0CA203C4 for ; Fri, 19 Jul 2013 05:50:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14EC5E5EFF for ; Thu, 18 Jul 2013 22:50:45 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 796EFE5EFF for ; Thu, 18 Jul 2013 22:48:07 -0700 (PDT) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 18 Jul 2013 22:48:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,699,1367996400"; d="scan'208";a="270420805" Received: from panda-dev.bj.intel.com ([10.238.154.175]) by AZSMGA002.ch.intel.com with ESMTP; 18 Jul 2013 22:48:05 -0700 From: Xiong Zhang To: intel-gfx@lists.freedesktop.org Date: Fri, 19 Jul 2013 13:51:26 +0800 Message-Id: <1374213086-2337-3-git-send-email-xiong.y.zhang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374213086-2337-1-git-send-email-xiong.y.zhang@intel.com> References: <1374213086-2337-1-git-send-email-xiong.y.zhang@intel.com> Subject: [Intel-gfx] [PATCH 3/3] drm/i915: run shmem_pread_fast() after page fault 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 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 fault_in_multipages_writeable() will load fault page into physical memory, then pread can run fast path, no need to run slow path Signed-off-by: Xiong Zhang --- drivers/gpu/drm/i915/i915_gem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f194d7e..982df1e 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -459,6 +459,7 @@ i915_gem_shmem_pread(struct drm_device *dev, page_do_bit17_swizzling = obj_do_bit17_swizzling && (page_to_phys(page) & (1 << 17)) != 0; +read_again: ret = shmem_pread_fast(page, shmem_page_offset, page_length, user_data, page_do_bit17_swizzling, needs_clflush); @@ -475,6 +476,8 @@ i915_gem_shmem_pread(struct drm_device *dev, * and just continue. */ (void)ret; prefaulted = 1; + mutex_lock(&dev->struct_mutex); + goto read_again; } ret = shmem_pread_slow(page, shmem_page_offset, page_length,