From patchwork Tue Mar 13 16:21:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Andrushchenko X-Patchwork-Id: 10279849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E0DA6038F for ; Tue, 13 Mar 2018 16:21:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E8EA290A9 for ; Tue, 13 Mar 2018 16:21:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D566290E1; Tue, 13 Mar 2018 16:21:44 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 17CF2291B3 for ; Tue, 13 Mar 2018 16:21:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E5556E564; Tue, 13 Mar 2018 16:21:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 395316E564 for ; Tue, 13 Mar 2018 16:21:24 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id p74-v6so282208lfd.3 for ; Tue, 13 Mar 2018 09:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7P1xnrSFHrtt1AnNALsL7xvAn2LHmtU2sfwWZzEn3ds=; b=qeicmDKFnhNoMKIaJKF40tGvrScS0ddAD4eS89UHwhF0omTMvcbV4a/B6rflJoDW6P LMpD7l1s7rdZBevgmFVhfwNxx7laRcTJdwRCUm0arkzyKhrChdF232fdQ9vz2ScqtUk5 y47jyV8oRXkvVoibqsoQRqovBQRC09Qf8iNUZsj9CUXngVi4ys8zXozqsn4HPhEdjT/f ZY99TIjn8LGJtghdCIRPyGTEuEQaUNj1fHPDdOxNqxipLt0roubLAiObEepCrxr+fyGD th54AnY6ySvmQ4PyM9ZL+W10T0zb57Y+MXl1QlPgLa+w/PbmzP4iGZM8a/9CaNF1lCUr dSXQ== 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; bh=7P1xnrSFHrtt1AnNALsL7xvAn2LHmtU2sfwWZzEn3ds=; b=s1twaOzQV+/hO0qO0qbgrb9tjz4+SDGjK22UWhqFJDMbnT2k1GFBbjNk3HUnt4Tc82 2IyERkJTwCbuqiN5w4We+/0poGBoZDxNtueTJe9vyASUUCcGz1MJRku6VVv6+Nxl5/Mz /DsFJZtuzIOtzuuM8R1nEyiVWxNh9tK4rLWQbSBNh2t+dX5LN/6auE/hjPfB/g2ZvjAq oX6V2bn6fj2pY9eK7nJ0ZbJO8aC6eQjZiOyrC/Nef34kbp9vWHtD9oqmilhkyKZPb1SE umkxGN8blix6i/0OqQhE/D3PdJl2rRk1uQ5UlMzgjXmackuI1YAEoRR7nXeIsxcTwKVb qs9Q== X-Gm-Message-State: AElRT7G56kaS1erPts7BwSigqhS3xcZBYZLACWn1xQ7IHqwjFFHNIhyW TRokL1TYAPhu2F14zOppG0s= X-Google-Smtp-Source: AG47ELu4w+ejLGTQlv+hvBodVjHZqx3OU+hNUO640mUShkM0rN+aR2IdpNYhBxBfxzWQXsKDOguHZg== X-Received: by 2002:a19:771b:: with SMTP id s27-v6mr867776lfc.138.1520958082361; Tue, 13 Mar 2018 09:21:22 -0700 (PDT) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id p26sm109395lja.95.2018.03.13.09.21.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Mar 2018 09:21:21 -0700 (PDT) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, daniel.vetter@intel.com, seanpaul@chromium.org, gustavo@padovan.org, jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH RESEND v2 2/2] drm/xen-front: Provide kernel documentation Date: Tue, 13 Mar 2018 18:21:06 +0200 Message-Id: <1520958066-22875-3-git-send-email-andr2000@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520958066-22875-1-git-send-email-andr2000@gmail.com> References: <1520958066-22875-1-git-send-email-andr2000@gmail.com> 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: andr2000@gmail.com, Oleksandr Andrushchenko MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Oleksandr Andrushchenko Provide kernel documentation for the Xen para-virtualized frontend DRM driver. Signed-off-by: Oleksandr Andrushchenko --- Documentation/gpu/index.rst | 1 + Documentation/gpu/xen-front.rst | 77 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 Documentation/gpu/xen-front.rst diff --git a/Documentation/gpu/index.rst b/Documentation/gpu/index.rst index c36586dad29d..e31684af0a20 100644 --- a/Documentation/gpu/index.rst +++ b/Documentation/gpu/index.rst @@ -20,6 +20,7 @@ Linux GPU Driver Developer's Guide vga-switcheroo vgaarbiter bridge/dw-hdmi + xen-front todo .. only:: subproject and html diff --git a/Documentation/gpu/xen-front.rst b/Documentation/gpu/xen-front.rst new file mode 100644 index 000000000000..6ac0b75373c4 --- /dev/null +++ b/Documentation/gpu/xen-front.rst @@ -0,0 +1,77 @@ +==================================== +Xen para-virtualized frontend driver +==================================== +This frontend driver implements Xen para-virtualized display +according to the display protocol described at +include/xen/interface/io/displif.h + +Driver modes of operation in terms of display buffers used +========================================================== + +Depending on the requirements for the para-virtualized environment, namely +requirements dictated by the accompanying DRM/(v)GPU drivers running in both +host and guest environments, number of operating modes of para-virtualized +display driver are supported: + +- display buffers can be allocated by either frontend driver or backend +- display buffers can be allocated to be contiguous in memory or not + +Note! Frontend driver itself has no dependency on contiguous memory for +its operation. + +Buffers allocated by the frontend driver +---------------------------------------- + +The below modes of operation are configured at compile-time via +frontend driver's kernel configuration: + +With GEM CMA helpers +~~~~~~~~~~~~~~~~~~~~ + This use-case is useful when used with accompanying DRM/vGPU driver in + guest domain which was designed to only work with contiguous buffers, + e.g. DRM driver based on GEM CMA helpers: such drivers can only import + contiguous PRIME buffers, thus requiring frontend driver to provide + such. In order to implement this mode of operation para-virtualized + frontend driver can be configured to use GEM CMA helpers. + +Without GEM CMA helpers +~~~~~~~~~~~~~~~~~~~~~~~ + If accompanying drivers can cope with non-contiguous memory then, to + lower pressure on CMA subsystem of the kernel, driver can allocate + buffers from system memory. + + Note! If used with accompanying DRM/(v)GPU drivers this mode of operation + may require IOMMU support on the platform, so accompanying DRM/vGPU + hardware can still reach display buffer memory while importing PRIME + buffers from the frontend driver. + +Buffers allocated by the backend +-------------------------------- + +This mode of operation is run-time configured via guest domain configuration +through XenStore entries. + +For systems which do not provide IOMMU support, but having specific +requirements for display buffers it is possible to allocate such buffers +at backend side and share those with the frontend. +For example, if host domain is 1:1 mapped and has DRM/GPU hardware expecting +physically contiguous memory, this allows implementing zero-copying +use-cases. + +Note, while using this scenario the following should be considered: + +#. If guest domain dies then pages/grants received from the backend + cannot be claimed back + +#. Misbehaving guest may send too many requests to the + backend exhausting its grant references and memory + (consider this from security POV). + +Driver limitations +================== + +#. Only primary plane without additional properties is supported. + +#. Only one video mode per connector supported which is configured via XenStore. + +#. All CRTCs operate at fixed frequency of 60Hz.