From patchwork Mon Jan 11 17:30:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8007171 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 4B49D9F1C0 for ; Mon, 11 Jan 2016 17:34:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B2CE20256 for ; Mon, 11 Jan 2016 17:34:10 +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 7A63A201BB for ; Mon, 11 Jan 2016 17:34:09 +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 1aIgKk-0008Ry-7a; Mon, 11 Jan 2016 17:32:46 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aIgK7-0007kA-Vn for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2016 17:32:10 +0000 Received: by mail-pa0-x22b.google.com with SMTP id yy13so231749664pab.3 for ; Mon, 11 Jan 2016 09:31:47 -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=brlqyl4TpcN4CM4dAZXfpSNkfMo51uyWpdt+4/YUyfw=; b=gUxeyG8MLbgUBmRBteDiM0bkut0lD/c0UEX7oBv8vVcsTGrYcIFvCc/xS4CU+7jeNz kr3zT9UIqCrwmDPMjAc+DQdLcPPGTmXEpo3mcwjG/1Qhr8tqoYwSR0fs1NPubT9viBkq Zkf08FIKLXZ7AKVFozfGTXumvQ7lOUNWPcCQU= 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=brlqyl4TpcN4CM4dAZXfpSNkfMo51uyWpdt+4/YUyfw=; b=LBXah/Fmq3LyEZDquWSGam4tnLZhYOHxYHXH1oxflHIgLxdTk8GdNT2MxRKWIAv4n5 MiTXn8qv9Y9fJixXyhmlNt8WVFEwe2ab87x9aR94XQ3lt7q5FgJDItR7t+SO6TruTgEY TO4rnuktq2haXgOQWlWcCWObBV+QCe1V4TZV8CxpYoqDL6z6UYQY1Gj3jo8FP0oFaR/1 Z8tdbW5+8PvC6kGzy/bwmur3fwMBS3qd1Ku77W3DyP/3WwysSCZf3sBpDkYhWRnUrA0L aHaQaTejn0Ju7NLlykKNGVWsIXNm2q1jOa+E1BGIHCQ/VufWg+gHd9itM9V/GlprRJN+ yjyw== X-Gm-Message-State: ALoCoQlBzY00GeOHfA4cjWjZQ5embc+KNTTjFTc+qXmAQjLImere/yziQ4x9aqAUUjNmVliHaqdDliehNnMbw7OzMNpuN98//Q== X-Received: by 10.67.24.33 with SMTP id if1mr106047819pad.137.1452533507290; Mon, 11 Jan 2016 09:31:47 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id wa17sm118618460pac.38.2016.01.11.09.31.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 09:31:46 -0800 (PST) From: Douglas Anderson To: linux@arm.linux.org.uk, mchehab@osg.samsung.com, robin.murphy@arm.com, tfiga@chromium.org, m.szyprowski@samsung.com Subject: [PATCH v6 5/5] s5p-mfc: Set DMA_ATTR_ALLOC_SINGLE_PAGES Date: Mon, 11 Jan 2016 09:30:27 -0800 Message-Id: <1452533428-12762-6-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1452533428-12762-1-git-send-email-dianders@chromium.org> References: <1452533428-12762-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160111_093208_391674_FC352FB2 X-CRM114-Status: GOOD ( 13.04 ) 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.com, Dmitry Torokhov , Douglas Anderson , linux-kernel@vger.kernel.org, hch@infradead.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_ALLOC_SINGLE_PAGES. See also the previous change ("ARM: dma-mapping: Use DMA_ATTR_ALLOC_SINGLE_PAGES hint to optimize allocation"). Signed-off-by: Douglas Anderson --- Changes in v6: - renamed DMA_ATTR_NO_HUGE_PAGE to DMA_ATTR_ALLOC_SINGLE_PAGES 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..421d25a1aec1 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_ALLOC_SINGLE_PAGES, &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;