Deleted Added
full compact
bcm2835_fbd.c (245071) bcm2835_fbd.c (245389)
1/*-
2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c 245071 2013-01-05 21:05:16Z gonzo $");
28__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c 245389 2013-01-13 22:05:46Z ray $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bio.h>
33#include <sys/bus.h>
34#include <sys/conf.h>
35#include <sys/endian.h>
36#include <sys/kernel.h>

--- 94 unchanged lines hidden (view full) ---

131};
132
133struct video_adapter_softc {
134 /* Videoadpater part */
135 video_adapter_t va;
136 int console;
137
138 intptr_t fb_addr;
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bio.h>
33#include <sys/bus.h>
34#include <sys/conf.h>
35#include <sys/endian.h>
36#include <sys/kernel.h>

--- 94 unchanged lines hidden (view full) ---

131};
132
133struct video_adapter_softc {
134 /* Videoadpater part */
135 video_adapter_t va;
136 int console;
137
138 intptr_t fb_addr;
139 intptr_t fb_paddr;
139 unsigned int fb_size;
140
141 unsigned int height;
142 unsigned int width;
143 unsigned int depth;
144 unsigned int stride;
145
146 unsigned int xmargin;

--- 70 unchanged lines hidden (view full) ---

217 fb_config->bpp);
218
219
220 device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n",
221 fb_config->pitch, fb_config->base,
222 fb_config->screen_size);
223
224 va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size);
140 unsigned int fb_size;
141
142 unsigned int height;
143 unsigned int width;
144 unsigned int depth;
145 unsigned int stride;
146
147 unsigned int xmargin;

--- 70 unchanged lines hidden (view full) ---

218 fb_config->bpp);
219
220
221 device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n",
222 fb_config->pitch, fb_config->base,
223 fb_config->screen_size);
224
225 va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size);
226 va_sc->fb_paddr = fb_config->base;
225 va_sc->fb_size = fb_config->screen_size;
226 va_sc->depth = fb_config->bpp;
227 va_sc->stride = fb_config->pitch;
228
229 va_sc->width = fb_config->xres;
230 va_sc->height = fb_config->yres;
231 bcmfb_update_margins(&va_sc->va);
232 }

--- 557 unchanged lines hidden (view full) ---

790
791 sc = (struct video_adapter_softc *)adp;
792
793 /*
794 * This might be a legacy VGA mem request: if so, just point it at the
795 * framebuffer, since it shouldn't be touched
796 */
797 if (offset < sc->stride*sc->height) {
227 va_sc->fb_size = fb_config->screen_size;
228 va_sc->depth = fb_config->bpp;
229 va_sc->stride = fb_config->pitch;
230
231 va_sc->width = fb_config->xres;
232 va_sc->height = fb_config->yres;
233 bcmfb_update_margins(&va_sc->va);
234 }

--- 557 unchanged lines hidden (view full) ---

792
793 sc = (struct video_adapter_softc *)adp;
794
795 /*
796 * This might be a legacy VGA mem request: if so, just point it at the
797 * framebuffer, since it shouldn't be touched
798 */
799 if (offset < sc->stride*sc->height) {
798 *paddr = sc->fb_addr + offset;
800 *paddr = sc->fb_paddr + offset;
799 return (0);
800 }
801
802 return (EINVAL);
803}
804
805static int
806bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data)
807{
801 return (0);
802 }
803
804 return (EINVAL);
805}
806
807static int
808bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data)
809{
810 struct video_adapter_softc *sc;
811 struct fbtype *fb;
808
812
813 sc = (struct video_adapter_softc *)adp;
814
815 switch (cmd) {
816 case FBIOGTYPE:
817 fb = (struct fbtype *)data;
818 fb->fb_type = FBTYPE_PCIMISC;
819 fb->fb_height = sc->height;
820 fb->fb_width = sc->width;
821 fb->fb_depth = sc->depth;
822 if (sc->depth <= 1 || sc->depth > 8)
823 fb->fb_cmsize = 0;
824 else
825 fb->fb_cmsize = 1 << sc->depth;
826 fb->fb_size = sc->fb_size;
827 break;
828 default:
829 return (fb_commonioctl(adp, cmd, data));
830 }
831
809 return (0);
810}
811
812static int
813bcmfb_clear(video_adapter_t *adp)
814{
815
816 return (bcmfb_blank_display(adp, 0));

--- 153 unchanged lines hidden ---
832 return (0);
833}
834
835static int
836bcmfb_clear(video_adapter_t *adp)
837{
838
839 return (bcmfb_blank_display(adp, 0));

--- 153 unchanged lines hidden ---