Received: by 10.223.185.116 with SMTP id b49csp605695wrg; Wed, 21 Feb 2018 04:02:32 -0800 (PST) X-Google-Smtp-Source: AH8x227eYUW+apw7WWR7CdyEDSZwjBeOMCxxqwsW+Rb4to7VfIVAYdGoEkJszKywU2RoN26j6lbr X-Received: by 10.99.110.201 with SMTP id j192mr2565864pgc.59.1519214551997; Wed, 21 Feb 2018 04:02:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519214551; cv=none; d=google.com; s=arc-20160816; b=YWiCZQtel8ARF04BkPkf2YlUIRcNTd08Ekp+as8NjhEpqZKUXJMLOWtX9KZnsjYGle u1ZQ8PvpOJQU0mwPL7Jvv+WpwyIOS9eV65eZS1AEVkef7yPsyX6aCMpIU73+4POgDJaA aBGyP7WV9nBmA7XuUCfEWAzU1VwNwTWgSN6GHJ7VUkyDk5tD5O+emzYZnS3QynvpgO1B h6GFp4gPxCEiV7O+MrU4BDmjAA9sXp87AcjeCU2r/3bNbuSbz5slI/0ACj0cv6KZ2z2u 8zMToli1dHtQMyFIt3RBecRzxZo72BSMrPiOiYm6+M/N9mUgvMQsJ/5yFzRkttWewBNa qSaA== 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=Jm01MPjeYgUh6zGuHPkMNPXbjc3c4JO1aPm8i36BrMY=; b=RlHaZhz5J095B9PECej6FMxUzP519jfG0f/qScCums1MP7iuy9lHtHi4Kb81CJuOIw AvTqDfiG0ejhs4nTH5gb7WiUC5Xx8n32oGW9TGePa/2OCs4oYblTxMnBBRGLAyi8jtFd GGePk/UoLheTHZuKu1jlq+kMn3k3s1t1mhKrrh+x8KvCbP7mqq+g+uj5l+lhVID6iL9F RmMa9weKIWOLO4/QbKFVZYskGJuQbS/kG3GqtXlmGKWKkOJr2kRFPnh0r8EQ15BKQLsB AO1ikB2Z+lSKHh91uCKfEfB9HeTPS2K1Pqa0met0bEx6wh0iRb4bJtXLWKpNJH/KGmI/ 5OKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FgGbdIeL; 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 m11-v6si2796911pls.19.2018.02.21.04.02.15; Wed, 21 Feb 2018 04:02:31 -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=FgGbdIeL; 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 S1752036AbeBUIEn (ORCPT + 99 others); Wed, 21 Feb 2018 03:04:43 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:42801 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922AbeBUIEF (ORCPT ); Wed, 21 Feb 2018 03:04:05 -0500 Received: by mail-lf0-f68.google.com with SMTP id t204so1071211lff.9 for ; Wed, 21 Feb 2018 00:04:04 -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=Jm01MPjeYgUh6zGuHPkMNPXbjc3c4JO1aPm8i36BrMY=; b=FgGbdIeLdJAEnZ8mjbTtAc/CAA07dsalteOIvLse1oY/s+IA1f/HooA/H1SU0jn7Xj VHqiTZigUIyEEVBUv57PcRlMwV92MHcFefT+2Zaz8kUPvfLF0mgJzmwSpGta/PifQxqZ R4qmmILLHKnTde77Z9mlapH9DqV6IFzdXBhrGxYRspA3mDjmEnv2+UtlFr/Cv5s/wSId 2u3PtQHf1vtdHsiw+HvdD7rB1AY09VfoDTgFV5TP2R4xuF3YFZVitrBKCcrwCEH9QS63 vS9ZkP7NpdI8wY2eJ8rmm59FIMBLAXe1ziFKFiYG4z/ASC4XwuCQr6DV/mmoBrBSlLQZ WKIg== 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=Jm01MPjeYgUh6zGuHPkMNPXbjc3c4JO1aPm8i36BrMY=; b=i+8wqeC3ABdTPuj+nN0GCaQLn7Xxp/qGl9D4mJmTDcNbOhiA/t/MeOW8Q5J6utmPJy PhzXnAZjpPFpME3wTpXiW8XxN16RwxYn/PxnpXVujs+yrHGXnEN1TQ1X+ALjr2n1MZxZ 7rccOIEUh+EB5MUOiIOurv65YcunVj3uvRmTgCY9Jjie0BqCgtsOT9hIIvDCpOsidC7l kSWBBK4W8vFlnucod/BdOmAU5w5+a+G+TV8THDpOUrHVGfRhiOpcHFp12Eiel8Zd3ibX PHLmQOTr3y2ZCLWbDR079pCb9DGwiPKURnrUcLFIDbq3BF4oq3Zda3a4NjR9Fe+mo0VY nBkA== X-Gm-Message-State: APf1xPD0pwMzng9BhtIiGSvITDx6OTkv7BL2KXBr2u0ypBi/cbpw2CM7 KEBIGVm/gflqGgN0iUX602c= X-Received: by 10.25.21.149 with SMTP id 21mr1781756lfv.13.1519200243756; Wed, 21 Feb 2018 00:04:03 -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.04.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Feb 2018 00:04:02 -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 7/9] drm/xen-front: Implement KMS/connector handling Date: Wed, 21 Feb 2018 10:03:40 +0200 Message-Id: <1519200222-20623-8-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 Implement kernel modesetiing/connector handling using DRM simple KMS helper pipeline: - implement KMS part of the driver with the help of DRM simple pipepline helper which is possible due to the fact that the para-virtualized driver only supports a single (primary) plane: - initialize connectors according to XenStore configuration - handle frame done events from the backend - generate vblank events - create and destroy frame buffers and propagate those to the backend - propagate set/reset mode configuration to the backend on display enable/disable callbacks - send page flip request to the backend and implement logic for reporting backend IO errors on prepare fb callback - implement virtual connector handling: - support only pixel formats suitable for single plane modes - make sure the connector is always connected - support a single video mode as per para-virtualized driver configuration Signed-off-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/Makefile | 2 + drivers/gpu/drm/xen/xen_drm_front_conn.c | 125 +++++++++++++ drivers/gpu/drm/xen/xen_drm_front_conn.h | 35 ++++ drivers/gpu/drm/xen/xen_drm_front_drv.c | 15 ++ drivers/gpu/drm/xen/xen_drm_front_drv.h | 12 ++ drivers/gpu/drm/xen/xen_drm_front_kms.c | 299 +++++++++++++++++++++++++++++++ drivers/gpu/drm/xen/xen_drm_front_kms.h | 30 ++++ 7 files changed, 518 insertions(+) create mode 100644 drivers/gpu/drm/xen/xen_drm_front_conn.c create mode 100644 drivers/gpu/drm/xen/xen_drm_front_conn.h create mode 100644 drivers/gpu/drm/xen/xen_drm_front_kms.c create mode 100644 drivers/gpu/drm/xen/xen_drm_front_kms.h diff --git a/drivers/gpu/drm/xen/Makefile b/drivers/gpu/drm/xen/Makefile index d3068202590f..4fcb0da1a9c5 100644 --- a/drivers/gpu/drm/xen/Makefile +++ b/drivers/gpu/drm/xen/Makefile @@ -2,6 +2,8 @@ drm_xen_front-objs := xen_drm_front.o \ xen_drm_front_drv.o \ + xen_drm_front_kms.o \ + xen_drm_front_conn.o \ xen_drm_front_evtchnl.o \ xen_drm_front_shbuf.o \ xen_drm_front_cfg.o diff --git a/drivers/gpu/drm/xen/xen_drm_front_conn.c b/drivers/gpu/drm/xen/xen_drm_front_conn.c new file mode 100644 index 000000000000..d9986a2e1a3b --- /dev/null +++ b/drivers/gpu/drm/xen/xen_drm_front_conn.c @@ -0,0 +1,125 @@ +/* + * 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