From patchwork Tue Dec 21 10:46:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 424141 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBLAkT05009606 for ; Tue, 21 Dec 2010 10:46:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751250Ab0LUKqi (ORCPT ); Tue, 21 Dec 2010 05:46:38 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:64444 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193Ab0LUKqi (ORCPT ); Tue, 21 Dec 2010 05:46:38 -0500 Received: from axis700.grange (pD9EB91F3.dip0.t-ipconnect.de [217.235.145.243]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MdoPF-1PlrGb165N-00PP8v; Tue, 21 Dec 2010 11:46:36 +0100 Received: by axis700.grange (Postfix, from userid 1000) id E791EE6A77; Tue, 21 Dec 2010 11:46:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id E583C1067BC; Tue, 21 Dec 2010 11:46:35 +0100 (CET) Date: Tue, 21 Dec 2010 11:46:35 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-fbdev@vger.kernel.org cc: linux-sh@vger.kernel.org Subject: [PATCH 2/3] fbdev: sh-mobile: retrieve and propagate display sizes from EDID Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:qZP663tDJ82YiJonP6K04jsQ6IWHRveRENfHRK64lMb /fx961qXRRE9Bb9ZbvUku87cqdUW6VGXk8cIfQJXyBbWjydRXW yvTB3f/2vcGbi88KDHCVsLd3jHPUKzD+AoNK+OIjRn0Pox+5eI pRytee4wXMCSbUMqiKBZD1TSlYrHZd27drgeZ4MKNzBmKiDXLL ti+Aj5BBzzcZAv8hTJg6aF269Z4upJntKgglAAi4Qk= 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 21 Dec 2010 10:46:39 +0000 (UTC) diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index d7df103..fcda0e9 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c @@ -787,6 +787,9 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi) found_rate_error = rate_error; } + hdmi->var.width = hdmi->monspec.max_x * 10; + hdmi->var.height = hdmi->monspec.max_y * 10; + /* * TODO 1: if no ->info is present, postpone running the config until * after ->info first gets registered. @@ -960,8 +963,12 @@ static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi) dev_dbg(info->dev, "Old %ux%u, new %ux%u\n", mode1.xres, mode1.yres, mode2.xres, mode2.yres); - if (fb_mode_is_equal(&mode1, &mode2)) + if (fb_mode_is_equal(&mode1, &mode2)) { + /* It can be a different monitor with an equal video-mode */ + old_var->width = new_var->width; + old_var->height = new_var->height; return false; + } dev_dbg(info->dev, "Switching %u -> %u lines\n", mode1.yres, mode2.yres); @@ -1057,8 +1064,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) * on, if we run a resume here, the logo disappears */ if (lock_fb_info(hdmi->info)) { - sh_hdmi_display_on(hdmi, hdmi->info); - unlock_fb_info(hdmi->info); + struct fb_info *info = hdmi->info; + info->var.width = hdmi->var.width; + info->var.height = hdmi->var.height; + sh_hdmi_display_on(hdmi, info); + unlock_fb_info(info); } } else { /* New monitor or have to wake up */