From patchwork Wed Jan 24 02:55:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 10181305 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 CC2A360467 for ; Wed, 24 Jan 2018 02:55:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE5302094F for ; Wed, 24 Jan 2018 02:55:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0FBF26B41; Wed, 24 Jan 2018 02:55:56 +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 41E2C2094F for ; Wed, 24 Jan 2018 02:55:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 545F46E4E9; Wed, 24 Jan 2018 02:55:54 +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 C59696E4E9 for ; Wed, 24 Jan 2018 02:55:52 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id c6so1942512pfi.8 for ; Tue, 23 Jan 2018 18:55:52 -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=X+t3rob+rYwf6/E18q6QNqewNGd9Ug+o5mdrRmV4XMY=; b=J4rxzk0iLsYQjZnACkHcm9JJ63iH37ueqDieN3Cjnsawnz/1+23Jod34ccHC4Wknwp Nuau2tw4DyEOm1p5DnCMSyRCMswOWuMOhtBGw0cFFi2HCoNbh1N5JuIMHXb3jiDLEpA4 +mjpbZPq7Qf+6DK+ujPEbe1N7nQf2MsHBOUwQ= 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=X+t3rob+rYwf6/E18q6QNqewNGd9Ug+o5mdrRmV4XMY=; b=P4/1MZcCt+BBUNcfJV5s7k2073dKlS70jtwRLx9QMiqjs64WT3oOfwQIof3CJKrQgA iuiUEJfKgmamx+xF7x8J0V8sEXi6Umi8rUswSfK1Cx11OsaiFReb1+0ODb/ic/R4ESl1 xeu/hTyZpG8W/6He5OScUEsJsMzK/aJbI2Z/8qnKV40CDq971cilNc2JYNkTZOAuVWMe O6OFRWlmtpi6XfcIGfTH5DBadoTL8SMzLuggNFPkn4MhT48aD1SEEjjCMI/lB9hjUESk 52Vtz3+3X3uUG75CEyVjxhOP0/g0vaAvL5ZuoH6yS05P37Y5Pbm3P8EyklksXn5cI9Oo gLmQ== X-Gm-Message-State: AKwxyteI5Tnn8df4PJ+gVR0odxcf5izBzN0FzgKwOFlK1R28v+QgoMu6 +rxWsODT4envnWd1fwFm2w1HsWFvUtE= X-Google-Smtp-Source: AH8x225VuEpsjO4+05o2aoQakGjZ45E1cFsOBml4wUfwlcWdiQownLHaMfF78p4D2w5jvMs2oBb/1w== X-Received: by 10.98.212.26 with SMTP id a26mr11669854pfh.38.1516762551942; Tue, 23 Jan 2018 18:55:51 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:0:1000:1600:f560:c8e6:9f8d:ba54]) by smtp.gmail.com with ESMTPSA id c25sm5866015pfi.183.2018.01.23.18.55.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 18:55:50 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] drm: rename {drm_clflush_sg, drm_clflush_pages} Date: Tue, 23 Jan 2018 18:55:30 -0800 Message-Id: <20180124025534.2964-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.13.5 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gurchetan Singh , thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, daniel.vetter@intel.com, linux-arm-kernel@lists.infradead.org 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 8bc3283484be..a8c0703a096d 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 b9b53ac14176..f6cff6e5c520 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 5a046a3c543a..54b1971cd817 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)