From patchwork Wed Jan 24 02:56:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 10181315 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 25B9F60467 for ; Wed, 24 Jan 2018 02:56:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 198BA285BA for ; Wed, 24 Jan 2018 02:56:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DB2228631; Wed, 24 Jan 2018 02:56:40 +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 B7F7E285BA for ; Wed, 24 Jan 2018 02:56:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 969D26E4FA; Wed, 24 Jan 2018 02:56:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 881326E4F9 for ; Wed, 24 Jan 2018 02:56:35 +0000 (UTC) Received: by mail-pg0-x243.google.com with SMTP id y27so1714575pgc.5 for ; Tue, 23 Jan 2018 18:56:35 -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:in-reply-to:references; bh=0oSoobyZcAdXpGhsGVUkZ1iyqZ1Gjk1FAo9jUmS7ziM=; b=gwjZU0ewyg173u6Q9T6tYdnZWz2pnYkZ5xGgYOZ1bHY1J60gfarzB/AACGfmriCH8f DQBIP1no94KhtTSwcKCaRTwoDiwr6VlGImEK6JMv6UXm/8dhxLKQtxlo81IzpJK0XbO+ q03EtRmkLMHNd/wU5L/r+kPRGAbcExLn3viic= 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:in-reply-to :references; bh=0oSoobyZcAdXpGhsGVUkZ1iyqZ1Gjk1FAo9jUmS7ziM=; b=SXclH9LarNBeiQQJ98hbr17rWvUxvmm2Yu3dtx63DQy2zNhaR7px33qzoMawyHzzz8 ctoFMJVVwOxQ+FrOsknI3d33qMkyD6zbXBlavl0d7f/tWbko7dj1rHbxhOdDbXXYXsht YcN01QpSPunDHjR/OtY7mxjzMBJ20xLEtVaMVoFbFNxvZjPydhgf8YZFJBfgH7PBhsUc CqFiGCx8mc1u38l6JjdTiNhyNR9MaaYbTKBQUUZi7W4d6dG3TOa7CTP7lq5bU/DalEfy ewlXNnbpdRuHaGooz/xn/fGWkA/U0ICZD7DLMh32PZ8issqGRmmTiTgfA/27X0GM+42x DnoA== X-Gm-Message-State: AKwxytdepAgiTkCS7z4lPfSUDZ8eHyXzBfGFK3voELJdi7rgT86B37F6 Ho6rw/17rqn5mz9W8V6Tx3yZRjaJIQA= X-Google-Smtp-Source: AH8x2253bdtiHBpO/ObB6/BnDb/H99h+aCCCNWEdgmpxOZG7khIdJz4OgfzL/XW5sYh+DZbgOR6/DQ== X-Received: by 10.98.68.91 with SMTP id r88mr11729316pfa.52.1516762594913; Tue, 23 Jan 2018 18:56:34 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:0:1000:1600:f560:c8e6:9f8d:ba54]) by smtp.gmail.com with ESMTPSA id i20sm7041301pfj.58.2018.01.23.18.56.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 18:56:34 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm: use drm_flush_sg where possible Date: Tue, 23 Jan 2018 18:56:06 -0800 Message-Id: <20180124025606.3020-5-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20180124025606.3020-2-gurchetansingh@chromium.org> References: <20180124025606.3020-2-gurchetansingh@chromium.org> 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 We should use our common cache maintenance functions when possible. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 7 ++----- drivers/gpu/drm/tegra/gem.c | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 8ac7eb25e46d..0652c2f79719 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -99,15 +100,11 @@ 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_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) sg_dma_address(s) = sg_phys(s); - dma_sync_sg_for_device(drm->dev, rk_obj->sgt->sgl, rk_obj->sgt->nents, - DMA_TO_DEVICE); + drm_flush_sg(rk_obj->sgt); return 0; diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 49b9bf28f872..0db403653adc 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -15,6 +15,7 @@ #include #include +#include #include #include "drm.h" @@ -229,15 +230,11 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo) /* * 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_clflash_sg() once it can be implemented - * without relying on symbols that are not exported. */ for_each_sg(bo->sgt->sgl, s, bo->sgt->nents, i) sg_dma_address(s) = sg_phys(s); - dma_sync_sg_for_device(drm->dev, bo->sgt->sgl, bo->sgt->nents, - DMA_TO_DEVICE); + drm_flush_sg(bo->sgt); return 0;