From patchwork Fri Jul 7 08:31:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700309 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA8E0C001DF for ; Fri, 7 Jul 2023 08:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231461AbjGGIe3 (ORCPT ); Fri, 7 Jul 2023 04:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjGGIe3 (ORCPT ); Fri, 7 Jul 2023 04:34:29 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 273D9113; Fri, 7 Jul 2023 01:34:28 -0700 (PDT) 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 B3905227BD; Fri, 7 Jul 2023 08:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cKR3ZnbG7MMz5F4/vJcdpyoOxU6C2g5Dy4H9g3Ktz+0=; b=Nbcs7L2X8dIrZ+pjQOetdl5EkQ4rA1yUjdmIj0aEumWkNisY4c6iuwVlm4OR9RFP06ww7d Exd+QdNTTqYEi8x1GLb8QJblP6+pmWAHraagp5/la2v9YIVrYyL/NnwMTRM5IWl6DA+UcN 4rgfrhQc9Fddsv5Ke4IwoY4gmCKxKjM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cKR3ZnbG7MMz5F4/vJcdpyoOxU6C2g5Dy4H9g3Ktz+0=; b=yV+s2SQuvmnMWfG30ZwHvxeNO7ITtmJ8CzxOX04kJDO0NagLNxnKxD8XCrfU+ew+AhhCs3 9WVRmDOsaeHNnzDA== 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 7EC0813A18; Fri, 7 Jul 2023 08:34:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sA8OHhLOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:26 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Helge Deller Subject: [PATCH v3 01/12] fbdev: Add fb_ops init macros for framebuffers in DMA-able memory Date: Fri, 7 Jul 2023 10:31:52 +0200 Message-ID: <20230707083422.18691-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add initializer macros for struct fb_ops for framebuffers in DMA-able memory areas. Also add a corresponding Kconfig token. As of now, this is equivalent to system framebuffers and mostly useful for labeling drivers correctly. A later patch may add a generic DMA-specific mmap operation. Linux offers a number of dma_mmap_*() helpers for different use cases. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard Cc: Helge Deller --- drivers/video/fbdev/Kconfig | 8 ++++++++ include/linux/fb.h | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index cecf15418632..f14229757311 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -168,6 +168,14 @@ config FB_DEFERRED_IO bool depends on FB +config FB_DMA_HELPERS + bool + depends on FB + select FB_SYS_COPYAREA + select FB_SYS_FILLRECT + select FB_SYS_FOPS + select FB_SYS_IMAGEBLIT + config FB_IO_HELPERS bool depends on FB diff --git a/include/linux/fb.h b/include/linux/fb.h index 1d5c13f34b09..1191a78c5289 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -594,6 +594,19 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, __FB_DEFAULT_SYS_OPS_DRAW, \ __FB_DEFAULT_SYS_OPS_MMAP +/* + * Helpers for framebuffers in DMA-able memory + */ + +#define __FB_DEFAULT_DMA_OPS_RDWR \ + .fb_read = fb_sys_read, \ + .fb_write = fb_sys_write + +#define __FB_DEFAULT_DMA_OPS_DRAW \ + .fb_fillrect = sys_fillrect, \ + .fb_copyarea = sys_copyarea, \ + .fb_imageblit = sys_imageblit + /* drivers/video/fbmem.c */ extern int register_framebuffer(struct fb_info *fb_info); extern void unregister_framebuffer(struct fb_info *fb_info); From patchwork Fri Jul 7 08:31:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700788 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DCB3C001E0 for ; Fri, 7 Jul 2023 08:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232773AbjGGIea (ORCPT ); Fri, 7 Jul 2023 04:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbjGGIe3 (ORCPT ); Fri, 7 Jul 2023 04:34:29 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D616131; Fri, 7 Jul 2023 01:34:28 -0700 (PDT) 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 E9EE81FDC8; Fri, 7 Jul 2023 08:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XootyEfuEdowwsYT1ndkIQz3oHSLOKT3pacwPLWntsg=; b=dx/gDdbQ4xnS05jx1iSmnV6XtaZ9vD7ISa4MD/WnsqFFpeoZQYOFcHqXyoth6H7UPPdcdz /SHnehS6f4eN8mZVI+t+7ELV9roqFyaTZznHm4hBJS5NBfarO51mg6yri8ks5sASxy2h9H AHm1pCKlFaQutDHNS5K2mh+C5vJl1Qw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XootyEfuEdowwsYT1ndkIQz3oHSLOKT3pacwPLWntsg=; b=OiJBDPWdlRKfjoA4N3bJxp4wW1HJv83ERAj1+AZi2etMnCprCk6P3FFrB/IYVpA7HpN2A7 xzAet8SDo2SrOoAA== 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 B83411346D; Fri, 7 Jul 2023 08:34:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qPsCLBLOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:26 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v3 02/12] drm/fbdev-dma: Use fbdev DMA helpers Date: Fri, 7 Jul 2023 10:31:53 +0200 Message-ID: <20230707083422.18691-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use fbdev's DMA helpers for fbdev-dma. They are equivalent to the previously used system-memory helpers, so no functional changes here. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard --- drivers/gpu/drm/Kconfig | 2 +- drivers/gpu/drm/drm_fbdev_dma.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index afb3b2f5f425..da3aa0625c36 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -216,7 +216,7 @@ config DRM_TTM_HELPER config DRM_GEM_DMA_HELPER tristate depends on DRM - select FB_SYS_HELPERS if DRM_FBDEV_EMULATION + select FB_DMA_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 8217f1ddc007..040c229a1737 100644 --- a/drivers/gpu/drm/drm_fbdev_dma.c +++ b/drivers/gpu/drm/drm_fbdev_dma.c @@ -62,9 +62,9 @@ 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_DEFAULT_SYS_OPS_RDWR, + __FB_DEFAULT_DMA_OPS_RDWR, DRM_FB_HELPER_DEFAULT_OPS, - __FB_DEFAULT_SYS_OPS_DRAW, + __FB_DEFAULT_DMA_OPS_DRAW, .fb_mmap = drm_fbdev_dma_fb_mmap, .fb_destroy = drm_fbdev_dma_fb_destroy, }; From patchwork Fri Jul 7 08:31:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700308 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8653C04FE2 for ; Fri, 7 Jul 2023 08:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbjGGIea (ORCPT ); Fri, 7 Jul 2023 04:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbjGGIea (ORCPT ); Fri, 7 Jul 2023 04:34:30 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 873691BF0; Fri, 7 Jul 2023 01:34:28 -0700 (PDT) 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 31FA61FE7B; Fri, 7 Jul 2023 08:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718867; 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=jl7S46mv6InEsHfLSGrNmxiKrUHhe7iR5mOjG/vfIWw=; b=jEqAhu4wH6neopwx5ieSj7lA0flxu1krzbMQQKq86saVdg/m+epuR2I37fB2bEGTZgqJcH pyEMPap6KM6NwR6R3fMcHD4GqXO4mXw5wURYqIC4/755TnG2c3qkX8veSGxi2R2ja1YIig 9NDDJSiK8ibtAWngjZw94F3O0HEN4n4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718867; 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=jl7S46mv6InEsHfLSGrNmxiKrUHhe7iR5mOjG/vfIWw=; b=bxdIlsS34ok8da7NL/vHMqFUOzoCUuRvqCW01STOnffkrquHWzCB2SPICZtAXdlgw4Conf qMrNAsl1clFBBfDw== 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 ED5EF13A18; Fri, 7 Jul 2023 08:34:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4NYFORLOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:26 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Thierry Reding , Mikko Perttunen Subject: [PATCH v3 03/12] drm/tegra: Use fbdev DMA helpers Date: Fri, 7 Jul 2023 10:31:54 +0200 Message-ID: <20230707083422.18691-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use fbdev's DMA helpers for fbdev emulation. They are equivalent to the previously used system-memory helpers, so no functional changes here. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard Cc: Thierry Reding Cc: Mikko Perttunen Acked-by: Thierry Reding --- drivers/gpu/drm/tegra/Kconfig | 2 +- drivers/gpu/drm/tegra/fbdev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig index 498313778175..39452c8480c1 100644 --- a/drivers/gpu/drm/tegra/Kconfig +++ b/drivers/gpu/drm/tegra/Kconfig @@ -12,7 +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 FB_DMA_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 e74d9be981c7..82577b7c88da 100644 --- a/drivers/gpu/drm/tegra/fbdev.c +++ b/drivers/gpu/drm/tegra/fbdev.c @@ -59,9 +59,9 @@ static void tegra_fbdev_fb_destroy(struct fb_info *info) static const struct fb_ops tegra_fb_ops = { .owner = THIS_MODULE, - __FB_DEFAULT_SYS_OPS_RDWR, + __FB_DEFAULT_DMA_OPS_RDWR, DRM_FB_HELPER_DEFAULT_OPS, - __FB_DEFAULT_SYS_OPS_DRAW, + __FB_DEFAULT_DMA_OPS_DRAW, .fb_mmap = tegra_fb_mmap, .fb_destroy = tegra_fbdev_fb_destroy, }; From patchwork Fri Jul 7 08:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700787 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36938C05052 for ; Fri, 7 Jul 2023 08:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232829AbjGGIeb (ORCPT ); Fri, 7 Jul 2023 04:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232708AbjGGIea (ORCPT ); Fri, 7 Jul 2023 04:34:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E08551FC4; Fri, 7 Jul 2023 01:34:28 -0700 (PDT) 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 71F95227BF; Fri, 7 Jul 2023 08:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718867; 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=KMwLIko/n0DlYoocrVnbzMjwujsIFsQzXunnsYrfOew=; b=ZTgvS2Hnu5DfHwlerwmCmX/X/rN3wSxLrGOo50U3pVZbebV6lsaa4CGtxXDKyXrfkJzUfC A9pODJuUuIQoBXaorEz3cNAr9dhI/aXiFB8I3v5YTxvXTIi3igAi7Gp/FbZ2R37A67pkKV c+0fL8VEfXJUusF8IJh2Mz97w7R43k8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718867; 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=KMwLIko/n0DlYoocrVnbzMjwujsIFsQzXunnsYrfOew=; b=y9QgbtOFwty2wuxsMqAeTPaQHu/VGEM7f3J+JoFxhlrN9q8tySeyveOSdS+Ft/JQF6WOz/ /06SkcDmyRH4A3Dw== 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 376931346D; Fri, 7 Jul 2023 08:34:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +D6FDBPOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:27 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Thierry Reding , Mikko Perttunen Subject: [PATCH v3 04/12] drm/tegra: Set fbdev FBINFO_VIRTFB flag Date: Fri, 7 Jul 2023 10:31:55 +0200 Message-ID: <20230707083422.18691-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is in DMA-able memory and should be accessed with the CPU's regular memory ops. v2: * drop FBINFO_DEFAULT Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard Cc: Thierry Reding Cc: Mikko Perttunen --- drivers/gpu/drm/tegra/fbdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c index 82577b7c88da..d8460c5dc91e 100644 --- a/drivers/gpu/drm/tegra/fbdev.c +++ b/drivers/gpu/drm/tegra/fbdev.c @@ -132,6 +132,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, } } + info->flags |= FBINFO_VIRTFB; info->screen_base = (void __iomem *)bo->vaddr + offset; info->screen_size = size; info->fix.smem_start = (unsigned long)(bo->iova + offset); From patchwork Fri Jul 7 08:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700307 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF91FEB64DA for ; Fri, 7 Jul 2023 08:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229555AbjGGIec (ORCPT ); Fri, 7 Jul 2023 04:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232795AbjGGIea (ORCPT ); Fri, 7 Jul 2023 04:34:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F1E090; Fri, 7 Jul 2023 01:34:29 -0700 (PDT) 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 B524B227C2; Fri, 7 Jul 2023 08:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718867; 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=eQNmIiu9FPrQ2iRFAnnWdhmaGOI2fQCKVb/yrH90NQ8=; b=VeGHrl+4naMUigWFJNgEaHbu8l+a60ndGxJ7jItht0CUySXoV8YHaBTfLYw/VdL86VZZsA QyjiDXEpl6KZjpPlCWAtMtGsTa+T6m+7ls1a9scipqZ48pGc7pK2QUU3/p5W7MQB2nDR9d +KiOZ68xCMpWx6v4n1I+dsM4ApWVXK4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718867; 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=eQNmIiu9FPrQ2iRFAnnWdhmaGOI2fQCKVb/yrH90NQ8=; b=wo4WMPJab2ru9dl6PlbaSjWgsH22ME7eqg1cTwguI/1l937mvCouAwYLwLtIdouvLKn9qX sN755NhhPzcmpdBA== 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 7953813A18; Fri, 7 Jul 2023 08:34:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QNhIHBPOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:27 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Thierry Reding , Mikko Perttunen Subject: [PATCH v3 05/12] drm/tegra: Store pointer to vmap'ed framebuffer in screen_buffer Date: Fri, 7 Jul 2023 10:31:56 +0200 Message-ID: <20230707083422.18691-6-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Tegra uses DMA-able memory, which has to be acessed with CPU ops for system-memory. Store the framebuffer's vmap address in struct fb_info.screen_buffer. The currently used field 'screen_base' is for I/O memory. Suggested-by: Thierry Reding Signed-off-by: Thomas Zimmermann Cc: Thierry Reding Cc: Mikko Perttunen Acked-by: Thierry Reding --- drivers/gpu/drm/tegra/fbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c index d8460c5dc91e..0b55215d2b7e 100644 --- a/drivers/gpu/drm/tegra/fbdev.c +++ b/drivers/gpu/drm/tegra/fbdev.c @@ -133,7 +133,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, } info->flags |= FBINFO_VIRTFB; - info->screen_base = (void __iomem *)bo->vaddr + offset; + info->screen_buffer = bo->vaddr + offset; info->screen_size = size; info->fix.smem_start = (unsigned long)(bo->iova + offset); info->fix.smem_len = size; From patchwork Fri Jul 7 08:31:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700306 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FEE9C07CA9 for ; Fri, 7 Jul 2023 08:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232879AbjGGIec (ORCPT ); Fri, 7 Jul 2023 04:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232828AbjGGIea (ORCPT ); Fri, 7 Jul 2023 04:34:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A89B113; Fri, 7 Jul 2023 01:34:29 -0700 (PDT) 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 111FD227C7; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718868; 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=LnzhKOMKou+3An0VrOO3dHuid13odYqHtyulpCAw3T0=; b=B2A4Qnj4OtsJezxE8XGrXXez0UDCt9lOnaIwnj3krziOawIuUsNgiIRAsb9zB/L7ordqh2 baBngongu2PsV9oOdSqFRBvqBC+UME46G8GlSbvjC+HJtur+NDbWO7nASFmDvQdWdNqPON vVdU9KgcDnQc74xdlrDvqN8yYS614zY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718868; 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=LnzhKOMKou+3An0VrOO3dHuid13odYqHtyulpCAw3T0=; b=aP02Jh+6NLxZcjjMu3qQDqg76Mt10umC1Ww4ZpwLDYDsjPoqVnwVo5hUd3hXobjYWh5h7F 9zY0lJGpaFncQ8Dw== 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 BAB851346D; Fri, 7 Jul 2023 08:34:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yJSyLBPOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:27 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Subject: [PATCH v3 06/12] drm/exynos: Use fbdev DMA helpers Date: Fri, 7 Jul 2023 10:31:57 +0200 Message-ID: <20230707083422.18691-7-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use fbdev's DMA helpers for fbdev emulation. The driver previously used the I/O-memory helpers, while allocating DMA-able system memory. This could (in theory) result in bus errors from accessing the memory range. This bug has been present since the exynos driver was first added. v2: * drop the pointless Fixes tag (Javier) * fix typo in commit message Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Inki Dae Acked-by: Maxime Ripard Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar --- drivers/gpu/drm/exynos/Kconfig | 2 +- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 7ca7e1dab52c..661b42ad4873 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -7,7 +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 FB_DMA_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/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index fdf65587f1fe..7ca3424b59ce 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -49,9 +49,9 @@ static void exynos_drm_fb_destroy(struct fb_info *info) static const struct fb_ops exynos_drm_fb_ops = { .owner = THIS_MODULE, - __FB_DEFAULT_IO_OPS_RDWR, + __FB_DEFAULT_DMA_OPS_RDWR, DRM_FB_HELPER_DEFAULT_OPS, - __FB_DEFAULT_IO_OPS_DRAW, + __FB_DEFAULT_DMA_OPS_DRAW, .fb_mmap = exynos_drm_fb_mmap, .fb_destroy = exynos_drm_fb_destroy, }; From patchwork Fri Jul 7 08:31:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700786 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE88FC18E72 for ; Fri, 7 Jul 2023 08:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232033AbjGGIee (ORCPT ); Fri, 7 Jul 2023 04:34:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232699AbjGGIeb (ORCPT ); Fri, 7 Jul 2023 04:34:31 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 414DE1FC9; Fri, 7 Jul 2023 01:34:30 -0700 (PDT) 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 5D988227C9; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718868; 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=29PcOIs6iLDyVAi4PX0zY/wIvImQqtIsi/8f5dKmXFU=; b=yLOKMZYTGNcL7uP8++SrkoIaRCiWMtzIgtttg/CbsF2SF4NTRUkyHc1Ue4oR1jn5O9fM/n BGU+JsBDfhumrjvZmHYNAxudY8v9qeSbB3xQsXYfEVS4iNPiEuo6GoxAT+k1Q1L4mYMU0Z YOZlIMusHDPniHog5u6MHV9L5ViclxU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718868; 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=29PcOIs6iLDyVAi4PX0zY/wIvImQqtIsi/8f5dKmXFU=; b=JCI5Nj4fCXcQYbDI/qXq8Q9sPn9X02hphqoYHvAF7/54mVZP38/pXx/rfpwR8iB4w1XFuF b/s69qwLkEPaV2AQ== 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 1599E13A18; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ePlNBBTOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:28 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar Subject: [PATCH v3 07/12] drm/exynos: Set fbdev FBINFO_VIRTFB flag Date: Fri, 7 Jul 2023 10:31:58 +0200 Message-ID: <20230707083422.18691-8-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is in DMA-able memory and should be accessed with the CPU's regular memory ops. v2: * drop FBINFO_FLAG_DEFAULT Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by : Inki Dae Acked-by: Maxime Ripard Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar --- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 7ca3424b59ce..828318de8529 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -79,6 +79,7 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, offset = fbi->var.xoffset * fb->format->cpp[0]; offset += fbi->var.yoffset * fb->pitches[0]; + fbi->flags |= FBINFO_VIRTFB; fbi->screen_buffer = exynos_gem->kvaddr + offset; fbi->screen_size = size; fbi->fix.smem_len = size; From patchwork Fri Jul 7 08:31:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700784 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BBB0C04A6A for ; Fri, 7 Jul 2023 08:34:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232848AbjGGIeg (ORCPT ); Fri, 7 Jul 2023 04:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232832AbjGGIeb (ORCPT ); Fri, 7 Jul 2023 04:34:31 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31CF9131; Fri, 7 Jul 2023 01:34:30 -0700 (PDT) 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 A964B1FE9C; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718868; 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=qOyy/62uNr8cje9SfKiZkXapV4SKDd0zvrCRWxeqNm8=; b=QirZkuuAoT9UGvxaf+c4VYTCdj3lO13cXs2Ck7qtm9g40eWs79Mn4JKB53BVGVf4rVDhtJ XoJbNlEVXtybMpcQHMIKrGJWd5NzTcM7ysYGoRVFxWIerk1xJ3JRJMmp5ICZiLMqOcWNcF qBStmYc6Ls5Ez4x92znA64jL/jwacX4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718868; 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=qOyy/62uNr8cje9SfKiZkXapV4SKDd0zvrCRWxeqNm8=; b=9N59VO84tDCop4eoEYIBS6BXczl4QITRyZjjNWZxNl8x5kOPktoIhEGlWUe8Y7XMaEy8iC 3xjT8SfH+G2a+nBA== 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 753B71346D; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4BivGxTOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:28 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Tomi Valkeinen Subject: [PATCH v3 08/12] drm/omapdrm: Set VM flags in GEM-object mmap function Date: Fri, 7 Jul 2023 10:31:59 +0200 Message-ID: <20230707083422.18691-9-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use the mmap callback in struct drm_gem_object_funcs to set the VM flags. Replace a number of mmap helpers in omapdrm with their GEM helper counterparts. Generate DRM's file-operations instance with GEM's DEFINE_DRM_GEM_FOPS. The omapdrm driver uses DRM's drm_gem_mmap() helper to prepare the VMA structure. It then modifies the resulting VMA state in its own helper omap_gem_mmap_obj(). The patch improves this by setting up the VMA in the mmap callback in drm_gem_object_funcs, which is called from within drm_gem_mmap(). Omapdrm's omap_gem_mmap() and omap_gem_mmap() can then be removed from the driver. A call to drm_gem_mmap() is sufficient for the mmap operation. Finally, with the omap functions gone, the drivers file_ops in omapdriver_fops can be generated with DEFINE_DRM_GEM_FOPS, which sets DRM's default helpers. v2: * detailed commit message (Javier) * do not set VM_PFNMAP Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard Cc: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_drv.c | 12 +----------- drivers/gpu/drm/omapdrm/omap_gem.c | 24 ++++++----------------- drivers/gpu/drm/omapdrm/omap_gem.h | 3 --- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 7 +------ 4 files changed, 8 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index e2697fe80e62..afeeb7737552 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -636,17 +636,7 @@ static int dev_open(struct drm_device *dev, struct drm_file *file) return 0; } -static const struct file_operations omapdriver_fops = { - .owner = THIS_MODULE, - .open = drm_open, - .unlocked_ioctl = drm_ioctl, - .compat_ioctl = drm_compat_ioctl, - .release = drm_release, - .mmap = omap_gem_mmap, - .poll = drm_poll, - .read = drm_read, - .llseek = noop_llseek, -}; +DEFINE_DRM_GEM_FOPS(omapdriver_fops); static const struct drm_driver omap_drm_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 6b58a5bb7b44..c48fa531ca32 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -524,26 +524,11 @@ static vm_fault_t omap_gem_fault(struct vm_fault *vmf) return ret; } -/** We override mainly to fix up some of the vm mapping flags.. */ -int omap_gem_mmap(struct file *filp, struct vm_area_struct *vma) -{ - int ret; - - ret = drm_gem_mmap(filp, vma); - if (ret) { - DBG("mmap failed: %d", ret); - return ret; - } - - return omap_gem_mmap_obj(vma->vm_private_data, vma); -} - -int omap_gem_mmap_obj(struct drm_gem_object *obj, - struct vm_area_struct *vma) +static int omap_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) { struct omap_gem_object *omap_obj = to_omap_bo(obj); - vm_flags_mod(vma, VM_MIXEDMAP, VM_PFNMAP); + vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP | VM_IO | VM_MIXEDMAP); if (omap_obj->flags & OMAP_BO_WC) { vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); @@ -563,12 +548,14 @@ int omap_gem_mmap_obj(struct drm_gem_object *obj, * address_space (so unmap_mapping_range does what we want, * in particular in the case of mmap'd dmabufs) */ - vma->vm_pgoff = 0; + vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node); vma_set_file(vma, obj->filp); vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); } + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); + return 0; } @@ -1282,6 +1269,7 @@ static const struct vm_operations_struct omap_gem_vm_ops = { static const struct drm_gem_object_funcs omap_gem_object_funcs = { .free = omap_gem_free_object, .export = omap_gem_prime_export, + .mmap = omap_gem_object_mmap, .vm_ops = &omap_gem_vm_ops, }; diff --git a/drivers/gpu/drm/omapdrm/omap_gem.h b/drivers/gpu/drm/omapdrm/omap_gem.h index 4d4488939f6b..fec3fa0e4c33 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.h +++ b/drivers/gpu/drm/omapdrm/omap_gem.h @@ -57,9 +57,6 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args); /* mmap() Interface */ -int omap_gem_mmap(struct file *filp, struct vm_area_struct *vma); -int omap_gem_mmap_obj(struct drm_gem_object *obj, - struct vm_area_struct *vma); u64 omap_gem_mmap_offset(struct drm_gem_object *obj); size_t omap_gem_mmap_size(struct drm_gem_object *obj); diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c index 8e194dbc9506..36f9ee4baad3 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c @@ -64,13 +64,8 @@ static int omap_gem_dmabuf_mmap(struct dma_buf *buffer, struct vm_area_struct *vma) { struct drm_gem_object *obj = buffer->priv; - int ret = 0; - ret = drm_gem_mmap_obj(obj, omap_gem_mmap_size(obj), vma); - if (ret < 0) - return ret; - - return omap_gem_mmap_obj(obj, vma); + return drm_gem_mmap_obj(obj, omap_gem_mmap_size(obj), vma); } static const struct dma_buf_ops omap_dmabuf_ops = { From patchwork Fri Jul 7 08:32:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700785 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23A12C001DD for ; Fri, 7 Jul 2023 08:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232844AbjGGIef (ORCPT ); Fri, 7 Jul 2023 04:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbjGGIeb (ORCPT ); Fri, 7 Jul 2023 04:34:31 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C601FCE; Fri, 7 Jul 2023 01:34:30 -0700 (PDT) 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 E9B611FE9F; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718868; 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=rQb6IlG62XQo7ECKPZHeGs/kIp3cTj1XvxOVONelJVM=; b=Yp3tLA1C98+qgFvCh67kcu+sWYrS7IGuXy+Vh/2tfK/lyf/qN8i81d16xqbiZF66XBRukx QHF3IK+/B5vJvcXaNDiq5eNEeHhD1PUFmonzs86NQjMd8L0iS2on41YNpqn6pGCEkpbAaa 6EOl+7JTcxTgzV0fCzG9feSowNU2uTA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718868; 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=rQb6IlG62XQo7ECKPZHeGs/kIp3cTj1XvxOVONelJVM=; b=5bA7Nqz+lSeoJSzvAOS70AP3dA0vobKR9294FnvuXmuP8NChw2nMp53rkwCeEF/WjxmDZR 5fDlyUT1MTGf8CAA== 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 AF18A1346D; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wFnVKRTOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:28 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Tomi Valkeinen Subject: [PATCH v3 09/12] drm/omapdrm: Use GEM mmap for fbdev emulation Date: Fri, 7 Jul 2023 10:32:00 +0200 Message-ID: <20230707083422.18691-10-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The fbdev emulation currently uses fbdev's default mmap code, which has been written for I/O memory. Provide an mmap that uses GEM's mmap infrastructure. Utilize fine-grained fbdev macros to initialize struct fb_ops. The macros set the read/write and the draw callbacks for DMA memory. Set the fb_mmap callback to omapdrm's new mmap helper. Also select the correct Kconfig token for fbdev's DMA helpers. Note that the DMA helpers are the same as for system memory. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard Cc: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/Kconfig | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig index b4ac76c9f31b..d3c4877e465c 100644 --- a/drivers/gpu/drm/omapdrm/Kconfig +++ b/drivers/gpu/drm/omapdrm/Kconfig @@ -4,7 +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 FB_DMA_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 b7ccce0704a3..b1a2d00ef52d 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -76,6 +76,15 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var, return drm_fb_helper_pan_display(var, fbi); } +static int omap_fbdev_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) +{ + struct drm_fb_helper *helper = info->par; + struct drm_framebuffer *fb = helper->fb; + struct drm_gem_object *bo = drm_gem_fb_get_obj(fb, 0); + + return drm_gem_mmap_obj(bo, omap_gem_mmap_size(bo), vma); +} + static void omap_fbdev_fb_destroy(struct fb_info *info) { struct drm_fb_helper *helper = info->par; @@ -97,14 +106,16 @@ static void omap_fbdev_fb_destroy(struct fb_info *info) static const struct fb_ops omap_fb_ops = { .owner = THIS_MODULE, - FB_DEFAULT_SYS_OPS, + __FB_DEFAULT_DMA_OPS_RDWR, .fb_check_var = drm_fb_helper_check_var, .fb_set_par = drm_fb_helper_set_par, .fb_setcmap = drm_fb_helper_setcmap, .fb_blank = drm_fb_helper_blank, .fb_pan_display = omap_fbdev_pan_display, + __FB_DEFAULT_DMA_OPS_DRAW, .fb_ioctl = drm_fb_helper_ioctl, - .fb_destroy = omap_fbdev_fb_destroy, + .fb_mmap = omap_fbdev_fb_mmap, + .fb_destroy = omap_fbdev_fb_destroy, }; static int omap_fbdev_create(struct drm_fb_helper *helper, From patchwork Fri Jul 7 08:32:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700305 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BF85C00528 for ; Fri, 7 Jul 2023 08:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231745AbjGGIef (ORCPT ); Fri, 7 Jul 2023 04:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232840AbjGGIeb (ORCPT ); Fri, 7 Jul 2023 04:34:31 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A471B1BF0; Fri, 7 Jul 2023 01:34:30 -0700 (PDT) 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 367621FEAB; Fri, 7 Jul 2023 08:34:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718869; 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=J/NRie959JEQJ9xVVtVDiOvK8CURnmkTr76iBarw5rA=; b=JjaII2g35R5NsnqlHKP463prSILOlEmTHgubbOz60n/kpf/IMf/Vexf149v+5pdSXckY++ YBqvs8onsV5GHcfuX/+K4ZhRRloUvsK0GeoGW973vU+YzsKKQ/Bwir5mMoNM99DoQE5rUI Wgfpw3ZuyfOl+QQk5DdxHHFuqFnBWHY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718869; 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=J/NRie959JEQJ9xVVtVDiOvK8CURnmkTr76iBarw5rA=; b=JUF6XvvKnCtqoJYcMs8ZWMSeMpIM2H/khMCamaX0LW+mlFNDQD7j8zGICu/ggnrqMcaEtm 48ho0j+QLLQeUpDA== 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 EE16E13A18; Fri, 7 Jul 2023 08:34:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KGoqORTOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:28 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Tomi Valkeinen Subject: [PATCH v3 10/12] drm/omapdrm: Set fbdev FBINFO_VIRTFB flag Date: Fri, 7 Jul 2023 10:32:01 +0200 Message-ID: <20230707083422.18691-11-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Mark the framebuffer with FBINFO_VIRTFB. The framebuffer range is in DMA-able memory and should be accessed with the CPU's regular memory ops. v2: * drop FBINFO_DEFAULT Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard Cc: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_fbdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index b1a2d00ef52d..2821182f1d93 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -207,6 +207,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, drm_fb_helper_fill_info(fbi, helper, sizes); + fbi->flags |= FBINFO_VIRTFB; fbi->screen_buffer = omap_gem_vaddr(bo); fbi->screen_size = bo->size; fbi->fix.smem_start = dma_addr; From patchwork Fri Jul 7 08:32:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700783 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3835BEB64D9 for ; Fri, 7 Jul 2023 08:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232842AbjGGIei (ORCPT ); Fri, 7 Jul 2023 04:34:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232782AbjGGIec (ORCPT ); Fri, 7 Jul 2023 04:34:32 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA474183; Fri, 7 Jul 2023 01:34:30 -0700 (PDT) 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 723FE1FEC7; Fri, 7 Jul 2023 08:34:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718869; 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=ekgUz+mjy+gWrvl+EnjksazPACAkT7jWIf87XY9ABXw=; b=XmqrVIohbJzyCDb2JyXKTkBWpsOXFJGd/J9G0No6PTxcxbOI1jyuSYzw9kxJvRiVRQ51wM sbJ9SXVExu5UNft77a69oLhW5ZvydKcs5JtA63oya8kEhLLqajbRv491VsfjhKZxB+O51w xEmlJy05LZ1eASP5QuJ8hIMKjqoXZnI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718869; 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=ekgUz+mjy+gWrvl+EnjksazPACAkT7jWIf87XY9ABXw=; b=wAYzu4eGL0qd6Cmdi5nhYNxFXDiPsfXvoDKUTxoZpMbMFGh1hyyjlO+2nIpbJ7trHSUEEI /KN1s6L8kZZyhpBQ== 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 3B9591346D; Fri, 7 Jul 2023 08:34:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iAiZDRXOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:29 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann , Helge Deller Subject: [PATCH v3 11/12] fbdev: Remove FB_DEFAULT_SYS_OPS Date: Fri, 7 Jul 2023 10:32:02 +0200 Message-ID: <20230707083422.18691-12-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Remove the initializer macro FB_DEFAULT_SYS_OPS and its helper macro __FB_DEFAULT_SYS_OPS_MMAP. There are no users. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Maxime Ripard Cc: Helge Deller (maintainer:FRAMEBUFFER LAYER) --- include/linux/fb.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index 1191a78c5289..d370f84fbca9 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -586,14 +586,6 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, .fb_copyarea = sys_copyarea, \ .fb_imageblit = sys_imageblit -#define __FB_DEFAULT_SYS_OPS_MMAP \ - .fb_mmap = NULL /* default implementation */ - -#define FB_DEFAULT_SYS_OPS \ - __FB_DEFAULT_SYS_OPS_RDWR, \ - __FB_DEFAULT_SYS_OPS_DRAW, \ - __FB_DEFAULT_SYS_OPS_MMAP - /* * Helpers for framebuffers in DMA-able memory */ From patchwork Fri Jul 7 08:32:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 700304 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A0C7C25B5E for ; Fri, 7 Jul 2023 08:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232916AbjGGIeh (ORCPT ); Fri, 7 Jul 2023 04:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232842AbjGGIec (ORCPT ); Fri, 7 Jul 2023 04:34:32 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AEB7113; Fri, 7 Jul 2023 01:34:31 -0700 (PDT) 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 AD988227C6; Fri, 7 Jul 2023 08:34:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718869; 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=pG2atEnU/fnP5AEZfc/l6A/pO+L/pdnmLd89LQ4Iezc=; b=z/1iK313cscssnSl3dukt9zaU/NvtiPYTbe1opqCaObgoeQyIYIu6KWiAKpUuSqep1JrwJ allC6ursXV8sNpzlEpZFp6UV9gDWqRTKHpVHJXhFoXDWC0vjGcjx5yBDWkMZKDtwMM3DwR 3GH0D+J0Hr7NDnhSsXbgd/OkhPPGpX8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718869; 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=pG2atEnU/fnP5AEZfc/l6A/pO+L/pdnmLd89LQ4Iezc=; b=zFeqG4PkIL07SuW6SJkGFssK3z7jLnXtgnpdYnTtVcIxMj8Nb97Q9jXvOSA32fm5x4vtNo rahxaezobqYQSzCw== 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 7BA681346D; Fri, 7 Jul 2023 08:34:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EFvwHBXOp2RdQAAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:34:29 +0000 From: Thomas Zimmermann To: javierm@redhat.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-fbdev@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v3 12/12] fbdev: Harmonize some comments in Date: Fri, 7 Jul 2023 10:32:03 +0200 Message-ID: <20230707083422.18691-13-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707083422.18691-1-tzimmermann@suse.de> References: <20230707083422.18691-1-tzimmermann@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Make the comments for I/O, system and DMA memory say the same. Makes the header file's structure more obvious. Suggested-by: Javier Martinez Canillas Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- include/linux/fb.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index d370f84fbca9..c8ca9c265fda 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -529,7 +529,7 @@ extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); extern int fb_blank(struct fb_info *info, int blank); /* - * Drawing operations where framebuffer is in I/O memory + * Helpers for framebuffers in I/O memory */ extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); @@ -540,10 +540,6 @@ extern ssize_t fb_io_read(struct fb_info *info, char __user *buf, extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos); -/* - * Initializes struct fb_ops for framebuffers in I/O memory. - */ - #define __FB_DEFAULT_IO_OPS_RDWR \ .fb_read = fb_io_read, \ .fb_write = fb_io_write @@ -562,7 +558,7 @@ extern ssize_t fb_io_write(struct fb_info *info, const char __user *buf, __FB_DEFAULT_IO_OPS_MMAP /* - * Drawing operations where framebuffer is in system RAM + * Helpers for framebuffers in system memory */ extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect); @@ -573,10 +569,6 @@ extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf, extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos); -/* - * Initializes struct fb_ops for framebuffers in system memory. - */ - #define __FB_DEFAULT_SYS_OPS_RDWR \ .fb_read = fb_sys_read, \ .fb_write = fb_sys_write