From patchwork Thu Aug 1 02:25:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 11070057 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 8150A1395 for ; Thu, 1 Aug 2019 02:25:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72F4728451 for ; Thu, 1 Aug 2019 02:25:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6726828450; Thu, 1 Aug 2019 02:25:24 +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 0BB14204FA for ; Thu, 1 Aug 2019 02:25:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08AF56E326; Thu, 1 Aug 2019 02:25:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 813C26E326 for ; Thu, 1 Aug 2019 02:25:21 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id c3so9876162pfa.13 for ; Wed, 31 Jul 2019 19:25:21 -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:mime-version :content-transfer-encoding; bh=0b83mFxyRn6zkAdnvu0XGM34loYRjow/prwSt7efn18=; b=f2nPX7gZKXDAV2BKcEomGFpUSHqBndwem8inNrIku35JNIbnHnrAhvLZPIUYgRqhvX SAFcVh/MpwbjoR/3dvsKB0oc2iiLGBy5AhNtI9Fm09Iew2tfrYabP2Nco14JRkAV+Ybm sM2TMos4kRnIaC4xKUX7AeNxr1ypk0TDZtOY2aENEkp7/+2UkKCiXaC89FvYqr9Q21FQ rk0nYnJ1fLGgBVTEWdUFxZ5pro0tr9RCXSbINSg6hVJtz3PW8rURG5gLRyqvunHUq49H 8qVbzMnKnE1DA0p8PrAzT/qzIQlCl2oWNkBHG4m5oSJvBwWa657HbIem4ReoxTRiVTLr 0m2Q== X-Gm-Message-State: APjAAAWfzCJywLyvEObd7dPH8pdHkESc3T/W/IGMjq0JsZvwYroDHnLX iELJmQIUbCZG1vZ6X83NtuGOP5i2Zkg= X-Google-Smtp-Source: APXvYqzzhOlGXx56ebH4YuRooIUVEixjqggst9Kp0B3MVZGz8WyZ9yS++AAczoTU245+naH/0lr3sg== X-Received: by 2002:a63:58c:: with SMTP id 134mr121724532pgf.106.1564626320863; Wed, 31 Jul 2019 19:25:20 -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.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Jul 2019 19:25:20 -0700 (PDT) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [RFC 0/6] udmabuf guest <--> host interaction model Date: Wed, 31 Jul 2019 19:25:11 -0700 Message-Id: <20190801022517.1903-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.20.1 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=0b83mFxyRn6zkAdnvu0XGM34loYRjow/prwSt7efn18=; b=gAGN5Vhc/Hq1t4lY3qSZ5rgfopzZSs/tIlrsu1p9XOYhmQsBZUyBOi/uiEikWwcoRw aKfiM9i3JXT32wbtHBGcCxbTIhFLFN3W8Xeq6txcDmggI/vQ5rCG8N4Ysjw3X01Ps48k 3DCG10f7MKaI7UDiIhQVCmRQA97RnJdb7r3eM= 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 It's desirable to use zero-copy mechanisms when using various graphics buffers. With udmabuf, two cases come to mind: 1) Directly scan-out a guest-mapped buffer 2) Import into VK with VK_EXT_external_memory_dma_buf However, displays are not generally coherent with the CPU and many GPUs aren't either. So we need to map write-combine in the guest. One way to achieve this is to synchronize on the host. [warning] -- only compile tested at this point to get feedback Gurchetan Singh (6): udmabuf: use cache_sgt_mapping option udmabuf: add ability to set access flags on udmabuf udmabuf: enforce access flags udmabuf: add a pointer to the miscdevice in dma-buf private data udmabuf: separate out creating/destroying scatter-table udmabuf: implement begin_cpu_access/end_cpu_access hooks drivers/dma-buf/udmabuf.c | 103 +++++++++++++++++++++++++++++------ include/uapi/linux/udmabuf.h | 5 +- 2 files changed, 90 insertions(+), 18 deletions(-)