[{"id":1766040,"web_url":"http://patchwork.ozlabs.org/comment/1766040/","msgid":"<ccea6f96-4658-b25a-a8ba-2959815318e3@au1.ibm.com>","list_archive_url":null,"date":"2017-09-11T04:35:51","subject":"Re: [PATCH v3 2/3] drm: add fallback default device detection","submitter":{"id":66955,"url":"http://patchwork.ozlabs.org/api/people/66955/","name":"Andrew Donnellan","email":"andrew.donnellan@au1.ibm.com"},"content":"On 01/09/17 17:27, Daniel Axtens wrote:\n> The VGA arbiter selects a default VGA device that is enabled and\n> reachable via the legacy VGA resources (mem 0xa0000-0xbffff, io\n> 0x3b0-0x3bb, io 0x3c0-0x3df, etc).\n> \n> (As a special case for x86 and IA64, this can be overridden by\n> EFI.)\n> \n> If there is no such device, e.g., because there's no enabled VGA\n> device, the host bridge doesn't support access to those legacy\n> resources, or a PCI-PCI bridge doesn't have VGA Enable set, a\n> platform may select an arbitrary device by calling\n> pci_set_default_display(). powerpc does this, for example.\n> \n> If there is also no platform hook, there will be no default\n> device nominated. This is not necessarily what we want.\n> \n> Add handling for devices that aren't handled by the vga arbiter or\n> platform by adding a late initcall and a class enable hook. If there\n> is no default from vgaarb or the platform then the first VGA card\n> that is enabled, has a driver bound, and can decode memory or I/O\n> will be marked as default.\n> \n> This means single-card setups on systems without access to legacy\n> areas and without arch hooks will work. Multi-card setups on these\n> systems will nominate an arbitrary device, rather than no devices.\n> \n> Signed-off-by: Daniel Axtens <dja@axtens.net>\n> \n> ---\n> \n> v3:\n> \n> Split out from re-organisation for simplicity.\n> Add better description and better documentaion.\n> \n> Thanks to (in no particular order), Daniel Vetter, Lorenzo Pieralisi,\n> Ard Biesheuvel and Dave Airlie. Special thanks to Ben Herrenschmidt\n> and Bjorn Helgass, whose prose I have borrowed.\n> \n> v1:\n> \n> Tested on:\n>   - x86_64 laptop\n>   - arm64 D05 board with hibmc card\n>   - qemu powerpc with tcg and bochs std-vga\n> \n> I know this adds another config option and that's a bit sad, but\n> we can't include it unconditionally as it depends on PCI.\n> Suggestions welcome.\n\nTested on our iMac G5, the fallback handler doesn't fire (which should \nbe correct).\n\nTested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>\n\n> +static void vga_default_enable_hook(struct pci_dev *pdev)\n> +{\n> +       if (!vga_default_active)\n> +\t       return;\n> +\n> +       if (pci_default_display())\n> +               return;\n> +\n> +       vga_default_try_device(pdev);\n> +}\n> +DECLARE_PCI_FIXUP_CLASS_ENABLE(PCI_ANY_ID, PCI_ANY_ID,\n> +\t\t\t       PCI_CLASS_DISPLAY_VGA, 8,\n> +\t\t\t       vga_default_enable_hook)\n> \n\nLooks like you have some spaces/tabs inconsistencies here.","headers":{"Return-Path":"<linux-pci-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-pci-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xrFVf5vcvz9sBd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 14:36:10 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751270AbdIKEgG (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tMon, 11 Sep 2017 00:36:06 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36748 \"EHLO\n\tmx0a-001b2d01.pphosted.com\" rhost-flags-OK-OK-OK-FAIL)\n\tby vger.kernel.org with ESMTP id S1751318AbdIKEf7 (ORCPT\n\t<rfc822; linux-pci@vger.kernel.org>); Mon, 11 Sep 2017 00:35:59 -0400","from pps.filterd (m0098419.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8B4YCe1029157\n\tfor <linux-pci@vger.kernel.org>; Mon, 11 Sep 2017 00:35:59 -0400","from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cw40ppmqm-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linux-pci@vger.kernel.org>; Mon, 11 Sep 2017 00:35:58 -0400","from localhost\n\tby e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linux-pci@vger.kernel.org> from <andrew.donnellan@au1.ibm.com>; \n\tMon, 11 Sep 2017 14:35:56 +1000","from d23relay10.au.ibm.com (202.81.31.229)\n\tby e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tMon, 11 Sep 2017 14:35:54 +1000","from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97])\n\tby d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv8B4Zsna41484360\n\tfor <linux-pci@vger.kernel.org>; Mon, 11 Sep 2017 14:35:54 +1000","from d23av03.au.ibm.com (localhost [127.0.0.1])\n\tby d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv8B4ZiYF014296\n\tfor <linux-pci@vger.kernel.org>; Mon, 11 Sep 2017 14:35:46 +1000","from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv8B4ZiLi014293; Mon, 11 Sep 2017 14:35:44 +1000","from [10.61.2.125] (haven.au.ibm.com [9.192.254.114])\n\t(using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits))\n\t(No client certificate requested)\n\tby ozlabs.au.ibm.com (Postfix) with ESMTPSA id A1914A0173;\n\tMon, 11 Sep 2017 14:35:51 +1000 (AEST)"],"Subject":"Re: [PATCH v3 2/3] drm: add fallback default device detection","To":"Daniel Axtens <dja@axtens.net>, linux-pci@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org","Cc":"lorenzo.pieralisi@arm.com, gabriele.paoloni@huawei.com,\n\tard.biesheuvel@linaro.org, airlied@linux.ie, will.deacon@arm.com,\n\tdri-devel@lists.freedesktop.org, z.liuxinliang@hisilicon.com,\n\talex.williamson@redhat.com, lukas@wunner.de, helgaas@kernel.org,\n\tcatalin.marinas@arm.com, zourongrong@gmail.com, daniel.vetter@intel.com","References":"<20170901072744.2409-1-dja@axtens.net>\n\t<20170901072744.2409-3-dja@axtens.net>","From":"Andrew Donnellan <andrew.donnellan@au1.ibm.com>","Date":"Mon, 11 Sep 2017 14:35:51 +1000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170901072744.2409-3-dja@axtens.net>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-AU","Content-Transfer-Encoding":"7bit","X-TM-AS-MML":"disable","x-cbid":"17091104-1617-0000-0000-000001FF519A","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17091104-1618-0000-0000-0000484D9E35","Message-Id":"<ccea6f96-4658-b25a-a8ba-2959815318e3@au1.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-11_01:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709110070","Sender":"linux-pci-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-pci.vger.kernel.org>","X-Mailing-List":"linux-pci@vger.kernel.org"}}]