Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1619315ybi; Sun, 30 Jun 2019 20:24:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqHuBhfLSOwfJ/K1tWE+DJWFfV67a4t8IyV06Ep1o4Y4CszYoKkFyfZ7YYIZ+/bUV0KFSH X-Received: by 2002:a17:90a:a00d:: with SMTP id q13mr27976230pjp.80.1561951496587; Sun, 30 Jun 2019 20:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561951496; cv=none; d=google.com; s=arc-20160816; b=uDQxdiTZefHQRd/SmXPO0huIMqN8/LieYtTa16ITm678ywlxij0SRhSsSjQLXjeM1S IAMR/Yo+Nd2BIRQE9VxO+aXwUcMtbpjQSe16jIvXcpSIMWyWyb7wGp1Uo78h48ZoYOfP XVrKPymdWI6kKUf6gaB5Pcks2UurtbE1OVmc+Nd80fp0UVJknbJwmKvoPdeKxxJUcr4m LAbjruwbMUNB9yyvWMZRh71OapT+1IodRvJpsyC5neBttkskewrfQXEFenN9JpF2gEmN lzm0Zad2K6AWvjrIS+RsYwAc7RkyEf+tbpC5NcXmt5QPyTghE1cwZH3aHaPRtPtthd8r KOKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=bafLLGxzRxByJVBG7vRwFnpyj42fKM5Pnwg7VF4Oo5w=; b=rBiQsJ6qwWuz7P4a3LNXUlip2meznVIKHClApGiRKGU1dW8oUFMoqBMxyW5LdL22RK sRvBcEHmpizhn8Tr3wSWsiX+33XRwa2+77VMZ3GCrKSRCmorjDTUNsT0VcZ1QCKWiYUi ZodfLkMZ8jxVAFDrUAOqCxwd0i5i1gC+JI4cNpTLEaUtRTm7zozgGvp7AQ/tGq+J+n7g DHq07JH2zBkIGLpCkyECHimT8MCf8cw3M/he8MO2ChWXJoJk/h99CufWJyNBBHbH0y/W wEXjwJJOXzqzgzyuAaus0CNr37PxOu+dVozABZENBmzkd2WJfHPe6aw1lFPRFikH7Zzi Jgiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IJYrL6KM; 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 y16si9980334pjj.80.2019.06.30.20.24.41; Sun, 30 Jun 2019 20:24:56 -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=IJYrL6KM; 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 S1727092AbfGADXp (ORCPT + 99 others); Sun, 30 Jun 2019 23:23:45 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:37221 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbfGADXp (ORCPT ); Sun, 30 Jun 2019 23:23:45 -0400 Received: by mail-qt1-f196.google.com with SMTP id y57so13163245qtk.4 for ; Sun, 30 Jun 2019 20:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=bafLLGxzRxByJVBG7vRwFnpyj42fKM5Pnwg7VF4Oo5w=; b=IJYrL6KMhAQ2gTf/9x/jTlmgJjybilb869TBwxd0iHT+NRLtXc2D4xPunWEcJJ2XW9 OcMUXGJ+3f3kxQa2WvKVwksvG0b49rj0MxaMoWelQPRxPjqXg/IX350QMd6LInDy+XUe hAucj63HrKLgbauP88cm6ONVzQ/WYLQH+5xiDPvZ0vKd4oWKMrxCzCgbdaTTeCM2i3ss 6mOX9Zn4zxwJAxqMrl4s9tCYyoRapU3WoVzHP9FyLWVY0VcMx9jV8WEcAEoUk6N50+g0 CGrSoz1CKGiPVwP6YvDgjZj769YIsrvzjAW9iv5cLW0e3xnQeUfuJtf0/EjAvARnrMFd pAkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=bafLLGxzRxByJVBG7vRwFnpyj42fKM5Pnwg7VF4Oo5w=; b=ro8dAhPp76sBunNILM0+aeOdgt9E4Vk6DCyShmoF5/zSf5otVJAMMuwwpMbQsvMA4s XkwSTYJ8JcjWvtep5wbsvxGBX1wWZUi0Dg1LQSGZ0UjhocZYTe8niCN0OaY+LHw3Ljo1 plc7H95Z88MrpfTBHspYkD7oh4hneiAIxoBJxoTTATL1OWG3CEm8xtluC79RgcQmwJvw kI2Ix6Yx6zsmigxrtmJCZ8GFCQa5RRIMWtD31a5FE21U/RnG0mtBWWQIL/wxluzzCoW9 GuoDyn+dEdAClKEVYwQi11Uy012/q+l7DKrBwgGmxvbGy+Wo7w8YOG2r2NzBn/7+fyLM vFMg== X-Gm-Message-State: APjAAAWcF5aY7UShqacEq/fJFP34EUQEcxOvb8YTrHIzVwGWa8ZglKI0 bBeRBk1Tb/lRVUGgy6kYzrQ= X-Received: by 2002:a0c:f9c1:: with SMTP id j1mr19298673qvo.235.1561951423846; Sun, 30 Jun 2019 20:23:43 -0700 (PDT) Received: from smtp.gmail.com ([187.121.151.22]) by smtp.gmail.com with ESMTPSA id l4sm4611434qtd.25.2019.06.30.20.23.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 30 Jun 2019 20:23:43 -0700 (PDT) Date: Mon, 1 Jul 2019 00:23:39 -0300 From: Rodrigo Siqueira To: Daniel Vetter , Haneen Mohammed , David Airlie , Simon Ser Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] drm/vkms: Introduce basic support for configfs Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset introduces the support for configfs in vkms by adding a primary structure for handling the vkms subsystem and exposing connectors as a use case. This series allows enabling/disabling virtual and writeback connectors on the fly. The first patch of this series reworks the initialization and cleanup code of each type of connector, with this change, the second patch adds the configfs support for vkms. It is important to highlight that this patchset depends on https://patchwork.freedesktop.org/series/61738/. After applying this series, the user can utilize these features with the following steps: 1. Load vkms without parameter modprobe vkms 2. Mount a configfs filesystem mount -t configfs none /mnt/ After that, the vkms subsystem will look like this: vkms/ |__connectors |__Virtual |__ enable The connectors directories have information related to connectors, and as can be seen, the virtual connector is enabled by default. Inside a connector directory (e.g., Virtual) has an attribute named ‘enable’ which is used to enable and disable the target connector. For example, the Virtual connector has the enable attribute set to 1. If the user wants to enable the writeback connector it is required to use the mkdir command, as follows: cd /mnt/vkms/connectors mkdir Writeback After the above command, the writeback connector will be enabled, and the user could see the following tree: vkms/ |__connectors |__Virtual | |__ enable |__Writeback |__ enable If the user wants to remove the writeback connector, it is required to use the command rmdir, for example rmdir Writeback Another way to enable and disable a connector it is by using the enable attribute, for example, we can disable the Virtual connector with: echo 0 > /mnt/vkms/connectors/Virtual/enable And enable it again with: echo 1 > /mnt/vkms/connectors/Virtual/enable It is important to highlight that configfs 'obey' the parameters used during the vkms load and does not allow users to remove a connector directory if it was load via module parameter. For example: modprobe vkms enable_writeback=1 vkms/ |__connectors |__Virtual | |__ enable |__Writeback |__ enable If the user tries to remove the Writeback connector with “rmdir Writeback”, the operation will be not permitted because the Writeback connector was loaded with the modules. However, the user may disable the writeback connector with: echo 0 > /mnt/vkms/connectors/Writeback/enable Rodrigo Siqueira (2): drm/vkms: Add enable/disable functions per connector drm/vkms: Introduce configfs for enabling/disabling connectors drivers/gpu/drm/vkms/Makefile | 3 +- drivers/gpu/drm/vkms/vkms_configfs.c | 229 ++++++++++++++++++++++++++ drivers/gpu/drm/vkms/vkms_drv.c | 6 + drivers/gpu/drm/vkms/vkms_drv.h | 17 ++ drivers/gpu/drm/vkms/vkms_output.c | 84 ++++++---- drivers/gpu/drm/vkms/vkms_writeback.c | 31 +++- 6 files changed, 332 insertions(+), 38 deletions(-) create mode 100644 drivers/gpu/drm/vkms/vkms_configfs.c -- 2.21.0 -- Rodrigo Siqueira https://siqueira.tech