From patchwork Fri Jan 8 23:05:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 7990881 Return-Path: X-Original-To: patchwork-linux-arm@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 AE18E9F6FA for ; Fri, 8 Jan 2016 23:08:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBDD02014A for ; Fri, 8 Jan 2016 23:08:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08822201C7 for ; Fri, 8 Jan 2016 23:08:08 +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 1aHg7P-00052O-R5; Fri, 08 Jan 2016 23:06:51 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHg6s-0004iM-ES for linux-arm-kernel@lists.infradead.org; Fri, 08 Jan 2016 23:06:20 +0000 Received: by mail-pf0-x22a.google.com with SMTP id q63so16229535pfb.1 for ; Fri, 08 Jan 2016 15:05:58 -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=BZ1XWLFFeu5KBL8ptIMqyTNKwTXjRqRzBbiXRCKMzUg=; b=bDrBT7g7gbIGGqBGa5CKOyKa8cjaKsStw4WanWVWVvpBT+R0BZDOuR/X35cX5FF9Jw TY35gpQyvBW1AiNAGghT7+UoKv3dfKwXQSdzSNlRmehP/pbREjNvegiT5vAuL7P9WyJB Td0Q4i4usx0rsw21YygU+fqx7XgqLzjiwKO9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BZ1XWLFFeu5KBL8ptIMqyTNKwTXjRqRzBbiXRCKMzUg=; b=DKxLe4A1Eoa+O7lE6gMoN+k7Tsq29EZ1wiqw+uWeEdmHqOmNNoKstOeqfvsAiXmSPc tVl0rVHuZv8DWOYmVWrBwWexUGBiygVMDL7YG7LF+XE7UbGC5g7OrU+hECHPPx8WR4m1 3l1ZtFtj5vO1gqK1RxEX1M5ijQkUbxKVcXwldFYCQL5r94PKsbimkYWPGe/mQIECtbnG Vo8svzqdpGPW0s1ZORToMLYILYUuhmU8USfWG6ApUFuXrjlw5DPL0tgyo4i87IBKbAxV mVr0JnUrqlKJc1EjlSpPk5+klNIMvtDdnR4B4uEHM4VCyKCwq2rzyB19g6hnEHICuuW/ X1qQ== X-Gm-Message-State: ALoCoQk0o6lhqxUW0oPZKUrdDlU6Vi0E9IRI6DN0LzKqxfcRvIx6ag5dkwCeehSKmYy8SPyZMi/IHrQLncTeQoxB4Dofu9Md8g== X-Received: by 10.98.75.22 with SMTP id y22mr8118541pfa.147.1452294357726; Fri, 08 Jan 2016 15:05:57 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id z7sm7027783pfi.19.2016.01.08.15.05.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 15:05:57 -0800 (PST) From: Douglas Anderson To: Russell King , Mauro Carvalho Chehab , Robin Murphy , Tomasz Figa , Marek Szyprowski Subject: [PATCH v5 5/5] [media] s5p-mfc: Set DMA_ATTR_NO_HUGE_PAGE Date: Fri, 8 Jan 2016 15:05:32 -0800 Message-Id: <1452294332-23415-6-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1452294332-23415-1-git-send-email-dianders@chromium.org> References: <1452294332-23415-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160108_150618_768958_B2653F5E X-CRM114-Status: GOOD ( 14.09 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.debski@samsung.com, Pawel Osciak , Dmitry Torokhov , Douglas Anderson , linux-kernel@vger.kernel.org, jtp.park@samsung.com, kyungmin.park@samsung.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 We do video allocation all the time and we need it to be fast. Plus TLB efficiency isn't terribly important for video. That means we want to set DMA_ATTR_NO_HUGE_PAGE. See also the previous change ("ARM: dma-mapping: Use DMA_ATTR_NO_HUGE_PAGE hint to optimize allocation"). Signed-off-by: Douglas Anderson --- Changes in v5: - s5p-mfc patch new for v5 Changes in v4: None Changes in v3: None Changes in v2: None drivers/media/platform/s5p-mfc/s5p_mfc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 927ab4928779..7ea5d0d262bb 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1095,6 +1095,7 @@ static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev) /* MFC probe function */ static int s5p_mfc_probe(struct platform_device *pdev) { + DEFINE_DMA_ATTRS(attrs); struct s5p_mfc_dev *dev; struct video_device *vfd; struct resource *res; @@ -1164,12 +1165,20 @@ static int s5p_mfc_probe(struct platform_device *pdev) } } - dev->alloc_ctx[0] = vb2_dma_contig_init_ctx(dev->mem_dev_l); + /* + * We'll do mostly sequential access, so sacrifice TLB efficiency for + * faster allocation. + */ + dma_set_attr(DMA_ATTR_NO_HUGE_PAGE, &attrs); + + dev->alloc_ctx[0] = vb2_dma_contig_init_ctx_attrs(dev->mem_dev_l, + &attrs); if (IS_ERR(dev->alloc_ctx[0])) { ret = PTR_ERR(dev->alloc_ctx[0]); goto err_res; } - dev->alloc_ctx[1] = vb2_dma_contig_init_ctx(dev->mem_dev_r); + dev->alloc_ctx[1] = vb2_dma_contig_init_ctx_attrs(dev->mem_dev_r, + &attrs); if (IS_ERR(dev->alloc_ctx[1])) { ret = PTR_ERR(dev->alloc_ctx[1]); goto err_mem_init_ctx_1;