From patchwork Thu Apr 9 14:34:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 6188111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 94492BF4A6 for ; Thu, 9 Apr 2015 14:38:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE13A20353 for ; Thu, 9 Apr 2015 14:38:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC69420375 for ; Thu, 9 Apr 2015 14:38:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YgDYq-00043z-IV; Thu, 09 Apr 2015 14:36:04 +0000 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YgDXV-0002DQ-Pc for linux-arm-kernel@lists.infradead.org; Thu, 09 Apr 2015 14:34:42 +0000 Received: by wgsk9 with SMTP id k9so99809786wgs.3 for ; Thu, 09 Apr 2015 07:34:19 -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=WwOqWeQTzMg2j9nBNIgFwycYky8yzeT0Fi8zYVmZnGo=; b=PiZU/PUiQRYH/1icVZY/I4ypQy43W8cjC+b6kIQfi+BuzwN1KuIqWIiIXD4xC0mLa7 cGuOXffHhcaz1XhdSNXXbmWvTeNZOTPxtqPBC/QDLvRxFpRFlUC2Rg6O98bvs7t+/wAs tBwkMshqL3+XeJ0vB9k/1fYRI/VnJs16CvNunq9DrYKdnBsw0ZCP1fMT//ZzB9uJ0xwO fUqv2ukc000431PS72jRynNFJFm55qT2f22b8v0EfmmfD/FO+0dZRsZxYY2HVYRuvP/f Gi4tkUaAySNKAXAN8p8ndYfmAaJMYL6sNBA6H8p1hxQDzA3ArEjxd0a+WxDshmp4c2RY 6MPQ== X-Received: by 10.180.93.166 with SMTP id cv6mr6616961wib.89.1428590059603; Thu, 09 Apr 2015 07:34:19 -0700 (PDT) Received: from localhost (port-21116.pppoe.wtnet.de. [46.59.144.37]) by mx.google.com with ESMTPSA id e2sm20442759wij.5.2015.04.09.07.34.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Apr 2015 07:34:19 -0700 (PDT) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/6] drm/msm: gem: Use drm_clflush_*() functions Date: Thu, 9 Apr 2015 16:34:09 +0200 Message-Id: <1428590049-20357-6-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1428590049-20357-1-git-send-email-thierry.reding@gmail.com> References: <1428590049-20357-1-git-send-email-thierry.reding@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150409_073442_053137_32EC2C6D X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -0.8 (/) Cc: Arnd Bergmann , David Airlie , Catalin Marinas , intel-gfx@lists.freedesktop.org, Will Deacon , Rob Clark , Russell King , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Thierry Reding Instead of going through the DMA mapping API for cache maintenance, use the drm_clflush_*() family of functions to achieve the same effect. Cc: Rob Clark Signed-off-by: Thierry Reding --- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/msm_gem.c | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig index 0a6f6764a37c..5da7fe793e89 100644 --- a/drivers/gpu/drm/msm/Kconfig +++ b/drivers/gpu/drm/msm/Kconfig @@ -5,6 +5,7 @@ config DRM_MSM depends on ARCH_QCOM || (ARM && COMPILE_TEST) depends on OF && COMMON_CLK select REGULATOR + select DRM_CACHE select DRM_KMS_HELPER select DRM_PANEL select SHMEM diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 52839769eb6c..ce265085fc57 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -101,8 +101,7 @@ static struct page **get_pages(struct drm_gem_object *obj) * because display controller, GPU, etc. are not coherent: */ if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) - dma_map_sg(dev->dev, msm_obj->sgt->sgl, - msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + drm_clflush_sg(msm_obj->sgt); } return msm_obj->pages; @@ -113,12 +112,6 @@ static void put_pages(struct drm_gem_object *obj) struct msm_gem_object *msm_obj = to_msm_bo(obj); if (msm_obj->pages) { - /* For non-cached buffers, ensure the new pages are clean - * because display controller, GPU, etc. are not coherent: - */ - if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) - dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl, - msm_obj->sgt->nents, DMA_BIDIRECTIONAL); sg_free_table(msm_obj->sgt); kfree(msm_obj->sgt);