Commit Graph

503 Commits

Author SHA1 Message Date
Vasily Khoruzhick
59fa089b2b zipitz2: enable LCD rotation
z2's screen is rotated by 270 degrees

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
2016-03-27 09:12:56 -04:00
Alexander Graf
99de254e8d bcm2835 video: Map fb as cached
The bcm2835 frame buffer is in RAM, so we can easily map it as cached and gain
all the glorious performance boost that brings with it.

Signed-off-by: Alexander Graf <agraf@suse.de>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2016-03-27 09:12:19 -04:00
Lawrence Yu
cf6eca7ccd sunxi: Configure only LVDS pins instead of all LCD pins when LVDS interface selected
The behavior before this patch would attempt to configure the mux
setting for pins 0 to 27 on PORTD to all be setting 3 for LVDS.  The
LVDS interface actually only uses pins 18 to 27 and not pins 0 to 27
as in the parallel LCD interface.  This patch restricts the
configuration to only the relevant pins 18 to 27 on PORTD.

This was tested on a sun8i A33 tablet with an LVDS screen.  MMC1 has
the capability to use pins 2 to 7 on PORTD and the mux on those pins
was being inadvertently set to setting 3 for MMC functionality which
this patch corrects.

Signed-off-by: Lawrence Yu <lyu@micile.com>
[hdegoede@redhat.com: Only apply this change to A23 / A33]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-03-23 22:04:13 +01:00
Simon Glass
97cb092763 x86: broadwell: Add video support
Add a video driver for Intel's broadwell integrated graphics controller.
This uses a binary blob for most init, with the driver just performing a few
basic tasks.

This driver supports VESA as the mode-setting mechanism. Since most boards
don't support driver model yet with VESA, a special case is added to the
Kconfig for broadwell. Eventually all boards will use driver model and this
can be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-17 10:27:26 +08:00
Simon Glass
e23c6c28b0 video: Allow simple-panel to be used without regulators
At present simple-panel requires regulator support and will not build
without it. But some panels do not have a power supply, or at least not one
that can be controlled. Update the implementation to cope with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
2016-03-17 10:27:22 +08:00
Bin Meng
f1d6fda6d3 x86: Move asm/arch-coreboot/tables.h to a common place
Move asm/arch-coreboot/tables.h to asm/coreboot_tables.h so that
coreboot table definitions can be used by other x86 builds.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-03-17 10:27:21 +08:00
Tom Rini
4d339a9e8a Merge branch 'master' of git://git.denx.de/u-boot-video 2016-03-15 08:01:17 -04:00
Peng Fan
3cb4f25cc7 video: ipu: avoid overflow issue
Multiplication, as "clk->parent->rate * 16" may overflow. So use
do_div to avoid such issue.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Signed-off-by: Sandor Yu <sandor.yu@nxp.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
2016-03-14 22:47:41 +01:00
Simon Glass
3f603cbbb8 dm: Use uclass_first_device_err() where it is useful
Use this new function in places where it simplifies the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 15:34:50 -06:00
Jacob Chen
8530783594 rockchip: video: Add LVDS support in vop driver
LVDS have a different display out mode, add code to get right flag.

The vop_ip decide display device and the remote_vop_id decide which
vop was being used. So we should use the remote_vop_id to set DCLK_VOP.

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-03-14 22:24:10 +01:00
Jacob Chen
35ac89dd8f rockchip: video: Add a display driver for rockchip LVDS
Some Rockchip SoCs support LVDS output. Add a display driver for this so
that these displays can be used on supported boards.

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-03-14 22:06:33 +01:00
Jacob Chen
eab314f590 dm: video: Add a operation to display uclass
The current display class only allow to get timing from edid.
So add a operation to get timing directly from driver.
In driver, I will use fdtdec_decode_display_timing to get timing.

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-03-14 22:01:26 +01:00
Marek Vasut
703c751169 video: Add S3C24xx framebuffer support
Add basic framebuffer driver for the S3C24xx family of CPUs.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>

V2: Keep the Makefile sorted.
Acked-by: Anatolij Gustschin <agust@denx.de>
2016-02-22 18:07:17 +01:00
Simon Glass
d5b9d11cb6 video: freetype: Fix a memory leak with a bad parameter
Make sure to free memory used when the scale facture is incorrect.

Reported-by: Coverity (CID: 24068)
Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-22 14:41:22 +01:00
Simon Glass
f6e75ba7fe video: truetype: Fix a memory leak on error
When the resolution is not supported we should free the memory we don't plan
to use.

Reported-by: Coverity (CID: 135127)

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-22 14:41:02 +01:00
Simon Glass
91c08afe66 tegra: video: Move LCD driver to use the DM PWM driver
Use the driver-model PWM driver in preference to the old code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:53 -07:00
Simon Glass
f5acf91f6f tegra: video: Move all fdt-decoding into a single function
Join the two functions which decode the device tree and put them in the
ofdata_to_platdata() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:53 -07:00
Simon Glass
bfda03770c tegra: video: Move LCD enums into the driver
There is no need to have these in a separate file as they are not
referenced from anywhere else.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:53 -07:00
Simon Glass
f20b2c0671 tegra: video: Remove the static variables
We can move the static variables into the driver-private data.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:52 -07:00
Simon Glass
9e6866d3b6 tegra: video: Convert tegra20 LCD driver to driver model
Move this driver over to use driver model. This involves rearranging the
code somewhat. The effect is that everything is run from the probe() method.

Boards which use this are fixed up, but only seaboard is tested.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:52 -07:00
Simon Glass
ce0c474a72 tegra: video: Merge the two config structures together
We have a structure for the display panel and another for the controller.
There is some overlap between them. Merge them to simplify the driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:52 -07:00
Simon Glass
40d56a918c tegra: video: Move the check for CONFIG_OF_CONTROL to Kconfig
We can check this in Kconfig now.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:52 -07:00
Simon Glass
71cafc3fba tegra: video: Merge the display driver into one file
At present we have code in arch/arm and code in drivers/video. Move it all
into drivers/video since it is a display driver and our current approach is
to put all driver code in drivers/.

Make a few functions static now that they are not used outside the file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:52 -07:00
Simon Glass
d2f906500e tegra: video: Rename CONFIG_VIDEO_TEGRA to CONFIG_VIDEO_TEGRA20
This option refers only to the tegra20 video driver, so name it as such
to avoid confusion with tegra124.

Also move this option to Kconfig.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:51 -07:00
Simon Glass
d76592122b tegra: nyan-big: Move the LCD driver to driver model
Adjust the driver to use driver model. The SOR becomes a bridge device. We
use the normal simple_panel driver to handle the display itself. We also
need to enable some options such as regulators, PWMs and DM_VIDEO itself.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:51 -07:00
Simon Glass
4dd811581a tegra: lcd: Merge tegra124-lcd.c into display.c
There isn't a lot of benefit of have two separate files. With driver model
the code needs to be in the same driver, so it's better to have it in the
same file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:51 -07:00
Simon Glass
bbc8a8b4cc dm: video: Flush the cache after a puts()
This helps keep the display consistent. puts() is used when printing the
prompt, so is a useful way to make sure the current display contents is
visible.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-02-16 09:17:50 -07:00
Tom Rini
9ef2835f26 Merge branch 'master' of git://git.denx.de/u-boot-video 2016-02-11 18:18:15 -05:00
Simon Glass
a2931b30d2 dm: video: Add a temporary work-around for old stdout var
Boards with a saved environment may use 'lcd' in their stdout environment
variable, expecting that this will enable output to the LCD. When the board
moves to use driver model for video, this will no-longer work. Add a
work-around to fix this. A warning messages is printed, and we will remove
the work-around at the end of 2016.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
2016-02-11 21:37:17 +01:00
Stephen Warren
1382648b6b video: bcm2835: use bus_to_phys() on FB address
The FB address is generated by the firmware running on the GPU/VideoCore
and is a "bus" address. This address is the other side of an IOMMU from
the ARM upon which U-Boot is running. Use bus_to_phys() to convert this
to an ARM physical address. Without this, U-Boot seems to work just fine,
but once the Linux kernel boots on an RPi2, accessing the FB memory often
causes a hard system hang.

This is related to:
122426d46e ARM: bcm2835: use phys_to_bus() for mbox
5c0beb5c58 usb: dwc2: use phys_to_bus/bus_to_phys
79340db7f1 ARM: bcm2835: implement phys_to_bus/bus_to_phys

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2016-02-06 19:07:29 +01:00
Simon Glass
2b80b4e246 video: Use 'int' for loop variables instead of short
Using short doesn't save anything and is confusing when the width and height
variables are ulong.

This may fix Coverity CID134902 but I doubt it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-02-06 13:55:49 +01:00
Simon Glass
8de536c27c video: sandbox: Allow selection of font size and console name
For testing it is useful to be able to select the font size and the console
driver for sandbox. Add this information to platform data and copy it to
the video device when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:57:30 +01:00
Simon Glass
826f35f9b5 video: Allow selection of the driver and font size
Provide a way for the video console driver to be selected. This is
controlled by the video driver's private data. This can be set up when the
driver is probed so that it is ready for the video_post_probe() method.

The font size is provided as well. The console driver may or may not support
this depending on its capability.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-30 10:57:20 +01:00
Simon Glass
c0603b98d4 video: Add the Cantoraone decorative font
This font is a little more ornate than normal. Example uses are on security
screens where a feeling of formality is required.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:56:34 +01:00
Simon Glass
7ad4e30dec video: Add the Rufscript handwriting font
This can be used when a a friendly 'hand-writing' font is needed. It helps
to make the device feel familiar.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:56:22 +01:00
Simon Glass
c43c43cd48 video: Add the AnkaCoder mono-spaced font
This can be used when a mono-space font is needed, but the console font
is too small (such as with high-DPI displays).

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:56:09 +01:00
Simon Glass
84b4791ada video: Add the Nimbus sans font
This provides a good-looking font for user prompts.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:55:57 +01:00
Simon Glass
a29b012037 video: Add a console driver that uses TrueType fonts
The existing 8x16 font is adequate for most purposes. It is small and fast.
However for boot screens where information must be presented to the user,
the console font is not ideal. Common requirements are larger and
better-looking fonts.

This console driver can use TrueType fonts built into U-Boot, and render
them at any size. This can be used in scripts to place text as needed on
the display.

This driver is not really designed to operate with the command line. Much
of U-Boot expects a fixed-width font. But to keep things working correctly,
rudimentary support for the console is provided. The main missing feature is
support for command-line editing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-30 10:55:47 +01:00
Simon Glass
7b9f7e445e video: Provide a backspace method
With proportional fonts the vidconsole uclass cannot itself erase the
previous character. Provide an optional method so that the driver can
handle this operation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:55:37 +01:00
Simon Glass
58c733a70f video: Provide a signal when a new console line is started
When we start a new line (due to the user pressing return), signal this to
the driver so that it can flush its buffer of character positions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:55:27 +01:00
Simon Glass
c5b77d01d1 video: Provide a left margin for the text console
Allow the left margin to be set so that text does not have to be right up
against the left side. On some panels this makes it hard to read.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:55:15 +01:00
Simon Glass
5508f10ac9 video: Handle the 'bell' character
This can be sent when to many characters are entered. Make sure it is
ignored and does not cause a character to be displayed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 10:55:02 +01:00
Simon Glass
f266178698 video: Use fractional units for X coordinates
With anti-aliased fonts we need a more fine-grained horizontal position
than a single pixel. Characters can be positioned to start part-way through
a pixel, with anti-aliasing (greyscale edges) taking care of the visual
effect.

To cope with this, use fractional units (1/256 pixel) for horizontal
positions in the text console.

Signed-off-by: Simon Glass <sjg@chromium.org>
[agust: rebased]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-30 10:53:26 +01:00
Simon Glass
6e42e25196 video kconfig console_normal
Signed-off-by: Simon Glass <sjg@chromium.org>
[agust: rebased on current master]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-30 10:03:01 +01:00
Simon Glass
8340ef6278 video: Add stb TrueType font renderer
This is a header file which provides a fairly light-weight TrueType
rendering implementation. It is pulled from http://nothings.org/. The code
style does not comply with U-Boot but I think it is best to leave alone to
permit the source to be synced later if needed.

The only change is to fix a reference to fabs() which should route through
a macro to allow U-Boot to provide its own version.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-30 09:35:58 +01:00
Anatolij Gustschin
7588c31252 video: add CONFIG_I2C_EDID and disable CONFIG_DISPLAY by default
Enabling CONFIG_DISPLAY breaks building for some architectures
(microblaze-generic), so we disable CONFIG_DISPLAY in Kconfig
by default and enable this option in defconfigs. CONFIG_DISPLAY
depends on CONFIG_I2C_EDID, so add and enable it in defconfigs, too.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reported-by: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-26 08:06:13 +01:00
Stefan Roese
913d1be208 video: Add support for Armada XP LCD controller
This patch adds basic support for the LCD controller of the Marvell
Armada XP SoC.

An AXP based custom board port will be added later, to use this
driver to display a splash screen via the bmp command later.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
[agust: rebased]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-01-23 22:58:07 +01:00
Simon Glass
7b7ad5c31c rockchip: video: Add a video-output driver
Some rockchip SoCs include video output (VOP). Add a driver to support this.
It can output via a display driver (UCLASS_DISPLAY) and currently HDMI and
eDP are supported.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-21 20:42:36 -07:00
Simon Glass
5852d539ea rockchip: video: Add a display driver for rockchip eDP
Some Rockchip SoCs support embedded DisplayPort output. Add a display driver
for this so that these displays can be used on supported boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-21 20:42:36 -07:00
Simon Glass
c253948341 rockchip: video: Add a display driver for rockchip HDMI
Some Rockchip SoCs support HDMI output. Add a display driver for this so
that these displays can be used on supported boards.

Unfortunately this driver is not fully functional. It cannot reliably read
EDID information over HDMI. This seems to be due to the clocks being
incorrect - the I2C bus speed appears to be up to 100x slower than the
clock settings indicate. The root cause may be in the clock logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-21 20:42:36 -07:00