From patchwork Sun Aug 21 20:35:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bernie@plugable.com X-Patchwork-Id: 1083842 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7LKaAKP023433 for ; Sun, 21 Aug 2011 20:36:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755766Ab1HUUgK (ORCPT ); Sun, 21 Aug 2011 16:36:10 -0400 Received: from mail-iy0-f170.google.com ([209.85.210.170]:50178 "EHLO mail-iy0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755615Ab1HUUgJ (ORCPT ); Sun, 21 Aug 2011 16:36:09 -0400 Received: by iye16 with SMTP id 16so9120681iye.1 for ; Sun, 21 Aug 2011 13:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=bfwjWxd8a/GUDWV3LUUfOx7bgkIvXdqkj4KcvKW3Ahw=; b=AWhkxpgYaak78OY+xSx1hUGCxVPEWNNxLm349OKvj0b4+ORmysQrThlOWGggO2JiKG 5PNE/nI0vMk+ppQjnVt45obmTbc4vj1w4ujpZ4NpHppSOwIbCFVty3oB9o7V6BTjFpGL 2PrBj7xok7DTuY2Iuk+PH7yzXF5CAVwGkHLTk= Received: by 10.42.29.199 with SMTP id s7mr1794341icc.301.1313958969032; Sun, 21 Aug 2011 13:36:09 -0700 (PDT) Received: from localhost.localdomain (c-76-22-58-200.hsd1.wa.comcast.net [76.22.58.200]) by mx.google.com with ESMTPS id t4sm5027894icw.19.2011.08.21.13.36.07 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 21 Aug 2011 13:36:08 -0700 (PDT) From: bernie@plugable.com To: linux-fbdev@vger.kernel.org Cc: FlorianSchandinat@gmx.de, Bernie Thompson Subject: [PATCH 5/6] udlfb: Enable fb_defio by default Date: Sun, 21 Aug 2011 13:35:38 -0700 Message-Id: <1313958939-5681-5-git-send-email-bernie@plugable.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 21 Aug 2011 20:36:11 +0000 (UTC) From: Bernie Thompson Enables page fault based detection of mmap writes to the framebuffer, which allows standard fbdev apps (like the generic fbdev xorg driver) to work on DisplayLink devices. Not all bugs are shaken out of the fb_defio path of udlfb, but it's tantalizingly close, so this seems a good time to enable by default. Alternatively, option can be disabled when running with an xorg driver that can more directly communicate damaged regions of the framebuffer via IOCTL. This is a simpler, higher perf option, when available. Signed-off-by: Bernie Thompson --- Documentation/fb/udlfb.txt | 24 ++++++++++++++++-------- drivers/video/udlfb.c | 4 ++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt index 473ceed..c6d90a6 100644 --- a/Documentation/fb/udlfb.txt +++ b/Documentation/fb/udlfb.txt @@ -87,20 +87,28 @@ Special configuration for udlfb is usually unnecessary. There are a few options, however. From the command line, pass options to modprobe -modprobe udlfb defio=1 console=1 +modprobe udlfb fb_defio=0 console=1 shadow=1 -Or for permanent option, create file like /etc/modprobe.d/options with text -options udlfb defio=1 console=1 +Or modify options on the fly at /sys/module/udlfb/parameters directory via +sudo nano fb_defio +change the parameter in place, and save the file. -Accepted options: +Unplug/replug USB device to apply with new settings + +Or for permanent option, create file like /etc/modprobe.d/udlfb.conf with text +options udlfb fb_defio=0 console=1 shadow=1 + +Accepted boolean options: fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel module to track changed areas of the framebuffer by page faults. - Standard fbdev applications that use mmap but that do not - report damage, may be able to work with this enabled. - Disabled by default because of overhead and other issues. + Standard fbdev applications that use mmap but that do not + report damage, should be able to work with this enabled. + Disable when running with X server that supports reporting + changed regions via ioctl, as this method is simpler, + more stable, and higher performance. -console Allow fbcon to attach to udlfb provided framebuffers. This +console Allow fbcon to attach to udlfb provided framebuffers. This is disabled by default because fbcon will aggressively consume the first framebuffer it finds, which isn't usually what the user wants in the case of USB displays. diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 5a13dc5..5207bd2 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -71,7 +71,7 @@ MODULE_DEVICE_TABLE(usb, id_table); /* module options */ static int console; /* Optionally allow fbcon to consume first framebuffer */ -static int fb_defio; /* Optionally enable experimental fb_defio mmap support */ +static int fb_defio = 1; /* Detect mmap writes using page faults */ static int shadow = 1; /* Optionally disable shadow framebuffer */ /* dlfb keeps a list of urbs for efficient bulk transfers */ @@ -1961,7 +1961,7 @@ module_param(console, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); MODULE_PARM_DESC(console, "Allow fbcon to consume first framebuffer found"); module_param(fb_defio, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); -MODULE_PARM_DESC(fb_defio, "Enable fb_defio mmap support. *Experimental*"); +MODULE_PARM_DESC(fb_defio, "Page fault detection of mmap writes"); module_param(shadow, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP); MODULE_PARM_DESC(shadow, "Shadow vid mem. Disable to save mem but lose perf");