From patchwork Tue Jul 11 13:38:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 9834713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9740A60363 for ; Tue, 11 Jul 2017 13:38:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88A3F25EA6 for ; Tue, 11 Jul 2017 13:38:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CF5B283BB; Tue, 11 Jul 2017 13:38:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F82125EA6 for ; Tue, 11 Jul 2017 13:38:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932469AbdGKNif (ORCPT ); Tue, 11 Jul 2017 09:38:35 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33964 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932229AbdGKNie (ORCPT ); Tue, 11 Jul 2017 09:38:34 -0400 Received: by mail-qk0-f194.google.com with SMTP id q66so6539701qki.1; Tue, 11 Jul 2017 06:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K/J2xJnZQGvhVANWUSNkhwOBuEbkyu+qsS8FNihdsiA=; b=h+Kga0K8fXOOPf+TGbU9j9Yi+eZYcLciEaDnWNlSJs2EiOECkLzk/s6HLnKaBz7kcf Cod07Cgq9eUQFDnGJpUd0OnAG4jz1OK8hMLUB8yjgLYfwWslk00KDypsbNG5lNjFRrM0 j2sx3O1uwPccUSueWUO5F7j3SnJRgdOqUM7iI6goHPd+njNZ2FmRetW65lg3Xc7TwFaf qRZxH1Wb1rVndqpfePc3TIo1cUVBRdDf9sZsd7uJ7GOur95biZbZYEMnviaSVtB+3S5A eQWVh4VVv+fHIkK9EXPke+S9QV5HWEH0MoYn3kPqlXOAnIiCneyN9unC2IBgRoLb0FdX yrqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K/J2xJnZQGvhVANWUSNkhwOBuEbkyu+qsS8FNihdsiA=; b=hWYOFhUWIPjLctDo/aFt9rOP9N+5OVC2hNwQhZ2esYIHhPpH01CXGSC7zVREUGUbBy cc7u2200CDJGhGQ4UDFc/JmmDCjWDMlAF0+bd36AKzHbB41Hgdp3OsCG34iACTCmnM38 T2lcfhACf1PnrTzkhZezzmmyk3n3dt/QCAtbp9NDpZOBBTMXyMIPaquzWqfzBgpTypGe mcvxlBwhRzT/GKx6Spw1FuB8+4c3p8pgXmr14NX1Iq3/sJOPbYAWhGMOe/qqnB/WSSfR 5KuwW+sRiZZdFIkuNb1VUPeP1UV/uyuCol8AQjV63axVwBLqQ1Wu9o4aZg8CBemQ5QMc Plog== X-Gm-Message-State: AIVw111T9NdVj2IZxwx3EE0tZciBIbLP/O/mFKmqc2kD0OCx13sfx682 1e+YjMVDr96erA== X-Received: by 10.237.32.70 with SMTP id 64mr10499730qta.218.1499780313588; Tue, 11 Jul 2017 06:38:33 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id v34sm11307906qtg.31.2017.07.11.06.38.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 06:38:32 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, Archit Taneja , Bartlomiej Zolnierkiewicz , Rob Clark Subject: [PATCH 1/3] drm/msm: kick out firmware framebuffer Date: Tue, 11 Jul 2017 09:38:20 -0400 Message-Id: <20170711133822.31978-2-robdclark@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170711133822.31978-1-robdclark@gmail.com> References: <20170711133822.31978-1-robdclark@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes a problem with console not appearing when booting with EFI that has GOP support, because fb0 would end up being efifb, even after drm has taken over the display. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_drv.c | 20 ++++++++++++++++++++ drivers/gpu/drm/msm/msm_drv.h | 2 ++ drivers/gpu/drm/msm/msm_fbdev.c | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index f49f6ac5585c..f487437fb9d0 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -286,6 +286,24 @@ static int get_mdp_ver(struct platform_device *pdev) #include +static void kick_out_firmware_fb(void) +{ + struct apertures_struct *ap; + + ap = alloc_apertures(1); + if (!ap) + return; + + /* Since msm is a UMA device, the simplefb or efifb node may + * have been located anywhere in memory. + */ + ap->ranges[0].base = 0; + ap->ranges[0].size = MAX_RESOURCE; + + drm_fb_helper_remove_conflicting_framebuffers(ap, FB_NAME, false); + kfree(ap); +} + static int msm_init_vram(struct drm_device *dev) { struct msm_drm_private *priv = dev->dev_private; @@ -416,6 +434,8 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) if (ret) goto fail; + kick_out_firmware_fb(); + msm_gem_shrinker_init(ddev); switch (get_mdp_ver(pdev)) { diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index e5d8cadfdb75..e69c029b428c 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -55,6 +55,8 @@ struct msm_fence_cb; struct msm_gem_address_space; struct msm_gem_vma; +#define FB_NAME "msm" + struct msm_file_private { /* currently we don't do anything useful with this.. but when * per-context address spaces are supported we'd keep track of diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index 5ecf4ff9a059..794265225cda 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -146,7 +146,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, fbi->flags = FBINFO_DEFAULT; fbi->fbops = &msm_fb_ops; - strcpy(fbi->fix.id, "msm"); + strcpy(fbi->fix.id, FB_NAME); drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth); drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);