From patchwork Mon Dec 6 13:47:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yannick Fertre X-Patchwork-Id: 12694892 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 378BDC433EF for ; Mon, 6 Dec 2021 13:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=VkO+7ztP9RWNA66wwCOqjzkLWWEcNYJHCUxPV7LsksA=; b=JIjN89UMuU0mZl +RMlVzfa1PLEgb6kUDruit9vxws46MM4MWUw3BakpRcHUcGYfOyjtjR5BTyzMv+xfhprl+qDC2Dp4 bZJCYnDtK+vdsVO4OBVIeJARJ2hfsIuFmtU67b5vcHhCYTkfojIB6XqCk3gtgjGeOqP2Fw+7McRPa yAY4gy7GAWEH6ebnI4lSw/5+pzdYlQt6KG4CFFCRR3dTzUNAPMX6uv7hp33eiyJ6VSkcH+4/YcAMw /k0wICrzpqvq3Tja41VjyAIcghgVReFhqO9112PZqvhqy+GDfV5MyzUJMDPWVPanb7DvfSGJCfHlE GCPIYiHDrElQkVeDaehA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muELa-0044W1-8j; Mon, 06 Dec 2021 13:48:02 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muELW-0044UV-Dp for linux-arm-kernel@lists.infradead.org; Mon, 06 Dec 2021 13:47:59 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1B6DD5o8016714; Mon, 6 Dec 2021 14:47:52 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : subject : date : message-id : mime-version : content-type; s=selector1; bh=f3nDQtMXpQcllE0coLEE7OqOqZngGgJMRjJO5GIHeeM=; b=DkVa1qcVP6Y6MswBfa4yHJJ+YA+rdPBS6Asy4cs1LRIHMxXFAo3+RS4a66ynTVYPv2xc kJNFqfVNpksh6tCw6EKPjYs94wiPFgmmjyEEx73ouGBELVZpci0MJn0dt1IVkJzNfWe2 g0DL0BS3PTaokfsWnWiHaF5XxOwCp1zwWsTMLoEkyA5K2wlnlrG7Bt6u4PGE/hiyM1br S+CPNTq0c8/HlywDJvsIVV7jQNqHRbNFqX5njq8eWvT8H2BPqjlBHUJAnmx884Jhshnc aFUyFKYN/sTbMnuChz3pp2WSCnK/8zq2+ED80y7e8+a1KuqVXPBIo7F9yL8izfl0g3T5 cg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3cseqrhsx7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 14:47:52 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EEC2210002A; Mon, 6 Dec 2021 14:47:51 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E5DDA2C38A4; Mon, 6 Dec 2021 14:47:51 +0100 (CET) Received: from localhost (10.75.127.47) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Mon, 6 Dec 2021 14:47:51 +0100 From: Yannick Fertre To: Yannick Fertre , Philippe Cornu , Raphael Gallais-Pou , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH] drm/stm: remove conflicting framebuffers Date: Mon, 6 Dec 2021 14:47:35 +0100 Message-ID: <20211206134735.13537-1-yannick.fertre@foss.st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-06_04,2021-12-06_02,2021-12-02_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_054758_779176_0E48F399 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In case of using simplefb or another conflicting framebuffer, call drm_aperture_remove_framebuffers() to remove memory allocated. Signed-off-by: Yannick Fertre Reviewed-by: Thomas Zimmermann Acked-by: Philippe Cornu --- drivers/gpu/drm/stm/drv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 222869b232ae..9f441aadf2d5 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -183,6 +184,10 @@ static int stm_drm_platform_probe(struct platform_device *pdev) DRM_DEBUG("%s\n", __func__); + ret = drm_aperture_remove_framebuffers(false, &drv_driver); + if (ret) + return ret; + dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); ddev = drm_dev_alloc(&drv_driver, dev);