From patchwork Tue Apr 4 20:18:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 13200965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A116C77B75 for ; Tue, 4 Apr 2023 20:18:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20B4910E7AB; Tue, 4 Apr 2023 20:18:51 +0000 (UTC) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6732610E7AA for ; Tue, 4 Apr 2023 20:18:49 +0000 (UTC) Received: by mail-ed1-x52c.google.com with SMTP id t10so135337133edd.12 for ; Tue, 04 Apr 2023 13:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1680639525; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=v8jR+JhVCEnNPPxxCLey69HJ6bOpFLkEFDu5RIj5lCQ=; b=CF3IsDvY6dbEEipZWbZecaB37m03mDmQee26T2SFkUKX7uUiS6WgmAfFWdfr/xo9pg Df+9rE/8viBPRfR1w+7r9v3aj7BfD3mNTeOavSozjciQzIW/xKxSnHxT3HwL8pACaTdn +UChul2klVrq4mbeJHYKxGH7AajhXYHoTO93A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680639525; 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=v8jR+JhVCEnNPPxxCLey69HJ6bOpFLkEFDu5RIj5lCQ=; b=RUnurQDBIoeaQLoMwU+rR2ugXj/ZZAaMuA34Ym2L5rRXMTFRBHl/5XbitJaMWU1dOM KW8w3E2vIPAXbWO3PqroGPC2yBgyGruHpmHFlji2bBnMFND7f+27aha9RxdrDUodLq4n /F84Ma/IJorbWZJ8GcW97kRZh2SdQefyhnDnWYjdgJ7UEFBElsQvE5z4lVED0CdCXqrX hQYD8TYlWiqtTcdDQEToKvXBi+EpK5M6GQJY0enZoWRWZ+H3BkLf0sjpTWJ35gX7i3Fo Z8OT2p6YgJsUrijiLl3uUzLT2el4V5CAKf2TaKZRTw2+ZK2W71qRznkVpOt9/hrCVmUv cabw== X-Gm-Message-State: AAQBX9cyXu6sPGPMzXhN+qagCUG3YZUILda16JVp2IhK8aNNuktzTCBZ qlonVsH7+URbcw0aaqSkUJBXTw== X-Google-Smtp-Source: AKy350bsqIb6bhwWYVrLpFa0mQtIxSkLSapSGL/+ogxl2OMRYOXLKUNNTNqVQMeVfYdPtm9a3hx8Sg== X-Received: by 2002:a05:6402:35cb:b0:502:c397:adc8 with SMTP id z11-20020a05640235cb00b00502c397adc8mr1534431edc.1.1680639525501; Tue, 04 Apr 2023 13:18:45 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-33.fiber7.init7.net. [212.51.149.33]) by smtp.gmail.com with ESMTPSA id u12-20020a50c04c000000b004d8d2735251sm6367986edd.43.2023.04.04.13.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 13:18:45 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Tue, 4 Apr 2023 22:18:35 +0200 Message-Id: <20230404201842.567344-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/8] drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Javier Martinez Canillas , Thomas Zimmermann , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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. v2: Unfortunately the framebuffer sits outside of the pci bars for gma500, and so only using the pci helpers won't be enough. Otoh if we only use non-pci helper, then we don't get the vga handling, and subsequent refactoring to untangle these special cases won't work. It's not pretty, but the simplest fix (since gma500 really is the only quirky pci driver like this we have) is to just have both calls. Signed-off-by: Daniel Vetter Cc: Patrik Jakobsson Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/gma500/psb_drv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 2ce96b1b9c74..f1e0eed8fea4 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -422,12 +422,17 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* * We cannot yet easily find the framebuffer's location in memory. So - * remove all framebuffers here. + * remove all framebuffers here. Note that we still want the pci special + * handling to kick out vgacon. * * 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_framebuffers(false, &driver); + if (ret) + return ret; + + ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver); if (ret) return ret;