[{"id":1766042,"web_url":"http://patchwork.ozlabs.org/comment/1766042/","msgid":"<ccea6f96-4658-b25a-a8ba-2959815318e3@au1.ibm.com>","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":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrFWk6Fbyz9sBd\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 11 Sep 2017 14:37:06 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xrFWk5LXmzDrb8\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 11 Sep 2017 14:37:06 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xrFVV4srfzDrZh\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon, 11 Sep 2017 14:36:02 +1000 (AEST)","from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8B4YAa7077366\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 11 Sep 2017 00:35:59 -0400","from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cwd14dk4a-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 11 Sep 2017 00:35:58 -0400","from localhost\n\tby e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<andrew.donnellan@au1.ibm.com>; Mon, 11 Sep 2017 14:35:56 +1000","from d23relay06.au.ibm.com (202.81.31.225)\n\tby e23smtp06.au.ibm.com (202.81.31.212) 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 d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv8B4Zrfr43384972\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 11 Sep 2017 14:35:53 +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\tv8B4ZiYB014296\n\tfor <linuxppc-dev@lists.ozlabs.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)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=au1.ibm.com\n\t(client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=andrew.donnellan@au1.ibm.com; receiver=<UNKNOWN>)","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","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-0040-0000-0000-000003559B5A","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17091104-0041-0000-0000-00000CD5C068","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","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"lorenzo.pieralisi@arm.com, gabriele.paoloni@huawei.com,\n\tard.biesheuvel@linaro.org, airlied@linux.ie, catalin.marinas@arm.com, \n\twill.deacon@arm.com, dri-devel@lists.freedesktop.org,\n\tz.liuxinliang@hisilicon.com, alex.williamson@redhat.com,\n\tlukas@wunner.de, \n\thelgaas@kernel.org, zourongrong@gmail.com, daniel.vetter@intel.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]