bcm2835_fb.c (243666) | bcm2835_fb.c (243687) |
---|---|
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 243666 2012-11-29 05:46:46Z gonzo $"); | 28__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c 243687 2012-11-30 02:31:08Z gonzo $"); |
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> --- 734 unchanged lines hidden (view full) --- 771 addr[4*j+3] = bcmfb_palette[color].a; 772 break; 773 case 24: 774 addr[3*j] = bcmfb_palette[color].r; 775 addr[3*j+1] = bcmfb_palette[color].g; 776 addr[3*j+2] = bcmfb_palette[color].b; 777 break; 778 case 16: | 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> --- 734 unchanged lines hidden (view full) --- 771 addr[4*j+3] = bcmfb_palette[color].a; 772 break; 773 case 24: 774 addr[3*j] = bcmfb_palette[color].r; 775 addr[3*j+1] = bcmfb_palette[color].g; 776 addr[3*j+2] = bcmfb_palette[color].b; 777 break; 778 case 16: |
779 rgb = (bcmfb_palette[color].r >> 3) << 10; 780 rgb |= (bcmfb_palette[color].g >> 3) << 5; | 779 rgb = (bcmfb_palette[color].r >> 3) << 11; 780 rgb |= (bcmfb_palette[color].g >> 2) << 5; |
781 rgb |= (bcmfb_palette[color].b >> 3); | 781 rgb |= (bcmfb_palette[color].b >> 3); |
782 addr[2*j] = (rgb >> 8) & 0xff; 783 addr[2*j + 1] = rgb & 0xff; | 782 addr[2*j] = rgb & 0xff; 783 addr[2*j + 1] = (rgb >> 8) & 0xff; |
784 default: 785 /* Not supported yet */ 786 break; 787 } 788 } 789 790 addr += (sc->stride); 791 } --- 41 unchanged lines hidden --- | 784 default: 785 /* Not supported yet */ 786 break; 787 } 788 } 789 790 addr += (sc->stride); 791 } --- 41 unchanged lines hidden --- |