From patchwork Fri Jul 7 08:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13304571 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 53750C0015E for ; Fri, 7 Jul 2023 08:35:03 +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:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=CoS7rVO6O95MTFkwJo4hUJz5aYgzeAw9kzp4vDpiKV4=; b=igSKIIlBNKPCD7 VzUyCZqDWWET45eH2EUaX1LHhNFCbYQ8aPWiEkIAl7pStyz4XcXoSOkwn6Iu3SL9HnFc6DC9scP74 ty14k458XIU6VEYFKi8q/00rKzvj61vfhF0HyZ+FuPJywGr/kOFueQliAvIHB+uDahuUdODJTQgJ3 7vevUGEkiRQAYL8hUuht+BESIblz3R+53uLa1czwS8duShA4V2gKxiC6I1JkVEbJC42jJkJ8nygLl eDGnWJ5citNEjo8sgkYzkoWudGXW1/336dtNiaCILVEWxTatizhqsVFIKq+2Z2P/9VnRsSBxfMFNM TqJ/Nd6zSE6el3G6AIFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHgvA-0040O4-1m; Fri, 07 Jul 2023 08:34:32 +0000 Received: from smtp-out1.suse.de ([2001:67c:2178:6::1c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHgv6-0040KY-30 for linux-arm-kernel@lists.infradead.org; Fri, 07 Jul 2023 08:34:30 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7989C227B0; Fri, 7 Jul 2023 08:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Pvfj/OY6eCHI5adzX5a09+e+OBxPRPHmLMKqJIGthDI=; b=1GFi3pIGlBjSZkCD/VYvTY5TMcveaTo2LhruYtHhaMYNkMV8bjN6ZvuZScTeBSuIj1N951 S3p7n9wct/WmCXVSVsJwYTbsHbMY7Ph3loJvwC9HKAfMc99osCFJJ0uLMtoDdTQAxL57JT Kgy4uydqkc5Ah9uaFHeNHY9ziHw1P8c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Pvfj/OY6eCHI5adzX5a09+e+OBxPRPHmLMKqJIGthDI=; b=3ZFfdrcNBnX0QGiMOP/uCo/tK0c3jzRLvVLQMdkCfhlkjQGhUmk/NQ1hsItKS5pHpbvyme 02tuatFhYQSDuQCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4697B1346D; Fri, 7 Jul 2023 08:34:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0qwgEBLOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:26 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v3 00/12] drm: Improve fbdev emulation for DMA-able framebuffers Date: Fri, 7 Jul 2023 10:31:51 +0200 Message-ID: <20230707083422.18691-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_013429_137451_D4A0AF01 X-CRM114-Status: GOOD ( 11.18 ) 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 Add fbdev helpers for framebuffers in DMA-able memory and update fbdev emulation in the respective DRM drivers. DMA memory used to handled as system memory. Improve this and prepare for possible future changes. Patch 1 adds initializer macros for struct fb_ops and a Kconfig token for framebuffers in DMA memory. Patches 2 to 5 update fbdev-dma and tegra. No functional changes are expected as both used system memory before. Patches 6 and 7 update exynos to use DMA helpers. Exynos incorrectly used fbdev's I/O-memory helpers. Fix this. Patches 8 to 10 update omapdrm to use DMA helpers. Patch 7 first reworks the driver's mmap to current best practices. This also makes it suitable for use with fbdev, which patches 8 and 9 implement. Patchies 11 removes some fbdev macros for system memory that are now unused; patch 12 fixes some comments. The patchset would ideally go through drm-misc-next. Future patches can build upon it and update fbdev drivers in similar ways. v3: * set screen_buffer in tegra (Thierry) v2: * fix omap mmap flags * drop FBINFO_DEFAULT from patches * minor cleanups Thomas Zimmermann (12): fbdev: Add fb_ops init macros for framebuffers in DMA-able memory drm/fbdev-dma: Use fbdev DMA helpers drm/tegra: Use fbdev DMA helpers drm/tegra: Set fbdev FBINFO_VIRTFB flag drm/tegra: Store pointer to vmap'ed framebuffer in screen_buffer drm/exynos: Use fbdev DMA helpers drm/exynos: Set fbdev FBINFO_VIRTFB flag drm/omapdrm: Set VM flags in GEM-object mmap function drm/omapdrm: Use GEM mmap for fbdev emulation drm/omapdrm: Set fbdev FBINFO_VIRTFB flag fbdev: Remove FB_DEFAULT_SYS_OPS fbdev: Harmonize some comments in drivers/gpu/drm/Kconfig | 2 +- drivers/gpu/drm/drm_fbdev_dma.c | 4 ++-- drivers/gpu/drm/exynos/Kconfig | 2 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 5 ++-- drivers/gpu/drm/omapdrm/Kconfig | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 12 +--------- drivers/gpu/drm/omapdrm/omap_fbdev.c | 16 +++++++++++-- drivers/gpu/drm/omapdrm/omap_gem.c | 24 +++++-------------- drivers/gpu/drm/omapdrm/omap_gem.h | 3 --- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 7 +----- drivers/gpu/drm/tegra/Kconfig | 2 +- drivers/gpu/drm/tegra/fbdev.c | 7 +++--- drivers/video/fbdev/Kconfig | 8 +++++++ include/linux/fb.h | 29 ++++++++++------------- 14 files changed, 56 insertions(+), 67 deletions(-)