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: 430353 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 3BB03C433ED for ; Sat, 1 May 2021 20:01:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CFCC61446 for ; Sat, 1 May 2021 20:01:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231670AbhEAUCL (ORCPT ); Sat, 1 May 2021 16:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231655AbhEAUCL (ORCPT ); Sat, 1 May 2021 16:02:11 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D56A7C06174A for ; Sat, 1 May 2021 13:01:20 -0700 (PDT) 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 Cc: Laurent Pinchart , Merlijn Wajer , Daniel Vetter , David Airlie , linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@collabora.com, Sebastian Reichel , Carl Philipp Klemm 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 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- 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);