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: 7990761 Return-Path: X-Original-To: patchwork-linux-media@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 C9513BEEE5 for ; Fri, 8 Jan 2016 23:06:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9EF6201C7 for ; Fri, 8 Jan 2016 23:06:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 139AF2014A for ; Fri, 8 Jan 2016 23:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932548AbcAHXGQ (ORCPT ); Fri, 8 Jan 2016 18:06:16 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:35832 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932633AbcAHXF6 (ORCPT ); Fri, 8 Jan 2016 18:05:58 -0500 Received: by mail-pf0-f174.google.com with SMTP id 65so15829585pff.2 for ; Fri, 08 Jan 2016 15:05:57 -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=Njo1VK+NCLBr/tm89Y6NVODmjTZF6PdMIyBNMMtaIvZYaK/TA5hdjFPed6Wh6vgvsz IuM0QwCI8D5cq1ZAO5S2ddJQe9aIgJu6dIkPogigPuznrU3qzBALH152LohqEozrxlKv ygKEYNI4BBIvRd+z4lQS5JHjN4vZcKgsYaTRUdqqmqAXwZOrGqKQ0EPZFbj9KcLkcKeM lj4hKPhI1r3YczatT59momymu0pomn5tqs583cHfQSLOWWT/J3BQmb45enXwj5V5PtVK 06bGFZfpSgCycApNQJbIVqYuLYMcq0ctYOzxtlw8bFOhpUVQDVdbWIu/Npo3hEERkMTw 00hw== X-Gm-Message-State: ALoCoQn4xQ6bxGW7EtzGrPIsdDpEtcUJmUlceDndtztKYJhRmABO1xJeNpFaoOAW3Szt6NDD9hSuoJnS1IjKdmt6kK2nsRxmCQ== 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 Cc: Pawel Osciak , Dmitry Torokhov , 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 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> 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=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;