From patchwork Thu Apr 28 14:19:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 8971251 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F1D719F1D3 for ; Thu, 28 Apr 2016 14:24:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E86B20306 for ; Thu, 28 Apr 2016 14:24:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D1E6C202F8 for ; Thu, 28 Apr 2016 14:24:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3502A6ED38; Thu, 28 Apr 2016 14:24:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtprelay.synopsys.com (smtprelay4.synopsys.com [198.182.47.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 261E16ED32 for ; Thu, 28 Apr 2016 14:20:23 +0000 (UTC) Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id 533E924E1700; Thu, 28 Apr 2016 07:20:22 -0700 (PDT) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 0BAEB4E214; Thu, 28 Apr 2016 07:20:22 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id D1B654E202; Thu, 28 Apr 2016 07:20:21 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id B9F9E765; Thu, 28 Apr 2016 07:20:21 -0700 (PDT) Received: from abrodkin-7440l.internal.synopsys.com (unknown [10.121.8.131]) by mailhost.synopsys.com (Postfix) with ESMTP id 3A33475C; Thu, 28 Apr 2016 07:20:20 -0700 (PDT) From: Alexey Brodkin To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2 v2] drm/arcpgu: use dedicated memory area for frame buffer Date: Thu, 28 Apr 2016 17:19:55 +0300 Message-Id: <1461853196-15599-2-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1461853196-15599-1-git-send-email-abrodkin@synopsys.com> References: <1461853196-15599-1-git-send-email-abrodkin@synopsys.com> X-Mailman-Approved-At: Thu, 28 Apr 2016 14:24:39 +0000 Cc: linux-snps-arc@lists.infradead.org, Alexey Brodkin , linux-kernel@vger.kernel.org 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-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Now when ARC supports reserved memory areas and per-device coherent DMA allocations we may switch ARC PGU to use of those dedicated areas. One of the benefits we may move frame-buffer area out from IO Coherency aperture and so significantly reduce IOC utilization allowing less demanding peripherals to use all perks of IOC. Signed-off-by: Alexey Brodkin Cc: Dave Airlie Cc: Daniel Vetter --- No changes v1 -> v2. drivers/gpu/drm/arc/arcpgu_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c index 5b35e5db..76e187a 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "arcpgu.h" #include "arcpgu_regs.h" @@ -135,6 +136,11 @@ static int arcpgu_load(struct drm_device *drm) dev_info(drm->dev, "arc_pgu ID: 0x%x\n", arc_pgu_read(arcpgu, ARCPGU_REG_ID)); + /* Get the optional framebuffer memory resource */ + ret = of_reserved_mem_device_init(drm->dev); + if (ret && ret != -ENODEV) + return ret; + if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32))) return -ENODEV;