From patchwork Mon Feb 19 14:19:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13562778 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 8CD39C48BC3 for ; Mon, 19 Feb 2024 14:21:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 85F7510E2D6; Mon, 19 Feb 2024 14:21:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=atomide.com header.i=@atomide.com header.b="LjnfjspU"; dkim-atps=neutral Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23AE810E269 for ; Mon, 19 Feb 2024 14:21:19 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id DF0B66088D; Mon, 19 Feb 2024 14:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1708352478; bh=2+gw+ZCvOzg8K6L47uCfoS1vDcz2pWSSndevxkn0Z5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LjnfjspUcB19s1joTmF0IsWSr8pGHQOivb0aVeAMs9ctz0GEGoAAItcAZEzcErgDX qmv5eS8xVoXXs5uzUXYeM1u5suzT1Qkv1xUKwIZtwadU08gp4DcMIjsbqA8sbzGzqD oqr6QZFoi1pgffCnSM0a+j6wdbMOVXTTuIbZ8LOhewAAs1jgYWjcwfjzC36wXut0cY xqer1uhYo3vYqx3IQoY8gnbyYfVwJy7aMOre4WhSKEpHQ8m3HdkQB3Xdcw/fh50jUV hAUwaBotS/fNWtBKIF5h4TGRYRLJ7kqC8DrjGpfzokfIeG7S8VnBbuMSKYOy/csxmY hXKY2AM+kbczQ== From: Tony Lindgren To: Tomi Valkeinen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Javier Martinez Canillas , Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/omapdrm: Fix console with deferred ops Date: Mon, 19 Feb 2024 16:19:56 +0200 Message-ID: <20240219142001.19727-2-tony@atomide.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240219142001.19727-1-tony@atomide.com> References: <20240219142001.19727-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Commit 95da53d63dcf ("drm/omapdrm: Use regular fbdev I/O helpers") broke console because there is no damage handling in fb_sys_write() unlike we have in drm_fb_helper_sys_write(). Let's fix the issue by using deferred ops with fb helpers for damage. Fixes: 95da53d63dcf ("drm/omapdrm: Use regular fbdev I/O helpers") Signed-off-by: Tony Lindgren --- drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/omapdrm/omap_fbdev.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig --- a/drivers/gpu/drm/omapdrm/Kconfig +++ b/drivers/gpu/drm/omapdrm/Kconfig @@ -5,6 +5,7 @@ config DRM_OMAP depends on ARCH_OMAP2PLUS select DRM_KMS_HELPER select FB_DMAMEM_HELPERS if DRM_FBDEV_EMULATION + select FB_IOMEM_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 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -51,6 +51,10 @@ static void pan_worker(struct work_struct *work) omap_gem_roll(bo, fbi->var.yoffset * npages); } +FB_GEN_DEFAULT_DEFERRED_IOMEM_OPS(omap_fbdev, + drm_fb_helper_damage_range, + drm_fb_helper_damage_area) + static int omap_fbdev_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi) { @@ -106,13 +110,13 @@ static void omap_fbdev_fb_destroy(struct fb_info *info) static const struct fb_ops omap_fb_ops = { .owner = THIS_MODULE, - __FB_DEFAULT_DMAMEM_OPS_RDWR, + __FB_DEFAULT_DEFERRED_OPS_RDWR(omap_fbdev), .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_DMAMEM_OPS_DRAW, + __FB_DEFAULT_DEFERRED_OPS_DRAW(omap_fbdev), .fb_ioctl = drm_fb_helper_ioctl, .fb_mmap = omap_fbdev_fb_mmap, .fb_destroy = omap_fbdev_fb_destroy,