From owner-svn-src-head@FreeBSD.ORG Sun Jan 13 22:05:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 016BCA42; Sun, 13 Jan 2013 22:05:46 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6DE129; Sun, 13 Jan 2013 22:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DM5kiE011162; Sun, 13 Jan 2013 22:05:46 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DM5kc2011161; Sun, 13 Jan 2013 22:05:46 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201301132205.r0DM5kc2011161@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 13 Jan 2013 22:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245389 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2013 22:05:47 -0000 Author: ray Date: Sun Jan 13 22:05:46 2013 New Revision: 245389 URL: http://svnweb.freebsd.org/changeset/base/245389 Log: Enable syscons framebuffer support for bcm2835. It makes possible to run Xorg on Raspberry Pi. o convert mmap address to physical. o add FBIOGTYPE ioctl handler - allow to get screen resolution by new xf86-video-scfb driver. Originally designed for "Efika MX" project. Sponsored by: FreeBSD Foundation Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Jan 13 21:32:40 2013 (r245388) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Jan 13 22:05:46 2013 (r245389) @@ -136,6 +136,7 @@ struct video_adapter_softc { int console; intptr_t fb_addr; + intptr_t fb_paddr; unsigned int fb_size; unsigned int height; @@ -222,6 +223,7 @@ bcm_fb_init(void *arg) fb_config->screen_size); va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + va_sc->fb_paddr = fb_config->base; va_sc->fb_size = fb_config->screen_size; va_sc->depth = fb_config->bpp; va_sc->stride = fb_config->pitch; @@ -795,7 +797,7 @@ bcmfb_mmap(video_adapter_t *adp, vm_ooff * framebuffer, since it shouldn't be touched */ if (offset < sc->stride*sc->height) { - *paddr = sc->fb_addr + offset; + *paddr = sc->fb_paddr + offset; return (0); } @@ -805,6 +807,27 @@ bcmfb_mmap(video_adapter_t *adp, vm_ooff static int bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) { + struct video_adapter_softc *sc; + struct fbtype *fb; + + sc = (struct video_adapter_softc *)adp; + + switch (cmd) { + case FBIOGTYPE: + fb = (struct fbtype *)data; + fb->fb_type = FBTYPE_PCIMISC; + fb->fb_height = sc->height; + fb->fb_width = sc->width; + fb->fb_depth = sc->depth; + if (sc->depth <= 1 || sc->depth > 8) + fb->fb_cmsize = 0; + else + fb->fb_cmsize = 1 << sc->depth; + fb->fb_size = sc->fb_size; + break; + default: + return (fb_commonioctl(adp, cmd, data)); + } return (0); }