From patchwork Thu Jun 23 13:16:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Katsak, William Alexander (Bill)" X-Patchwork-Id: 908862 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 p5NDJGH2023242 for ; Thu, 23 Jun 2011 13:19:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757399Ab1FWNTQ (ORCPT ); Thu, 23 Jun 2011 09:19:16 -0400 Received: from ihemail3.lucent.com ([135.245.0.37]:37804 "EHLO ihemail3.lucent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756318Ab1FWNTP (ORCPT ); Thu, 23 Jun 2011 09:19:15 -0400 Received: from usnavsmail3.ndc.alcatel-lucent.com (usnavsmail3.ndc.alcatel-lucent.com [135.3.39.11]) by ihemail3.lucent.com (8.13.8/IER-o) with ESMTP id p5NDJEqW011282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Jun 2011 08:19:14 -0500 (CDT) Received: from thread.research.bell-labs.com (thread.research.bell-labs.com [135.104.120.92]) by usnavsmail3.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id p5NDJDfn018043; Thu, 23 Jun 2011 08:19:13 -0500 From: William Katsak To: linux-fbdev@vger.kernel.org Cc: William Katsak Subject: [PATCH] This patch fixes a problem where a DisplayLink device autoselects a suboptimal framebuffer resolution. Date: Thu, 23 Jun 2011 09:16:29 -0400 Message-Id: <1308834989-28712-1-git-send-email-william.katsak@alcatel-lucent.com> X-Mailer: git-send-email 1.7.3.4 X-Scanned-By: MIMEDefang 2.57 on 135.245.2.37 X-Scanned-By: MIMEDefang 2.64 on 135.3.39.11 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]); Thu, 23 Jun 2011 13:19:16 +0000 (UTC) The situation in which the problem occurred was with a Plugable UGA-2K-A connected to a Samsung EX2220X display. The driver indicates that 1920x1080 is a valid mode (the first mode available, in fact), but proceeds to set the framebuffer size to 1600x1200. The patch corrects what seems to be a logic error, regarding unsetting the FB_MISC_1ST_DETAIL flag, if the first (top/best) mode is invalid. The existing code unset the flag if ANY mode was invalid. Signed-off-by: William Katsak --- drivers/video/udlfb.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 52b0f3e..816a4fd 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -1233,8 +1233,12 @@ static int dlfb_setup_modes(struct dlfb_data *dev, if (dlfb_is_valid_mode(&info->monspecs.modedb[i], info)) fb_add_videomode(&info->monspecs.modedb[i], &info->modelist); - else /* if we've removed top/best mode */ - info->monspecs.misc &= ~FB_MISC_1ST_DETAIL; + else { + if (i == 0) + /* if we've removed top/best mode */ + info->monspecs.misc + &= ~FB_MISC_1ST_DETAIL; + } } default_vmode = fb_find_best_display(&info->monspecs,