Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/broadcom/bcm2835/bcm2835_fb.c
Show First 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | bcmfb_configure(int flags) | ||||
/* | /* | ||||
* It seems there is no way to let syscons framework know | * It seems there is no way to let syscons framework know | ||||
* that framebuffer resolution has changed. So just try | * that framebuffer resolution has changed. So just try | ||||
* to fetch data from FDT bootargs, FDT display data and | * to fetch data from FDT bootargs, FDT display data and | ||||
* finally go with defaults if everything else has failed. | * finally go with defaults if everything else has failed. | ||||
*/ | */ | ||||
chosen = OF_finddevice("/chosen"); | chosen = OF_finddevice("/chosen"); | ||||
if (chosen != 0 && | if (chosen != -1 && | ||||
OF_getprop(chosen, "bootargs", &bootargs, sizeof(bootargs)) > 0) { | OF_getprop(chosen, "bootargs", &bootargs, sizeof(bootargs)) > 0) { | ||||
p = bootargs; | p = bootargs; | ||||
while ((v = strsep(&p, " ")) != NULL) { | while ((v = strsep(&p, " ")) != NULL) { | ||||
if (*v == '\0') | if (*v == '\0') | ||||
continue; | continue; | ||||
n = strsep(&v, "="); | n = strsep(&v, "="); | ||||
if (strcmp(n, "bcm2708_fb.fbwidth") == 0 && v != NULL) | if (strcmp(n, "bcm2708_fb.fbwidth") == 0 && v != NULL) | ||||
sc->width = (unsigned int)strtol(v, NULL, 0); | sc->width = (unsigned int)strtol(v, NULL, 0); | ||||
else if (strcmp(n, "bcm2708_fb.fbheight") == 0 && | else if (strcmp(n, "bcm2708_fb.fbheight") == 0 && | ||||
v != NULL) | v != NULL) | ||||
sc->height = (unsigned int)strtol(v, NULL, 0); | sc->height = (unsigned int)strtol(v, NULL, 0); | ||||
else if (strcmp(n, "bcm2708_fb.fbswap") == 0 && | else if (strcmp(n, "bcm2708_fb.fbswap") == 0 && | ||||
v != NULL) | v != NULL) | ||||
if (*v == '1') | if (*v == '1') | ||||
sc->fbswap = 1; | sc->fbswap = 1; | ||||
} | } | ||||
} | } | ||||
root = OF_finddevice("/"); | root = OF_finddevice("/"); | ||||
if ((root != 0) && | if ((root != -1) && | ||||
(display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) { | (display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) { | ||||
if (sc->width == 0) { | if (sc->width == 0) { | ||||
if ((OF_getencprop(display, "broadcom,width", | if ((OF_getencprop(display, "broadcom,width", | ||||
&cell, sizeof(cell))) > 0) | &cell, sizeof(cell))) > 0) | ||||
sc->width = cell; | sc->width = cell; | ||||
} | } | ||||
if (sc->height == 0) { | if (sc->height == 0) { | ||||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |