From patchwork Fri Sep 1 07:27:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 9933685 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 5AF0660309 for ; Fri, 1 Sep 2017 07:39:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 464552858E for ; Fri, 1 Sep 2017 07:39:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B25028582; Fri, 1 Sep 2017 07:39:56 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C716B28583 for ; Fri, 1 Sep 2017 07:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VNGQ+OfWj8Zte3N/avvMr8V9FBXLSRMO79qMVeET84g=; b=XekLwZFEHoYQPyW2+BCOh5BgMU yHKK3z/twZISNlAeh3hi6SW8Zoh/rf2qXB0b7mpZfJ1k2HcBR++utgI/H0hZP6m4qKWmTFVcoV6VU /ohon/aqx2LNtbs402h9XxkkuGfmMhYZn4Cq/mcOUEnQ7RXLxjyaO6f649y38jfGSu5aM3sdg+Q4r 4bQIc3Rh1lN9xvN2hS5ZdzScxiP5Ds9ETgUzF1jDxC1+5vHfoXmWRrwKAmTLyDZhIplk4QvKR/Kj6 e5YFfp/vj1ky5qQPqqB3hfzyPlivzSDx5d5N5OQ/H2VIx7UVUrkJ5ZwhQZmaFA7rNcg9wKtD7ejuI Fm0h+ITQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dngYP-0001Ws-BR; Fri, 01 Sep 2017 07:39:49 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dngNs-0002Sr-OB for linux-arm-kernel@lists.infradead.org; Fri, 01 Sep 2017 07:29:04 +0000 Received: by mail-pf0-x244.google.com with SMTP id a2so1174997pfj.4 for ; Fri, 01 Sep 2017 00:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hKzZfZDxftC+GlONhJGQ7yGmTJlbWNbWPAwxJaUYBVc=; b=qM/nOp5FZaawNCNnWSpsG7BUzb5cBysXhQwYxANeZzLaQP/nDTmYTd4C8mq/dpOCLQ QyjwcpMwGhY6Wm7TONFXPYKBXAGZkpOz+9sExyovvb1KwBOX7g9KKjhYP3RB/2SKnzBc g4fEnZbqhdr7S5REuGwXZqeab+2RBOiQ0aL2E= 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=hKzZfZDxftC+GlONhJGQ7yGmTJlbWNbWPAwxJaUYBVc=; b=Y2iY3Zefib+gwhcUDCWB8JZAe4FMDJvAdfnMyQqD/JX24ZQwRTnWbEAtzXP7of8AUa OkB4lYN1xR39YkH9TNbDsHMhRS8ifapG/HErJOHImS4KubHlLjAg/Hq9SRR+Uk/V1jVH XcSJPHPz6xP+q5FjQDPwzFv160gB5P4HJr1z2husa6XK7IRaFDV9CvlxXwMIjwIdkZez OgZig/T+O75trV60GdqVmYmy46XOa4FOvy3VfBySL3M6rmHfk2WSMA57iTBEsjjY8Yst 8IHZLb6aqUI1t5/eErSgGBI6/BIXZeJ7RV6iPcTZ9fhM08+P9Gc3sd5lB1A+Ei9tIHSe H1tQ== X-Gm-Message-State: AHPjjUiIzq4NVsMj4Dtn988Si1EKFP+I6x5Cu59+/jtqjUSIp4sF6uj5 dy+BRXoRjXF5sfinVUasyw== X-Google-Smtp-Source: ADKCNb6SF8U4xLPhDN5082K2s+rZHv9cIgmOjvpK88ENEdDVpBCDGexEJAjpJltfhWWUboNsqrIBjQ== X-Received: by 10.84.236.79 with SMTP id h15mr1314458pln.393.1504250919790; Fri, 01 Sep 2017 00:28:39 -0700 (PDT) Received: from localhost.localdomain (124-171-202-56.dyn.iinet.net.au. [124.171.202.56]) by smtp.gmail.com with ESMTPSA id l30sm2430300pgc.61.2017.09.01.00.28.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Sep 2017 00:28:39 -0700 (PDT) From: Daniel Axtens To: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/3] drm: documentation for default display device Date: Fri, 1 Sep 2017 17:27:44 +1000 Message-Id: <20170901072744.2409-4-dja@axtens.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170901072744.2409-1-dja@axtens.net> References: <20170901072744.2409-1-dja@axtens.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170901_002857_508389_08359830 X-CRM114-Status: GOOD ( 20.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, gabriele.paoloni@huawei.com, ard.biesheuvel@linaro.org, airlied@linux.ie, benh@kernel.crashing.org, will.deacon@arm.com, dri-devel@lists.freedesktop.org, z.liuxinliang@hisilicon.com, alex.williamson@redhat.com, lukas@wunner.de, helgaas@kernel.org, catalin.marinas@arm.com, zourongrong@gmail.com, daniel.vetter@intel.com, Daniel Axtens MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We have refactored and extended this - document it. Signed-off-by: Daniel Axtens --- Documentation/gpu/default_display.rst | 93 +++++++++++++++++++++++++++++++++++ Documentation/gpu/index.rst | 1 + 2 files changed, 94 insertions(+) create mode 100644 Documentation/gpu/default_display.rst diff --git a/Documentation/gpu/default_display.rst b/Documentation/gpu/default_display.rst new file mode 100644 index 000000000000..3c190611564e --- /dev/null +++ b/Documentation/gpu/default_display.rst @@ -0,0 +1,93 @@ +======================= +Default Display Devices +======================= + +Overview +======== + +.. kernel-doc:: drivers/gpu/vga/default_display.c + :doc: overview + + +Why do we need this? +==================== + +The default device is used to set the ``boot_vga`` per-device sysfs +file, which is used by user-space. Most notably, Xorg reads this file +via libpciaccess in order to facilitate auto-configuration. + + +History +======= + +When the VGA arbiter was introduced, it would pick a default device on +boot. As the arbiter exists to arbitrate access to legacy resources, +it would only pick a card that could be accessed through legacy areas. +(See the :doc:`vgaarbiter` documentation for more.) + +The arbiter was later extended on x86 and IA64 to consider the EFI +framebuffer. + +This is all well and good if you have legacy resources or +EFI. However, some systems do not have either of those. For example, +on POWER8: [0]_ + + - There is no IO space at all + + - We configure the 32-bit MMIO window to be around 3..4G (to avoid + overlapping with DMA space below it). + +So effectively, there is no path to the legacy areas. + +This means the VGA arbiter will not pick a default device on these +platforms. So, on powerpc, a class hook was added to mark a default +device (``arch/powerpc/kernel/pci-common.c``), independent of the +arbiter. + +When this issue arose on an arm64 system, it was decided that a generic +approach would be better than more special cases. Therefore, the +default device selection was factored out, and it now operates using +the priority list described in the Overview. + +API +=== + +Public +------ + +.. kernel-doc:: drivers/gpu/vga/default_display.c + :export: + +Private +------- + +.. kernel-doc:: drivers/gpu/vga/default_display.c + :internal: + +Future Work +=========== + +There is no support for non-PCI VGA devices being marked as default. +The following comment, extracted from an earlier version of +:c:func:`pci_default_display()` might help: + + If your VGA default device is not PCI, you'll have to override this + and return NULL here. In this case, I assume it will not conflict + with any PCI card. If this is not true, I'll have to define two + archs hooks for enabling/disabling the VGA default device if that + is possible. + + This may be a problem with real _ISA_ VGA cards, in addition to a + PCI one. I don't know at this point how to deal with that card. Can + theirs IOs be disabled at all ? If not, then I suppose it's a matter + of having the proper arch hook telling us about it, so we basically + never allow anybody to succeed a ``vga_get()``... + +Currently there is also no way to support non-VGA-class PCI devices as +default display devices. + + +References +========== + +.. [0] https://www.spinics.net/lists/linux-pci/msg64142.html diff --git a/Documentation/gpu/index.rst b/Documentation/gpu/index.rst index 35d673bf9b56..8083d84f2334 100644 --- a/Documentation/gpu/index.rst +++ b/Documentation/gpu/index.rst @@ -16,6 +16,7 @@ Linux GPU Driver Developer's Guide tegra tinydrm vc4 + default_display vga-switcheroo vgaarbiter bridge/dw-hdmi