Received: by 10.213.65.68 with SMTP id h4csp1524294imn; Thu, 29 Mar 2018 06:21:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/V6jphz7+AVWoxBawXbLTnwsP00a5uNXhPAqNXNXEhOHa4eXkgbcJmxNeA+bFlyinGc4hS X-Received: by 10.101.65.195 with SMTP id b3mr5546638pgq.118.1522329694524; Thu, 29 Mar 2018 06:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522329694; cv=none; d=google.com; s=arc-20160816; b=kwxOc5rbPyXxEJ5mPLeF1+e80kLIFyrlez2nx9X7yCda8qx5hREzhDJg0nRvxIRjZu /BdwXfa1FUabZjTpwHp3zElc4stSPVoqng1biQiunvVgi9hSALx7vNRtc5e/xniLT843 y1ZqCSiyEaM1lsF0hjWSWyvJhIPBGTPvJ1IyvbbpUO5mZvsMyJSExvfACUcoa/pgHADE aVqxkvApm7rDptHC846RhqCSHv1PZaT0oqsMXowJtt8Mf7jZ0Woo7AhYmsY5ehyM51mW RmjBDtLKYNznQTwiBuWRmlSpqyjFa075c1uMIsAetiXEbBDOCxjin6akuBiS4yv6xAxW goKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9UmXOgwVSHAElhQAnCxfRH2Ts27JmlwmsVgtFKuE568=; b=QvgB2g25fiX7daDPCiMSm0zQuCNml/1AxUnPq/kFEEWC0mk6AWFRdh7MR19ttIzIh5 aXwFmgaYoytxQ09Ll9h/O+wjVubizqVFeoqsfrLyixl8P3w4UgrpW5/Flao0GyC7YOvR fcbt1vb/aXUsJn6UqjjrRsBc+IIjGqZQ1Jbi4YXp9QeiMilnDUPyQrf0zdgdllQO/EXc Ve2DeSqE2OeLTPhv0KgEficHFDLrpyucJS3hY4oIlSxy7Yf70PAIdmpWE7v6FV/P7j5y n0HYxzntRDFJEV8y8Cx4sRkjZjA+dXCmVh2DEz1uzRs9JXVyGE+X5bOGzmNl45HoEJ26 rPCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RohMPZn7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si4346623pfn.313.2018.03.29.06.21.20; Thu, 29 Mar 2018 06:21:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RohMPZn7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbeC2NTo (ORCPT + 99 others); Thu, 29 Mar 2018 09:19:44 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:41545 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752387AbeC2NTm (ORCPT ); Thu, 29 Mar 2018 09:19:42 -0400 Received: by mail-lf0-f66.google.com with SMTP id o102-v6so8366213lfg.8 for ; Thu, 29 Mar 2018 06:19:41 -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; bh=9UmXOgwVSHAElhQAnCxfRH2Ts27JmlwmsVgtFKuE568=; b=RohMPZn7bVaAXElTyAfAupWnu91xTAHFE1wfEQ+E34PbLv+/RbyECr05vW4wtirAnr +y3OuT9FoNLTYN7Dpk5pHthXtJd5o2C+iBKnNqHV0jm9L8tZy6cRQUJCSCdpVkrKbK9N SOJI6BDk+XtUQPUlnFUS7gWiTb9Wj4vt/dodmdD8ZtU0Qev0LwrItURFEBFdIun39LA6 oSSYYRS4Qq2Ub7woQQWmLPslSUnKEZj2GoTnJaGwPPH6+tYdpw08DwIaBjwrshYuusx+ ylYPKY+g6EyTYXyozuW1n/zSb9rxkVu5+Mp1CcVV9CQ3rljEcqzPEG+z3ePqcXkoSjXH d6Fw== 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; bh=9UmXOgwVSHAElhQAnCxfRH2Ts27JmlwmsVgtFKuE568=; b=naRTfrEYP0a4CvS8f6yghRg9xWUEWHuBpYax5bZyrfMyviPIuT2aj5pDhbchb03U4f DEuxzLEVRNM+4tZScsceX+O6xZKJIV2Wsyow6JQizJrmXF+Q7hk42XjjcrwMWMIO3apC 8DwpfLB052vjwv/FD1fd/qA5FtFztAX+/sH+Jsm7lPi9eW14VXUgjyTgv1tcUZXF7R30 9aslPY9sIQ0kfDI51Xjp0iPDGVvYXHu2l2xhaK9DQNAs8TtJd09gfljyuKNU7ovWHi1f wk3f6qkRD866Y6GZXkQe9TjfSPJt/i3q7hJLx4dlZGTy/Pst3mty8U9PtpbO4l0KX2+d 9igw== X-Gm-Message-State: AElRT7EuUlMDcQPqT3xGJqOiROG+r4LOpTGuk9e2KDC/atLuee0ac+rj Rnag9iG0QItmyyhoEjLmkHw= X-Received: by 10.46.53.11 with SMTP id z11mr5205740ljz.69.1522329580969; Thu, 29 Mar 2018 06:19:40 -0700 (PDT) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-59.209.223.85.sovam.net.ua. [85.223.209.59]) by smtp.gmail.com with ESMTPSA id v4sm1035789lji.15.2018.03.29.06.19.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Mar 2018 06:19:40 -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 Cc: andr2000@gmail.com, Oleksandr Andrushchenko Subject: [PATCH 0/1] drm/xen-zcopy: Add Xen zero-copy helper DRM driver Date: Thu, 29 Mar 2018 16:19:30 +0300 Message-Id: <20180329131931.29957-1-andr2000@gmail.com> X-Mailer: git-send-email 2.16.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleksandr Andrushchenko Hello! When using Xen PV DRM frontend driver then on backend side one will need to do copying of display buffers' contents (filled by the frontend's user-space) into buffers allocated at the backend side. Taking into account the size of display buffers and frames per seconds it may result in unneeded huge data bus occupation and performance loss. This helper driver allows implementing zero-copying use-cases when using Xen para-virtualized frontend display driver by implementing a DRM/KMS helper driver running on backend's side. It utilizes PRIME buffers API to share frontend's buffers with physical device drivers on backend's side: - a dumb buffer created on backend's side can be shared with the Xen PV frontend driver, so it directly writes into backend's domain memory (into the buffer exported from DRM/KMS driver of a physical display device) - a dumb buffer allocated by the frontend can be imported into physical device DRM/KMS driver, thus allowing to achieve no copying as well For that reason number of IOCTLs are introduced: - DRM_XEN_ZCOPY_DUMB_FROM_REFS This will create a DRM dumb buffer from grant references provided by the frontend - DRM_XEN_ZCOPY_DUMB_TO_REFS This will grant references to a dumb/display buffer's memory provided by the backend - DRM_XEN_ZCOPY_DUMB_WAIT_FREE This will block until the dumb buffer with the wait handle provided be freed With this helper driver I was able to drop CPU usage from 17% to 3% on Renesas R-Car M3 board. This was tested with Renesas' Wayland-KMS and backend running as DRM master. Thank you, Oleksandr Oleksandr Andrushchenko (1): drm/xen-zcopy: Add Xen zero-copy helper DRM driver Documentation/gpu/drivers.rst | 1 + Documentation/gpu/xen-zcopy.rst | 32 + drivers/gpu/drm/xen/Kconfig | 25 + drivers/gpu/drm/xen/Makefile | 5 + drivers/gpu/drm/xen/xen_drm_zcopy.c | 880 ++++++++++++++++++++++++++++ drivers/gpu/drm/xen/xen_drm_zcopy_balloon.c | 154 +++++ drivers/gpu/drm/xen/xen_drm_zcopy_balloon.h | 38 ++ include/uapi/drm/xen_zcopy_drm.h | 129 ++++ 8 files changed, 1264 insertions(+) create mode 100644 Documentation/gpu/xen-zcopy.rst create mode 100644 drivers/gpu/drm/xen/xen_drm_zcopy.c create mode 100644 drivers/gpu/drm/xen/xen_drm_zcopy_balloon.c create mode 100644 drivers/gpu/drm/xen/xen_drm_zcopy_balloon.h create mode 100644 include/uapi/drm/xen_zcopy_drm.h -- 2.16.2