From patchwork Wed Jan 11 15:41:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42056 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391220wrt; Wed, 11 Jan 2023 07:42:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXtcGjEKlFBQhJov/Uvgaxh9AnQ1jjuklcdud6wTWZTl/v54W/8dINHe5sVLDiAjKudQVgU1 X-Received: by 2002:a05:6a20:2d06:b0:ad:e5e8:cfe8 with SMTP id g6-20020a056a202d0600b000ade5e8cfe8mr90655902pzl.48.1673451721316; Wed, 11 Jan 2023 07:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451721; cv=none; d=google.com; s=arc-20160816; b=Y4nU4yxUekKFgXNE/CrvXcj4oKHMutcfqYYyPmRAr52bqq9g39mg9oITsYhYTSkUeQ XLGMxUOx3UG58Es5L/BvCnzwfff3Z9dhTIbwV0Gzinpac2t3IU7g1LVYt/cQ8kL74Sn3 QPxERDU5Zunqqn1SgOhTS5m1bYWoGcZgIM8A74+X09PzeHbCzlkirUN2udG/EgGRyawf LBeUaUsCCPqPYo32zPDAefFl/AwdvyJT0E6BYyG0RUV19GUGMZf+AAjlzfceqOhIa/GK YEk7arxA8WjF2Dez4gPSMlwxUx8kWuDVxVi/BznFDE22Q+NVJa4qtT6rm0N2auLvSHls ffGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OGvydfcnswB5kCTr6pgmQFxcgFjCL3fOh+5DF0n/kHQ=; b=jaTE9rZq0aN42PT3ojec6qVgmR2ITG25ktvhuvL52gHpnFl1mZnSETinnvlAg3ralO UjjhRcxAx+4g276PfJMM8kCG6HjwoVuXraKxkRBQplcnSRXV1PZ5Qu8q8VaX8e8Nc2yr BlX22NHU2MneOKGDQaC7VVIp6yKDdrammBdhlcl+xxRrk+izVjzmsxjLAe68n3ce6owR cpOSvpS5k4NqK4K9h1/UXcw/TJaCeOvvqXEAizDgnkch6aPYStisntQP9Bvs4nVN2cHz HXCSd/Hp57cI2w8zLQI5xXRDf37MEtTZuVUyQ+fXUIhPGRqhe0DxBvszbdD1p9SyCNIu JEsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=MlaP4iz9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a6568c7000000b00477dfb6bcffsi15082452pgt.679.2023.01.11.07.41.48; Wed, 11 Jan 2023 07:42:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=MlaP4iz9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235478AbjAKPld (ORCPT + 99 others); Wed, 11 Jan 2023 10:41:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbjAKPlZ (ORCPT ); Wed, 11 Jan 2023 10:41:25 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7A4E2E0 for ; Wed, 11 Jan 2023 07:41:22 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id ay12-20020a05600c1e0c00b003d9ea12bafcso9268933wmb.3 for ; Wed, 11 Jan 2023 07:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OGvydfcnswB5kCTr6pgmQFxcgFjCL3fOh+5DF0n/kHQ=; b=MlaP4iz9T5QOEdEs7QRCj0LRht0gbuOE12jC5lqdYaja6OmWEu3x44yTN6+eBPdseA ZRP3gRxjIwfx/RvbvL1abOvvxn4IUBTB76ngU0gOrbj6czdukqRxbFjuguKcKlCvBiAi OIRDopYxEw1xY1T5KE6yRdOqY5ob94mIqBzMI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OGvydfcnswB5kCTr6pgmQFxcgFjCL3fOh+5DF0n/kHQ=; b=VZpzVkbw0UJ2Obb5M9//zNIWwT6UwblykdmmFXPv+f3kprKGisgHsKiLan0UvOA9IS IMqZToQKAyEWfxzTDQ0LCNZpzuZxTtDpkdKVboswpG6vMfIcpfUdJt8EMKn0KqpXwjN3 zNCvmJEKEdrfaM81OIE/SzwffJ82Aevc/BddzyE7NNN1GpY9LPJNzRO/AKP8WiY9kb6Z wlfRDG7OJM8YJHdgzZ7bajPfMXgwwUjjnO3fP+bsQ7BrN1XtlMgNHJgZTzmT+epBqqFy BSzD8M/iVPbHAomKYYuObDRnL2uPPuYYh6hFWa315d+YVBZJqz8Y/dXza8vk2UM/LXzB ngXw== X-Gm-Message-State: AFqh2koeVV7R/higXKXrhRMjwsHGIQW4vqv/BTcSopRzCJ9QYD/LTvyj Hge2Ritdi6IQMVESBf+NTd8r0A== X-Received: by 2002:a05:600c:3482:b0:3d3:4f56:62e1 with SMTP id a2-20020a05600c348200b003d34f5662e1mr51193693wmq.27.1673451681375; Wed, 11 Jan 2023 07:41:21 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:20 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Dave Airlie , Thomas Zimmermann , Javier Martinez Canillas , Helge Deller , linux-fbdev@vger.kernel.org Subject: [PATCH 01/11] drm/ast: Use drm_aperture_remove_conflicting_pci_framebuffers Date: Wed, 11 Jan 2023 16:41:02 +0100 Message-Id: <20230111154112.90575-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741312170334522?= X-GMAIL-MSGID: =?utf-8?q?1754741312170334522?= It's just open coded and matches. Note that Thomas said that his version apparently failed for some reason, but hey maybe we should try again. Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Tested-by: Thomas Zimmmermann Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/ast/ast_drv.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index 420fc75c240e..3ac24a780f50 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -90,27 +90,13 @@ static const struct pci_device_id ast_pciidlist[] = { MODULE_DEVICE_TABLE(pci, ast_pciidlist); -static int ast_remove_conflicting_framebuffers(struct pci_dev *pdev) -{ - bool primary = false; - resource_size_t base, size; - - base = pci_resource_start(pdev, 0); - size = pci_resource_len(pdev, 0); -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; -#endif - - return drm_aperture_remove_conflicting_framebuffers(base, size, primary, &ast_driver); -} - static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct ast_private *ast; struct drm_device *dev; int ret; - ret = ast_remove_conflicting_framebuffers(pdev); + ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &ast_driver); if (ret) return ret; From patchwork Wed Jan 11 15:41:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391238wrt; Wed, 11 Jan 2023 07:42:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXup3fpPQv/FxGdlk5BgMYLj9GfH2Dsq7PLu8OCs97Vil5XN56N3vu1zbqXIQgkbhzT/bHrd X-Received: by 2002:a05:6a00:e8d:b0:580:c223:90e9 with SMTP id bo13-20020a056a000e8d00b00580c22390e9mr63287472pfb.6.1673451723649; Wed, 11 Jan 2023 07:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451723; cv=none; d=google.com; s=arc-20160816; b=xGClk9aDobd+MaoGo6LpoHkWPxLxmOvRoNlYHBtDGCdvzjlPp2z/gmEUVeuP2fVfDN HjNW9HqBb1pssYvHog3T6eaf6XFWhghXd6efISv3a5miR3rtQ49UUEVp/h60t9L1ui46 7xj8kf0wtfyhlp32Ehtd0wHJvgP+6/goyJRL28rltYsnZpOSUAOR19lIAD3VxGpsEk1P kH9+OiHzuJDNvfRGSHJi+2pD9g+41tAUH6jnIMShMjcMaEPfmpFqntAWyx6TYwm51Dgr VuUefLSdcHWvuiRNIxauaV0LTPtpmoKViftprQNWEwJtkjwSgOKvQMi7fbj1JYT4Os/Y cknQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=94eajVQl3EIphKCpXXhL7CnxhOfjsXCJp+mdLyrDZk0=; b=WKRC5Fos0D4T02WhvwkldFxjwzWS8K7c5uXocYOn+nr+oNiVATsF2f2+/L2RNNadUp Po/6pcd+PNmcFf7tF10OvGTYkzLnwoDXNBpkSmlWaNBYH4LOgcyDqIh64lVQd+7YH3rx m7okPeflOUC6CrotKEg6v+iHSbsA8RVyM41ArNP9+zphnb7vqyW00DLdTZ2iUp+EUPL+ tQA3xoISZN8i60HfR16iNLsWwWyD1uTQPKk3i4SNU7cWp45n38JOVMSlL6vCgwxXjm4x mHJ3rsnhJFiTikbhsOAKBzr9uPongYJxct+hCtRcRihUhgt0RuGhimsUky4+hQiKhNfk fc0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=f7KHQ8uU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t36-20020a056a0013a400b0056e4c95266bsi16632576pfg.77.2023.01.11.07.41.51; Wed, 11 Jan 2023 07:42:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=f7KHQ8uU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235623AbjAKPli (ORCPT + 99 others); Wed, 11 Jan 2023 10:41:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233853AbjAKPlZ (ORCPT ); Wed, 11 Jan 2023 10:41:25 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 045F429C for ; Wed, 11 Jan 2023 07:41:24 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id l26so11383590wme.5 for ; Wed, 11 Jan 2023 07:41:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=94eajVQl3EIphKCpXXhL7CnxhOfjsXCJp+mdLyrDZk0=; b=f7KHQ8uU7yo7cC1q+hRAYyai9jdEOJCO8tU1UcHPeDOQzr3zT9mcNDiHKbkAh9YMdi PcqaMKKeizVMG9LtdqmhoiqGGOE/2lkXWI8gQheuKM7IeiU6H+0SevQsiVwVjpCuYqMs pIc2/KEnN2fQGSipr275BOLjvkdqRmvXH0z6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=94eajVQl3EIphKCpXXhL7CnxhOfjsXCJp+mdLyrDZk0=; b=pWSYNCmnT2PI6rz+iStjSFdkcZD/nGkGqb7i0pEXX6tc7aZZkB3XTZyunEyCwg9e0Z TSAc0WU5W8ehj2Ubxf9/hLNMTlf/p25r3AB5a4XEmsyJFtndZUBD4/iaFo90tZlAXZgN VtTA2hte6ZOsWC2xjcRKh2wPxUhnResaoOfjL3g1G+5HjpJdtML9cGw3XtdIARFM57Qv GNi+U8Kq4hRfc+fwBpODFYCxL9qr9ZCqS+vj0T/k134uVu/IME2XuuWx4Xy42nJD85jU 1Nb4jM6i/np5Id3Ia4OeSGBsXDn1TH4sjwvtv8HMeNURlwW+yBr8dRytOe0+fYOE6Fj1 qJgw== X-Gm-Message-State: AFqh2krUZFqAbnOjbQ1BIv8eUa3JXaTnFs9iyC39HSdYUmf2pZnjNGdJ 9JfZrDqmPrpKzZhf58KW6Es9sA== X-Received: by 2002:a05:600c:4e4f:b0:3cf:9d32:db67 with SMTP id e15-20020a05600c4e4f00b003cf9d32db67mr52259243wmq.3.1673451682597; Wed, 11 Jan 2023 07:41:22 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:21 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter Subject: [PATCH 02/11] drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers Date: Wed, 11 Jan 2023 16:41:03 +0100 Message-Id: <20230111154112.90575-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741314330059432?= X-GMAIL-MSGID: =?utf-8?q?1754741314330059432?= This one nukes all framebuffers, which is a bit much. In reality gma500 is igpu and never shipped with anything discrete, so there should not be any difference. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/gma500/psb_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index cd9c73f5a64a..9b0daf90dc50 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -429,7 +429,7 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) * TODO: Refactor psb_driver_load() to map vdc_reg earlier. Then we * might be able to read the framebuffer range from the device. */ - ret = drm_aperture_remove_framebuffers(true, &driver); + ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver); if (ret) return ret; From patchwork Wed Jan 11 15:41:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391271wrt; Wed, 11 Jan 2023 07:42:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXutEnXjAHvdiAdoOFMqRCgIrtxkxxqH5+yoCfQsDsIq5J2wxmue14Kr3k+iENxG7lOMlpX2 X-Received: by 2002:a17:903:28e:b0:192:a470:c6d with SMTP id j14-20020a170903028e00b00192a4700c6dmr48394026plr.41.1673451726831; Wed, 11 Jan 2023 07:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451726; cv=none; d=google.com; s=arc-20160816; b=nAcqJD91lTDd3TCxCqoz69zGkcw7bjeuqjK6jxyBhaTkgc7iNBC6SVvT8PyB7BafPS kvF6HrSj+tY9awgO4vdL9v1rLdsVenA3+FTCWzYSn2fOWyqw+j0zYWADXso+51kq6Z9R bHtgkScNk9KTZlAF0rppRqXY7LhHsLhPxxbD8d3fsNkzBZcTY4fQD6Fw4ADPYKRATS6D Zpnc4U7zaZtpGQ0QZc7352Eq3EOLh8MoJgugRrlnpycD66Pt82efg/gpgcMdHc886yZm 1rpysFgwgu8beHgi+FqFgrutS5riG1Hsgh/XUPf64CLQyseg1Vx6Kty8pwGCUUTVMpny e0RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fiMQ8+piQ8nAgiaXcZRE7LWfuFHPuL/LU3O06mzJvSM=; b=RntvmfqGfrZBtty1jUk5FqI3/HjF5vVYn4mLjIFJqnukxAKNHL9dw/MIhc7hup+tdp mJfFv5YDqnX6xCcBd48T6fjmeGQvNcuSJkIWKuPSRiFUCvJSvvLKbKvT9JvFsoTgz2zW /heOv5fxW8++X0uDu6f0yHmRUBQTkK5l46CWwdevpSqM2vEuYDmxGeZpvkJBZ6VbAEGO KQau3HS667lKAyQcZjk5KkRoO99z+tEmi6jD51xKtYzNotKpi9lK/OY1cGrIoTNO6MAA WaJFOxfA05e89tI5kOxoQUq5NMEQZpvV7IsUm84RTP9AvXa8vtDnRWQRaQBZmKv4AFqv vyfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Iqzt7IQv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a1709029a4200b00189906d63bdsi13191841plv.7.2023.01.11.07.41.52; Wed, 11 Jan 2023 07:42:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Iqzt7IQv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238706AbjAKPlq (ORCPT + 99 others); Wed, 11 Jan 2023 10:41:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233587AbjAKPl1 (ORCPT ); Wed, 11 Jan 2023 10:41:27 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4514BA1 for ; Wed, 11 Jan 2023 07:41:25 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so12977700wms.2 for ; Wed, 11 Jan 2023 07:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fiMQ8+piQ8nAgiaXcZRE7LWfuFHPuL/LU3O06mzJvSM=; b=Iqzt7IQv9xkXzUobpL7j4FC6H3jn7vKZFofcLajEyVyyq/l3TjSTkDPJ7LQPaPPDVt DntP9I7yBTDr40b9uovHZl3T7CjuutDn8i98wswT9A6TAH/6BuhCaihmhopNbBlY+BL0 AFmkupIYCR64BDSjc1bNduosHCeaOjzn2kdCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fiMQ8+piQ8nAgiaXcZRE7LWfuFHPuL/LU3O06mzJvSM=; b=4D/3nWbERxwcbWoG7AP9GEXEkKFMT3CmDZmlNrc0BkssYwZbqz5DE+aPE8cjoC/2ya Oj8VieaxYcbw7vNmAFYUF8WsjX/Hx0pMgndJwkCf73iHcx5StrCr26gWitr72ztNBELY xr9n6ULS2HdJShuikk1a8jM5HpOEROYcXeam+pPAAojQt85oncK22uy8os+QBbxGWYfH ukD+QjCgmDMcfjb8yaKqYseR/k4/f3GBl2rjr8W0N9KCqQVYG0QCc2379+WUVdS60t0Q x19BHul8l6Ri8J33u4bBp6mNwLx3TCrb+f2BoTzZBvk5CkGYj9f/ioc44Wm7Qlb6LE7X VLmQ== X-Gm-Message-State: AFqh2ko0nJOlWJiERzY+KRRfSqGfdVWO2JCc+Amf/1OTw1XF2kMx35dP HngXLcPGV8Pj9/DntY9/OA6G4A== X-Received: by 2002:a05:600c:4496:b0:3d3:47b7:569e with SMTP id e22-20020a05600c449600b003d347b7569emr51728355wmo.2.1673451684207; Wed, 11 Jan 2023 07:41:24 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:23 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Thomas Zimmermann , Javier Martinez Canillas , Maarten Lankhorst , Maxime Ripard , Deepak Rawat , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Thierry Reding , Jonathan Hunter , Emma Anholt , Helge Deller , David Airlie , Daniel Vetter , linux-hyperv@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: [PATCH 03/11] drm/aperture: Remove primary argument Date: Wed, 11 Jan 2023 16:41:04 +0100 Message-Id: <20230111154112.90575-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741317771174362?= X-GMAIL-MSGID: =?utf-8?q?1754741317771174362?= Only really pci devices have a business setting this - it's for figuring out whether the legacy vga stuff should be nuked too. And with the preceeding two patches those are all using the pci version of this. Which means for all other callers primary == false and we can remove it now. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Deepak Rawat Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: Thierry Reding Cc: Jonathan Hunter Cc: Emma Anholt Cc: Helge Deller Cc: David Airlie Cc: Daniel Vetter Cc: linux-hyperv@vger.kernel.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-tegra@vger.kernel.org Cc: linux-fbdev@vger.kernel.org --- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/armada/armada_drv.c | 2 +- drivers/gpu/drm/drm_aperture.c | 11 +++-------- drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 1 - drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 +- drivers/gpu/drm/stm/drv.c | 2 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +- drivers/gpu/drm/tegra/drm.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 2 +- include/drm/drm_aperture.h | 7 +++---- 12 files changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 7043d1c9ed8f..98267e355918 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -297,7 +297,7 @@ static int hdlcd_drm_bind(struct device *dev) */ if (hdlcd_read(hdlcd, HDLCD_REG_COMMAND)) { hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0); - drm_aperture_remove_framebuffers(false, &hdlcd_driver); + drm_aperture_remove_framebuffers(&hdlcd_driver); } drm_mode_config_reset(drm); diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 0643887800b4..c99ec7078301 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -95,7 +95,7 @@ static int armada_drm_bind(struct device *dev) } /* Remove early framebuffers */ - ret = drm_aperture_remove_framebuffers(false, &armada_drm_driver); + ret = drm_aperture_remove_framebuffers(&armada_drm_driver); if (ret) { dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n", __func__, ret); diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_aperture.c index 3b8fdeeafd53..697cffbfd603 100644 --- a/drivers/gpu/drm/drm_aperture.c +++ b/drivers/gpu/drm/drm_aperture.c @@ -32,17 +32,13 @@ * * static int remove_conflicting_framebuffers(struct pci_dev *pdev) * { - * bool primary = false; * resource_size_t base, size; * int ret; * * base = pci_resource_start(pdev, 0); * size = pci_resource_len(pdev, 0); - * #ifdef CONFIG_X86 - * primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; - * #endif * - * return drm_aperture_remove_conflicting_framebuffers(base, size, primary, + * return drm_aperture_remove_conflicting_framebuffers(base, size, * &example_driver); * } * @@ -161,7 +157,6 @@ EXPORT_SYMBOL(devm_aperture_acquire_from_firmware); * drm_aperture_remove_conflicting_framebuffers - remove existing framebuffers in the given range * @base: the aperture's base address in physical memory * @size: aperture size in bytes - * @primary: also kick vga16fb if present * @req_driver: requesting DRM driver * * This function removes graphics device drivers which use the memory range described by @@ -171,9 +166,9 @@ EXPORT_SYMBOL(devm_aperture_acquire_from_firmware); * 0 on success, or a negative errno code otherwise */ int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size, - bool primary, const struct drm_driver *req_driver) + const struct drm_driver *req_driver) { - return aperture_remove_conflicting_devices(base, size, primary, req_driver->name); + return aperture_remove_conflicting_devices(base, size, false, req_driver->name); } EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers); diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c index 427c20ba3404..7e81d58c083f 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c @@ -74,7 +74,6 @@ static int hyperv_setup_vram(struct hyperv_drm_device *hv, drm_aperture_remove_conflicting_framebuffers(screen_info.lfb_base, screen_info.lfb_size, - false, &hyperv_driver); hv->fb_size = (unsigned long)hv->mmio_megabytes * 1024 * 1024; diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 79bfe3938d3c..c8d39809d897 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -285,7 +285,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) * Remove early framebuffers (ie. simplefb). The framebuffer can be * located anywhere in RAM */ - ret = drm_aperture_remove_framebuffers(false, &meson_driver); + ret = drm_aperture_remove_framebuffers(&meson_driver); if (ret) goto free_drm; diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index 31e1e30cb52a..84dfbccb6912 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -155,7 +155,7 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev) } /* the fw fb could be anywhere in memory */ - ret = drm_aperture_remove_framebuffers(false, dev->driver); + ret = drm_aperture_remove_framebuffers(dev->driver); if (ret) goto fini; diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 6e0788d14c10..d97f2edc646b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -140,7 +140,7 @@ static int rockchip_drm_bind(struct device *dev) int ret; /* Remove existing drivers that may own the framebuffer memory. */ - ret = drm_aperture_remove_framebuffers(false, &rockchip_drm_driver); + ret = drm_aperture_remove_framebuffers(&rockchip_drm_driver); if (ret) { DRM_DEV_ERROR(dev, "Failed to remove existing framebuffers - %d.\n", diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 50410bd99dfe..354349c6e085 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -185,7 +185,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) DRM_DEBUG("%s\n", __func__); - ret = drm_aperture_remove_framebuffers(false, &drv_driver); + ret = drm_aperture_remove_framebuffers(&drv_driver); if (ret) return ret; diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index cc94efbbf2d4..6367b89cbab1 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -98,7 +98,7 @@ static int sun4i_drv_bind(struct device *dev) goto cleanup_mode_config; /* Remove early framebuffers (ie. simplefb) */ - ret = drm_aperture_remove_framebuffers(false, &sun4i_drv_driver); + ret = drm_aperture_remove_framebuffers(&sun4i_drv_driver); if (ret) goto cleanup_mode_config; diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 7bd2e65c2a16..d2ff527cf6d7 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1252,7 +1252,7 @@ static int host1x_drm_probe(struct host1x_device *dev) drm_mode_config_reset(drm); - err = drm_aperture_remove_framebuffers(false, &tegra_drm_driver); + err = drm_aperture_remove_framebuffers(&tegra_drm_driver); if (err < 0) goto hub; diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 0ccaee57fe9a..0a9e922636b1 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -350,7 +350,7 @@ static int vc4_drm_bind(struct device *dev) return -EPROBE_DEFER; } - ret = drm_aperture_remove_framebuffers(false, driver); + ret = drm_aperture_remove_framebuffers(driver); if (ret) return ret; diff --git a/include/drm/drm_aperture.h b/include/drm/drm_aperture.h index 7096703c3949..cbe33b49fd5d 100644 --- a/include/drm/drm_aperture.h +++ b/include/drm/drm_aperture.h @@ -13,14 +13,13 @@ int devm_aperture_acquire_from_firmware(struct drm_device *dev, resource_size_t resource_size_t size); int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size, - bool primary, const struct drm_driver *req_driver); + const struct drm_driver *req_driver); int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const struct drm_driver *req_driver); /** * drm_aperture_remove_framebuffers - remove all existing framebuffers - * @primary: also kick vga16fb if present * @req_driver: requesting DRM driver * * This function removes all graphics device drivers. Use this function on systems @@ -30,9 +29,9 @@ int drm_aperture_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, * 0 on success, or a negative errno code otherwise */ static inline int -drm_aperture_remove_framebuffers(bool primary, const struct drm_driver *req_driver) +drm_aperture_remove_framebuffers(const struct drm_driver *req_driver) { - return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1, primary, + return drm_aperture_remove_conflicting_framebuffers(0, (resource_size_t)-1, req_driver); } From patchwork Wed Jan 11 15:41:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391511wrt; Wed, 11 Jan 2023 07:42:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXtXgeIsLEpxLRrKjn8t+agicWRMJowqogZdXav8xzq74P2++G6v3AJMcQj2qq0jH2Zc/oyv X-Received: by 2002:a05:6a20:4391:b0:ad:f68e:bc with SMTP id i17-20020a056a20439100b000adf68e00bcmr87925474pzl.40.1673451756968; Wed, 11 Jan 2023 07:42:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451756; cv=none; d=google.com; s=arc-20160816; b=v2roUV0+JctHq9TDJYdlJEVvVtObJbKIaEKOiKJrPS5M01xls3RGhOkmB+A/YNhbX1 JwRQyqR7DlxMguGg0DtywDkvI0fb+gGANZLoQonXyNbmMA8hSotSWHuzrdVRSjQHCZGE +JCbYTi0BGdbmGExlp7eVYL2AMnZGR6rmkoF+7V680Fg0TS4TKN/uh5/EYf4/7D1Ji0g 4fcppwUZfkGqXlE+cJEmGtQmJxwxIjIc/CaHKWBo2DfiT7MNtsIi8/c9aqe1b2K4daMu 5veoSq8Sbb1sRdLSDTRtFOXcKnNnEdJP/3iMGILvgeEDeXgPFp4PQaNrxVyHayuG6UhN HT8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3apArcl7OMNeWOL87XhRmEIILQii5IFqm3oMsEY2uTQ=; b=vFH3BXokip74cdXfNXe2MdIIFtlQMi2ZDJx7G9eAzfmh5PVuHLaLO+TrUnAze0f+tJ xmGEUMYaz0eTGuhLvBex3pTr97XfkDe9VpLoOCzndXzs0Bet2OdhgsXgfFhdnM72r3HJ ZBWA+qUJBbvrGxH4haMttyfZngEkbzgSEix6skOLFfQpYtuC3udIeHhzxKYZtenJzN+m HdBrW9AANIycK2b29CIoya/mn38qRYD4h7pCt5fBPvF069MeO8n6PXOIo2eCJWi4gFET HyRddArH6Xj2ioADUTaB5XTr0WB+sPC3WvFW1O6P6892ry77DEXmeBwdK2xQWemiL4FW H9gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=TWS3RJUG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w69-20020a638248000000b004928a5abf68si9764007pgd.876.2023.01.11.07.42.23; Wed, 11 Jan 2023 07:42:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=TWS3RJUG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239150AbjAKPmK (ORCPT + 99 others); Wed, 11 Jan 2023 10:42:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234727AbjAKPl2 (ORCPT ); Wed, 11 Jan 2023 10:41:28 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2863FBEE for ; Wed, 11 Jan 2023 07:41:27 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id z5so14398545wrt.6 for ; Wed, 11 Jan 2023 07:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3apArcl7OMNeWOL87XhRmEIILQii5IFqm3oMsEY2uTQ=; b=TWS3RJUGnec7HJ8IdThWihyacAzGTfgOMMVKgAJ3sP5gvHzb6Hv2fQ8yYcj9IsnVVA o219u3LYZ8uCnmmEdWK9E++vy2du8AWTGfafd+vHo4u8SlnZt/LoMDlKNNioYzUIuXPf TJ6xYHvwDOSOn4s2j1NLyLLyiRMiLhKLjL0bQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3apArcl7OMNeWOL87XhRmEIILQii5IFqm3oMsEY2uTQ=; b=Hnt4RwBxY5Ck126wCW2HL/McNPH4XR+zbiTr6yICkLZ8p0UwE09bB0vhWOoBR+vlDD 528R1vwJuaoL8vHkILN6/16vQxdj1wUnavrxCbvffjFH4+E/XhTFabn9zP4Cuz7Tg4l8 i8vKPXYXjBKUWV3RtpGncMw9snkOhS9TVK08dn10W9BxgcWQuxF7k2D0gLFKeTd2evN5 YkIUWzedl4SuS+4V4/Oe/zadbCWCvjdN/Ueu2+6tbJmP8amCDSK2++9Y7p/1q3jwF5yn 3+OWrn8UfpO46AJcp5yOezslOtdSADPnz+9IjTowCqosx087BxTn9Ckif4SHuGhwGl3C mTyA== X-Gm-Message-State: AFqh2kqJn+PbVMJfskzX3djrjVYl5cbFYmNHQWV73vQWJUFjcDo+Q1xM Xnozgny3leffZbT/LARiPX6WHQ== X-Received: by 2002:a5d:664c:0:b0:281:b594:c716 with SMTP id f12-20020a5d664c000000b00281b594c716mr39704840wrw.36.1673451685621; Wed, 11 Jan 2023 07:41:25 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:24 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Thomas Zimmermann , Javier Martinez Canillas , Helge Deller , linux-fbdev@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org Subject: [PATCH 04/11] video/aperture: use generic code to figure out the vga default device Date: Wed, 11 Jan 2023 16:41:05 +0100 Message-Id: <20230111154112.90575-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741349553584804?= X-GMAIL-MSGID: =?utf-8?q?1754741349553584804?= Since vgaarb has been promoted to be a core piece of the pci subsystem we don't have to open code random guesses anymore, we actually know this in a platform agnostic way, and there's no need for an x86 specific hack. See also 1d38fe6ee6a8 ("PCI/VGA: Move vgaarb to drivers/pci") This should not result in any functional change, and the non-x86 multi-gpu pci systems are probably rare enough to not matter (I don't know of any tbh). But it's a nice cleanup, so let's do it. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org --- drivers/video/aperture.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index 41e77de1ea82..3d8c925c7365 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -324,13 +324,11 @@ EXPORT_SYMBOL(aperture_remove_conflicting_devices); */ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name) { - bool primary = false; + bool primary; resource_size_t base, size; int bar, ret; -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; -#endif + primary = pdev == vga_default_device(); for (bar = 0; bar < PCI_STD_NUM_BARS; ++bar) { if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) From patchwork Wed Jan 11 15:41:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42060 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391407wrt; Wed, 11 Jan 2023 07:42:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXuYnf18XTfiFhMWwf7PUExrLFVH24A1xlfpGUl/NTZCTJM+pkzxQX9rdXknpFu4O/iOM/tk X-Received: by 2002:a05:6402:3887:b0:496:4d2f:1b4b with SMTP id fd7-20020a056402388700b004964d2f1b4bmr17969631edb.7.1673451744410; Wed, 11 Jan 2023 07:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451744; cv=none; d=google.com; s=arc-20160816; b=LKDj2F1JlS6j5H4iCwZ5p3Xz/apwfvVGcUfIwMVc9MtxcOHYVTryZ9SA3ATguQkfze /2lhqKiOyob5evlVMDKO0x1Gi8/oBMRawoF+a1yDyNWnoMMmGzLUW3ZZhvrC8Epg5ekK cmdmHE8Fd7FKodK91MTtLcpcs6ieq2a+Q8Aw2kYpmoF9aluUe3L6sdU6KPqYhLKKVIkT CUi2WV9Xf9I2Wjo1vgBBP5Mxa6fPQVzcJe45ZY0rr0SKhQQt2rkkccPJGOyUj+oVlr1z 1dzdhbn4lxrEOOlSxcBNYz5+UG6wIAsrS/3l3bnEoW/gQXzMaOWfKBeLWvbRKFKKQL6U 0eng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tJcVjf8pDC4yO+skqSU0XKC89Tk1zxOfzlV0lRIff7c=; b=WpkvRTWJesO5UzL5H89N6DK8XubPQwoLGhd/kr5PozLEq+deZNqqP8efleUfbOaNsN SMroIo0iAlp4mZYZKgytwCmVfQkQ5mDus97tzRQkRnrYvXpt+QGv950PitN1C7f9HWii r4xcH/cxhlQZuMFhniC7wnXqkQvHdRfxhH0ltikj+kgcGFn8m+dTUVvJAcEWKBrJITAl Qy6kWYOVR+WDbVcJIU6dlFbW9/Q2NmHnAyvWPVo25bvS+6c2zjGD1T24ypvYbX++eyho YReP+m0TmoCue9wCI8BHySHKwObQ2JtCm0xmMOTLu4Q63O4SeynSP3VwxpnS2V2UylZQ R/iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=aZrY9NQH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a056402090e00b0048721e1b62csi17579149edz.613.2023.01.11.07.42.00; Wed, 11 Jan 2023 07:42:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=aZrY9NQH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238814AbjAKPlu (ORCPT + 99 others); Wed, 11 Jan 2023 10:41:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234924AbjAKPl3 (ORCPT ); Wed, 11 Jan 2023 10:41:29 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D089D43 for ; Wed, 11 Jan 2023 07:41:28 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so14682005wmb.2 for ; Wed, 11 Jan 2023 07:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tJcVjf8pDC4yO+skqSU0XKC89Tk1zxOfzlV0lRIff7c=; b=aZrY9NQHD2THbetIXlgCj7dIm+IHrmHhq7F17hc477mP1n6APHub6Ck2CJ3DzdinLT ElgTJWC47fGty6V4ACS9w2xVnnEuSz4Z9Kz+uIPLYWQdsKohf8UMi7KQUG29Hent2GEo Jqem0opQMtn8iekTGOrnsTul/w0T9hALDGZaE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tJcVjf8pDC4yO+skqSU0XKC89Tk1zxOfzlV0lRIff7c=; b=UN75pwRTYBhm9beKyiQ/H5jrUB0QjdcmojEaFLmNKnc6s5x5XwrCvflECq0J23PzTw 5vGYtU3ADpwpbtwHLCOPpcNLVad4ruPEYfFWixFkeg4Nvz+bVj/TTyNNZ7mGT6YLcToA 6xatWVeAaAkgFBewP43AWr+udLvzE4iTp22av31WVYmbDcvPvdF1eNWSAxqDvxghWViL Abiyd3sBcXPNXle5JvNXe+/b93ycE109F+TPn2+0IGqIUdBAQXJBcjcpAO29weY4GQGj K5EkBIuvPWjdPut95rNb+IUrW0n6FRSh+t+pzemFg0V5AvzW4xTPfLHD47dbvi6BbInC ILhQ== X-Gm-Message-State: AFqh2koPMJxHstywZ4M7WfYTDj2J/aomg5V80GyIsTyHEUCKt7CLMrT1 KZIeBGahfL+Y9mwd9+ByATqqpg== X-Received: by 2002:a05:600c:1d8a:b0:3d9:ebab:ccff with SMTP id p10-20020a05600c1d8a00b003d9ebabccffmr10800367wms.33.1673451687083; Wed, 11 Jan 2023 07:41:27 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:26 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Thomas Zimmermann , Javier Martinez Canillas , Helge Deller , linux-fbdev@vger.kernel.org Subject: [PATCH 05/11] video/aperture: Only kick vgacon when the pdev is decoding vga Date: Wed, 11 Jan 2023 16:41:06 +0100 Message-Id: <20230111154112.90575-5-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741336417872604?= X-GMAIL-MSGID: =?utf-8?q?1754741336417872604?= Otherwise it's bit silly, and we might throw out the driver for the screen the user is actually looking at. I haven't found a bug report for this case yet, but we did get bug reports for the analog case where we're throwing out the efifb driver. References: https://bugzilla.kernel.org/show_bug.cgi?id=216303 Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org --- drivers/video/aperture.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index 3d8c925c7365..6f351a58f6c6 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -341,6 +341,9 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na return ret; } + if (!primary) + return 0; + /* * WARNING: Apparently we must kick fbdev drivers before vgacon, * otherwise the vga fbdev driver falls over. From patchwork Wed Jan 11 15:41:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42059 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391399wrt; Wed, 11 Jan 2023 07:42:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXsOUeLAZyND3vhUYhhD3fSB2O6GT8epHke9hXctEGgYB12cMlkWn7F+X7z/B0rCNzRGQ5hc X-Received: by 2002:a05:6a00:438c:b0:582:9f43:2c7b with SMTP id bt12-20020a056a00438c00b005829f432c7bmr33672024pfb.17.1673451743558; Wed, 11 Jan 2023 07:42:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451743; cv=none; d=google.com; s=arc-20160816; b=tK4lEd/J5pBB1ghpPHDKYJJ6bKNfTpFdy3bL4Z/fE58WGkY0D4FBBHqAy4Dcg7gmCH BntwS4gynFZcMpRfA9/8VcgeqZ6GwNrT5c6MLuVmHGBp6ReRwN+PVla3EE3tItvPAUDm q6C2soIejb6RrGIoKgVP9+nEYl+p8zvBdGjJPiHS8PCYv6OdpD0cRri+HIxGSOQrqUxs yOoNLNodi+y3VT7AuHhyUWQ9oGEaajk+HNGPK499kGA7QWqAsDZSnewvZES6zNs92SxA C9293MO95++bitnLIJ33xVhVADg6/Ot8jdkD1V3R1nKaDDbHSjLlvljkhVYHVluLRGu4 tJ9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uA+tPLir+1X4c7NIGPD8fbGsyIZBKsPUjYPi9h9kAc8=; b=j2GiwhnFAlIqkI+BOtYJoqGMypCs/dup1WD6M7V8mf990PlpZAOYrQ35ZDx4IJz+1f eynQYkr2NQlrc/rKbVZCWh1dCNmR/UE5RAqm4Bd3u+bSWO5KeG2lgjfgYns21dTcoc8e P11sYIgAzY366QgaLak2EAYQaZNirQ/RUcLeM1fTT7CNbrbEmWIvHWG+Hd1mvea/sUWm w5qCLBT8JOXZx+0J7GFgm0jraHuG8Hj74P38qL3AxcmG+RQFuYcRlzRnvmi6uZja5nHQ amwH0/eeJyQGgd1Hy0TPgIVL8bNKPwaXy24vjaCWMnwRAUK5b+jo8jizFzpEI+894nOZ E3aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=eNQu3m5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a056a00150f00b00576950b449asi13416435pfu.351.2023.01.11.07.42.10; Wed, 11 Jan 2023 07:42:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=eNQu3m5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238128AbjAKPlx (ORCPT + 99 others); Wed, 11 Jan 2023 10:41:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235054AbjAKPl3 (ORCPT ); Wed, 11 Jan 2023 10:41:29 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C6B7D49 for ; Wed, 11 Jan 2023 07:41:28 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so12970581wms.4 for ; Wed, 11 Jan 2023 07:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uA+tPLir+1X4c7NIGPD8fbGsyIZBKsPUjYPi9h9kAc8=; b=eNQu3m5MBYcJ4ir7wnU2uKSOdOlTVnwwoNbl7ndwmx7pL0oaymY4tJ+VPavmH4gWu3 ctX/ciqpqll+Gi0G39VkzdIVV+zIy+55w4NRmQ48GvAAagPpdV92t11x9dtuCypNqs8x VKs1+2qNooBYEQ/WTCaaYQDd8eQZXRMv5YgkU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uA+tPLir+1X4c7NIGPD8fbGsyIZBKsPUjYPi9h9kAc8=; b=l8uxN7DnE+uvTiAP3Efp3ZBjGg5WOMuCHWUP248q2M89Zfkvht2XRqOpw7uHoxjdCs n81rPFiq6CC3O3EHpfrEt2OM2Usbwn7QCIgvJ4jESzByaLaEAs60h2rbU0dN8mKoCvA9 C0+Ecvtvzd2XiIhm8IMVVCraJs6Tn2dzct/dfDjnqx9HUrZYD3AbhGJM3Aw/KaM4CIwR XeMBsA0iAlj3/72IpN6Q9Y8T8ZI57HnBk7fyK3yNj1NxjECfXWj0IEdlPM3Np4oZlpO4 4XR4v/3WPo68o1/oKLWKMP/++69veIEOYbD1rW+QjcoUV2gTQmdDe+mirVTXJ8ZAKEyX o+wA== X-Gm-Message-State: AFqh2kq6/b4CjNx/p1TR12oQVelFvfrhZD2mvOz+OV3rJVR1gZaoqj8x dh6/uxr9LCtNd9ZODG6ePl9SuapCh3cXvR+z X-Received: by 2002:a05:600c:4f83:b0:3d2:3f55:f73f with SMTP id n3-20020a05600c4f8300b003d23f55f73fmr53421615wmq.8.1673451688237; Wed, 11 Jan 2023 07:41:28 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:27 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Sudip Mukherjee , Teddy Wang , linux-fbdev@vger.kernel.org Subject: [PATCH 06/11] staging/lynxfb: Use pci aperture helper Date: Wed, 11 Jan 2023 16:41:07 +0100 Message-Id: <20230111154112.90575-6-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741335124039727?= X-GMAIL-MSGID: =?utf-8?q?1754741335124039727?= It exists! Note that since this is an exact copy, there shouldn't be any functional difference here. Signed-off-by: Daniel Vetter Cc: Sudip Mukherjee Cc: Teddy Wang Cc: linux-fbdev@vger.kernel.org --- drivers/staging/sm750fb/sm750.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index effc7fcc3703..22ace3168723 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -989,20 +989,6 @@ static int sm750fb_framebuffer_alloc(struct sm750_dev *sm750_dev, int fbidx) return err; } -static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev) -{ - resource_size_t base = pci_resource_start(pdev, 0); - resource_size_t size = pci_resource_len(pdev, 0); - bool primary = false; - -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & - IORESOURCE_ROM_SHADOW; -#endif - - return aperture_remove_conflicting_devices(base, size, primary, "sm750_fb1"); -} - static int lynxfb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -1011,7 +997,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, int fbidx; int err; - err = lynxfb_kick_out_firmware_fb(pdev); + err = aperture_remove_conflicting_pci_devices(pdev, "sm750_fb1"); if (err) return err; From patchwork Wed Jan 11 15:41:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42061 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391438wrt; Wed, 11 Jan 2023 07:42:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsrTmFnZdZEWz9LIMfVTzxUYQg5/vjqmcYwoU7FtFGR5TZkPtKEOartj+RqR1TqkmE7hGsf X-Received: by 2002:a17:902:b192:b0:193:2d53:3fc9 with SMTP id s18-20020a170902b19200b001932d533fc9mr10514040plr.6.1673451748801; Wed, 11 Jan 2023 07:42:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451748; cv=none; d=google.com; s=arc-20160816; b=yGAVrrAQ0wUuLG8lmkcGviD2sMwwZfNBKRh0NuoVQ+2G/EstMaQ3eevIbogi/n7eND tXWrU58dpy3J2/qYYcb4VjgAIQvXyQc+2WBizkwBFedtYnKpncdBntdb+O0/AJc+5m2A TOKryjVi67LVHD7s2JCR7z4PV7e07H4BoZ/1ZpmVukogJG+GFTT3RN7HpCLCeNmKqjUN PzVu4MEEHdyeqzpYVKrbSptQwq8/h4Qldrc7kyHCJ5g5xkf7ldnw0BQoOs3TMOmlu0jI 9Pgqu1n6RsbLV4bNkybpd6QDFmMeMs0Phb0ssJl1Pf8p/QGZZbFpEnLtfhL5glZFMwAx KZhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=okH8AsNmtLn+Xev5OTCMqwCCcQgJeFP0KaGCnceKOFQ=; b=RlCEbI6UYJAjXA2BOMK2D9NRtsNlQN1pUTdM/flcpoPoiz2jtLTy1bm7Njozfnedh2 mVztNIHK4a9jMUH+Cg58MCK/7fbV86nwfvrjJoJtp6y8AvH9vbpu3Wqa4UMJ1iEW4RZ9 LRHe6DdeSojPs/uEmsRV/REvoYwrGnWOp+frrlh/bVrjMJwxy8hLobXuihX5gqI8nImB B30t0i0jRxyWgg9tkf3kBFWPJSWqX7OlXZb3jCHXEWws3w9NwY0OHjTULGXvGiMsSlNK AO9FCKZA896p54Lb82F9+L1oNRroZl/0EsBkD8l+pG4WK9gaTw7aH7I57cmox+ymJw3B c5Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=e3QgYRhA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z5-20020a170902708500b00192a2923f63si13489094plk.464.2023.01.11.07.42.13; Wed, 11 Jan 2023 07:42:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=e3QgYRhA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239000AbjAKPmD (ORCPT + 99 others); Wed, 11 Jan 2023 10:42:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235295AbjAKPlb (ORCPT ); Wed, 11 Jan 2023 10:41:31 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7BB2E0 for ; Wed, 11 Jan 2023 07:41:29 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so12970636wms.4 for ; Wed, 11 Jan 2023 07:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=okH8AsNmtLn+Xev5OTCMqwCCcQgJeFP0KaGCnceKOFQ=; b=e3QgYRhA/FauY7S29GhmvTbp6mhIVjL3kUKyk/aiNJTXGHtP9m5oMyVm5h+bchf5VB 5Ozpe8kode9PPOMtykJJWS4wCtMq4JeTqLZWhNsrNNrrwUmqJgCj6729094+1wKf7qV8 SfwbZApVC/cUEh7SexrqejM4npd5PFpvVRP4I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=okH8AsNmtLn+Xev5OTCMqwCCcQgJeFP0KaGCnceKOFQ=; b=7LxQFHcmqk3oeufFgmgwt/NoLkhG5P2Z1Hv/geOQC1W2IZ6nqzRRuq55upDtjPxuUz 2UWp5MmhzqVaZzXCgBEto1owCa+YPSJE8KF464s5OUAj+oRxbHfKyzIXyjwsVx/LqcFx k82cEI7rMgAMVvAY3uggT7/1CC7Tb8ENxaG/R4T/arf9YUou0FKNvVR/ZS1l/jXcZcRC A6zoENEwrG1zQ0acQrkSonSYpJCa5qL8krb016YgD8K25GDqu1V2TSUOhkB0vuqlDROK 52uKwjfrtuJUVcplNjrIw/6nq2KR9HuqtHhXjUYr4HfFvYUabvto0U3FnArwI/1NV5sA pE/g== X-Gm-Message-State: AFqh2koen4opR2qYhx4YAM+I3ESGoQRakEndxdtd7fm/TL1vJ1l2pQuT dbPSk0aOXTVGvh1tbbjX/dmmnw== X-Received: by 2002:a05:600c:3d05:b0:3d3:5c21:dd94 with SMTP id bh5-20020a05600c3d0500b003d35c21dd94mr54680019wmb.9.1673451689538; Wed, 11 Jan 2023 07:41:29 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:28 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Benjamin Herrenschmidt , linux-fbdev@vger.kernel.org Subject: [PATCH 07/11] fbdev/radeon: use pci aperture helpers Date: Wed, 11 Jan 2023 16:41:08 +0100 Message-Id: <20230111154112.90575-7-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741340964857508?= X-GMAIL-MSGID: =?utf-8?q?1754741340964857508?= It's not exactly the same since the open coded version doesn't set primary correctly. But that's a bugfix, so shouldn't hurt really. Signed-off-by: Daniel Vetter Cc: Benjamin Herrenschmidt Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/aty/radeon_base.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index 657064227de8..972c4bbedfa3 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -2238,14 +2238,6 @@ static const struct bin_attribute edid2_attr = { .read = radeon_show_edid2, }; -static int radeon_kick_out_firmware_fb(struct pci_dev *pdev) -{ - resource_size_t base = pci_resource_start(pdev, 0); - resource_size_t size = pci_resource_len(pdev, 0); - - return aperture_remove_conflicting_devices(base, size, false, KBUILD_MODNAME); -} - static int radeonfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -2296,7 +2288,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev, rinfo->fb_base_phys = pci_resource_start (pdev, 0); rinfo->mmio_base_phys = pci_resource_start (pdev, 2); - ret = radeon_kick_out_firmware_fb(pdev); + ret = aperture_remove_conflicting_pci_devices(pdev, KBUILD_MODNAME); if (ret) goto err_release_fb; From patchwork Wed Jan 11 15:41:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391510wrt; Wed, 11 Jan 2023 07:42:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXs2H96QugygsNikDIyhD/ry1RrenWrS9gXiJQ0kUF5335kGe+/ShsLgMPXI8uSgdQE9JulP X-Received: by 2002:aa7:9533:0:b0:585:e009:6e41 with SMTP id c19-20020aa79533000000b00585e0096e41mr13641917pfp.10.1673451756866; Wed, 11 Jan 2023 07:42:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451756; cv=none; d=google.com; s=arc-20160816; b=QOPAxSXAOLT5kqCqKoadS0DkFTmSfPjqRRuuVU5tLHVegJwlv4fRm7sdQH+mMmtwL7 sF8c2skzM2J5GtIj9xFhG30h2VIscBLG/LDjTD1AVh9WO7aurOEFvmXPuOwMpLk+luAt SpH3BuQq6gf3t1PnG6OaTsnzTVTXhFTgmebaDtKPF6sK6kPTEud5WfkfmxZ5cCBQn6XE gPwmwCYd51F5i5AzTQJqL1xgkx636Hx5tsfUin2FgvYXeYhsRd/OwClveorTPD2l6afZ uYguyTrh1gCNVmVDco1O41KIVA1CIXyg7zykFkjoveXhNKyNhIQoCwW8kuzlYkY83xdh EajA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G2sqw4liQtpNZ++ehK/ijyVQMT7dm9/yDDOGWgKM06Q=; b=PCevfdLK/CLlHBbamuOAdsqvNy1SUdOFph8XXbiXK5xx12NyPbFhpoo/nidx2PFzUu v7fFbWxzmwU45sQ4SFo53HmY8s3ZSZNi84E6iwcknn9Xa2TLJWLybLuHDEJAn8KwaWCR ENxJ4wZgIfF0OubCg+oA4Js0kMI1rFzbK6ffF3GnXePa2rivx9bL89JHVPhINT/L8ZL2 YRzfZzbsz2ZN2Rhkl5XHIMw6kuBeNhvwRxkd4hMtBUC6BNP0Ba4IC5c5HLDK6Yv61w/P RxdKPfHfO7/KxnTK/dciQdad85DFveZr0iCDZHmQ+tpucYw0zYrkC75kEYzTyB+r+Hb5 LcIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=QFSULLmM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a056a0016c400b0056ee105315fsi15398647pfc.178.2023.01.11.07.42.23; Wed, 11 Jan 2023 07:42:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=QFSULLmM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238848AbjAKPmN (ORCPT + 99 others); Wed, 11 Jan 2023 10:42:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235411AbjAKPlc (ORCPT ); Wed, 11 Jan 2023 10:41:32 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BAECB68 for ; Wed, 11 Jan 2023 07:41:31 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id i17-20020a05600c355100b003d99434b1cfso12990641wmq.1 for ; Wed, 11 Jan 2023 07:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G2sqw4liQtpNZ++ehK/ijyVQMT7dm9/yDDOGWgKM06Q=; b=QFSULLmMVFFwJ3kPRo04bI+cTmjJnjfKH40bscRWkka9KWLPADsKgemIa4JXzvMkeK v49Cp1Za1fPlLnKdgCl4jKo453bf3sIRTGpbcHpGl7KAbEP0dJP61vP0ovBnnh98zN2z 7FfdaXLc80KuSpk0fZAE3Tu5F7hg8nJd6DWYU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G2sqw4liQtpNZ++ehK/ijyVQMT7dm9/yDDOGWgKM06Q=; b=kszDzNhcddt+bderrZsdKL+RSRnDkWHHS5DqSgArFYumZ9ZiPDuy2QLOWviFAmy3po SkDlrdmBWKru4YM785QAZdsz0ZjFCe+XWyyhZQpSCnz7pyT/hXkL3lReM3IZ0O+Bp8+5 STEJ9uwqxtG4v0sNv2k0FsUAjfXcguVerth9dqBUHiXnvoJ9uGiVQqD/9vvy3qpULfwH AxGFMTNMRECYAPCo+iJRw/WypY+/+TMAtRWIIFDv4wUEtOO89wHT/Dr2B0KgqhSop6Bi oulB1cUM7VrWTV9tBDXai/8Gcub8YliaV6ciJmtpaGCGgpvtcaLjbJSo/vNGKQzj3LCK k9fQ== X-Gm-Message-State: AFqh2kr47bzTMwLotpGXMbHxeaofF6adEZkLGlC5AeIfr7A7RjRSKZ8C b+qIenVA/anTD54IDXmDb0yLb+KTB9qYiTUP X-Received: by 2002:a05:600c:54c2:b0:3d3:3c74:dbd0 with SMTP id iw2-20020a05600c54c200b003d33c74dbd0mr52401995wmb.13.1673451690779; Wed, 11 Jan 2023 07:41:30 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:30 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , linux-hyperv@vger.kernel.org Subject: [PATCH 08/11] fbdev/hyperv: use pci aperture helpers Date: Wed, 11 Jan 2023 16:41:09 +0100 Message-Id: <20230111154112.90575-8-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741349411344169?= X-GMAIL-MSGID: =?utf-8?q?1754741349411344169?= Again this just gets setting the primary parameter right, which might help in some case (but then I guess the hyperv display isn't vga compatible, I have no idea). It's more consistent for sure. Signed-off-by: Daniel Vetter Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Cc: linux-hyperv@vger.kernel.org --- drivers/video/fbdev/hyperv_fb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index fdbf02b42723..1067a64bbdf3 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -1076,9 +1076,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) info->screen_size = dio_fb_size; getmem_done: - aperture_remove_conflicting_devices(info->apertures->ranges[0].base, - info->apertures->ranges[0].size, - false, KBUILD_MODNAME); + aperture_remove_conflicting_pci_devices(pdev, KBUILD_MODNAME); if (gen2vm) { /* framebuffer is reallocated, clear screen_info to avoid misuse from kexec */ From patchwork Wed Jan 11 15:41:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391661wrt; Wed, 11 Jan 2023 07:42:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXtZFC9B+tzqDz7u2EK0viUNgXRRfIXBIEI72luXvPFDCfdQOQejnBE4V8AGCj6glf+9FDyf X-Received: by 2002:a05:6a21:33a2:b0:b5:d242:d4de with SMTP id yy34-20020a056a2133a200b000b5d242d4demr15931035pzb.58.1673451775664; Wed, 11 Jan 2023 07:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451775; cv=none; d=google.com; s=arc-20160816; b=Nu8tcIQnBWdGOpU0lS+ng2a59MhgdFbeHlRLEDlR+gPT530sGGUikVbqrUNQcjUre6 j+NYKkYBtf81KLQNCU99vAU3tF+DSRXB/KEWEWfzXQ9TYKORcNyu56oXFWvpGrBm3OHp /kIgh8TUM0ezTkDO03trPb7fRc+m/RVxRsQE9rEA80/pUqR5RMgqPBotjOFm51gvrzOm 7PcVbqw4Lw0n1mGh1kq09BLkMsH5Ya+vdTLv/sHRwyXwC4y5TzKMHqk+vXT+54JkrzH0 Z+Pn4ylAU9GtmeZuMGuucDKdtZ4lJL+lsx+toAnfOvm1AdVX9/wqUO35QV9muHGAIct/ rdGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mvSF0y9cGVydackbO4wbJNVFr06wRRTkQkIKN/PkYhQ=; b=H6vjgUHjDpl+r2zKx/m2k2TC0ycKivLOqoAQ04KM0VBRe1Y+L7oHL/7K/e9VpVzXr5 5i/jBT/lLepTc5oKfZ0tHoFW0620i8wfBTF5bXfZjm6cXvaiFU1PC6zwG9cVFoR6N2m4 uhiqTpHht0Bitc26oJqgLZUeG7/D1d3VkzuMpvB7N2aDm2b/DQ3Ut447bgTHHzqkIlw8 Gcal+ZfZ3N2RNbFaKbMcUvP7964ytr2kgzMUT7qpEzYzE4mPN6/aD7eiRwlKZu+DQrFh y6DiXsOjeDQWZkIMMvPCKAOOTCFQb9JRh8wcbqMmgZdlQlrsF/L35GIb+RHiJrFyoJAD 6pow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=DS7eOdA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a65638f000000b004a081f1ee8fsi14375535pgv.184.2023.01.11.07.42.43; Wed, 11 Jan 2023 07:42:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=DS7eOdA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239082AbjAKPmU (ORCPT + 99 others); Wed, 11 Jan 2023 10:42:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235547AbjAKPlf (ORCPT ); Wed, 11 Jan 2023 10:41:35 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77EC9B43 for ; Wed, 11 Jan 2023 07:41:33 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id ja17so11392849wmb.3 for ; Wed, 11 Jan 2023 07:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mvSF0y9cGVydackbO4wbJNVFr06wRRTkQkIKN/PkYhQ=; b=DS7eOdA9ggp4AlFEpH67KG9/Cyrzc8B52VSXtRv27As9iIaxCjD1rF7UtS4h4TapEk Quz07JxkUhXAlDX9lIGGsOfQOVMNJyvTYgSIuwpUlvI4g9njZiG5av0/RgjEXMFc/zhv JALqBUcMWnCnrHQHz+bk/xt1vMvCFmUL8DchE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mvSF0y9cGVydackbO4wbJNVFr06wRRTkQkIKN/PkYhQ=; b=MyxBbQhnvDl60atvQ0M+DIVIeZxI1jl3wJi9L0AvsFRyL+tYp2d/dXgGQsPWhCps4D b9wA4RR6D68cyHU66R8yVJ6fJ5+arOa0ep2tV4CXl2RT98nG2Nuu5qYZzpL4feXh9oh/ gLWI7IIEwcD3MbM6kMZ4jBmfwTn5NyJidU3qXXsM9qWio0H0P+RuReLa/Emd+1p9AqmH f1yqhTnOk5O1uYJZaZRz8pIkxXRIWcchU8RKiehv00Mm++WdG6CUYvulmL2ZcE2kCIGX RXlG5Zh4CmcHCOBCUznWoptcO09aCgrbM5NEvYzQ9Oy/zE1O7Kh0DH41Xxp1WGZRd8BM pn7w== X-Gm-Message-State: AFqh2krjKZrel3+y5KVZvJ+DMSVJoqp9lOrWQw3zgZixczUXRY/1kJj/ hPEkjfZ25VAX1Q1rksHB7OBbseSpmBAoXI/o X-Received: by 2002:a05:600c:3b8f:b0:3d0:85b5:33d3 with SMTP id n15-20020a05600c3b8f00b003d085b533d3mr54156813wms.16.1673451692093; Wed, 11 Jan 2023 07:41:32 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:31 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Thomas Zimmermann , Javier Martinez Canillas , Helge Deller , linux-fbdev@vger.kernel.org Subject: [PATCH 09/11] video/aperture: Move vga handling to pci function Date: Wed, 11 Jan 2023 16:41:10 +0100 Message-Id: <20230111154112.90575-9-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741369367868379?= X-GMAIL-MSGID: =?utf-8?q?1754741369367868379?= A few reasons for this: - It's really the only one where this matters. I tried looking around, and I didn't find any non-pci vga-compatible controllers for x86 (since that's the only platform where we had this until a few patches ago), where a driver participating in the aperture claim dance would interfere. - I also don't expect that any future bus anytime soon will not just look like pci towards the OS, that's been the case for like 25+ years by now for practically everything (even non non-x86). - Also it's a bit funny if we have one part of the vga removal in the pci function, and the other in the generic one. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org --- drivers/video/aperture.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index 6f351a58f6c6..03f8a5e95238 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -298,14 +298,6 @@ int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t si aperture_detach_devices(base, size); - /* - * If this is the primary adapter, there could be a VGA device - * that consumes the VGA framebuffer I/O range. Remove this device - * as well. - */ - if (primary) - aperture_detach_devices(VGA_FB_PHYS_BASE, VGA_FB_PHYS_SIZE); - return 0; } EXPORT_SYMBOL(aperture_remove_conflicting_devices); @@ -344,6 +336,13 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na if (!primary) return 0; + /* + * If this is the primary adapter, there could be a VGA device + * that consumes the VGA framebuffer I/O range. Remove this device + * as well. + */ + aperture_detach_devices(VGA_FB_PHYS_BASE, VGA_FB_PHYS_SIZE); + /* * WARNING: Apparently we must kick fbdev drivers before vgacon, * otherwise the vga fbdev driver falls over. From patchwork Wed Jan 11 15:41:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3392449wrt; Wed, 11 Jan 2023 07:44:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdzcyrF85IxUP0wUNCh9GB6LHIAzazlJ61rzmfBr4p7eRniRxa3zkA6BcKeVxjwudxdpkQ X-Received: by 2002:a17:902:6acc:b0:193:11df:670 with SMTP id i12-20020a1709026acc00b0019311df0670mr18171785plt.20.1673451881381; Wed, 11 Jan 2023 07:44:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451881; cv=none; d=google.com; s=arc-20160816; b=KJs/P0r65p7/DjK1ZqNcXgC+pzQ117kc8y9APia7swsvpevl/jzTJ9IDNJyhpcAmPY G6c5WiPRnLQD9kZEeA3xx/+/ZAgXcd508CgHGAkuIT+4T2cbfBJQ2dVjzZaRc3JmwzxI 3HHZBOk/eOa1L00btlrFoJ3bKSEjTccLFFBqJLNhzb8q0FBkiz2IsdkW00I/r1OWn61K zUnQi+lsn63F+/U4TDnh6lOEvIchdjHrN6U0lLAF8therI+A42IXf7br97NsWq99+I59 mOuL/5EnSlLoPdrKsE3jxXGdWFU1fZESm4xFsccZ3nMfyNgugyn/Bw/KklNPaTMjDoFb eo1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2dVHGsRGAtc8yC6r+7bI8QFfhEvYdoERWC1PQCrm1tw=; b=AVXtDgcm2HVROgVYl4dWI9mjhvIp1xIB2nGhDNOl/e5pVcmqONWAjHXC5A6R/7+UnC fjR95tD1EizM1rDZ2JnKf7gwWTYL1W1WL8QPTdyph91mMq8dvnYIMdBjf7fkwACzCxkI 6qMZH9ugqaCAHwgulRKzEuqosO3L7nICQnmivN9F9U7ogkJUySLTXSJOUSFo3VPLOJFx KIhO/sARVQIreCxUPxud6THyUsTwUUpw1j4DvAitJjVO700G0lSKb/dDG3X6FCLkiYoi yRjVXGg5o3et+TZtL9gI5r39sFQ11lxlb1bVWSo44dQo1p4j+tXw5CC7cvtYYz0U687i ldUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=I4+Xr0vc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170902dad000b00193f8c6a020si5706705plx.111.2023.01.11.07.44.25; Wed, 11 Jan 2023 07:44:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=I4+Xr0vc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239010AbjAKPmY (ORCPT + 99 others); Wed, 11 Jan 2023 10:42:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233689AbjAKPlf (ORCPT ); Wed, 11 Jan 2023 10:41:35 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94B39BEB for ; Wed, 11 Jan 2023 07:41:34 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id ay12-20020a05600c1e0c00b003d9ea12bafcso9269391wmb.3 for ; Wed, 11 Jan 2023 07:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2dVHGsRGAtc8yC6r+7bI8QFfhEvYdoERWC1PQCrm1tw=; b=I4+Xr0vcrHPi2zx8cnusy5qj5UkH4ZEMi/VSE9jNNkYnEsukNwrnfB9Iurz3G5dgcf 76QuwtxZbjRwvvCqspLSFHr8XB3P1q2RF2Y5eWrxoFMskwYTX1IWSdJ6WiZU1henB7u7 962tRp+8jbVpmWIs5v3fymXrn6cX2yJfS+ahs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2dVHGsRGAtc8yC6r+7bI8QFfhEvYdoERWC1PQCrm1tw=; b=STpsuExTA9T5VP8m3xWE973pmB4/kXvJAjxWDWukFWl7P1mwh/NmHua6OZt9NRFeiL ABOgLawiSIEh0I0RJyJZuymwm334ksEp4K/8QFiG0ji00fB1rF8sMaDAiJ5wd4A4QIIb SteGtxUxHKv9qM0TQuaWosUMS6KHFd4DT+jynqzq+Y8fpbETMOV/7iyju7BUm3C2xbxK m6XLXF4AGQBA1ugEA2Z1fpEzynEBCMhJqGryD7RLuagHgnDZwDE5NYHV90hvnQIq20z6 +sXm8vANpbwfxEkUm4o5vHd1l+lVbItCXYsZqFHYBeRsJK0XYutqDb+1f0fCa8H5qh8F a5Bg== X-Gm-Message-State: AFqh2koo/AdZLTZvOg3NWpsE5LMf5Q4QpfbEIzH07zSapbkFhms/uuwI O5I/ojfYXEl5ZW3hE+4hoZL9Gw== X-Received: by 2002:a05:600c:1c20:b0:3d2:2f48:9443 with SMTP id j32-20020a05600c1c2000b003d22f489443mr52172779wms.15.1673451694167; Wed, 11 Jan 2023 07:41:34 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:33 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Thomas Zimmermann , Javier Martinez Canillas , Helge Deller , linux-fbdev@vger.kernel.org Subject: [PATCH 10/11] video/aperture: Drop primary argument Date: Wed, 11 Jan 2023 16:41:11 +0100 Message-Id: <20230111154112.90575-10-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741479579441172?= X-GMAIL-MSGID: =?utf-8?q?1754741479579441172?= With the preceeding patches it's become defunct. Also I'm about to add a different boolean argument, so it's better to keep the confusion down to the absolute minimum. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org --- drivers/gpu/drm/drm_aperture.c | 2 +- drivers/video/aperture.c | 7 +++---- include/linux/aperture.h | 9 ++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_aperture.c index 697cffbfd603..5729f3bb4398 100644 --- a/drivers/gpu/drm/drm_aperture.c +++ b/drivers/gpu/drm/drm_aperture.c @@ -168,7 +168,7 @@ EXPORT_SYMBOL(devm_aperture_acquire_from_firmware); int drm_aperture_remove_conflicting_framebuffers(resource_size_t base, resource_size_t size, const struct drm_driver *req_driver) { - return aperture_remove_conflicting_devices(base, size, false, req_driver->name); + return aperture_remove_conflicting_devices(base, size, req_driver->name); } EXPORT_SYMBOL(drm_aperture_remove_conflicting_framebuffers); diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index 03f8a5e95238..ba565515480d 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -43,7 +43,7 @@ * base = mem->start; * size = resource_size(mem); * - * ret = aperture_remove_conflicting_devices(base, size, false, "example"); + * ret = aperture_remove_conflicting_devices(base, size, "example"); * if (ret) * return ret; * @@ -274,7 +274,6 @@ static void aperture_detach_devices(resource_size_t base, resource_size_t size) * aperture_remove_conflicting_devices - remove devices in the given range * @base: the aperture's base address in physical memory * @size: aperture size in bytes - * @primary: also kick vga16fb if present; only relevant for VGA devices * @name: a descriptive name of the requesting driver * * This function removes devices that own apertures within @base and @size. @@ -283,7 +282,7 @@ static void aperture_detach_devices(resource_size_t base, resource_size_t size) * 0 on success, or a negative errno code otherwise */ int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size, - bool primary, const char *name) + const char *name) { /* * If a driver asked to unregister a platform device registered by @@ -328,7 +327,7 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na base = pci_resource_start(pdev, bar); size = pci_resource_len(pdev, bar); - ret = aperture_remove_conflicting_devices(base, size, primary, name); + ret = aperture_remove_conflicting_devices(base, size, name); if (ret) return ret; } diff --git a/include/linux/aperture.h b/include/linux/aperture.h index 442f15a57cad..7248727753be 100644 --- a/include/linux/aperture.h +++ b/include/linux/aperture.h @@ -14,7 +14,7 @@ int devm_aperture_acquire_for_platform_device(struct platform_device *pdev, resource_size_t size); int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size, - bool primary, const char *name); + const char *name); int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name); #else @@ -26,7 +26,7 @@ static inline int devm_aperture_acquire_for_platform_device(struct platform_devi } static inline int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size, - bool primary, const char *name) + const char *name) { return 0; } @@ -39,7 +39,6 @@ static inline int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, /** * aperture_remove_all_conflicting_devices - remove all existing framebuffers - * @primary: also kick vga16fb if present; only relevant for VGA devices * @name: a descriptive name of the requesting driver * * This function removes all graphics device drivers. Use this function on systems @@ -48,9 +47,9 @@ static inline int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, * Returns: * 0 on success, or a negative errno code otherwise */ -static inline int aperture_remove_all_conflicting_devices(bool primary, const char *name) +static inline int aperture_remove_all_conflicting_devices(const char *name) { - return aperture_remove_conflicting_devices(0, (resource_size_t)-1, primary, name); + return aperture_remove_conflicting_devices(0, (resource_size_t)-1, name); } #endif From patchwork Wed Jan 11 15:41:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 42064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3391547wrt; Wed, 11 Jan 2023 07:42:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXugJ/KXYnBJsxOZ8scY6j79iDnl8Ts0WIQ/LvldWkFOA43RdWDKRXfZjWbgq50SKuh6vLOc X-Received: by 2002:a62:1c8d:0:b0:58a:541a:8b6f with SMTP id c135-20020a621c8d000000b0058a541a8b6fmr6613470pfc.10.1673451760182; Wed, 11 Jan 2023 07:42:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673451760; cv=none; d=google.com; s=arc-20160816; b=STdgemqpxy2yDcg8KUYhnevx1GJad6GXFWbjz6O1a83xolNHsOpc3jP01zP5RW3Mgu 34f8EUgKLu7ecObyvOJC99Zplni/srO9nAwfRILW2gd3/C27fZskTphMV96rRCbN9DhX NJ3NVDG1ScvC4SKTAdz3fem88eYokv2STi/5g1ejEcP6XUy1aPK3umqGinRwaasV2jJD LA+HvqAQM6q1a2IKEykTbmSsOZKBEI7ru4bt1P3WuEBPRfQtk4XLeO7CoVsq/Jh0Fwpa 7CW6ynClN4/+aRS5hggUJlEKd7Nd60dLNnAc5JojZJgepWBixy3d+N+Z/SIqsIn3pxid oUVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6J5rucn+hYvg3m1RRrffzZkT45tj6msLk6PzkRA+oVc=; b=1JeEgNy2IadIdSKODjp34kzDeRkW7xsYeZ36KIL5Wy7bVPIq/g3HGuQvm0ZQyA4339 obVENutUdZxZlQ8TsFBDWIG0lwWo8MnkczBkWXz5VONYNW9lywGQKE5QiWMtINBRZQVo KCgNqg0TdHRcL7aCYNlstIvdEPTlI4aw2sZfznMumBw36aQ89eGZX9vZsqT9miDUf8qO Jj5gtFmC1E6H7gSumvwBsilm0WzE2Htvq1YGarVECeEZRCagn0Lc/JybVsoujYwmLeWo qpvJr0vX7jwTjafSbplTKxo+JnhK77yTe+pKZGpmgDjUBFkK19SzXOerVYNCnAu+fDXd e/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=UVhq2xNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a056a001a0d00b00572899f993fsi15209582pfv.306.2023.01.11.07.42.26; Wed, 11 Jan 2023 07:42:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=UVhq2xNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238964AbjAKPmS (ORCPT + 99 others); Wed, 11 Jan 2023 10:42:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235423AbjAKPlg (ORCPT ); Wed, 11 Jan 2023 10:41:36 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7846386 for ; Wed, 11 Jan 2023 07:41:35 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so12978154wms.2 for ; Wed, 11 Jan 2023 07:41:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6J5rucn+hYvg3m1RRrffzZkT45tj6msLk6PzkRA+oVc=; b=UVhq2xNFtKTEbVePhTQcD+DkCgbC/RTrE0C4YZitCzyqe4S737uZqLY3u5UyA5WYdh DU1EQp1fcY/CsFWajQS4me7Fr87/4MjvTP/R0kLn9HFvOw1ZaYON/UzLgbPfAX349II2 SzM9iGgw+0+m+eT166Z18NC4dIm8W4gJUqyaU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6J5rucn+hYvg3m1RRrffzZkT45tj6msLk6PzkRA+oVc=; b=AjnX5vl7+29NXfQNtNLambGNx4ECgIuyYHcD+FysVvNS75UDnd+/SruV3FFTfk2p/d ofbP/xNpWeHHkwmgrEvCdT8tRng5O5LLevmjZIJBlXhNioMw4oGsVMyjH+rBByfCc+lR 1xDqcqW4jVKIycLITED/9vFg3jj0uVBLKiPOWfPupxYxsRem6VKUgQDSk+g0PcZYz+jK QqCxgytW2RMqZU3FpKVPbx5JCuawV40R3/xy+4vEPLcCpslUW8ij8Sm9qys5Y5Ii9zpb 6t09AbTwY7sjRuhVp4jxKKbfF8d3AvPpbszilyXhtKgSelIiMo3x4qiFSEMYAKa0WiGa lUXQ== X-Gm-Message-State: AFqh2krb4oFAHFum8itpv3Y/49iLqv6oUIYCVdvMr1n8wh8ZHXsnFCjk vJf9gg5Kzxf36trf0tlzOuunEA== X-Received: by 2002:a05:600c:3b8f:b0:3d0:480b:ac53 with SMTP id n15-20020a05600c3b8f00b003d0480bac53mr55362290wms.12.1673451695486; Wed, 11 Jan 2023 07:41:35 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm15936149wmq.9.2023.01.11.07.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 07:41:34 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Daniel Vetter , Aaron Plattner , Javier Martinez Canillas , Thomas Zimmermann , Helge Deller , Sam Ravnborg , Alex Deucher , stable@vger.kernel.org Subject: [PATCH 11/11] video/aperture: Only remove sysfb on the default vga pci device Date: Wed, 11 Jan 2023 16:41:12 +0100 Message-Id: <20230111154112.90575-11-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230111154112.90575-1-daniel.vetter@ffwll.ch> References: <20230111154112.90575-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754741352906225885?= X-GMAIL-MSGID: =?utf-8?q?1754741352906225885?= This fixes a regression introduced by ee7a69aa38d8 ("fbdev: Disable sysfb device registration when removing conflicting FBs"), where we remove the sysfb when loading a driver for an unrelated pci device, resulting in the user loosing their efifb console or similar. Note that in practice this only is a problem with the nvidia blob, because that's the only gpu driver people might install which does not come with an fbdev driver of it's own. For everyone else the real gpu driver will restor a working console. Also note that in the referenced bug there's confusion that this same bug also happens on amdgpu. But that was just another amdgpu specific regression, which just happened to happen at roughly the same time and with the same user-observable symptons. That bug is fixed now, see https://bugzilla.kernel.org/show_bug.cgi?id=216331#c15 For the above reasons the cc: stable is just notionally, this patch will need a backport and that's up to nvidia if they care enough. References: https://bugzilla.kernel.org/show_bug.cgi?id=216303#c28 Signed-off-by: Daniel Vetter Cc: Aaron Plattner Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Cc: Helge Deller Cc: Sam Ravnborg Cc: Alex Deucher Cc: # v5.19+ (if someone else does the backport) Reviewed-by: Javier Martinez Canillas Tested-by: Aaron Plattner --- drivers/video/aperture.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index ba565515480d..a1821d369bb1 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -321,15 +321,16 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na primary = pdev == vga_default_device(); + if (primary) + sysfb_disable(); + for (bar = 0; bar < PCI_STD_NUM_BARS; ++bar) { if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) continue; base = pci_resource_start(pdev, bar); size = pci_resource_len(pdev, bar); - ret = aperture_remove_conflicting_devices(base, size, name); - if (ret) - return ret; + aperture_detach_devices(base, size); } if (!primary)