From patchwork Wed Jan 17 00:35:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 10168347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 716736055D for ; Wed, 17 Jan 2018 00:36:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D57827F7F for ; Wed, 17 Jan 2018 00:36:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E64D27F85; Wed, 17 Jan 2018 00:36:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9AED427F7F for ; Wed, 17 Jan 2018 00:36:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB4EF6E328; Wed, 17 Jan 2018 00:36:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41A516E328 for ; Wed, 17 Jan 2018 00:36:10 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id e11so10584644pff.6 for ; Tue, 16 Jan 2018 16:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=uCuwqGBGT+zAj9Krav5B+/smMF8joBWxqpim1ycwtS0=; b=iZDscIzjaDYIn7m9E8SpLsn46PlCr1uwv2VihZFfCjqHvdVY2PpPvKqyQ4cwFpDqOx /7ErE5HSPRBSMeehMgwIXZXAiomYK4zseU5JzXZA3vfIlMGUr53/bnxyYDi2gJtZXf/u Z8+CUV4nagK39V8EAdDv6LL1PRJpySjQNcJGw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uCuwqGBGT+zAj9Krav5B+/smMF8joBWxqpim1ycwtS0=; b=fjbrNNLbnaakijU8m3dVYNDUFLrCxdPUXeKPou6DicftPJQ9U96ZINvb7UX0A3XP4f LXvfQwu1K9/jn1F8CfY2VrNXHKzu4BP/cVpx28WVcjEdvP9HCcSOmHo/i21NvPlICJGz Bh12eUoiuaE8uOM84tSC2eMQSYxHJi8Qd39CewUnoJ59ygPfFm4+pv7JcBkQWj5BBPYU 3fwV8V/PHV5FWYMdzZrHPXRT35QP5dBNMxaa4f9IEa9dMgBwjX1/j0eShJgSPnZEVpbm 4cjvkWyZpxQc97HUWCp2DvKnAPDMJ6y+ucg1/Dzv/+ZDh43uRzEmZSl7UUE/ONor7JxL W+hg== X-Gm-Message-State: AKGB3mI+LOKwN58M5rLnc3vINYF09MLfPnA9OudQRzTRGHjVKPzWUupA ZX2xf8xfMaTRcMd8TCYB1TJ9ikuxb18= X-Google-Smtp-Source: ACJfBot+/G1PFZI2K36169sf+IDThwrrI99LD6iHJjZ+TemsWCZ+wZCRbehQYw85wJAs0qK9LkM6Yw== X-Received: by 10.99.100.131 with SMTP id y125mr26894784pgb.359.1516149369402; Tue, 16 Jan 2018 16:36:09 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:0:1000:1600:1dfc:23a3:37e7:107c]) by smtp.gmail.com with ESMTPSA id 15sm5792104pfi.97.2018.01.16.16.36.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jan 2018 16:36:07 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm: rename {drm_clflush_sg, drm_clflush_pages} Date: Tue, 16 Jan 2018 16:35:56 -0800 Message-Id: <20180117003559.67837-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.13.5 Cc: Gurchetan Singh , thierry.reding@gmail.com, linux-tegra@vger.kernel.org, daniel.vetter@intel.com 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-Virus-Scanned: ClamAV using ClamSMTP Since clfush is an x86-only instruction, these function names won't make much sense if we start adding cases for other architectures. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/drm_cache.c | 12 ++++++------ drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gem_clflush.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- drivers/gpu/drm/ttm/ttm_tt.c | 2 +- drivers/gpu/drm/vgem/vgem_drv.c | 2 +- include/drm/drm_cache.h | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index 3bd76e918b5d..89cdd32fe1f3 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c @@ -70,7 +70,7 @@ static void drm_cache_flush_clflush(struct page *pages[], #endif /** - * drm_clflush_pages - Flush dcache lines of a set of pages. + * drm_flush_pages - Flush dcache lines of a set of pages. * @pages: List of pages to be flushed. * @num_pages: Number of pages in the array. * @@ -78,7 +78,7 @@ static void drm_cache_flush_clflush(struct page *pages[], * to a page in the array. */ void -drm_clflush_pages(struct page *pages[], unsigned long num_pages) +drm_flush_pages(struct page *pages[], unsigned long num_pages) { #if defined(CONFIG_X86) @@ -109,17 +109,17 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages) WARN_ON_ONCE(1); #endif } -EXPORT_SYMBOL(drm_clflush_pages); +EXPORT_SYMBOL(drm_flush_pages); /** - * drm_clflush_sg - Flush dcache lines pointing to a scather-gather. + * drm_flush_sg - Flush dcache lines pointing to a scather-gather. * @st: struct sg_table. * * Flush every data cache line entry that points to an address in the * sg. */ void -drm_clflush_sg(struct sg_table *st) +drm_flush_sg(struct sg_table *st) { #if defined(CONFIG_X86) if (static_cpu_has(X86_FEATURE_CLFLUSH)) { @@ -140,7 +140,7 @@ drm_clflush_sg(struct sg_table *st) WARN_ON_ONCE(1); #endif } -EXPORT_SYMBOL(drm_clflush_sg); +EXPORT_SYMBOL(drm_flush_sg); /** * drm_clflush_virt_range - Flush dcache lines of a region diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 61ba321e9970..fe191d0e84e1 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -259,7 +259,7 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj, if (needs_clflush && (obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0 && !(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ)) - drm_clflush_sg(pages); + drm_flush_sg(pages); __start_cpu_write(obj); } diff --git a/drivers/gpu/drm/i915/i915_gem_clflush.c b/drivers/gpu/drm/i915/i915_gem_clflush.c index f663cd919795..f413c5e5735d 100644 --- a/drivers/gpu/drm/i915/i915_gem_clflush.c +++ b/drivers/gpu/drm/i915/i915_gem_clflush.c @@ -71,7 +71,7 @@ static const struct dma_fence_ops i915_clflush_ops = { static void __i915_do_clflush(struct drm_i915_gem_object *obj) { GEM_BUG_ON(!i915_gem_object_has_pages(obj)); - drm_clflush_sg(obj->mm.pages); + drm_flush_sg(obj->mm.pages); intel_fb_obj_flush(obj, ORIGIN_CPU); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 1d9655576b6e..8ac7eb25e46d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -100,7 +100,7 @@ static int rockchip_gem_get_pages(struct rockchip_gem_object *rk_obj) * Fake up the SG table so that dma_sync_sg_for_device() can be used * to flush the pages associated with it. * - * TODO: Replace this by drm_clflush_sg() once it can be implemented + * TODO: Replace this by drm_flush_sg() once it can be implemented * without relying on symbols that are not exported. */ for_each_sg(rk_obj->sgt->sgl, s, rk_obj->sgt->nents, i) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 8ebc8d3560c3..59e272a58752 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -122,7 +122,7 @@ static int ttm_tt_set_caching(struct ttm_tt *ttm, } if (ttm->caching_state == tt_cached) - drm_clflush_pages(ttm->pages, ttm->num_pages); + drm_flush_pages(ttm->pages, ttm->num_pages); for (i = 0; i < ttm->num_pages; ++i) { cur_page = ttm->pages[i]; diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 2524ff116f00..802a97e1a4bf 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -325,7 +325,7 @@ static int vgem_prime_pin(struct drm_gem_object *obj) /* Flush the object from the CPU cache so that importers can rely * on coherent indirect access via the exported dma-address. */ - drm_clflush_pages(pages, n_pages); + drm_flush_pages(pages, n_pages); return 0; } diff --git a/include/drm/drm_cache.h b/include/drm/drm_cache.h index beab0f0d0cfb..25c029470315 100644 --- a/include/drm/drm_cache.h +++ b/include/drm/drm_cache.h @@ -35,8 +35,8 @@ #include -void drm_clflush_pages(struct page *pages[], unsigned long num_pages); -void drm_clflush_sg(struct sg_table *st); +void drm_flush_pages(struct page *pages[], unsigned long num_pages); +void drm_flush_sg(struct sg_table *st); void drm_clflush_virt_range(void *addr, unsigned long length); static inline bool drm_arch_can_wc_memory(void)