From patchwork Tue Nov 26 01:10:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11261263 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69B29138C for ; Tue, 26 Nov 2019 01:11:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5181C2068F for ; Tue, 26 Nov 2019 01:11:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5181C2068F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA2636E1BE; Tue, 26 Nov 2019 01:11:20 +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 E61146E1BE for ; Tue, 26 Nov 2019 01:11:18 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id 6so3564014pgk.0 for ; Mon, 25 Nov 2019 17:11:18 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=E/aY1zeifCUazA2R7W+5YbKLA6FIG6CMK8P5lmxEc9w=; b=Okfqe3utiCLPYyIoKBsWYPlkHmp0hXIaeF8sTELVVEelxFhENBsoUATBgehTVsnj8J z1UNVgr7eEg+VYm9pUuCJpBPGiD52lWkFef9iKRwXwe4edsRGjqvJVshjftfMBEtWnb9 Es15qrtLUKst9YhAPrj/xwNkjEsikMCPtHdMJn5vfA+zmcFRc2fZljExB/r7Oae28MeI 30NwZEJkfgA9HEbLpBdeP7DaKF18YsH2+AJaaZERKSkb2o6ZLyDwYTfSmQQGtrycEZiB GQlNWRw/d5avPIk7VtFVWMN7O/685l+jReF3OggOJn8CcdNyZSh7XTXYUeTGhtl9NJyp tudw== X-Gm-Message-State: APjAAAU72DLrhojFpWHR5wIFlpqg3m7q2hVb1PIhJBoaGOZvKB5ZME8v uUCSmTh4/0lHMgtv8QfnK1mEMyToMBA= X-Google-Smtp-Source: APXvYqzU2Mkl6zxLrwxnguxy4Ta6s3lQMXAGyCk8xupI/jtFSu0iy5cbt6SwFCWMAIuzgAbU0lwsIQ== X-Received: by 2002:a62:6086:: with SMTP id u128mr38357762pfb.4.1574730678352; Mon, 25 Nov 2019 17:11:18 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:15c:202:201:bc97:5740:52a7:6875]) by smtp.gmail.com with ESMTPSA id z10sm9672903pgg.39.2019.11.25.17.11.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Nov 2019 17:11:17 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] udmabuf: use cache_sgt_mapping option Date: Mon, 25 Nov 2019 17:10:52 -0800 Message-Id: <20191126011056.67928-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.21.0 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:mime-version :content-transfer-encoding; bh=E/aY1zeifCUazA2R7W+5YbKLA6FIG6CMK8P5lmxEc9w=; b=noUTO8FLsA53qPu6+gJpr/+Emaxjj5VhyAIk6MPejpNh5pgSldm6/GbSYDE8k5xqzi zuyUMtzTn2c/PZm2DGDHvn/EVPRcVrzZFYlVUWHs1AGkx0ou40FwL02Thvp0DGgptU5O Dtf9GzICEQM4p1Ef65ozZIA2EQRAmJU4j4mbo= 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: Gurchetan Singh , kraxel@redhat.com, hch@lst.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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)