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: Douglas Anderson X-Patchwork-Id: 8007141 Return-Path: X-Original-To: patchwork-linux-media@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 782E39F1C0 for ; Mon, 11 Jan 2016 17:33:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 966CB20256 for ; Mon, 11 Jan 2016 17:33:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACB6D201D3 for ; Mon, 11 Jan 2016 17:33:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932670AbcAKRc5 (ORCPT ); Mon, 11 Jan 2016 12:32:57 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36436 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760144AbcAKRbs (ORCPT ); Mon, 11 Jan 2016 12:31:48 -0500 Received: by mail-pa0-f52.google.com with SMTP id yy13so231749660pab.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=B5qFj1HNd1nJMPUBvR+wNGvR9mpgfozcTzDAzxucs45csl4TMGMLVfeAHOX1he2DRT dqfLjFmUqmMPPxwQlhub0F4emw1QCMPeXhUYVbE59jHrBOb7+ua/XUwGpWiMQQUT4aqw V5qTxVaxhW3Nxkd/CUNeSvDF7FcmD3jXW8iyOpGS1xi2HxtvpJ6lX46ME6f6Oh0mW1HI p0WGu7qP5ZpVZ1hShN63Ztfy20S+vGAt3dlNEWHFW3vRJcumkK+rWoiWEk9j9KzmeOQ5 rxSr9GFMl0vXkn6r/ueqmpofXo16LdCPOKMcPEFysc5QUa/SzwdxxKDDLBnUgwuPPHMo 36mg== X-Gm-Message-State: ALoCoQl8BNs+gm2n/Vbx+Hw3MoKINTATQxO9MORYMz4Ukd1Q/NFQypKznKxNW1QkDIEhDIYaO2cAyEM4q8YhLKlTHo1BTGuMFg== 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 Cc: pawel@osciak.com, Dmitry Torokhov , hch@infradead.org, Douglas Anderson , kyungmin.park@samsung.com, k.debski@samsung.com, jtp.park@samsung.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org 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> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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;