From patchwork Sun Dec 15 20:40:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 3350871 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 972A59F32E for ; Sun, 15 Dec 2013 20:41:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9CAE20145 for ; Sun, 15 Dec 2013 20:41:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BDF3200E6 for ; Sun, 15 Dec 2013 20:41:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751897Ab3LOUkz (ORCPT ); Sun, 15 Dec 2013 15:40:55 -0500 Received: from mo-p00-ob.rzone.de ([81.169.146.162]:9682 "EHLO mo-p00-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821Ab3LOUkz (ORCPT ); Sun, 15 Dec 2013 15:40:55 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1387140052; l=1866; s=domk; d=aepfle.de; h=Date:Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=ezhAbvfm1QQBQ2X3NT1N4Bjukoc=; b=c9+0LxLRTa+Y5p3dBpWhItPzmU4e1bh6O2RqcRBcawYsYFGW44NcLXy4l7IMQsMLr1M OgcVg9EAqXHyUsfvd1WS1OYSOQzPE+hBKi+MXMW+fwe4R77OGRR8m/IOCCDxfBsa6H7Yl PqOqplOZpwKqmsY1jGQ5wR9blXaKWS63IqI= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWJwKkjb5r/XwS/H9GI= X-RZG-CLASS-ID: mo00 Received: from probook.site (dslb-088-065-083-211.pools.arcor-ip.net [88.65.83.211]) by smtp.strato.de (RZmta 32.17 DYNA|AUTH) with (TLSv1:DHE-RSA-AES256-SHA encrypted) ESMTPSA id Y0094cpBFKep6al ; Sun, 15 Dec 2013 21:40:51 +0100 (CET) Received: by probook.site (Postfix, from userid 1000) id 213135010C; Sun, 15 Dec 2013 21:40:51 +0100 (CET) From: Olaf Hering To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Olaf Hering Subject: [PATCH] fbmem: really support wildcard video=options for all fbdev drivers Date: Sun, 15 Dec 2013 21:40:35 +0100 Message-Id: <1387140035-12234-1-git-send-email-olaf@aepfle.de> X-Mailer: git-send-email 1.8.5 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Documentation/fb/modedb.txt states that video=option should be considered a global option. But video_setup and fb_get_options are not coded that way. Instead its required to boot with video=driver:option to set a given option in drvier. This is cumbersome because it requires to know in advance which driver will be active for a given board/kernel. The following patch implements the documented catchall for the fbdev drivers. It is now possible to boot with video=XxY without the need to know the active driver in advance. The specific case it tries to fix is syslinux in the SUSE installer which offers a menu to set a display resolution. Right now this just appends the vga= option the kernel. But in addition to vga= it should be possible to pass a generic video=XxY for all framebuffer/drm drivers. With this change forcing a certain window size of VM displays is now much easier. Today the video= option is stored in a global fb_mode_option. But unfortunately only drm uses it. Note: this change introduces a small memleak if video=option is actually used because fb_mode_option is const. Most drivers use strsep to get to individual options. This could be fixed in a followup patch which always releases the option string in every caller of fb_get_options. Signed-off-by: Olaf Hering --- drivers/video/fbmem.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 010d191..cde4619 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -1930,6 +1930,9 @@ int fb_get_options(const char *name, char **option) options = opt + name_len + 1; } } + /* No match, pass global option */ + if (!options && option && fb_mode_option) + options = kstrdup(fb_mode_option, GFP_KERNEL); if (options && !strncmp(options, "off", 3)) retval = 1;