From owner-svn-src-all@freebsd.org Sun Dec 31 06:10:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A6DCEA5116; Sun, 31 Dec 2017 06:10:08 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 442676472E; Sun, 31 Dec 2017 06:10:08 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBV6A7Tg062882; Sun, 31 Dec 2017 06:10:07 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBV6A7cn062881; Sun, 31 Dec 2017 06:10:07 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712310610.vBV6A7cn062881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 31 Dec 2017 06:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327418 - head/sys/powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ps3 X-SVN-Commit-Revision: 327418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Dec 2017 06:10:08 -0000 Author: nwhitehorn Date: Sun Dec 31 06:10:07 2017 New Revision: 327418 URL: https://svnweb.freebsd.org/changeset/base/327418 Log: Use data from the boot loader to pick the appropriate output graphics mode instead of hard-coding a default. This information is passed implicitly by the PS3 firmware and can be relied upon. Also adjust the default mode, if somehow firmware doesn't pass one, to 1920x1080 from 720x480 since it is 2017. MFC after: 2 weeks Modified: head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Sun Dec 31 05:38:19 2017 (r327417) +++ head/sys/powerpc/ps3/ps3_syscons.c Sun Dec 31 06:10:07 2017 (r327418) @@ -159,16 +159,62 @@ static int ps3fb_init(struct vt_device *vd) { struct ps3fb_softc *sc; + char linux_video_mode[24]; + int linux_video_mode_num = 0; /* Init softc */ vd->vd_softc = sc = &ps3fb_softc; - /* XXX: get from HV repository */ sc->fb_info.fb_depth = 32; - sc->fb_info.fb_height = 480; - sc->fb_info.fb_width = 720; + sc->fb_info.fb_height = 1080; + sc->fb_info.fb_width = 1920; + + /* See if the bootloader has passed a graphics mode to use */ + bzero(linux_video_mode, sizeof(linux_video_mode)); + TUNABLE_STR_FETCH("video", linux_video_mode, sizeof(linux_video_mode)); + sscanf(linux_video_mode, "ps3fb:mode:%d", &linux_video_mode_num); + + switch (linux_video_mode_num) { + case 1: + case 2: + sc->fb_info.fb_height = 480; + sc->fb_info.fb_width = 720; + break; + case 3: + case 8: + sc->fb_info.fb_height = 720; + sc->fb_info.fb_width = 1280; + break; + case 4: + case 5: + case 9: + case 10: + sc->fb_info.fb_height = 1080; + sc->fb_info.fb_width = 1920; + break; + case 6: + case 7: + sc->fb_info.fb_height = 576; + sc->fb_info.fb_width = 720; + break; + case 11: + sc->fb_info.fb_height = 768; + sc->fb_info.fb_width = 1024; + break; + case 12: + sc->fb_info.fb_height = 1024; + sc->fb_info.fb_width = 1280; + break; + case 13: + sc->fb_info.fb_height = 1200; + sc->fb_info.fb_width = 1920; + break; + } + + /* Allow explicitly-specified values for us to override everything */ TUNABLE_INT_FETCH("hw.ps3fb.height", &sc->fb_info.fb_height); TUNABLE_INT_FETCH("hw.ps3fb.width", &sc->fb_info.fb_width); + sc->fb_info.fb_stride = sc->fb_info.fb_width*4; sc->fb_info.fb_size = sc->fb_info.fb_height * sc->fb_info.fb_stride; sc->fb_info.fb_bpp = sc->fb_info.fb_stride / sc->fb_info.fb_width * 8;