From patchwork Fri Sep 1 07:27:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 808541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.b="nNBLHNMT"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xk9nx0h62z9s81 for ; Fri, 1 Sep 2017 17:28:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751359AbdIAH2T (ORCPT ); Fri, 1 Sep 2017 03:28:19 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34393 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354AbdIAH2T (ORCPT ); Fri, 1 Sep 2017 03:28:19 -0400 Received: by mail-pg0-f68.google.com with SMTP id 63so1249431pgc.1 for ; Fri, 01 Sep 2017 00:28:18 -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; bh=UPYSRpF6pwAnbpFPJLw5aLd69/8V53O87xUWraljj+Q=; b=nNBLHNMTobPDo9sVxufPm8qwRE2HLUuMTY2ECLCEzx++Y8K0zXGXX/KUAZQIKb2LRO TQJUa19qIu5Eo8D6DTqGpklDOHr5sYNXSVSQAi5lu1nNieg2u+NylGrBFgs6Mj4JdIdn Q0oIv8ZZvPTt5FJjYKvmdKb8mfGkLd/ZzAvks= 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=UPYSRpF6pwAnbpFPJLw5aLd69/8V53O87xUWraljj+Q=; b=ArUlM2MX7/weOjKOulrRUPno7+mun/vP4KdyRMCTzcf+t1WcVuAp6+CDKI0sMsNNc3 H0Xs0lBy2GYIDfUvUId3xVZdPNEfZs8UWDvlVrczMKQVP7NnhBkcFxIv0ojnExzBf67E XSA6eRG4qrUvc/iNni7nxuEQ+mTtak0fVC/r/wTEpAFHWvJXMyD+efnTuiB5GVr9vjOZ 4w2Yid4DajmEPzhkJ6YW1mbM4gLKiDGtgoJptiMY02WvRHXjyQPfqyy6CmMl8C3KpOvH /JBqWifIeBrmgXbcm0qeD1C9LfU911gJVsNcIzFT7yq1Oixw73Eitf5+FGy/n32UihYT qZHQ== X-Gm-Message-State: AHPjjUizfnPEMV9Vt/sI4Rra0lA0uTlUAaomdzT5xYlQFf92EsUu9d62 UGIipJ8Gdt8n7PzEqRt86Q== X-Google-Smtp-Source: ADKCNb7xZROecgE8ih+swvD2Yye0PkI0bAkaPIc1zoGf6bbxbkPhjIhYS5OneLmefpJv2TR1o7pvGQ== X-Received: by 10.84.128.36 with SMTP id 33mr1319276pla.212.1504250898562; Fri, 01 Sep 2017 00:28:18 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Sep 2017 00:28:18 -0700 (PDT) From: Daniel Axtens To: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Cc: benh@kernel.crashing.org, z.liuxinliang@hisilicon.com, zourongrong@gmail.com, catalin.marinas@arm.com, will.deacon@arm.com, gabriele.paoloni@huawei.com, helgaas@kernel.org, airlied@linux.ie, daniel.vetter@intel.com, alex.williamson@redhat.com, dri-devel@lists.freedesktop.org, lukas@wunner.de, ard.biesheuvel@linaro.org, lorenzo.pieralisi@arm.com, Daniel Axtens Subject: [PATCH v3 0/3] Split default display handling out from VGA arbiter Date: Fri, 1 Sep 2017 17:27:41 +1000 Message-Id: <20170901072744.2409-1-dja@axtens.net> X-Mailer: git-send-email 2.11.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This patch set: - splits the default display handling out from VGA arbiter, into its own file and behind its own Kconfig option (and gives the functions better names). - adds extra detection of default devices. To be nominated, the vga arbiter and platform hooks must not have nominated a default. A card will then only be nominated if it has a driver attached and has IO or memory decoding enabled. - adds relevant documentation. The practical impact of this is improved X autoconfiguration on some arm64 systems. Changes in v3: - Add documentation - thanks Daniel Vetter for pointing it out. - Clarify explanations. Thanks to everyone for continuing to bear with my incomplete understanding of PCI and provide some clarity. - Split refactoring and adding functionality. Changes in v2: https://www.spinics.net/lists/linux-pci/msg64007.html Drop all the powerpc patches. [explanation snipped] v1: https://www.spinics.net/lists/linux-pci/msg63581.html Regards, Daniel Daniel Axtens (3): drm: split default display handler out of VGA arbiter drm: add fallback default device detection drm: documentation for default display device Documentation/gpu/default_display.rst | 93 +++++++++++++++++++ Documentation/gpu/index.rst | 1 + arch/ia64/pci/fixup.c | 6 +- arch/powerpc/kernel/pci-common.c | 6 +- arch/x86/pci/fixup.c | 6 +- arch/x86/video/fbdev.c | 4 +- drivers/gpu/vga/Kconfig | 12 +++ drivers/gpu/vga/Makefile | 1 + drivers/gpu/vga/default_display.c | 163 ++++++++++++++++++++++++++++++++++ drivers/gpu/vga/vga_switcheroo.c | 8 +- drivers/gpu/vga/vgaarb.c | 61 +++---------- drivers/pci/pci-sysfs.c | 4 +- include/linux/default_display.h | 44 +++++++++ include/linux/vgaarb.h | 15 ---- 14 files changed, 344 insertions(+), 80 deletions(-) create mode 100644 Documentation/gpu/default_display.rst create mode 100644 drivers/gpu/vga/default_display.c create mode 100644 include/linux/default_display.h Acked-by: Ard Biesheuvel Tested-by: Daniel Axtens # arm64, ppc64-qemu-tcg