From patchwork Mon May 15 09:40:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241139 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 696B6C7EE24 for ; Mon, 15 May 2023 09:41:18 +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:References:In-Reply-To: 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: List-Owner; bh=P9rpAd+GWEea9pRFGUssGn82st/1mlVvvYZBVU4iTog=; b=QoRDGKNRwZJ1IA enrDolX82keC1ixwuvZga2/6I//A4yYG5P89ZymqCaQCC8XzKs6FzZqqrvDJM2HKYqLOjfmJnMmtm jUR8sK/V/GAHAHSv871+BpILO1cThC0J2Bf5vc1cAC+fv0xm3873I3bOmwqt+TZIh2xz/huerguXR /mlqVsy3V+r0JyIqfcgbV9cuniKTiA7NAVjLtylDK/tU/Ohp/uXrks0GYOZ7Ij/lPzvZcZNgOkvlr AS56MYlIka0t8ACTBalkAcfwR0J6wKQerohBWHVOf57CRMEvkrvc0l2YzrSDtbXrtP5SHo9VB5cdz IJ2Exg7SYsjaV9SdQPmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhI-001b40-2b; Mon, 15 May 2023 09:40:52 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh5-001aut-2s for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:43 +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-out2.suse.de (Postfix) with ESMTPS id 25BC01F86B; Mon, 15 May 2023 09:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143635; 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: in-reply-to:in-reply-to:references:references; bh=qjNmepOlstSW7aI9qSdBCMAnW3SQOZjY1qN2d6uup9w=; b=I4/8bFdv/CrgdWOPjs21l1veEI2sfiqb44cRefX01+Is8VgzQ9bWx4RgpH0VPAaUBCTg9H 4RRn0nOrVVO0f1MQNuqKMvuIginfUxW88Q/u3LNP9hfoC1PIcfkvPQKDnkEpDJixRGjhxF +pn1jxYWtNQoJWzAtvZU+WXWV9Mp7W4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143635; 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: in-reply-to:in-reply-to:references:references; bh=qjNmepOlstSW7aI9qSdBCMAnW3SQOZjY1qN2d6uup9w=; b=nxm63RuI7/3RwCMoi67qgjQXDdBTMXCDgnfmcFxVusWuIzBdoY0pa+CQq/qIzy2aMW7icN ds4fQ3FzjxKHMwCA== 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 C5FCF138FE; Mon, 15 May 2023 09:40:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id cIlKLxL+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:34 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 01/12] fbdev: Add Kconfig options to select different fb_ops helpers Date: Mon, 15 May 2023 11:40:22 +0200 Message-Id: <20230515094033.2133-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024040_068593_7C84C99A X-CRM114-Status: GOOD ( 10.72 ) 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 Many fbdev drivers use the same set of fb_ops helpers. Add Kconfig options to select them at once. This will help with making DRM's fbdev emulation code more modular, but can also be used to simplify fbdev's driver configs. Signed-off-by: Thomas Zimmermann --- drivers/video/fbdev/Kconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 485e8c35d5c6..d5ca66f10d1c 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -158,6 +158,27 @@ config FB_DEFERRED_IO bool depends on FB +config FB_IO_HELPERS + bool + depends on FB + select FB_CFB_COPYAREA + select FB_CFB_FILLRECT + select FB_CFB_IMAGEBLIT + +config FB_SYS_HELPERS + bool + depends on FB + select FB_SYS_COPYAREA + select FB_SYS_FILLRECT + select FB_SYS_FOPS + select FB_SYS_IMAGEBLIT + +config FB_SYS_HELPERS_DEFERRED + bool + depends on FB + select FB_DEFERRED_IO + select FB_SYS_HELPER + config FB_HECUBA tristate depends on FB From patchwork Mon May 15 09:40:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241138 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 385BEC7EE2E for ; Mon, 15 May 2023 09:41:15 +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:References:In-Reply-To: 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: List-Owner; bh=ELI6Dw1Z4Y9KSxX2FjEZI8AHMSKwtoVAd9n6HQyFqRI=; b=Gd258hs81jQbOO un452lcfuA3wAvgQXJXEcf6GqznWavSD7zKCCkRqShlNsIMaCSAc7Ql1151n597+XuRVmnpd1mX07 YcC3gwb5zPyLuPs9zbMi3nMlFkO+UXa+4BdJu/960MX6DKn3C++ZpfBSJmPh+RvcB1gvo/vig5Tnz qGLD1YcI2LbX1wNph0LlwKNGo6+i/HaxybNGFNhsV6Wqu53ad9Oz83KAFT1SeCVDjuN3Ulp+QrXAd FqznYUFe0+qPmCJiIonwKqZe1jn8uT/8+vvmunDzOhth8LAX/c9yw+b4fViuNk6jz/8h+Cvwg7rzV FivHIZqKg9nDv6jezkqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhG-001b24-22; Mon, 15 May 2023 09:40:50 +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 1pyUh5-001aus-1F for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:41 +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 7D7C121C83; Mon, 15 May 2023 09:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143635; 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: in-reply-to:in-reply-to:references:references; bh=Ky/T9sxQFkFg9mWm114fhNRWHvZEHyZCwJPgXOmx12g=; b=xRldKZuG3ETyIhlqhiq2IMoiqXzmVrM58gW/7ooohmjOgVsMgfqHGh0uqvfY9lUXwc2YKR U4QEGRafBq7rnks2azjW5U6azcb6l3T9clpn0RoE+2XWoYvgX8NxD6seGXB6d0ToHemQHV sN1+r6+D9h64ggq5AzydOy99po38XLs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143635; 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: in-reply-to:in-reply-to:references:references; bh=Ky/T9sxQFkFg9mWm114fhNRWHvZEHyZCwJPgXOmx12g=; b=ObX6EUWyXD5+4ZOBGJ0Gxylxgf/ZNiPdpzXhB6ZG158H5Xm0eNfs5y3TtDdbMRr9+1uZdw IXvnmQztR38+KnBQ== 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 2B8DC13466; Mon, 15 May 2023 09:40:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KMlVCRP+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:35 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Russell King Subject: [PATCH v2 02/12] drm/armada: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:23 +0200 Message-Id: <20230515094033.2133-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024039_575657_38B88FC8 X-CRM114-Status: GOOD ( 14.75 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Armada does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Cc: Russell King --- drivers/gpu/drm/armada/Kconfig | 1 + drivers/gpu/drm/armada/armada_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/armada/Kconfig b/drivers/gpu/drm/armada/Kconfig index f5c66d89ba99..5afade25e217 100644 --- a/drivers/gpu/drm/armada/Kconfig +++ b/drivers/gpu/drm/armada/Kconfig @@ -3,6 +3,7 @@ config DRM_ARMADA tristate "DRM support for Marvell Armada SoCs" depends on DRM && HAVE_CLK && ARM && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION help Support the "LCD" controllers found on the Marvell Armada 510 devices. There are two controllers on the device, each controller diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index 0a5fd1aa86eb..6c3bbaf53569 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -34,11 +35,9 @@ static void armada_fbdev_fb_destroy(struct fb_info *info) static const struct fb_ops armada_fb_ops = { .owner = THIS_MODULE, DRM_FB_HELPER_DEFAULT_OPS, - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, .fb_destroy = armada_fbdev_fb_destroy, }; From patchwork Mon May 15 09:40:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241144 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 28FBAC7EE22 for ; Mon, 15 May 2023 09:41:37 +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:References:In-Reply-To: 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: List-Owner; bh=WEgIOYiZwR4M2PMxyDmpngUjdL2cLLBpRQd+MFI0utE=; b=ZZcUxpgfoU2bbJ F9+k+xLoOxIaWWX2e7WNlpluqENctRtdIueMysmvejnF/dWd64wozQq5qx/PVKQ4M4tiOAYk08zmK YnEW0H536CYYiWiSacgrcUD0Czu+ubejaRwrrej0R7GlnreQ1F0JqfPmxagDWlXuPfXMaYYSF30m+ NrHE2/U2fDpOqqTlW0qFQVFlhtULmGada7ZiqMqOPbLTU16YlRRBpJaSenGv2+uVG57nX0Ml5V8dc lXBEgwERGuPPrXltxfm+bxEu+xnEIKzlWmzuo0GN6gX9HDPqsJh18o2bnoyb/7LEIHsSaJ7q6hMGb Jdf4iEsPoWicUQ/yxsww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhf-001bM0-0a; Mon, 15 May 2023 09:41:15 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh5-001auq-2L for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:43 +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 EB05A21C6D; Mon, 15 May 2023 09:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143635; 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: in-reply-to:in-reply-to:references:references; bh=6dy0eF5lWZgRJEM3nbj3bPtTSabwf6prvzqYRXIqg+Y=; b=agXmesnJyvI6MXIMbqk21l7iPigPa5EQ6kWNnOO0GA77PEJz1fAlXIwt9+FFZ1x1hoJD90 gyX5+iKYM83zbGuX/DXQyOddRnkWt8gW2QyvJYnsn7VVMOFMx/AsHxklZRCwT9U07Yd7D8 hEKdW9hIhqN/IHBOvNTJYs+DtHYC+6Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143635; 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: in-reply-to:in-reply-to:references:references; bh=6dy0eF5lWZgRJEM3nbj3bPtTSabwf6prvzqYRXIqg+Y=; b=4O9jI6Urs3Hz4gySSt9DeYTMdG5ieAqyMXezNuq8i5JidgfaAYoAySZyeEFSxEZ+9oNvLZ R5VdVd5XhgDPUWBg== 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 832CA138FE; Mon, 15 May 2023 09:40:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id APcCHxP+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:35 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Subject: [PATCH v2 03/12] drm/exynos: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:24 +0200 Message-Id: <20230515094033.2133-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024039_928744_F3860E8B X-CRM114-Status: GOOD ( 14.58 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Exynos does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar --- drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/Makefile | 2 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 0cb92d651ff1..7ca7e1dab52c 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -7,6 +7,7 @@ config DRM_EXYNOS select DRM_DISPLAY_HELPER if DRM_EXYNOS_DP select DRM_KMS_HELPER select VIDEOMODE_HELPERS + select FB_IO_HELPERS if DRM_FBDEV_EMULATION select SND_SOC_HDMI_CODEC if SND_SOC help Choose this option if you have a Samsung SoC Exynos chipset. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 2fd2f3ee4fcf..233a66036584 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -6,7 +6,6 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fb.o \ exynos_drm_gem.o exynos_drm_plane.o exynos_drm_dma.o -exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION) += exynos_drm_fbdev.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS5433_DECON) += exynos5433_drm_decon.o exynosdrm-$(CONFIG_DRM_EXYNOS7_DECON) += exynos7_drm_decon.o @@ -23,5 +22,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o exynosdrm-$(CONFIG_DRM_EXYNOS_SCALER) += exynos_drm_scaler.o exynosdrm-$(CONFIG_DRM_EXYNOS_GSC) += exynos_drm_gsc.o exynosdrm-$(CONFIG_DRM_EXYNOS_MIC) += exynos_drm_mic.o +exynosdrm-$(CONFIG_DRM_FBDEV_EMULATION) += exynos_drm_fbdev.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index ea4b3d248aac..b3333dd1d087 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -8,6 +8,8 @@ * Seung-Woo Kim */ +#include + #include #include #include @@ -49,11 +51,9 @@ static const struct fb_ops exynos_drm_fb_ops = { .owner = THIS_MODULE, DRM_FB_HELPER_DEFAULT_OPS, .fb_mmap = exynos_drm_fb_mmap, - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, .fb_destroy = exynos_drm_fb_destroy, }; From patchwork Mon May 15 09:40:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241133 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 A3C7EC77B7D for ; Mon, 15 May 2023 09:41:05 +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:References:In-Reply-To: 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: List-Owner; bh=j7jmoVls5xwEycbeMUbti/W4IViCG3UNoyzn3Kwwp8E=; b=HyuHNO++oXwPNx puUgtOE/7JedbxUKot0ECWpGOYqdRF556i82quexm8M0Tj4n5nBrxsGwvC+09arVd58i3OFT5tzsg zLYGHDX5Su307YDl5EqmBMC7rNOELbWNCE2zXzqacfYwfZ7z2piiDG8F3vMi8AufPtaUNWrUzKvTa 4KumFcChVjhuJzpgItKmVYxviVbN1MPjs5DGqJf0cwat9oLJEP4CFJ+SBwYoekja8kvPAgQ6aOhyI z0nQ/iglUuaU1VEYZyGAI3yOjnOxseSfs4AOu5oGrbLPJtYy5E8rRs3JUTQ1N40zy3ZxkI30asy2U FXIZBK6olK9+SESsxBFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh7-001axm-2a; Mon, 15 May 2023 09:40:41 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh5-001aun-0J for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:40 +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-out2.suse.de (Postfix) with ESMTPS id 4FC231F8AA; Mon, 15 May 2023 09:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143636; 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: in-reply-to:in-reply-to:references:references; bh=7oEflm68smLlu+8JIBbAdW2z0uLilKVJj7+U36OCXbI=; b=fA/TrdzdcVKmi18JjXcaUf3sYvfcl8IViJj+1NRzASTnnE1LJKZkjTn5ureg5I5GnG9+OV vqGuNGQTfKMI4mQGk/tqMqT0Cw4c9UGVijcJtUebmdkZ+C5kllEoU3qBMNMlad2khPWgle jJJDZjtDXYyobypvhlNxVJ5jwFfhi0M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143636; 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: in-reply-to:in-reply-to:references:references; bh=7oEflm68smLlu+8JIBbAdW2z0uLilKVJj7+U36OCXbI=; b=SoObgpBcCJpkyhysqio8cc0a3gCT278PFzkjo9/YuMnQKCeuef71AAHqBH7Va+YkeyigrW ViPFd6Sv970B5IDg== 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 EFC9913466; Mon, 15 May 2023 09:40:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EFiBORP+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:35 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Patrik Jakobsson Subject: [PATCH v2 04/12] drm/gma500: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:25 +0200 Message-Id: <20230515094033.2133-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024039_277903_3ABB9BFA X-CRM114-Status: GOOD ( 12.91 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Gma500 does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Cc: Patrik Jakobsson --- drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/gma500/fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/gma500/Kconfig b/drivers/gpu/drm/gma500/Kconfig index 2efc0eb41c64..cd3d92725ed4 100644 --- a/drivers/gpu/drm/gma500/Kconfig +++ b/drivers/gpu/drm/gma500/Kconfig @@ -3,6 +3,7 @@ config DRM_GMA500 tristate "Intel GMA500/600/3600/3650 KMS Framebuffer" depends on DRM && PCI && X86 && MMU select DRM_KMS_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION select I2C select I2C_ALGOBIT # GMA500 depends on ACPI_VIDEO when ACPI is enabled, just like i915 diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c index 62287407e717..60005c3d01d0 100644 --- a/drivers/gpu/drm/gma500/fbdev.c +++ b/drivers/gpu/drm/gma500/fbdev.c @@ -5,6 +5,7 @@ * **************************************************************************/ +#include #include #include @@ -136,11 +137,9 @@ static const struct fb_ops psb_fbdev_fb_ops = { .owner = THIS_MODULE, DRM_FB_HELPER_DEFAULT_OPS, .fb_setcolreg = psb_fbdev_fb_setcolreg, - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, .fb_mmap = psb_fbdev_fb_mmap, .fb_destroy = psb_fbdev_fb_destroy, }; From patchwork Mon May 15 09:40:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241140 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 23F80C7EE22 for ; Mon, 15 May 2023 09:41:33 +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:References:In-Reply-To: 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: List-Owner; bh=mJxZ6KiGYvCohI26r47EGCuFyaN6anvriOd6jJVQhNA=; b=wZNBCiqURevkOE mP0+9XL7ofWEAKV/bJq0anzrquM64O1W5JTUPodRYG0ZHQGgKWBcYfek9kYKglvezafbGawtzmeK2 Vywi5s1uvyjxGZw13z1wxZCatPwL7IzbeBtoIBxXXe7OrFEO4A+BYddghBUdze8HXXbHzejn2zYbA A1lIAhWPW4cBnLNsnTi5ZFQ/IRyN+UHFvpOh5/J5oAKSsNhkxJARNMWJLbbkley30W3IEoCqyvMRy hRa1vblqxZqhCrAjSz8w/snIwia+4w6ElL3JtDZ+MmrA6mWftnwWAA77nDbeLsW4PYIEy0tobhgfv n++uGh5OPbZx9NGouySA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUha-001bH7-2h; Mon, 15 May 2023 09:41:10 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh5-001aur-2b for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:44 +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-out2.suse.de (Postfix) with ESMTPS id AA9361F8D7; Mon, 15 May 2023 09:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143636; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T//tfEEUsUlXNaEiKBIRCSCuec02xIqnWeb1TK1YORk=; b=sMHUF86N8lIUl6Svx4Te6paLZb/Hjp9geXAXBymcixlSBboAAX7mrtBcr/tUPxuSt+gSNL nw0ZSGgMmd7R1ZB+B+GNSw4ofwjLAG3m+72BYCh8OVJWur1HOm4EHK+QMMh/UJeYKctwf+ jT+QYW0UXG4Dn+MqrVDcmx4+6vdYxSY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143636; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T//tfEEUsUlXNaEiKBIRCSCuec02xIqnWeb1TK1YORk=; b=lgaGOMImeMiE4KmKNX+cqf5pRvRwskR8O/D5jJKRZ7oIEgXRUD0MG6rWfMSVnqzORfGOBV eJzK/J3B7962wNAA== 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 548DD138FE; Mon, 15 May 2023 09:40:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uDOrExT+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:36 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" Subject: [PATCH v2 05/12] drm/radeon: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:26 +0200 Message-Id: <20230515094033.2133-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024040_007872_D4A8A0FC X-CRM114-Status: GOOD ( 13.20 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Radeon does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_IO_HELPERS option Signed-off-by: Thomas Zimmermann Acked-by: Alex Deucher Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" --- drivers/gpu/drm/radeon/Kconfig | 1 + drivers/gpu/drm/radeon/radeon_fbdev.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig index e19d77d58810..fe498c8af1bb 100644 --- a/drivers/gpu/drm/radeon/Kconfig +++ b/drivers/gpu/drm/radeon/Kconfig @@ -11,6 +11,7 @@ config DRM_RADEON select DRM_SUBALLOC_HELPER select DRM_TTM select DRM_TTM_HELPER + select FB_IO_HELPERS if DRM_FBDEV_EMULATION select SND_HDA_COMPONENT if SND_HDA_CORE select POWER_SUPPLY select HWMON diff --git a/drivers/gpu/drm/radeon/radeon_fbdev.c b/drivers/gpu/drm/radeon/radeon_fbdev.c index fe76e29910ef..dcabe527f9c0 100644 --- a/drivers/gpu/drm/radeon/radeon_fbdev.c +++ b/drivers/gpu/drm/radeon/radeon_fbdev.c @@ -24,6 +24,7 @@ * David Airlie */ +#include #include #include #include @@ -193,11 +194,9 @@ static const struct fb_ops radeon_fbdev_fb_ops = { DRM_FB_HELPER_DEFAULT_OPS, .fb_open = radeon_fbdev_fb_open, .fb_release = radeon_fbdev_fb_release, - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, .fb_destroy = radeon_fbdev_fb_destroy, }; From patchwork Mon May 15 09:40:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241137 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 E4596C7EE2A for ; Mon, 15 May 2023 09:41:13 +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:References:In-Reply-To: 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: List-Owner; bh=tMdvMOh0fzquGdVYzDdh7IsxZVuBSVI2xWCDTsPV6A4=; b=DMDSiqS2bOfx9u 6yUTcsoOfGo83Y1IxHcAZOGr+KIWFqYX0tfHMcPTnY9iDKi0FoN2wxyYzHh040eemkfJbJgBEQe/L tvn0JHjHG9GBY8kQMhV4RO1GdoqDRunwJKmK+jv66ayK7DnPSQxegidzj/uypA/Lc32gWXDt/ixf7 lcvcVkPw3igr0o3zJq7+YwabrWA0rAWiI36AKJoUyCDUk/HDoQVCFpGRBHkkuW2pxKuDve3NRI8WJ zpFFE+OD8KGqhVMqp+LWDRRc1iCrtShNtnH5lWEhhTD182Py8G7Psn5ThtqOiorf8qrPEsPRm4QSX 0usTj+D59lz20FFZY8/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhI-001b3P-0s; Mon, 15 May 2023 09:40:52 +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 1pyUh5-001aup-1E for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:42 +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 01C8821D07; Mon, 15 May 2023 09:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143637; 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: in-reply-to:in-reply-to:references:references; bh=uiYTGLoGZBNir0OiYcExL2dl4KpON0koS7GTXu2ItZk=; b=gtLWD7Tb0iCC86qLIMYKJxby13FNtw71kipxcQK8SxBOfX4Gb3mVoOzHqAy6OoMIFUhw4S yX6SCiYV1Le8mtetJJskEpeHIgByZprfDfCB7lRuPzJDk2aLBRHRZJ/3yQsj/lbZQX3+Yr iOkvFuSmiz3B4KUuzguKLHHAWpiCCus= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143637; 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: in-reply-to:in-reply-to:references:references; bh=uiYTGLoGZBNir0OiYcExL2dl4KpON0koS7GTXu2ItZk=; b=FviuwrkO6C1jN/8pZetlOG91IJdbtOg3t1aWm3lR38bvEEkF6YwDNBPIQ9SLmykni6FtkK kUcZof1Xu/lF/KCg== 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 AF42113466; Mon, 15 May 2023 09:40:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2JbfKRT+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:36 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 06/12] drm/fbdev-dma: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:27 +0200 Message-Id: <20230515094033.2133-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024039_578303_2267F8E1 X-CRM114-Status: GOOD ( 13.33 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Fbdev-dma does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/drm_fbdev_dma.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index ba3fb04bb691..77fb10ddd8a2 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -223,6 +223,7 @@ config DRM_TTM_HELPER config DRM_GEM_DMA_HELPER tristate depends on DRM + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION help Choose this if you need the GEM DMA helper functions diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c index 728deffcc0d9..09a36dc38c43 100644 --- a/drivers/gpu/drm/drm_fbdev_dma.c +++ b/drivers/gpu/drm/drm_fbdev_dma.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: MIT +#include + #include #include #include @@ -64,12 +66,12 @@ static const struct fb_ops drm_fbdev_dma_fb_ops = { .owner = THIS_MODULE, .fb_open = drm_fbdev_dma_fb_open, .fb_release = drm_fbdev_dma_fb_release, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write, DRM_FB_HELPER_DEFAULT_OPS, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_destroy = drm_fbdev_dma_fb_destroy, .fb_mmap = drm_fbdev_dma_fb_mmap, }; From patchwork Mon May 15 09:40:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241135 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 B70B4C7EE22 for ; Mon, 15 May 2023 09:41:12 +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:References:In-Reply-To: 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: List-Owner; bh=8HEeh5SM7m8FhqsNv9THJTIpHeVrhrVoybzTOaMWJ9g=; b=Eu+4lTdYwUDwlH FgAqbw3+Pu3jLE1v5Cw9rwSa9+rJhp80svZKiZeeJEjEjVjgtg6d4P2xsZeJk6sKeZwxyIvO3gsmU 4UQh8Sy3mOvfGVCP4hvmw2JuA2SpZASi0e9B3JLqkCxPgZN+ePd/c7L+FfNxvd+GMCB+WhC94TtXM kVtNfqyH7dI6r2xZzRa4OGckAPObYWIZZFPTdJ9cu8U7ImCRlRQrDY5qC/Byx+4w4N4VxCmaOaVKi f1lBBEWfh1gWI4LAsbploFVsIYFMZ1okqktLmPbAh6iYueBL4M+j4AlXO9nir4Z52GcRBpN+KNKkB Ex9xX3a44SuZaGdHCJ8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhH-001b2Q-0O; Mon, 15 May 2023 09:40:51 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh5-001auv-2L for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:42 +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 6652E21D28; Mon, 15 May 2023 09:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143637; 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: in-reply-to:in-reply-to:references:references; bh=opXTG60XyU/ZCK5AHjD7yJxVvldlhQpJTX0QZWs21Mc=; b=IT6vYbvjDEHpTGYjAbWHCgPx/sKEH7mQmtfygRYa37tA8ZuIe6kO85MVqO3aymN8ZJKL1B Z8xCExMr6PB+VQRY+l8XitWXI5/vO8qgW/205e36rG5Di1JBN10Gj+DPubgWCGWdMHxufE OpGqQ5Qwl6WRUXU5TOLsXPIKc8DQXZo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143637; 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: in-reply-to:in-reply-to:references:references; bh=opXTG60XyU/ZCK5AHjD7yJxVvldlhQpJTX0QZWs21Mc=; b=Fa+i7Q8xqLFxU+pPyhmkKI62cNpW+TbYPWm94XMrSeRi6GfnBZgSE2Zom3rYoG1FhPzU7L FlxwDvjqGVbpg2DA== 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 085A713466; Mon, 15 May 2023 09:40:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6JcLARX+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:37 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Dmitry Baryshkov , Rob Clark , Abhinav Kumar , Sean Paul Subject: [PATCH v2 07/12] drm/msm: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:28 +0200 Message-Id: <20230515094033.2133-8-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024039_929235_7C7B4211 X-CRM114-Status: GOOD ( 13.26 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Msm does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann Reviewed-by: Dmitry Baryshkov Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Sean Paul --- drivers/gpu/drm/msm/Kconfig | 1 + drivers/gpu/drm/msm/msm_fbdev.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig index 85f5ab1d552c..a78662bd6273 100644 --- a/drivers/gpu/drm/msm/Kconfig +++ b/drivers/gpu/drm/msm/Kconfig @@ -21,6 +21,7 @@ config DRM_MSM select DRM_BRIDGE select DRM_PANEL_BRIDGE select DRM_SCHED + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION select SHMEM select TMPFS select QCOM_SCM diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index 2ebc86381e1c..fc0353a4160e 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -4,6 +4,8 @@ * Author: Rob Clark */ +#include + #include #include #include @@ -57,11 +59,11 @@ static const struct fb_ops msm_fb_ops = { /* Note: to properly handle manual update displays, we wrap the * basic fbdev ops which write to the framebuffer */ - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_mmap = msm_fbdev_mmap, .fb_destroy = msm_fbdev_fb_destroy, }; From patchwork Mon May 15 09:40:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241141 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 79CD8C7EE2A for ; Mon, 15 May 2023 09:41:33 +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:References:In-Reply-To: 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: List-Owner; bh=5cT9IKBpIDYHdTJiFcLSzM2XVYqt9MJhbhIveO81UlQ=; b=YUiARRZgBKCajJ yWSdCnhxr7/3VChOosSRK57iPepzkOtTpLVnJgktRxuzB+km2ZwwPOHsukW7otdfAMiTIOQEWMpbf 6bWAvUqofUHkgqayxwQTssGnE2DTcUBy9EWveZJRIPld+f9AFQFyS/IzXp+lUfspoiQjbt8qVABRC RrJ8Ej6FKA1/ZLmJihzJ7eU1oPVtfHIG1D2ngiy14Snw9hgYNAnEfS+vWmw8iIb5IS57/gtwGaIG7 wyeS/ckGeqoZC8Y5OJlZqQl+52DZ1eRmY1p1nTg3hY1WIkLIng6M7jVheAtJUG4rUiw73vh+GD4UK aVlPDlN40LtBVhFhC2Lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhb-001bI5-2L; Mon, 15 May 2023 09:41:11 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh6-001aux-1T for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:44 +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-out2.suse.de (Postfix) with ESMTPS id BAEEE1FD88; Mon, 15 May 2023 09:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143637; 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: in-reply-to:in-reply-to:references:references; bh=GQazaZuLCZJXHsbNauTGijK4S+E/gEqEYYYcQP+o56w=; b=oL5MxO+9xT4qcHSqMxv8z05LLyBhXAm0MGfjT5O4uceqmrZ7xeBuZbVioQT+aJQ5yecctE SaZWDQcw3QzzlfvXTHzCKSlkXMuOKy2yC5lRZgJZRw87Wd72VJts7xGLJ29VWjoYJz1/9R pF0gfDwbh5HHOCLhmhK+EETIdBG7jfU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143637; 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: in-reply-to:in-reply-to:references:references; bh=GQazaZuLCZJXHsbNauTGijK4S+E/gEqEYYYcQP+o56w=; b=7ic4nT3jBFabI3/kHUomvL1SgUNvUZguFGwGaigI+H5NwwWZaaB9jtIm4ycVCUqrzGtyWZ P8O4N7590gAPgjCg== 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 6807C138FE; Mon, 15 May 2023 09:40:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UKVvGBX+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:37 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Tomi Valkeinen Subject: [PATCH v2 08/12] drm/omapdrm: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:29 +0200 Message-Id: <20230515094033.2133-9-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024040_688470_5C659DE9 X-CRM114-Status: GOOD ( 12.47 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Omapdrm does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann Cc: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig index 76ded1568bd0..b4ac76c9f31b 100644 --- a/drivers/gpu/drm/omapdrm/Kconfig +++ b/drivers/gpu/drm/omapdrm/Kconfig @@ -4,6 +4,7 @@ config DRM_OMAP depends on DRM && OF depends on ARCH_OMAP2PLUS select DRM_KMS_HELPER + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION select VIDEOMODE_HELPERS select HDMI default n diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index b950e93b3846..55a65b81ccdc 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -4,6 +4,8 @@ * Author: Rob Clark */ +#include + #include #include #include @@ -103,11 +105,11 @@ static const struct fb_ops omap_fb_ops = { .fb_pan_display = omap_fbdev_pan_display, .fb_ioctl = drm_fb_helper_ioctl, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_destroy = omap_fbdev_fb_destroy, }; From patchwork Mon May 15 09:40:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241143 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 99AD3C7EE2D for ; Mon, 15 May 2023 09:41:34 +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:References:In-Reply-To: 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: List-Owner; bh=NpwDreeaAV6kCudZYHj/rrMnGYryo7k57DAbjtSfs+A=; b=GQy5h+9AUw42XX CdQ3ov95XTMtd3xlJ4xZ6RPM+s4+c1pwpm20lnEKJ5bzFTbcHfDvOvWxDzg6nfrJ3kPjVaUhUoj9p n0LWsOOFSEoMvibEXsox9D0kZNqszAIPaU8QC7/EGTGFvRg4LU+GgUXRD9MLUBucWdVNfivDuh3Vz eriXadio0swscbNYm0ukvuNFwcLxSJuN7XnEFBuZXyf3E48e1AHVvMUZTYa7GIlfxeQpNAm9WYn+j hGcMO42yAf72QmrWDfLV9VPVLGos2G+SLfLbdQ2nRjky8w3TRz7Fh73HKigWBlJDE4DHzkTe8zUCo vPNkEDMX+UVmWE+3vrRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhc-001bId-15; Mon, 15 May 2023 09:41:12 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh7-001axi-2U for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:44 +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-out2.suse.de (Postfix) with ESMTPS id 270B31FD8B; Mon, 15 May 2023 09:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143638; 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: in-reply-to:in-reply-to:references:references; bh=x+qQP86XyhL0pbwZiVaiGsWQMYOZoabJAUGvw5FILJM=; b=ATqXNmnVqL4yZrWP00m5cyWbqQhmpjZMKLDUazFjXkjUCv9/auiobICNZSsMdjeSkDOKdz NZCqW5B4rmCrbK/5liGXHMVRwswbm7bPfxJQ2+O3Yju7sMz8dHc3ZtLvN2wECexr89ohlW vgiIyos5qAU0q0UnDZDwdqh2o6aciGE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143638; 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: in-reply-to:in-reply-to:references:references; bh=x+qQP86XyhL0pbwZiVaiGsWQMYOZoabJAUGvw5FILJM=; b=t6rpl03D6VEX8cjtTXXsVxJtqn9bFdk+xMpybcv8tEPlB+/HfITzvyA6E2WRif4nD4ETqA fMS7xqrmUQXK1qCA== 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 BFD8913466; Mon, 15 May 2023 09:40:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wJPdLRX+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:37 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Thierry Reding , Mikko Perttunen , Jonathan Hunter Subject: [PATCH v2 09/12] drm/tegra: Use regular fbdev I/O helpers Date: Mon, 15 May 2023 11:40:30 +0200 Message-Id: <20230515094033.2133-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024041_980613_28C6C864 X-CRM114-Status: GOOD ( 12.70 ) 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 Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Tegra does not use damage handling, so DRM's fbdev helpers are mere wrappers around the fbdev code. By using fbdev helpers directly within each DRM fbdev emulation, we can eventually remove DRM's wrapper functions entirely. v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann Cc: Thierry Reding Cc: Mikko Perttunen Cc: Jonathan Hunter --- drivers/gpu/drm/tegra/Kconfig | 1 + drivers/gpu/drm/tegra/fbdev.c | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig index 56453ca277c2..498313778175 100644 --- a/drivers/gpu/drm/tegra/Kconfig +++ b/drivers/gpu/drm/tegra/Kconfig @@ -12,6 +12,7 @@ config DRM_TEGRA select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION select TEGRA_HOST1X select INTERCONNECT select IOMMU_IOVA diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c index dca9eccae466..144d851e566f 100644 --- a/drivers/gpu/drm/tegra/fbdev.c +++ b/drivers/gpu/drm/tegra/fbdev.c @@ -8,6 +8,7 @@ */ #include +#include #include #include @@ -59,11 +60,11 @@ static void tegra_fbdev_fb_destroy(struct fb_info *info) static const struct fb_ops tegra_fb_ops = { .owner = THIS_MODULE, DRM_FB_HELPER_DEFAULT_OPS, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_read = fb_sys_read, + .fb_write = fb_sys_write, + .fb_fillrect = sys_fillrect, + .fb_copyarea = sys_copyarea, + .fb_imageblit = sys_imageblit, .fb_mmap = tegra_fb_mmap, .fb_destroy = tegra_fbdev_fb_destroy, }; From patchwork Mon May 15 09:40:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241136 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 384EEC7EE2D for ; Mon, 15 May 2023 09:41:14 +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:References:In-Reply-To: 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: List-Owner; bh=2Psubbp8qE9O8gfEdJQcbYOYRjvRkB3x75yMp1Ox+98=; b=E3k/JJuLheEVXe 5r6wj9aRYp7hXKEIVatovC59UGQoE/WmThUdTdUsMNb3WWbyjjgrZyYbnWGvG1RDin7aAzmmkInfs Z1hRcdxTHDQYyXRuy0IyYSP40uYXHl9dgOOUodTcllmHZb7j0hQaQzg4P+2jQsncjvgkVrvtmboBJ 87/JfLWJjn+cv9754dD4BQ4PmO7bVxdAfjpsAwYcRFDHLL4eHewIgjDBmjhARrHNckB7PiKVconH+ EcUGzNesF5b1CfKAAmyx+F90zCvz0fF6pqKMr101EwviZio9wbyZz5RnJcTFRIi8neFncO+bbczCF x7Q3bcOG2BDQoPcH1fNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhH-001b2z-2N; Mon, 15 May 2023 09:40:51 +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 1pyUh5-001av2-29 for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:42 +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 78B5221D33; Mon, 15 May 2023 09:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143638; 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: in-reply-to:in-reply-to:references:references; bh=mjuO+DxwR+YcO4n2FyX/dbJKiEf4TVp7gUioRCpA2lE=; b=0Qk50dZQqzDzwIuILQbvLx3gVqsTUEM4CT7OLcukJxPbgIinaRAnL1vFvy6Fnc4zLu2YIy lCllDdyLTrl/lCWv2Dd6cdSSCRHufibjLuCpBqJUqT6siKDBTme6oE+T/G5UCijz4v8Jyc +APHgnLj+AmQhfTTRsFhY9qBwG+CjGs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143638; 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: in-reply-to:in-reply-to:references:references; bh=mjuO+DxwR+YcO4n2FyX/dbJKiEf4TVp7gUioRCpA2lE=; b=OaiKkuTuRWbr/bl8EubYEfriR2gujQpBZXYoRsw7xBq4sfZ/KdXgqaMdYzVPfZzqGPFe+Q icxArvgLCMzMM2BQ== 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 2A889138FE; Mon, 15 May 2023 09:40:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ENJpCRb+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:38 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 10/12] drm/fb-helper: Export helpers for marking damage areas Date: Mon, 15 May 2023 11:40:31 +0200 Message-Id: <20230515094033.2133-11-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024039_863219_ED8C17A9 X-CRM114-Status: GOOD ( 12.03 ) 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 Export drm_fb_helper_damage() and drm_fb_helper_damage_range(), which handle damage areas for fbdev emulation. This is a temporary export that allows to move the DRM I/O helpers for fbdev into drivers. Only fbdev-generic and i915 need them. Both will be updated to implement damage handling by themselves and the exported functions will be removed. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 19 +++++++++++++++++-- include/drm/drm_fb_helper.h | 4 ++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index f0e9549b6bd7..8724e08c518b 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -625,13 +625,15 @@ static void drm_fb_helper_add_damage_clip(struct drm_fb_helper *helper, u32 x, u spin_unlock_irqrestore(&helper->damage_lock, flags); } -static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y, - u32 width, u32 height) +/* Don't use in new code. */ +void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y, + u32 width, u32 height) { drm_fb_helper_add_damage_clip(helper, x, y, width, height); schedule_work(&helper->damage_work); } +EXPORT_SYMBOL(drm_fb_helper_damage); /* * Convert memory region into area of scanlines and pixels per @@ -670,6 +672,19 @@ static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off, drm_rect_init(clip, x1, y1, x2 - x1, y2 - y1); } +/* Don't use in new code. */ +void drm_fb_helper_damage_range(struct drm_fb_helper *fb_helper, off_t off, size_t len) +{ + struct fb_info *info = fb_helper->info; + struct drm_rect damage_area; + + drm_fb_helper_memory_range_to_clip(info, off, len, &damage_area); + drm_fb_helper_damage(fb_helper, damage_area.x1, damage_area.y1, + drm_rect_width(&damage_area), + drm_rect_height(&damage_area)); +} +EXPORT_SYMBOL(drm_fb_helper_damage_range); + /** * drm_fb_helper_deferred_io() - fbdev deferred_io callback function * @info: fb_info struct pointer diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 72032c354a30..80c402f4e379 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -253,6 +253,10 @@ void drm_fb_helper_fill_info(struct fb_info *info, struct drm_fb_helper *fb_helper, struct drm_fb_helper_surface_size *sizes); +void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y, + u32 width, u32 height); +void drm_fb_helper_damage_range(struct drm_fb_helper *helper, off_t off, size_t len); + void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist); ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf, From patchwork Mon May 15 09:40:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241142 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 8D92AC7EE26 for ; Mon, 15 May 2023 09:41:33 +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:References:In-Reply-To: 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: List-Owner; bh=LU0Vf6/dAZX4q78jF1CYbSIz+Ani09WN2UsUzj5/Qcc=; b=sJrWU7GpuRNg2d EoA4eS+MbYY3tYvNwA9VNc8xZ7ToTJd7yuOQ6KVTgg4z/Ivt3Wr0mfA3gtszk5LHoGYtdCVU8VaV0 16floz7v0+7IP94KEtmkN4P4cVjCzr7Qhc07CF5Xn03vQZrM4vBAl09N+thDh4ZByxXCBa71J6NmD nlbiiP/SmvIMlbp52nmgTUtHeorFiX3QirJ+jJUqi8F7Al1PyHA4DdFfztiungv4d/+hz9niaXpNE 5TfXHJC3D0Mq0FZpU/KIP/fog3FuTYO+dQ/gb3b5MHClUC7v1dv3nmSavgccnWGPU+xRApIlPMCrD 5OprjwmAwkAPFPuSxX6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhd-001bJg-0V; Mon, 15 May 2023 09:41:13 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyUh7-001axh-2S for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:45 +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-out2.suse.de (Postfix) with ESMTPS id CC2341FD70; Mon, 15 May 2023 09:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143638; 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: in-reply-to:in-reply-to:references:references; bh=SL8F7hxy1FMTYqEvdVW2tVOzKiWvwxjWnVn5DsHBAlM=; b=LIVKoRdGXZcgf8u8lCvrp80Ge291x8t+/ypVwyWpjiZqweUoyNqmWbEk+UBg+z5OvwKbcv B1a92o+l3MRS/QcGLPcaZeAstkOttkB3PwwfawWp7nIkFHeNVJsqBKZaLPct0XsAdK7y8i B0zKzuT4huLd67pZmUU9tgROTBJXNEc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143638; 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: in-reply-to:in-reply-to:references:references; bh=SL8F7hxy1FMTYqEvdVW2tVOzKiWvwxjWnVn5DsHBAlM=; b=HVEzfCFLnZI1qkudwWo9brDtLK6LUeZDTRH7vo2yKt0Z/xnsBmxgH3/Zjj0ryNdHmZuBoy VDZ7DhCcMGSrEVDQ== 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 7E66E13466; Mon, 15 May 2023 09:40:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oIveHRb+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:38 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 11/12] drm/fbdev-generic: Implement dedicated fbdev I/O helpers Date: Mon, 15 May 2023 11:40:32 +0200 Message-Id: <20230515094033.2133-12-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024041_973721_B66DFF40 X-CRM114-Status: GOOD ( 16.71 ) 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 Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. Fbdev-generic was the only caller of the DRM helpers, so remove them from the helper module. v2: * use FB_SYS_HELPERS_DEFERRED option Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/Kconfig | 6 +- drivers/gpu/drm/drm_fb_helper.c | 107 ---------------------------- drivers/gpu/drm/drm_fbdev_generic.c | 47 ++++++++++-- include/drm/drm_fb_helper.h | 41 ----------- 4 files changed, 43 insertions(+), 158 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 77fb10ddd8a2..92a782827b7b 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -95,6 +95,7 @@ config DRM_KUNIT_TEST config DRM_KMS_HELPER tristate depends on DRM + select FB_SYS_HELPERS_DEFERRED if DRM_FBDEV_EMULATION help CRTC helpers for KMS drivers. @@ -135,11 +136,6 @@ config DRM_FBDEV_EMULATION select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT - select FB_DEFERRED_IO - select FB_SYS_FOPS - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE default y diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 8724e08c518b..ba0a808f14ee 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -729,113 +729,6 @@ void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagerefli } EXPORT_SYMBOL(drm_fb_helper_deferred_io); -/** - * drm_fb_helper_sys_read - Implements struct &fb_ops.fb_read for system memory - * @info: fb_info struct pointer - * @buf: userspace buffer to read from framebuffer memory - * @count: number of bytes to read from framebuffer memory - * @ppos: read offset within framebuffer memory - * - * Returns: - * The number of bytes read on success, or an error code otherwise. - */ -ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf, - size_t count, loff_t *ppos) -{ - return fb_sys_read(info, buf, count, ppos); -} -EXPORT_SYMBOL(drm_fb_helper_sys_read); - -/** - * drm_fb_helper_sys_write - Implements struct &fb_ops.fb_write for system memory - * @info: fb_info struct pointer - * @buf: userspace buffer to write to framebuffer memory - * @count: number of bytes to write to framebuffer memory - * @ppos: write offset within framebuffer memory - * - * Returns: - * The number of bytes written on success, or an error code otherwise. - */ -ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct drm_fb_helper *helper = info->par; - loff_t pos = *ppos; - ssize_t ret; - struct drm_rect damage_area; - - ret = fb_sys_write(info, buf, count, ppos); - if (ret <= 0) - return ret; - - if (helper->funcs->fb_dirty) { - drm_fb_helper_memory_range_to_clip(info, pos, ret, &damage_area); - drm_fb_helper_damage(helper, damage_area.x1, damage_area.y1, - drm_rect_width(&damage_area), - drm_rect_height(&damage_area)); - } - - return ret; -} -EXPORT_SYMBOL(drm_fb_helper_sys_write); - -/** - * drm_fb_helper_sys_fillrect - wrapper around sys_fillrect - * @info: fbdev registered by the helper - * @rect: info about rectangle to fill - * - * A wrapper around sys_fillrect implemented by fbdev core - */ -void drm_fb_helper_sys_fillrect(struct fb_info *info, - const struct fb_fillrect *rect) -{ - struct drm_fb_helper *helper = info->par; - - sys_fillrect(info, rect); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width, rect->height); -} -EXPORT_SYMBOL(drm_fb_helper_sys_fillrect); - -/** - * drm_fb_helper_sys_copyarea - wrapper around sys_copyarea - * @info: fbdev registered by the helper - * @area: info about area to copy - * - * A wrapper around sys_copyarea implemented by fbdev core - */ -void drm_fb_helper_sys_copyarea(struct fb_info *info, - const struct fb_copyarea *area) -{ - struct drm_fb_helper *helper = info->par; - - sys_copyarea(info, area); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, area->dx, area->dy, area->width, area->height); -} -EXPORT_SYMBOL(drm_fb_helper_sys_copyarea); - -/** - * drm_fb_helper_sys_imageblit - wrapper around sys_imageblit - * @info: fbdev registered by the helper - * @image: info about image to blit - * - * A wrapper around sys_imageblit implemented by fbdev core - */ -void drm_fb_helper_sys_imageblit(struct fb_info *info, - const struct fb_image *image) -{ - struct drm_fb_helper *helper = info->par; - - sys_imageblit(info, image); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, image->dx, image->dy, image->width, image->height); -} -EXPORT_SYMBOL(drm_fb_helper_sys_imageblit); - /** * drm_fb_helper_cfb_read - Implements struct &fb_ops.fb_read for I/O memory * @info: fb_info struct pointer diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 8e5148bf40bb..f53fc49e34a4 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -34,6 +34,43 @@ static int drm_fbdev_generic_fb_release(struct fb_info *info, int user) return 0; } +static ssize_t drm_fbdev_generic_fb_write(struct fb_info *info, const char __user *buf, + size_t count, loff_t *ppos) +{ + struct drm_fb_helper *helper = info->par; + loff_t pos = *ppos; + ssize_t ret; + + ret = fb_sys_write(info, buf, count, ppos); + if (ret > 0) + drm_fb_helper_damage_range(helper, pos, ret); + return ret; +} + +static void drm_fbdev_generic_fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) +{ + struct drm_fb_helper *helper = info->par; + + sys_fillrect(info, rect); + drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width, rect->height); +} + +static void drm_fbdev_generic_fb_copyarea(struct fb_info *info, const struct fb_copyarea *area) +{ + struct drm_fb_helper *helper = info->par; + + sys_copyarea(info, area); + drm_fb_helper_damage(helper, area->dx, area->dy, area->width, area->height); +} + +static void drm_fbdev_generic_fb_imageblit(struct fb_info *info, const struct fb_image *image) +{ + struct drm_fb_helper *helper = info->par; + + sys_imageblit(info, image); + drm_fb_helper_damage(helper, image->dx, image->dy, image->width, image->height); +} + static void drm_fbdev_generic_fb_destroy(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; @@ -56,12 +93,12 @@ static const struct fb_ops drm_fbdev_generic_fb_ops = { .owner = THIS_MODULE, .fb_open = drm_fbdev_generic_fb_open, .fb_release = drm_fbdev_generic_fb_release, - .fb_read = drm_fb_helper_sys_read, - .fb_write = drm_fb_helper_sys_write, + .fb_read = fb_sys_read, + .fb_write = drm_fbdev_generic_fb_write, DRM_FB_HELPER_DEFAULT_OPS, - .fb_fillrect = drm_fb_helper_sys_fillrect, - .fb_copyarea = drm_fb_helper_sys_copyarea, - .fb_imageblit = drm_fb_helper_sys_imageblit, + .fb_fillrect = drm_fbdev_generic_fb_fillrect, + .fb_copyarea = drm_fbdev_generic_fb_copyarea, + .fb_imageblit = drm_fbdev_generic_fb_imageblit, .fb_mmap = fb_deferred_io_mmap, .fb_destroy = drm_fbdev_generic_fb_destroy, }; diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 80c402f4e379..e3240d749a43 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -259,18 +259,6 @@ void drm_fb_helper_damage_range(struct drm_fb_helper *helper, off_t off, size_t void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist); -ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf, - size_t count, loff_t *ppos); -ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf, - size_t count, loff_t *ppos); - -void drm_fb_helper_sys_fillrect(struct fb_info *info, - const struct fb_fillrect *rect); -void drm_fb_helper_sys_copyarea(struct fb_info *info, - const struct fb_copyarea *area); -void drm_fb_helper_sys_imageblit(struct fb_info *info, - const struct fb_image *image); - ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos); ssize_t drm_fb_helper_cfb_write(struct fb_info *info, const char __user *buf, @@ -398,35 +386,6 @@ static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper) return -ENODEV; } -static inline ssize_t drm_fb_helper_sys_read(struct fb_info *info, - char __user *buf, size_t count, - loff_t *ppos) -{ - return -ENODEV; -} - -static inline ssize_t drm_fb_helper_sys_write(struct fb_info *info, - const char __user *buf, - size_t count, loff_t *ppos) -{ - return -ENODEV; -} - -static inline void drm_fb_helper_sys_fillrect(struct fb_info *info, - const struct fb_fillrect *rect) -{ -} - -static inline void drm_fb_helper_sys_copyarea(struct fb_info *info, - const struct fb_copyarea *area) -{ -} - -static inline void drm_fb_helper_sys_imageblit(struct fb_info *info, - const struct fb_image *image) -{ -} - static inline ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos) { From patchwork Mon May 15 09:40:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 13241145 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 60C02C7EE26 for ; Mon, 15 May 2023 09:41:38 +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:References:In-Reply-To: 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: List-Owner; bh=57zTVRy70tSmKuKLZW4NBTg62Ah5+t+T+9UF8LZSanI=; b=P8k6LqtHdFyd1Q cyVG15p7qZKKtN+UmlSLQN0LbDzeBp/9LSAYloFXFxq011dwIFN6Kx5ZKO+gjw7dX/sPjBYHogwaY ddDo1isKAqzKKoi9BgYltrzGW33ulgWh8qRT5x5NvKpzaHUqYTXy9U+LXUFxebVXWkNGcKhEp67h1 lw0VGsBJ7jzfuoHEDiGnMn7bxIN16PlDoI+PHIcSV8/3l2lhcsXGj2i7B7xSJEV45+RZIK5r8SaZx Lekpk3/vJAFYw1vywauuOyS4XN26h8YAfNdQWLW/RGi1fcja0XoDAvwp2B5Rdjun+TWYBc1gubMYc 62K0R1Zxp/hGdkm4w0OA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyUhd-001bKD-2h; Mon, 15 May 2023 09:41:13 +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 1pyUh9-001ayf-0V for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 09:40:46 +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 3B6CF21D38; Mon, 15 May 2023 09:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684143639; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x/ukCFzbN07fn8ALvdz1hMDvC2v9v6ch1Yiaceo0YOo=; b=Jx+lBh8GYrGyDI/X7iciwc7luLhdvN4bzVFkRuUqKuQm606adqkzJb4JBWWzuEAmEwub6X l64210xks++BezoYsvKRRnVIJTSjmvEDFjCOpQPR4HYG6KrYz5dFhfd6Ru+tekXjHBQbeg d9DP0um/s+0ZbC6lLLj21ACWqfQjoWE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684143639; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x/ukCFzbN07fn8ALvdz1hMDvC2v9v6ch1Yiaceo0YOo=; b=iv3Q59R2N8CIeokEPkJq8DE1uD56ygCZlgDnnH7d+RejKamfGu2K3dVxksiau9B3RerW1M s2magME+htFYNBCA== 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 CF7A4138FE; Mon, 15 May 2023 09:40:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mBiqMRb+YWTeTwAAMHmgww (envelope-from ); Mon, 15 May 2023 09:40:38 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, javierm@redhat.com, sam@ravnborg.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , =?utf-8?b?VmlsbGUgU3lyasOk?= =?utf-8?b?bMOk?= Subject: [PATCH v2 12/12] drm/i915: Implement dedicated fbdev I/O helpers Date: Mon, 15 May 2023 11:40:33 +0200 Message-Id: <20230515094033.2133-13-tzimmermann@suse.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515094033.2133-1-tzimmermann@suse.de> References: <20230515094033.2133-1-tzimmermann@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_024043_346250_2F28D024 X-CRM114-Status: GOOD ( 19.75 ) 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 Implement dedicated fbdev helpers for framebuffer I/O instead of using DRM's helpers. i915 was the only caller of the DRM helpers, so remove them from the helper module. v2: * use FB_IO_HELPERS options Signed-off-by: Thomas Zimmermann Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: "Ville Syrjälä" --- drivers/gpu/drm/Kconfig | 3 - drivers/gpu/drm/drm_fb_helper.c | 107 --------------------- drivers/gpu/drm/i915/Kconfig | 1 + drivers/gpu/drm/i915/display/intel_fbdev.c | 51 ++++++++-- include/drm/drm_fb_helper.h | 39 -------- 5 files changed, 46 insertions(+), 155 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 92a782827b7b..bb2e48cc6cd6 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -133,9 +133,6 @@ config DRM_FBDEV_EMULATION bool "Enable legacy fbdev support for your modesetting driver" depends on DRM_KMS_HELPER depends on FB=y || FB=DRM_KMS_HELPER - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE default y diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index ba0a808f14ee..5927896ad8f6 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -729,113 +729,6 @@ void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagerefli } EXPORT_SYMBOL(drm_fb_helper_deferred_io); -/** - * drm_fb_helper_cfb_read - Implements struct &fb_ops.fb_read for I/O memory - * @info: fb_info struct pointer - * @buf: userspace buffer to read from framebuffer memory - * @count: number of bytes to read from framebuffer memory - * @ppos: read offset within framebuffer memory - * - * Returns: - * The number of bytes read on success, or an error code otherwise. - */ -ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, - size_t count, loff_t *ppos) -{ - return fb_io_read(info, buf, count, ppos); -} -EXPORT_SYMBOL(drm_fb_helper_cfb_read); - -/** - * drm_fb_helper_cfb_write - Implements struct &fb_ops.fb_write for I/O memory - * @info: fb_info struct pointer - * @buf: userspace buffer to write to framebuffer memory - * @count: number of bytes to write to framebuffer memory - * @ppos: write offset within framebuffer memory - * - * Returns: - * The number of bytes written on success, or an error code otherwise. - */ -ssize_t drm_fb_helper_cfb_write(struct fb_info *info, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct drm_fb_helper *helper = info->par; - loff_t pos = *ppos; - ssize_t ret; - struct drm_rect damage_area; - - ret = fb_io_write(info, buf, count, ppos); - if (ret <= 0) - return ret; - - if (helper->funcs->fb_dirty) { - drm_fb_helper_memory_range_to_clip(info, pos, ret, &damage_area); - drm_fb_helper_damage(helper, damage_area.x1, damage_area.y1, - drm_rect_width(&damage_area), - drm_rect_height(&damage_area)); - } - - return ret; -} -EXPORT_SYMBOL(drm_fb_helper_cfb_write); - -/** - * drm_fb_helper_cfb_fillrect - wrapper around cfb_fillrect - * @info: fbdev registered by the helper - * @rect: info about rectangle to fill - * - * A wrapper around cfb_fillrect implemented by fbdev core - */ -void drm_fb_helper_cfb_fillrect(struct fb_info *info, - const struct fb_fillrect *rect) -{ - struct drm_fb_helper *helper = info->par; - - cfb_fillrect(info, rect); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width, rect->height); -} -EXPORT_SYMBOL(drm_fb_helper_cfb_fillrect); - -/** - * drm_fb_helper_cfb_copyarea - wrapper around cfb_copyarea - * @info: fbdev registered by the helper - * @area: info about area to copy - * - * A wrapper around cfb_copyarea implemented by fbdev core - */ -void drm_fb_helper_cfb_copyarea(struct fb_info *info, - const struct fb_copyarea *area) -{ - struct drm_fb_helper *helper = info->par; - - cfb_copyarea(info, area); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, area->dx, area->dy, area->width, area->height); -} -EXPORT_SYMBOL(drm_fb_helper_cfb_copyarea); - -/** - * drm_fb_helper_cfb_imageblit - wrapper around cfb_imageblit - * @info: fbdev registered by the helper - * @image: info about image to blit - * - * A wrapper around cfb_imageblit implemented by fbdev core - */ -void drm_fb_helper_cfb_imageblit(struct fb_info *info, - const struct fb_image *image) -{ - struct drm_fb_helper *helper = info->par; - - cfb_imageblit(info, image); - - if (helper->funcs->fb_dirty) - drm_fb_helper_damage(helper, image->dx, image->dy, image->width, image->height); -} -EXPORT_SYMBOL(drm_fb_helper_cfb_imageblit); - /** * drm_fb_helper_set_suspend - wrapper around fb_set_suspend * @fb_helper: driver-allocated fbdev helper, can be NULL diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index e4f4d2e3fdfe..01b5a8272a27 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -17,6 +17,7 @@ config DRM_I915 select DRM_KMS_HELPER select DRM_PANEL select DRM_MIPI_DSI + select FB_IO_HELPERS if DRM_FBDEV_EMULATION select RELAY select I2C select I2C_ALGOBIT diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index aab1ae74a8f7..64aeacef703d 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -84,6 +85,20 @@ static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev) intel_frontbuffer_invalidate(to_frontbuffer(ifbdev), ORIGIN_CPU); } +static ssize_t intel_fbdev_fb_write(struct fb_info *info, const char __user *buf, + size_t count, loff_t *ppos) +{ + struct drm_fb_helper *helper = info->par; + loff_t pos = *ppos; + ssize_t ret; + + ret = fb_io_write(info, buf, count, ppos); + if (ret > 0) + drm_fb_helper_damage_range(helper, pos, ret); + + return ret; +} + static int intel_fbdev_set_par(struct fb_info *info) { struct intel_fbdev *ifbdev = to_intel_fbdev(info->par); @@ -121,6 +136,30 @@ static int intel_fbdev_pan_display(struct fb_var_screeninfo *var, return ret; } +static void intel_fbdev_fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) +{ + struct drm_fb_helper *helper = info->par; + + cfb_fillrect(info, rect); + drm_fb_helper_damage(helper, rect->dx, rect->dy, rect->width, rect->height); +} + +static void intel_fbdev_fb_copyarea(struct fb_info *info, const struct fb_copyarea *area) +{ + struct drm_fb_helper *helper = info->par; + + cfb_copyarea(info, area); + drm_fb_helper_damage(helper, area->dx, area->dy, area->width, area->height); +} + +static void intel_fbdev_fb_imageblit(struct fb_info *info, const struct fb_image *image) +{ + struct drm_fb_helper *helper = info->par; + + cfb_imageblit(info, image); + drm_fb_helper_damage(helper, image->dx, image->dy, image->width, image->height); +} + static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma) { struct intel_fbdev *fbdev = to_intel_fbdev(info->par); @@ -134,13 +173,13 @@ static const struct fb_ops intelfb_ops = { .owner = THIS_MODULE, DRM_FB_HELPER_DEFAULT_OPS, .fb_set_par = intel_fbdev_set_par, - .fb_read = drm_fb_helper_cfb_read, - .fb_write = drm_fb_helper_cfb_write, - .fb_fillrect = drm_fb_helper_cfb_fillrect, - .fb_copyarea = drm_fb_helper_cfb_copyarea, - .fb_imageblit = drm_fb_helper_cfb_imageblit, - .fb_pan_display = intel_fbdev_pan_display, + .fb_read = fb_io_read, + .fb_write = intel_fbdev_fb_write, .fb_blank = intel_fbdev_blank, + .fb_pan_display = intel_fbdev_pan_display, + .fb_fillrect = intel_fbdev_fb_fillrect, + .fb_copyarea = intel_fbdev_fb_copyarea, + .fb_imageblit = intel_fbdev_fb_imageblit, .fb_mmap = intel_fbdev_mmap, }; diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index e3240d749a43..15f03d8fb5cd 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -259,18 +259,6 @@ void drm_fb_helper_damage_range(struct drm_fb_helper *helper, off_t off, size_t void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist); -ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, - size_t count, loff_t *ppos); -ssize_t drm_fb_helper_cfb_write(struct fb_info *info, const char __user *buf, - size_t count, loff_t *ppos); - -void drm_fb_helper_cfb_fillrect(struct fb_info *info, - const struct fb_fillrect *rect); -void drm_fb_helper_cfb_copyarea(struct fb_info *info, - const struct fb_copyarea *area); -void drm_fb_helper_cfb_imageblit(struct fb_info *info, - const struct fb_image *image); - void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, bool suspend); void drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper, bool suspend); @@ -386,33 +374,6 @@ static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper) return -ENODEV; } -static inline ssize_t drm_fb_helper_cfb_read(struct fb_info *info, char __user *buf, - size_t count, loff_t *ppos) -{ - return -ENODEV; -} - -static inline ssize_t drm_fb_helper_cfb_write(struct fb_info *info, const char __user *buf, - size_t count, loff_t *ppos) -{ - return -ENODEV; -} - -static inline void drm_fb_helper_cfb_fillrect(struct fb_info *info, - const struct fb_fillrect *rect) -{ -} - -static inline void drm_fb_helper_cfb_copyarea(struct fb_info *info, - const struct fb_copyarea *area) -{ -} - -static inline void drm_fb_helper_cfb_imageblit(struct fb_info *info, - const struct fb_image *image) -{ -} - static inline void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, bool suspend) {