From patchwork Sun May 25 12:34:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 4238371 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B52739F1E7 for ; Sun, 25 May 2014 12:34:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC8522025A for ; Sun, 25 May 2014 12:34:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E5CE620259 for ; Sun, 25 May 2014 12:34:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 56F4D6E4B3; Sun, 25 May 2014 05:34:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 293976E4BE for ; Sun, 25 May 2014 05:34:22 -0700 (PDT) Received: by mail-wg0-f41.google.com with SMTP id z12so6653085wgg.0 for ; Sun, 25 May 2014 05:34:21 -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:in-reply-to:references; bh=mVKvdxmXhBiiQTNgN9frZWLxewbHgqPuOvrNlRMo36c=; b=t0F9qpSjHYL36ao04Wmz/fAgQiumi/JlhkWVXEtgZhswinv3GZOb7BTwWqb6AN57Wx N2fOyEOa/3tdmO7O8SD296fVy3DBoXeQIOAjQV5nb8bb9DiBUg2Eu0buTyA5YlkiU0lK 92tL4Ztg6D6Stk1u0Uy7iE4n7MpqDb/IuONahsjOAFzwryrLV8E3DgmGAyEK+rHDGTpm Tv+j9hR9IAWDUaoUKbZ0drszM65reQ5Q0i4t5t8msvx152hRL3juTAciM1U6X3UnwsTe 2RWv17NwDoAfmd2UtK7GtET0VGlylBgr80ILbgTn1LEWDUBU+kTC/IPR3dAEGI576zHT 9yzA== X-Received: by 10.180.75.102 with SMTP id b6mr18600099wiw.26.1401021259968; Sun, 25 May 2014 05:34:19 -0700 (PDT) Received: from david-tp.localdomain (stgt-5f728b13.pool.mediaWays.net. [95.114.139.19]) by mx.google.com with ESMTPSA id w6sm18246933wjq.29.2014.05.25.05.34.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 May 2014 05:34:19 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/5] drm/i915: use shmem helpers if possible Date: Sun, 25 May 2014 14:34:10 +0200 Message-Id: <1401021252-29006-3-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1401021252-29006-1-git-send-email-dh.herrmann@gmail.com> References: <1401021252-29006-1-git-send-email-dh.herrmann@gmail.com> Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Instead of shuffling gfp-masks all the time, use the shmem_read_mapping_page() helper. Note that __GFP_IO and __GFP_WAIT are set in mapping_gfp_mask() for i915, so the behavior is still the same. Cc: Daniel Vetter Cc: Jani Nikula Signed-off-by: David Herrmann --- drivers/gpu/drm/i915/i915_gem.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index e1fa919..1a72aad 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1925,16 +1925,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) * our own buffer, now let the real VM do its job and * go down in flames if truly OOM. */ - gfp &= ~(__GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD); - gfp |= __GFP_IO | __GFP_WAIT; - i915_gem_shrink_all(dev_priv); - page = shmem_read_mapping_page_gfp(mapping, i, gfp); + page = shmem_read_mapping_page(mapping, i); if (IS_ERR(page)) goto err_pages; - - gfp |= __GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD; - gfp &= ~(__GFP_IO | __GFP_WAIT); } #ifdef CONFIG_SWIOTLB if (swiotlb_nr_tbl()) {