From patchwork Thu Aug 1 02:25:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11070059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8220314DB for ; Thu, 1 Aug 2019 02:25:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 756D2271FD for ; Thu, 1 Aug 2019 02:25:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69CD128474; Thu, 1 Aug 2019 02:25:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C702271FD for ; Thu, 1 Aug 2019 02:25:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 051106E328; Thu, 1 Aug 2019 02:25:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35D696E328 for ; Thu, 1 Aug 2019 02:25:25 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id t132so33143587pgb.9 for ; Wed, 31 Jul 2019 19:25:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IRUFnP4ofqonZexYeBGxV7EVAaZ3+L9vOKlLz0P0sBE=; b=f1MrXjDTtxpZMTS7mxwBVPuu8RlgSrj1FO3RRkV6lH5Ip8hKx/Vni+kN8Ru3q5IEEb rREi8GYo4yt8IyZhfi0Ow3xwLULGKRnPq+XoGVqOyPhaccsjA/eNZG+TovmfBuVS/Jry mZh/VAxJQYFqNZfaq8rMX3pGRhZdAQDIWaArIYi6XR1NDTnQ3jC+suOs8Kmu2te8pxc1 nIoljkqTZaYvs/SqVlmMKKuBH1Psb9FU2KXvj48DqYaZuV1QxviLGTxJiSs6gbOnNGo9 7veNWMBODmJoOwLif8mrB2cMbAVK92YK7Rec8B3doraHFkY2nlggY+/1YpBPlyQ2EuXD T2Tg== X-Gm-Message-State: APjAAAV5j18NakkVPmtP3lCdAzMBYdsfDMihwTzKMbXks38VOvJBSP4R wX3J/fxXz0ZzJAoXu8SdUgyLB78h/nw= X-Google-Smtp-Source: APXvYqxnEf6tanCWOd7XHEZwQLGuokiyY3veACgkT17VoC/OmESe7RwNDr0OwYtYY6g3sEZYcFW4DQ== X-Received: by 2002:a63:784c:: with SMTP id t73mr120019199pgc.268.1564626324589; Wed, 31 Jul 2019 19:25:24 -0700 (PDT) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id v184sm64911342pgd.34.2019.07.31.19.25.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Jul 2019 19:25:24 -0700 (PDT) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [RFC 1/6] udmabuf: use cache_sgt_mapping option Date: Wed, 31 Jul 2019 19:25:12 -0700 Message-Id: <20190801022517.1903-2-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190801022517.1903-1-gurchetansingh@chromium.org> References: <20190801022517.1903-1-gurchetansingh@chromium.org> MIME-Version: 1.0 X-Mailman-Original-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 :mime-version:content-transfer-encoding; bh=IRUFnP4ofqonZexYeBGxV7EVAaZ3+L9vOKlLz0P0sBE=; b=cOCUiIiQFNLIG5NkhQrvEw3Bke0+QcCd3EPbakpe4elRzFmgsNIiBs7auPFY95B5rM 4YKbT8Wls5WiL/uTkhycV+f+6BjdXVxIQXQTXnyAsQURt21vZCg7ronpYO7viaJ/cdmw fvzJooSHG4tiF3FFE/PelD3z1Btc3FE/ELXdQ= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kraxel@redhat.com, Gurchetan Singh Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The GEM prime helpers do it, so should we. It's also possible to make it optional later. Signed-off-by: Gurchetan Singh --- drivers/dma-buf/udmabuf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 9635897458a0..b345e91d831a 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -108,12 +108,13 @@ static void kunmap_udmabuf(struct dma_buf *buf, unsigned long page_num, } static const struct dma_buf_ops udmabuf_ops = { - .map_dma_buf = map_udmabuf, - .unmap_dma_buf = unmap_udmabuf, - .release = release_udmabuf, - .map = kmap_udmabuf, - .unmap = kunmap_udmabuf, - .mmap = mmap_udmabuf, + .cache_sgt_mapping = true, + .map_dma_buf = map_udmabuf, + .unmap_dma_buf = unmap_udmabuf, + .release = release_udmabuf, + .map = kmap_udmabuf, + .unmap = kunmap_udmabuf, + .mmap = mmap_udmabuf, }; #define SEALS_WANTED (F_SEAL_SHRINK)