Received: by 10.223.185.116 with SMTP id b49csp607308wrg; Wed, 21 Feb 2018 04:04:02 -0800 (PST) X-Google-Smtp-Source: AH8x227EwTE7GR+BxNepAwoIk9ngDXC7uta5fwFdsOlUjg/gTl52X2biZt+jC3PimfjmRX8ttn0a X-Received: by 2002:a17:902:a515:: with SMTP id s21-v6mr2923798plq.393.1519214641931; Wed, 21 Feb 2018 04:04:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519214641; cv=none; d=google.com; s=arc-20160816; b=NgV2bsbWEPJDExJxclyJ4tZhjw6qeNCzYwGU8ymE3/WXqSE+pAHqFRVx+pen1pF/Ab br9x0Ga1RJC4r+Mm0NroJMWXpQzoF43UpqI1B5MAVcPq2K8t4lxNBNcRz06sbDreoS03 dqoNouFWNgLzcZsysF6eHc8Jfb6YYnbKw+rcdlqlulrNFM+mflkPX7s3w+P8c3MJBZqC B26G9F442iZRcqxaaYydamjnEJ/EI8Afm9LalzIwx0r3uqYryOFDEctgdOTp2l+DOHyJ beqKpiRiNfAEaICDskPefXkmEJ8uQBk6wnA4+oeW+jYy7mJqUEBbMT/N66kpcbnkbuq8 gbfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=1WGX0yYg0tp+CBArRCHXkYbQgrTJDPMwUCHNfaHSKhA=; b=IyWMQFHZNnEIdBVH/jcH2KsfQFoBg94NXdXPZyhPQn9NlkoTPm2HOdU9/hA3ywGszN 4jBbsXSAyEfWEBY1JBUMlnmy6mkegqSIZ/RmB7JV3AAStNuzc9zdKn4fWIWTem/SlPB1 BK4Jll/hLXNG5utCuUKC4nVH5Aojgi2nqnWXGkLso6rZ1FBb3wiRdvxgoudYYYD3H7za z4hjEyGBdm45bo0Ws2CJh1ny1ro/jP2+pjckcmjxk2oLDsaaxTDaA3tU9TrwV1sZxNG7 xkMeDBvaRWgElDneOfmkH3fIU8obGtb1aYkt4wxpFoyX7yB2NRd8XzZz7CP93JrN3A0l f/KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WjP56aVT; 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 bc6-v6si1164178plb.250.2018.02.21.04.03.47; Wed, 21 Feb 2018 04:04:01 -0800 (PST) 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=WjP56aVT; 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 S1752189AbeBUIH3 (ORCPT + 99 others); Wed, 21 Feb 2018 03:07:29 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:44894 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751759AbeBUIDy (ORCPT ); Wed, 21 Feb 2018 03:03:54 -0500 Received: by mail-lf0-f66.google.com with SMTP id v9so1063549lfa.11 for ; Wed, 21 Feb 2018 00:03:53 -0800 (PST) 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=1WGX0yYg0tp+CBArRCHXkYbQgrTJDPMwUCHNfaHSKhA=; b=WjP56aVT7pv53nIDq2cBbYkRgleztmTGwa2L9GH5IGZ8i8EJY1qhmAJtpZ+gFqY50M VpT8SRp1DyWOEHMzcO/kKuALYkjthdaa0aOxa386a/4ZjmVicnw+WZhI0qGHjXwViQE0 KAhfGV5Fv8PS7a7f0OesBthRM2IP5CWNzFKljkwlkCgLgAipI3Xcx7zi1tNNXIPD8mpn tepzDQlYhzcT6CpTguWlqQMYL+i9BroAZrIrCnNz5QvdLdndPU3ThuMCAaowuFN94063 4WXD5fEPwTRof414AwXjKzq/KZKJY6O2XWezbaLPp5mcRsL1EqEPwGnkmo8xbprNbROx 3ABw== 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=1WGX0yYg0tp+CBArRCHXkYbQgrTJDPMwUCHNfaHSKhA=; b=S0Aq8TF5/hENrC6mun80jQeCaIbpoY2J44IowW2oynOPbVypLqWMiFssz9PBcH9zmC H9Msi/NcmtrenhXrvasNDZG/D+JDaSeBNme96RBkOhU57sc/Fogs5NScsoqsv3lDCci9 Jo5JYxRteJUJ93PnnT133PkwyWB27TCpj0FbddhXd71F8Gyv2eMcC7f/fDU/Ss5GBZ1J XrkSz10mH+7u7b/hyEk78BghwQk95+Vi4kYNmnWD2VHhgaIvplHi1Qsjx4iFzsN2vC8L HjzokGn1urSjGeYQc98WNEjM+7lJx8zFAswd6zGXM6Zb6h9WY36Me+vin2+cb8EswzK2 XLmQ== X-Gm-Message-State: APf1xPCrCIB/gQzJhotB4WPYKdSOPD63XCEua5a98u1y96gLGHGENSN/ 9Xuee926mFkdFESzYFQIRBQ= X-Received: by 10.46.20.30 with SMTP id u30mr1770363ljd.12.1519200232939; Wed, 21 Feb 2018 00:03:52 -0800 (PST) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-53.209.223.85.sovam.net.ua. [85.223.209.53]) by smtp.gmail.com with ESMTPSA id g38sm687394lji.24.2018.02.21.00.03.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Feb 2018 00:03:52 -0800 (PST) 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 1/9] drm/xen-front: Introduce Xen para-virtualized frontend driver Date: Wed, 21 Feb 2018 10:03:34 +0200 Message-Id: <1519200222-20623-2-git-send-email-andr2000@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519200222-20623-1-git-send-email-andr2000@gmail.com> References: <1519200222-20623-1-git-send-email-andr2000@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleksandr Andrushchenko Introduce skeleton of the para-virtualized Xen display frontend driver. This patch only adds required essential stubs. Signed-off-by: Oleksandr Andrushchenko --- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/xen/Kconfig | 17 ++++++++ drivers/gpu/drm/xen/Makefile | 5 +++ drivers/gpu/drm/xen/xen_drm_front.c | 83 +++++++++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 drivers/gpu/drm/xen/Kconfig create mode 100644 drivers/gpu/drm/xen/Makefile create mode 100644 drivers/gpu/drm/xen/xen_drm_front.c diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index deeefa7a1773..757825ac60df 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -289,6 +289,8 @@ source "drivers/gpu/drm/pl111/Kconfig" source "drivers/gpu/drm/tve200/Kconfig" +source "drivers/gpu/drm/xen/Kconfig" + # Keep legacy drivers last menuconfig DRM_LEGACY diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 50093ff4479b..9d66657ea117 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -103,3 +103,4 @@ obj-$(CONFIG_DRM_MXSFB) += mxsfb/ obj-$(CONFIG_DRM_TINYDRM) += tinydrm/ obj-$(CONFIG_DRM_PL111) += pl111/ obj-$(CONFIG_DRM_TVE200) += tve200/ +obj-$(CONFIG_DRM_XEN) += xen/ diff --git a/drivers/gpu/drm/xen/Kconfig b/drivers/gpu/drm/xen/Kconfig new file mode 100644 index 000000000000..4cca160782ab --- /dev/null +++ b/drivers/gpu/drm/xen/Kconfig @@ -0,0 +1,17 @@ +config DRM_XEN + bool "DRM Support for Xen guest OS" + depends on XEN + help + Choose this option if you want to enable DRM support + for Xen. + +config DRM_XEN_FRONTEND + tristate "Para-virtualized frontend driver for Xen guest OS" + depends on DRM_XEN + depends on DRM + select DRM_KMS_HELPER + select VIDEOMODE_HELPERS + select XEN_XENBUS_FRONTEND + help + Choose this option if you want to enable a para-virtualized + frontend DRM/KMS driver for Xen guest OSes. diff --git a/drivers/gpu/drm/xen/Makefile b/drivers/gpu/drm/xen/Makefile new file mode 100644 index 000000000000..967074d348f6 --- /dev/null +++ b/drivers/gpu/drm/xen/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + +drm_xen_front-objs := xen_drm_front.o + +obj-$(CONFIG_DRM_XEN_FRONTEND) += drm_xen_front.o diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c new file mode 100644 index 000000000000..fd372fb464a1 --- /dev/null +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -0,0 +1,83 @@ +/* + * Xen para-virtual DRM device + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Copyright (C) 2016-2018 EPAM Systems Inc. + * + * Author: Oleksandr Andrushchenko + */ + +#include + +#include +#include +#include + +#include + +static void backend_on_changed(struct xenbus_device *xb_dev, + enum xenbus_state backend_state) +{ +} + +static int xen_drv_probe(struct xenbus_device *xb_dev, + const struct xenbus_device_id *id) +{ + return 0; +} + +static int xen_drv_remove(struct xenbus_device *dev) +{ + return 0; +} + +static const struct xenbus_device_id xen_drv_ids[] = { + { XENDISPL_DRIVER_NAME }, + { "" } +}; + +static struct xenbus_driver xen_driver = { + .ids = xen_drv_ids, + .probe = xen_drv_probe, + .remove = xen_drv_remove, + .otherend_changed = backend_on_changed, +}; + +static int __init xen_drv_init(void) +{ + if (!xen_domain()) + return -ENODEV; + + if (xen_initial_domain()) { + DRM_ERROR(XENDISPL_DRIVER_NAME " cannot run in initial domain\n"); + return -ENODEV; + } + + if (!xen_has_pv_devices()) + return -ENODEV; + + DRM_INFO("Registering XEN PV " XENDISPL_DRIVER_NAME "\n"); + return xenbus_register_frontend(&xen_driver); +} + +static void __exit xen_drv_cleanup(void) +{ + DRM_INFO("Unregistering XEN PV " XENDISPL_DRIVER_NAME "\n"); + xenbus_unregister_driver(&xen_driver); +} + +module_init(xen_drv_init); +module_exit(xen_drv_cleanup); + +MODULE_DESCRIPTION("Xen para-virtualized display device frontend"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("xen:"XENDISPL_DRIVER_NAME); -- 2.7.4