From patchwork Sat May 1 20:00:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 12235049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7F53C433B4 for ; Sat, 1 May 2021 20:01:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A1ACF61446 for ; Sat, 1 May 2021 20:01:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1ACF61446 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AB226E1B5; Sat, 1 May 2021 20:01:23 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0CDB6E1B5 for ; Sat, 1 May 2021 20:01:20 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 5FA761F42C4E Received: by earth.universe (Postfix, from userid 1000) id B252E3C0C96; Sat, 1 May 2021 22:01:15 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel , Tomi Valkeinen , Tony Lindgren Subject: [PATCHv1] drm/omap: get fbdev working for manually updated display Date: Sat, 1 May 2021 22:00:50 +0200 Message-Id: <20210501200050.410704-1-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.30.2 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: , Cc: Carl Philipp Klemm , kernel@collabora.com, David Airlie , Merlijn Wajer , Sebastian Reichel , dri-devel@lists.freedesktop.org, Laurent Pinchart , linux-omap@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Running a legacy application, which directly uses /dev/fb0 currently results in display not being refreshed when the application mmaps the memory instead of calling write(). Deferred IO support will also schedule dirty_work with the damage collected from the mmap page writes and thus gets some more legacy applications working. Delay frequency settings have been taken over from drm_fb_helper_generic_probe(). Reported-by: Carl Philipp Klemm Tested-by: Carl Philipp Klemm Signed-off-by: Sebastian Reichel Reviewed-by: Laurent Pinchart --- Hi, I still need to fix my Droid 4, so I only compile tested this myself. -- Sebastian --- drivers/gpu/drm/omapdrm/omap_fbdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) base-commit: 152d32aa846835987966fd20ee1143b0e05036a0 diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index 42eac6ad12bd..fc3897d2d7cc 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -87,6 +87,11 @@ static const struct fb_ops omap_fb_ops = { .fb_imageblit = drm_fb_helper_sys_imageblit, }; +static struct fb_deferred_io omap_fb_defio = { + .delay = HZ / 20, + .deferred_io = drm_fb_helper_deferred_io, +}; + static int omap_fbdev_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { @@ -176,6 +181,9 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, drm_fb_helper_fill_info(fbi, helper, sizes); + fbi->fbdefio = &omap_fb_defio; + fb_deferred_io_init(fbi); + dev->mode_config.fb_base = dma_addr; fbi->screen_buffer = omap_gem_vaddr(fbdev->bo);