From patchwork Sat Sep 7 12:25:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 2856321 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A03E49F4D4 for ; Sat, 7 Sep 2013 12:25:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B547220375 for ; Sat, 7 Sep 2013 12:25:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1A6820335 for ; Sat, 7 Sep 2013 12:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750847Ab3IGMZt (ORCPT ); Sat, 7 Sep 2013 08:25:49 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:59222 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838Ab3IGMZs (ORCPT ); Sat, 7 Sep 2013 08:25:48 -0400 Received: by mail-ie0-f171.google.com with SMTP id 9so8978198iec.2 for ; Sat, 07 Sep 2013 05:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/KFbWpK2RQZB1gKwqDl5xVACf9q7IgzTIIjVZpL466w=; b=l5YBx1Bwa7aiiYNSuB76KPoV1fEyyfqEm7/7/joXyE9sdDKQCC4ujn0iLfDfN722Cf jfxPKIgUWAQv8+eDdb8durpcXvzgy2A8MCy5tJKKIrMPSuYRx3Alp1NoW6oiPvvmMKcC bUEKVtKL3H7GNi1wb2csAIlkOb97Pq2YmbmkVDI4DH9RwvCKP//nnbF/XWuHrXyngjxK xFEN5qObFSwEGLqcFYLw7NYW0ai85CAgej99Dv16CrEEc3NP1uDXpnajGbBDyu3tezBv alTea502O7DloBMMOSHnXIS5m5E5ABv52yUkQRasKcxWt3G0uMhoWuMDCDK13G/8/WuO dtBg== MIME-Version: 1.0 X-Received: by 10.50.154.41 with SMTP id vl9mr2011228igb.10.1378556747923; Sat, 07 Sep 2013 05:25:47 -0700 (PDT) Received: by 10.42.142.195 with HTTP; Sat, 7 Sep 2013 05:25:47 -0700 (PDT) In-Reply-To: References: Date: Sat, 7 Sep 2013 14:25:47 +0200 Message-ID: Subject: Re: [BUG] simplefb not showing any output From: David Herrmann To: Tom Gundersen Cc: Stephen Warren , "linux-fbdev@vger.kernel.org" Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Tom On Sat, Sep 7, 2013 at 1:47 PM, Tom Gundersen wrote: > On Sat, Sep 7, 2013 at 1:18 PM, David Herrmann wrote: >> On Sat, Sep 7, 2013 at 11:26 AM, Tom Gundersen wrote: >>> On Fri, Sep 6, 2013 at 6:11 PM, Tom Gundersen wrote: >>>> The driver seems to load ok, but sadly it does not give any output. If >>>> I boot via the gummiboot menu the screen remains black, and if I don't >>>> enter the gummiboot menu the screen remains grey (it is a Mac). >>> >>> My apologies, this was a config error (I somehow ended up with >>> FRAMEBUFFER_CONSOLE=m, which works fine with inteldrmfb, but obviously >>> not with any of the compiled in ones). >> >> Good, I almost went crazy looking for an error. Does that mean >> simplefb works for you? > > Sorry about that! Yes, it now works. No worries. Going crazy is part of working on the kernel, I guess. >> I guess the x86-sysfb patch is still needed? > > Yes, that is still needed. Ok, I will keep watching it then. >> Now I only wonder why the i915 issue showed up. Is it also solved with >> a built-in fbcon? > > Sadly, no, that problem persists. I will let Daniel know on IRC. > A related question: is it expected that simplefb should be > significantly slower than efifb, or is that something worth looking > into? My boot with simplefb is roughly five seconds slower than with > efifb. Coincidentally, I notice the same (or similar slowdown) with > inteldrmfb when I see the oops (but not otherwise). That is probably related to the missing write-combine tag in ioremap. Stephen, any objections to this attached patch? Tom, if this solves the speed-issues, I will send it out once I get home. Thanks David (Patch also attached in case of new-lines issues) From dbfb8e12166d494cd60823cbe84134d5d1a73ec8 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sat, 7 Sep 2013 14:22:01 +0200 Subject: [PATCH] devm/simplefb: introduce and use devm_ioremap_wc() We want to use devm_ioremap_nocache() or even devm_ioremap_wc() to speed up fbdev writes _a lot_. As devm_ioremap_wc() doesn't exist, yet, introduce it along the way. Note that ioremap_wc() is aliases to ioremap_nocache() in asm-generic/{io,iomem}.h so we can safely expect all architectures to either provide it or use the same alias. Reported-by: Tom Gundersen Signed-off-by: David Herrmann Cc: Stephen Warren Cc: Greg Kroah-Hartman Cc: Andrew Morton Tested-by: Alexandre Courbot Tested-by: Stephen Warren --- drivers/video/simplefb.c | 4 ++-- include/linux/io.h | 2 ++ lib/devres.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) * @addr: Address to unmap diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c index 8d78106..a29f1c4 100644 --- a/drivers/video/simplefb.c +++ b/drivers/video/simplefb.c @@ -212,8 +212,8 @@ static int simplefb_probe(struct platform_device *pdev) info->fbops = &simplefb_ops; info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE; - info->screen_base = devm_ioremap(&pdev->dev, info->fix.smem_start, - info->fix.smem_len); + info->screen_base = devm_ioremap_wc(&pdev->dev, info->fix.smem_start, + info->fix.smem_len); if (!info->screen_base) { framebuffer_release(info); return -ENODEV; diff --git a/include/linux/io.h b/include/linux/io.h index f4f42fa..c529410 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -62,6 +62,8 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, unsigned long size); void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, unsigned long size); +void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset, + unsigned long size); void devm_iounmap(struct device *dev, void __iomem *addr); int check_signature(const volatile void __iomem *io_addr, const unsigned char *signature, int length); diff --git a/lib/devres.c b/lib/devres.c index 8235331..34af7a9 100644 --- a/lib/devres.c +++ b/lib/devres.c @@ -72,6 +72,34 @@ void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, EXPORT_SYMBOL(devm_ioremap_nocache); /** + * devm_ioremap_wc - Managed ioremap_wc() + * @dev: Generic device to remap IO address for + * @offset: BUS offset to map + * @size: Size of map + * + * Managed ioremap_wc(). Map is automatically unmapped on driver detach. + */ +void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset, + unsigned long size) +{ + void __iomem **ptr, *addr; + + ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return NULL; + + addr = ioremap_wc(offset, size); + if (addr) { + *ptr = addr; + devres_add(dev, ptr); + } else + devres_free(ptr); + + return addr; +} +EXPORT_SYMBOL(devm_ioremap_wc); + +/** * devm_iounmap - Managed iounmap() * @dev: Generic device to unmap for