From patchwork Wed Jul 18 16:49:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 1212461 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3DF353FCFC for ; Wed, 18 Jul 2012 16:49:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459Ab2GRQtU (ORCPT ); Wed, 18 Jul 2012 12:49:20 -0400 Received: from mo-p00-ob.rzone.de ([81.169.146.161]:65098 "EHLO mo-p00-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850Ab2GRQtT (ORCPT ); Wed, 18 Jul 2012 12:49:19 -0400 X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfmwtM48/lq387pErHR X-RZG-CLASS-ID: mo00 Received: from probook.site (dslb-084-057-076-207.pools.arcor-ip.net [84.57.76.207]) by smtp.strato.de (jorabe mo30) (RZmta 29.19 DYNA|AUTH) with (DHE-RSA-AES256-SHA encrypted) ESMTPA id n00cefo6IGCHEq ; Wed, 18 Jul 2012 18:49:16 +0200 (CEST) Received: by probook.site (Postfix, from userid 1000) id 194EB18637; Wed, 18 Jul 2012 18:49:16 +0200 (CEST) From: olaf@aepfle.de To: Benjamin Herrenschmidt Cc: linux-fbdev@vger.kernel.org, linuxppc-dev@ozlabs.org, Tony Breeds , Olaf Hering Subject: [PATCH] radeonfb: Add quirk for the graphics adapter in some JSxx Date: Wed, 18 Jul 2012 18:49:04 +0200 Message-Id: <1342630144-16350-1-git-send-email-olaf@aepfle.de> X-Mailer: git-send-email 1.7.10.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Tony Breeds These devices are set to 640x480 by firmware, switch them to 800x600@60 so that the graphical installer can run on remote console. Reported by IBM during SLES10 SP2 beta testing: https://bugzilla.novell.com/show_bug.cgi?id=461002 LTC50817 Signed-off-by: Olaf Hering Signed-off-by: Tony Breeds diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c index 9261c91..5c23eac 100644 --- a/drivers/video/aty/radeon_monitor.c +++ b/drivers/video/aty/radeon_monitor.c @@ -730,6 +730,25 @@ static void radeon_videomode_to_var(struct fb_var_screeninfo *var, var->vmode = mode->vmode; } +#ifdef CONFIG_PPC_PSERIES +static int is_powerblade(const char *model) +{ + struct device_node *root; + const char* cp; + int len, l, rc = 0; + + root = of_find_node_by_path("/"); + if (root && model) { + l = strlen(model); + cp = of_get_property(root, "model", &len); + if (cp) + rc = memcmp(model, cp, min(len, l)) == 0; + of_node_put(root); + } + return rc; +} +#endif + /* * Build the modedb for head 1 (head 2 will come later), check panel infos * from either BIOS or EDID, and pick up the default mode @@ -865,6 +884,22 @@ void __devinit radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_ has_default_mode = 1; } +#ifdef CONFIG_PPC_PSERIES + if (!has_default_mode && ( + is_powerblade("IBM,8842") || /* JS20 */ + is_powerblade("IBM,8844") || /* JS21 */ + is_powerblade("IBM,7998") || /* JS12/JS21/JS22 */ + is_powerblade("IBM,0792") || /* QS21 */ + is_powerblade("IBM,0793") /* QS22 */ + )) { + printk("Falling back to 800x600 on JSxx hardware\n"); + if (fb_find_mode(&info->var, info, "800x600@60", + info->monspecs.modedb, + info->monspecs.modedb_len, NULL, 8) != 0) + has_default_mode = 1; + } +#endif + /* * Still no mode, let's pick up a default from the db */