mirror of
https://xff.cz/git/u-boot/
synced 2025-09-27 13:31:16 +02:00
Merge tag 'fixes-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-video
- fix missing graphics output on some x86 boards - avoid using #ifdef in video code - add .gitignore for video font *.S files
This commit is contained in:
@@ -38,7 +38,6 @@ config BACKLIGHT_GPIO
|
|||||||
config VIDEO_BPP8
|
config VIDEO_BPP8
|
||||||
bool "Support 8-bit-per-pixel displays"
|
bool "Support 8-bit-per-pixel displays"
|
||||||
depends on DM_VIDEO
|
depends on DM_VIDEO
|
||||||
default n
|
|
||||||
help
|
help
|
||||||
Support drawing text and bitmaps onto a 8-bit-per-pixel display.
|
Support drawing text and bitmaps onto a 8-bit-per-pixel display.
|
||||||
Enabling this will include code to support this display. Without
|
Enabling this will include code to support this display. Without
|
||||||
@@ -48,7 +47,6 @@ config VIDEO_BPP8
|
|||||||
config VIDEO_BPP16
|
config VIDEO_BPP16
|
||||||
bool "Support 16-bit-per-pixel displays"
|
bool "Support 16-bit-per-pixel displays"
|
||||||
depends on DM_VIDEO
|
depends on DM_VIDEO
|
||||||
default n
|
|
||||||
help
|
help
|
||||||
Support drawing text and bitmaps onto a 16-bit-per-pixel display.
|
Support drawing text and bitmaps onto a 16-bit-per-pixel display.
|
||||||
Enabling this will include code to support this display. Without
|
Enabling this will include code to support this display. Without
|
||||||
@@ -58,7 +56,7 @@ config VIDEO_BPP16
|
|||||||
config VIDEO_BPP32
|
config VIDEO_BPP32
|
||||||
bool "Support 32-bit-per-pixel displays"
|
bool "Support 32-bit-per-pixel displays"
|
||||||
depends on DM_VIDEO
|
depends on DM_VIDEO
|
||||||
default n
|
default y if X86
|
||||||
help
|
help
|
||||||
Support drawing text and bitmaps onto a 32-bit-per-pixel display.
|
Support drawing text and bitmaps onto a 32-bit-per-pixel display.
|
||||||
Enabling this will include code to support this display. Without
|
Enabling this will include code to support this display. Without
|
||||||
@@ -68,7 +66,6 @@ config VIDEO_BPP32
|
|||||||
config VIDEO_ANSI
|
config VIDEO_ANSI
|
||||||
bool "Support ANSI escape sequences in video console"
|
bool "Support ANSI escape sequences in video console"
|
||||||
depends on DM_VIDEO
|
depends on DM_VIDEO
|
||||||
default n
|
|
||||||
help
|
help
|
||||||
Enable ANSI escape sequence decoding for a more fully functional
|
Enable ANSI escape sequence decoding for a more fully functional
|
||||||
console.
|
console.
|
||||||
|
@@ -16,39 +16,36 @@
|
|||||||
static int console_normal_set_row(struct udevice *dev, uint row, int clr)
|
static int console_normal_set_row(struct udevice *dev, uint row, int clr)
|
||||||
{
|
{
|
||||||
struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
|
struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
|
||||||
void * __maybe_unused line;
|
void *line;
|
||||||
int __maybe_unused pixels = VIDEO_FONT_HEIGHT * vid_priv->xsize;
|
int pixels = VIDEO_FONT_HEIGHT * vid_priv->xsize;
|
||||||
int __maybe_unused i;
|
int i;
|
||||||
|
|
||||||
line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * vid_priv->line_length;
|
line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * vid_priv->line_length;
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < pixels; i++)
|
for (i = 0; i < pixels; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP16:
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
case VIDEO_BPP16: {
|
uint16_t *dst = line;
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < pixels; i++)
|
for (i = 0; i < pixels; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP32:
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
case VIDEO_BPP32: {
|
uint32_t *dst = line;
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < pixels; i++)
|
for (i = 0; i < pixels; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
@@ -76,7 +73,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y,
|
|||||||
struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev);
|
struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev);
|
||||||
struct udevice *vid = dev->parent;
|
struct udevice *vid = dev->parent;
|
||||||
struct video_priv *vid_priv = dev_get_uclass_priv(vid);
|
struct video_priv *vid_priv = dev_get_uclass_priv(vid);
|
||||||
int __maybe_unused i, row;
|
int i, row;
|
||||||
void *line = vid_priv->fb + y * vid_priv->line_length +
|
void *line = vid_priv->fb + y * vid_priv->line_length +
|
||||||
VID_TO_PIXEL(x_frac) * VNBYTES(vid_priv->bpix);
|
VID_TO_PIXEL(x_frac) * VNBYTES(vid_priv->bpix);
|
||||||
|
|
||||||
@@ -85,45 +82,45 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y,
|
|||||||
|
|
||||||
for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
|
for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
|
||||||
unsigned int idx = (u8)ch * VIDEO_FONT_HEIGHT + row;
|
unsigned int idx = (u8)ch * VIDEO_FONT_HEIGHT + row;
|
||||||
uchar __maybe_unused bits = video_fontdata[idx];
|
uchar bits = video_fontdata[idx];
|
||||||
|
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
||||||
*dst++ = (bits & 0x80) ? vid_priv->colour_fg
|
*dst++ = (bits & 0x80) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
bits <<= 1;
|
vid_priv->colour_bg;
|
||||||
|
bits <<= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP16:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
#endif
|
uint16_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
|
||||||
case VIDEO_BPP16: {
|
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
||||||
*dst++ = (bits & 0x80) ? vid_priv->colour_fg
|
*dst++ = (bits & 0x80) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
bits <<= 1;
|
vid_priv->colour_bg;
|
||||||
|
bits <<= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP32:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
#endif
|
uint32_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
|
||||||
case VIDEO_BPP32: {
|
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
||||||
*dst++ = (bits & 0x80) ? vid_priv->colour_fg
|
*dst++ = (bits & 0x80) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
bits <<= 1;
|
vid_priv->colour_bg;
|
||||||
|
bits <<= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
|
@@ -22,33 +22,30 @@ static int console_set_row_1(struct udevice *dev, uint row, int clr)
|
|||||||
(row + 1) * VIDEO_FONT_HEIGHT * pbytes;
|
(row + 1) * VIDEO_FONT_HEIGHT * pbytes;
|
||||||
for (j = 0; j < vid_priv->ysize; j++) {
|
for (j = 0; j < vid_priv->ysize; j++) {
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP16:
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
case VIDEO_BPP16: {
|
uint16_t *dst = line;
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP32:
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
case VIDEO_BPP32: {
|
uint32_t *dst = line;
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
@@ -99,39 +96,39 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch)
|
|||||||
|
|
||||||
for (col = 0; col < VIDEO_FONT_HEIGHT; col++) {
|
for (col = 0; col < VIDEO_FONT_HEIGHT; col++) {
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
||||||
*dst-- = (pfont[i] & mask) ? vid_priv->colour_fg
|
*dst-- = (pfont[i] & mask) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
|
vid_priv->colour_bg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP16:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
#endif
|
uint16_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
|
||||||
case VIDEO_BPP16: {
|
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
||||||
*dst-- = (pfont[i] & mask) ? vid_priv->colour_fg
|
*dst-- = (pfont[i] & mask) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
|
vid_priv->colour_bg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP32:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
#endif
|
uint32_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
|
||||||
case VIDEO_BPP32: {
|
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
||||||
*dst-- = (pfont[i] & mask) ? vid_priv->colour_fg
|
*dst-- = (pfont[i] & mask) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
|
vid_priv->colour_bg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
@@ -153,33 +150,30 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr)
|
|||||||
line = vid_priv->fb + vid_priv->ysize * vid_priv->line_length -
|
line = vid_priv->fb + vid_priv->ysize * vid_priv->line_length -
|
||||||
(row + 1) * VIDEO_FONT_HEIGHT * vid_priv->line_length;
|
(row + 1) * VIDEO_FONT_HEIGHT * vid_priv->line_length;
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < pixels; i++)
|
for (i = 0; i < pixels; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP16:
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
case VIDEO_BPP16: {
|
uint16_t *dst = line;
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < pixels; i++)
|
for (i = 0; i < pixels; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP32:
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
case VIDEO_BPP32: {
|
uint32_t *dst = line;
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < pixels; i++)
|
for (i = 0; i < pixels; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
@@ -226,42 +220,42 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch)
|
|||||||
uchar bits = video_fontdata[idx];
|
uchar bits = video_fontdata[idx];
|
||||||
|
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
||||||
*dst-- = (bits & 0x80) ? vid_priv->colour_fg
|
*dst-- = (bits & 0x80) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
bits <<= 1;
|
vid_priv->colour_bg;
|
||||||
|
bits <<= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP16:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
#endif
|
uint16_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
|
||||||
case VIDEO_BPP16: {
|
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
||||||
*dst-- = (bits & 0x80) ? vid_priv->colour_fg
|
*dst-- = (bits & 0x80) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
bits <<= 1;
|
vid_priv->colour_bg;
|
||||||
|
bits <<= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP32:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
#endif
|
uint32_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
|
||||||
case VIDEO_BPP32: {
|
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
|
||||||
*dst-- = (bits & 0x80) ? vid_priv->colour_fg
|
*dst-- = (bits & 0x80) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
bits <<= 1;
|
vid_priv->colour_bg;
|
||||||
|
bits <<= 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
@@ -281,33 +275,30 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr)
|
|||||||
line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * pbytes;
|
line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * pbytes;
|
||||||
for (j = 0; j < vid_priv->ysize; j++) {
|
for (j = 0; j < vid_priv->ysize; j++) {
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP16:
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
case VIDEO_BPP16: {
|
uint16_t *dst = line;
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP32:
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
case VIDEO_BPP32: {
|
uint32_t *dst = line;
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
|
||||||
*dst++ = clr;
|
*dst++ = clr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
@@ -356,39 +347,39 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch)
|
|||||||
|
|
||||||
for (col = 0; col < VIDEO_FONT_HEIGHT; col++) {
|
for (col = 0; col < VIDEO_FONT_HEIGHT; col++) {
|
||||||
switch (vid_priv->bpix) {
|
switch (vid_priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP8
|
case VIDEO_BPP8:
|
||||||
case VIDEO_BPP8: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
|
||||||
uint8_t *dst = line;
|
uint8_t *dst = line;
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
||||||
*dst++ = (pfont[i] & mask) ? vid_priv->colour_fg
|
*dst++ = (pfont[i] & mask) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
|
vid_priv->colour_bg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP16:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
#endif
|
uint16_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
|
||||||
case VIDEO_BPP16: {
|
|
||||||
uint16_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
||||||
*dst++ = (pfont[i] & mask) ? vid_priv->colour_fg
|
*dst++ = (pfont[i] & mask) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
|
vid_priv->colour_bg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case VIDEO_BPP32:
|
||||||
}
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
#endif
|
uint32_t *dst = line;
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
|
||||||
case VIDEO_BPP32: {
|
|
||||||
uint32_t *dst = line;
|
|
||||||
|
|
||||||
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
for (i = 0; i < VIDEO_FONT_HEIGHT; i++) {
|
||||||
*dst++ = (pfont[i] & mask) ? vid_priv->colour_fg
|
*dst++ = (pfont[i] & mask) ?
|
||||||
: vid_priv->colour_bg;
|
vid_priv->colour_fg :
|
||||||
|
vid_priv->colour_bg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
|
1
drivers/video/fonts/.gitignore
vendored
Normal file
1
drivers/video/fonts/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.S
|
@@ -116,7 +116,6 @@ static void vidconsole_newline(struct udevice *dev)
|
|||||||
video_sync(dev->parent, false);
|
video_sync(dev->parent, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_IS_ENABLED(VIDEO_BPP16) || CONFIG_IS_ENABLED(VIDEO_BPP32)
|
|
||||||
static const struct vid_rgb colors[VID_COLOR_COUNT] = {
|
static const struct vid_rgb colors[VID_COLOR_COUNT] = {
|
||||||
{ 0x00, 0x00, 0x00 }, /* black */
|
{ 0x00, 0x00, 0x00 }, /* black */
|
||||||
{ 0xc0, 0x00, 0x00 }, /* red */
|
{ 0xc0, 0x00, 0x00 }, /* red */
|
||||||
@@ -135,23 +134,22 @@ static const struct vid_rgb colors[VID_COLOR_COUNT] = {
|
|||||||
{ 0x00, 0xff, 0xff }, /* bright cyan */
|
{ 0x00, 0xff, 0xff }, /* bright cyan */
|
||||||
{ 0xff, 0xff, 0xff }, /* white */
|
{ 0xff, 0xff, 0xff }, /* white */
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
u32 vid_console_color(struct video_priv *priv, unsigned int idx)
|
u32 vid_console_color(struct video_priv *priv, unsigned int idx)
|
||||||
{
|
{
|
||||||
switch (priv->bpix) {
|
switch (priv->bpix) {
|
||||||
#if CONFIG_IS_ENABLED(VIDEO_BPP16)
|
|
||||||
case VIDEO_BPP16:
|
case VIDEO_BPP16:
|
||||||
return ((colors[idx].r >> 3) << 11) |
|
if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
|
||||||
((colors[idx].g >> 2) << 5) |
|
return ((colors[idx].r >> 3) << 11) |
|
||||||
((colors[idx].b >> 3) << 0);
|
((colors[idx].g >> 2) << 5) |
|
||||||
#endif
|
((colors[idx].b >> 3) << 0);
|
||||||
#if CONFIG_IS_ENABLED(VIDEO_BPP32)
|
}
|
||||||
case VIDEO_BPP32:
|
case VIDEO_BPP32:
|
||||||
return (colors[idx].r << 16) |
|
if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
|
||||||
(colors[idx].g << 8) |
|
return (colors[idx].r << 16) |
|
||||||
(colors[idx].b << 0);
|
(colors[idx].g << 8) |
|
||||||
#endif
|
(colors[idx].b << 0);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
/*
|
/*
|
||||||
* For unknown bit arrangements just support
|
* For unknown bit arrangements just support
|
||||||
|
@@ -92,26 +92,24 @@ int video_clear(struct udevice *dev)
|
|||||||
struct video_priv *priv = dev_get_uclass_priv(dev);
|
struct video_priv *priv = dev_get_uclass_priv(dev);
|
||||||
|
|
||||||
switch (priv->bpix) {
|
switch (priv->bpix) {
|
||||||
#ifdef CONFIG_VIDEO_BPP16
|
case VIDEO_BPP16:
|
||||||
case VIDEO_BPP16: {
|
if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
|
||||||
u16 *ppix = priv->fb;
|
u16 *ppix = priv->fb;
|
||||||
u16 *end = priv->fb + priv->fb_size;
|
u16 *end = priv->fb + priv->fb_size;
|
||||||
|
|
||||||
while (ppix < end)
|
while (ppix < end)
|
||||||
*ppix++ = priv->colour_bg;
|
*ppix++ = priv->colour_bg;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
case VIDEO_BPP32:
|
||||||
#ifdef CONFIG_VIDEO_BPP32
|
if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
|
||||||
case VIDEO_BPP32: {
|
u32 *ppix = priv->fb;
|
||||||
u32 *ppix = priv->fb;
|
u32 *end = priv->fb + priv->fb_size;
|
||||||
u32 *end = priv->fb + priv->fb_size;
|
|
||||||
|
|
||||||
while (ppix < end)
|
while (ppix < end)
|
||||||
*ppix++ = priv->colour_bg;
|
*ppix++ = priv->colour_bg;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
memset(priv->fb, priv->colour_bg, priv->fb_size);
|
memset(priv->fb, priv->colour_bg, priv->fb_size);
|
||||||
break;
|
break;
|
||||||
@@ -125,14 +123,14 @@ void video_set_default_colors(struct udevice *dev, bool invert)
|
|||||||
struct video_priv *priv = dev_get_uclass_priv(dev);
|
struct video_priv *priv = dev_get_uclass_priv(dev);
|
||||||
int fore, back;
|
int fore, back;
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_WHITE_ON_BLACK
|
if (CONFIG_IS_ENABLED(SYS_WHITE_ON_BLACK)) {
|
||||||
/* White is used when switching to bold, use light gray here */
|
/* White is used when switching to bold, use light gray here */
|
||||||
fore = VID_LIGHT_GRAY;
|
fore = VID_LIGHT_GRAY;
|
||||||
back = VID_BLACK;
|
back = VID_BLACK;
|
||||||
#else
|
} else {
|
||||||
fore = VID_BLACK;
|
fore = VID_BLACK;
|
||||||
back = VID_WHITE;
|
back = VID_WHITE;
|
||||||
#endif
|
}
|
||||||
if (invert) {
|
if (invert) {
|
||||||
int temp;
|
int temp;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user