]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - drivers/video/vidconsole_internal.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2015 Google, Inc
5 * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
6 * (C) Copyright 2023 Dzmitry Sankouski <dsankouski@gmail.com>
9 #define FLIPPED_DIRECTION 1
10 #define NORMAL_DIRECTION 0
13 * struct console_simple_priv - Private data for this driver
15 * @video_fontdata font graphical representation data
17 struct console_simple_priv
{
18 struct video_fontdata
*fontdata
;
22 * Checks if bits per pixel supported.
24 * @param bpix framebuffer bits per pixel.
26 * @returns 0, if supported, or else -ENOSYS.
28 int check_bpix_support(int bpix
);
31 * Fill 1 pixel in framebuffer, and go to next one.
33 * @param dstp a pointer to pointer to framebuffer.
34 * @param value value to write to framebuffer.
35 * @param pbytes framebuffer bytes per pixel.
36 * @param step framebuffer pointer increment. Usually is equal to pbytes,
37 * and may be negative to control filling direction.
39 void fill_pixel_and_goto_next(void **dstp
, u32 value
, int pbytes
, int step
);
42 * Fills 1 character in framebuffer vertically. Vertically means we're filling char font data rows
45 * @param pfont a pointer to character font data.
46 * @param line a pointer to pointer to framebuffer. It's a point for upper left char corner
47 * @param vid_priv driver private data.
48 * @fontdata font graphical representation data
49 * @param direction controls character orientation. Can be normal or flipped.
50 * When normal: When flipped:
51 *|-----------------------------------------------|
60 *| stepping -> | line stepping |
61 *|---!!we're starting from upper left char corner|
62 *|-----------------------------------------------|
64 * @returns 0, if success, or else error code.
66 int fill_char_vertically(uchar
*pfont
, void **line
, struct video_priv
*vid_priv
,
67 struct video_fontdata
*fontdata
, bool direction
);
70 * Fills 1 character in framebuffer horizontally.
71 * Horizontally means we're filling char font data columns across the lines.
73 * @param pfont a pointer to character font data.
74 * @param line a pointer to pointer to framebuffer. It's a point for upper left char corner
75 * @param vid_priv driver private data.
76 * @fontdata font graphical representation data
77 * @param direction controls character orientation. Can be normal or flipped.
78 * When normal: When flipped:
79 *|-----------------------------------------------|
80 *| * | line stepping |
84 *| line stepping | * |
86 *| stepping -> | <- stepping |
87 *|---!!we're starting from upper left char corner|
88 *|-----------------------------------------------|
90 * @returns 0, if success, or else error code.
92 int fill_char_horizontally(uchar
*pfont
, void **line
, struct video_priv
*vid_priv
,
93 struct video_fontdata
*fontdata
, bool direction
);
96 * console probe function.
98 * @param dev a pointer to device.
100 * @returns 0, if success, or else error code.
102 int console_probe(struct udevice
*dev
);
105 * Internal function to be used in as ops.
106 * See details in video_console.h get_font_size function
108 const char *console_simple_get_font_size(struct udevice
*dev
, uint
*sizep
);
111 * Internal function to be used in as ops.
112 * See details in video_console.h get_font function
114 int console_simple_get_font(struct udevice
*dev
, int seq
, struct vidfont_info
*info
);
117 * Internal function to be used in as ops.
118 * See details in video_console.h select_font function
120 int console_simple_select_font(struct udevice
*dev
, const char *name
, uint size
);