From owner-svn-src-all@freebsd.org Tue Aug 18 00:47:03 2015 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 7CAF99BB63C; Tue, 18 Aug 2015 00:47:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 5381EFA9; Tue, 18 Aug 2015 00:47:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7I0l3hx024735; Tue, 18 Aug 2015 00:47:03 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7I0l2qr024733; Tue, 18 Aug 2015 00:47:02 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508180047.t7I0l2qr024733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 18 Aug 2015 00:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286867 - in head/sys/dev/vt: . hw/fb X-SVN-Group: head 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.20 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: Tue, 18 Aug 2015 00:47:03 -0000 Author: marcel Date: Tue Aug 18 00:47:02 2015 New Revision: 286867 URL: https://svnweb.freebsd.org/changeset/base/286867 Log: Support frame buffers that are larger than the default screen size as defined by VT_FB_DEFAULT_WIDTH and VT_FB_DEFAULT_HEIGHT (at this time 2048x1200). The default is really a max. We cap the height and width to those defaults and position the screen in the center of the frame buffer. Ideally we use a bigger font to utility the entire real estate that is the frame buffer, but that's seen as an improvement over making it work first. PR: 193745 Modified: head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Tue Aug 18 00:21:25 2015 (r286866) +++ head/sys/dev/vt/hw/fb/vt_fb.c Tue Aug 18 00:47:02 2015 (r286867) @@ -294,6 +294,7 @@ vt_fb_bitblt_bitmap(struct vt_device *vd if (mask != NULL && (mask[byte] & bit) == 0) continue; o = (y + yi) * info->fb_stride + (x + xi) * bpp; + o += vd->vd_transpose; cc = pattern[byte] & bit ? fgc : bgc; switch(bpp) { @@ -411,11 +412,16 @@ int vt_fb_init(struct vt_device *vd) { struct fb_info *info; + u_int margin; int err; info = vd->vd_softc; - vd->vd_height = info->fb_height; - vd->vd_width = info->fb_width; + vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height); + margin = (info->fb_height - vd->vd_height) >> 1; + vd->vd_transpose = margin * info->fb_stride; + vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width); + margin = (info->fb_width - vd->vd_width) >> 1; + vd->vd_transpose += margin * (info->fb_bpp / NBBY); vd->vd_video_dev = info->fb_video_dev; if (info->fb_size == 0) Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Tue Aug 18 00:21:25 2015 (r286866) +++ head/sys/dev/vt/vt.h Tue Aug 18 00:47:02 2015 (r286867) @@ -140,6 +140,7 @@ struct vt_device { uint32_t vd_mstate; /* (?) Mouse state. */ vt_axis_t vd_width; /* (?) Screen width. */ vt_axis_t vd_height; /* (?) Screen height. */ + size_t vd_transpose; /* (?) Screen offset in FB */ struct mtx vd_lock; /* Per-device lock. */ struct cv vd_winswitch; /* (d) Window switch notify. */ struct callout vd_timer; /* (d) Display timer. */