Commit graph

199 commits

Author SHA1 Message Date
Lucas Stach
16f7b35138 video: simple-panel: depend on OFDEVICE
Fixes:
In function `simple_panel_ioctl':
undefined reference to `of_get_display_timings'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:33:07 +02:00
Sascha Hauer
c8fa7eed66 Merge branch 'for-next/misc' 2015-10-07 08:23:45 +02:00
Sascha Hauer
65894735e6 video: backlight-pwm: Add regulator support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:08 +02:00
Sascha Hauer
7bc30c8276 video: backlight-pwm: Add error message
Inform the user when we can't find a pwm for the backlight driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer
ec54ba6b31 video: ipuv3: print error message when no modes are found
This is a common error, so print a message to inform the user
what went wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer
80e3f29a58 video: simple-panel: Add support for device tree provided nodes
This adds support for display timings provided from device tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer
3dd4a3c747 video: simple-panel: Add debug/error messages
Let the driver be more informative when something goes wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer
7055047a34 video: ipuv3: imx-ldb: Support video modes in ldb node
We used to support video modes directly in the ldb device node, that
was lost in: 5bda17e video: ipuv3: Replace ipu_output with VPL.
Add this support back. Also drop duplicate vpl ioctl forwarding for
several calls.

With this patch modes can either be retrieved from the ldb node as
originally done or from the panel remote port.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer
dd80c5974b video: ipuv3: imx-ldb: remove unused variable
endpoint is set but not used. Remove the code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer
e8e387731b video: ipuv3: Do not crash when no mode is found
When something is missing in the device tree or not all necessary
drivers are compiled in it may happen that no valid mode is found.
Do not crash in this case but print an error message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Fabio Estevam
704588632f video: imx-hdmi: Remove unused 'regmap' structure
As regmap is not used in Barebox we can remove this field
from the imx_hdmi struct.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:23:14 +02:00
Sascha Hauer
7e44c8495a introduce strerrorp
putting an error pointer into strerror can be a bit confusing since
strerror takes a positive error code but PTR_ERR returns a negative
number, so we have to do strerror(-PTR_ERR(errp)). Some places got
this wrong already, so introduce a strerrorp function which directly
takes an error pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 17:12:44 +02:00
Uwe Kleine-König
36152c5aa5 video: imx: assert that image buffer doesn't cross a 4 MiB boundary
The reference manual (for the i.MX25 in my case) states:

	This field must start at a location that enables a complete
	picture to be stored in a 4 Mbyte memory boundary (A [21:0]). A
	[31:22] has a fixed value for a picture’s image.

Check this condition for user-supplied framebuffer values and enforce it
for driver-allocated buffers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-21 08:08:09 +02:00
Lucas Stach
eb1f1a1a24 video: imx-hdmi: depend on EDID support
HDMI support is not generally useful without EDID support.

Fixes:
In function `imx_hdmi_ioctl':
undefined reference to `edid_read_i2c'
undefined reference to `edid_to_display_timings'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 07:37:06 +02:00
Lucas Stach
a71937a470 video: vpl: depend on OFTREE
VPL uses the of_graph bindings, which are only available if OFTREE
support is compiled in.

Also fix the drivers using VPL to depend on OFTREE.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 07:37:06 +02:00
Sascha Hauer
f387bc96bb Merge branch 'for-next/fb-imx-ipu-v3' 2015-09-01 09:43:53 +02:00
Lucas Stach
2b7e24c1e9 video: fbcon: needs console support
Fixes:
In function `register_fbconsole':
drivers/video/fbconsole.c:425: undefined reference to `console_register

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer
f84415497e fb: fbconsole: Add missing blits
When using offscreen rendering we need some more points where we
blit the offscreen buffer to the screen. Add them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer
3b3d5f412d fb: fbconsole: print cursor after clearing the screen
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer
7c5937d245 gui: Use fb provided shadowfb for offscreen rendering
The fb core now has builtin support for offscreen rendering, use
this and drop offscreen handling in the gui code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer
6f96499064 fb: Add shadowfb support
For speeding up rendering we need shadow framebuffers. This is currently
implemented in the gui functions. This does not work properly when two
users (splash and fbconsole) use the same framebuffer since in this case
two different shadow framebuffers will be used. This patch implements
shadowfb handling in the fb core directly. With this the fb device gets
a parameter 'shadowfb'. When this is true the fb core will allocate a
shadow fb and provide it to the users.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Sascha Hauer
eac28050d0 fb: return original fb_info in FBIOGET_SCREENINFO
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Sascha Hauer
5c12f6b9f1 video: fbconsole: do not enter when we are already in fbconsole
Make it possible to issue console messages from inside the fbconsole
code without entering the fbconsole again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Lucas Stach
c5bfe48df0 video: simple-panel: mode support depends on I2C and EDID
Reading modes from EDID EEPROMs requires both I2C and EDID support to
be available. As the simple panel driver is also useful without mode
reading support, only built it in if the requirements are met.

Fixes:
In function `simple_panel_get_modes':
simple-panel.c:88: undefined reference to `of_find_i2c_adapter_by_node'
simple-panel.c:91: undefined reference to `edid_read_i2c'
simple-panel.c:95: undefined reference to `edid_to_display_timings'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:12:12 +02:00
Lucas Stach
6962badee7 video: MTL017: depend on I2C
This driver uses I2C functions and isn't useful without them.

Fixes:
In function `mtl017_init':
drivers/video/mtl017.c:278: undefined reference to `i2c_bus'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:11:35 +02:00
Lucas Stach
368b249043 video: ipu-fb: mark internally used functions as static
Fixes symbol clashes with the IPUv3 driver:
In function `ipu_ch_param_write_field':
drivers/video/imx-ipu-v3/ipu-common.c:103: multiple definition of `ipu_ch_param_write_field'
drivers/video/imx-ipu-fb.c:359: first defined here

In function `ipu_cpmem_set_format_rgb':
drivers/video/imx-ipu-v3/ipu-common.c:155: multiple definition of `ipu_cpmem_set_format_rgb'
drivers/video/imx-ipu-fb.c:504: first defined here

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:48:59 +02:00
Sascha Hauer
3ea5798a9f fb: imx-ipu-v3: Use writecombine memory for fb
To speed up copying to the framebuffer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-07 15:43:02 +02:00
Sascha Hauer
77ac6b4786 video: ipuv3: Adjust videomode to IPU limitations
The IPU needs an upper margin >= 2. Make this sure. This is based
on Linux commit:

commit 6541d71082fdb91f862c92920c6530e4e0548d6f
Author: Jiada Wang <jiada_wang@mentor.com>
Date:   Thu Dec 18 18:00:20 2014 -0800

    gpu: ipu-di: Add ipu_di_adjust_videomode()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-07 15:42:49 +02:00
Sascha Hauer
45bd49715f video: imx-hdmi: sync with kernel
This syncs the imx-hdmi driver with Linux 4.2-rc1 where it makes sense. This
makes it easier to compare the driver with the kernel. This also adds
hdmi_av_composer which is mandatory. Somehow the driver worked without it in
lower resolutions, but now it also works for higher resolutions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-07 15:42:44 +02:00
Sascha Hauer
98b5672c4d Merge branch 'for-next/vpl' 2015-08-07 07:55:00 +02:00
Sascha Hauer
19afbd285e Merge branch 'for-next/video' 2015-08-06 12:33:26 +02:00
Sascha Hauer
3c92473a9e Merge branch 'for-next/fbcon' 2015-08-06 12:33:06 +02:00
Lucas Stach
1c9535cff8 video: backlight-pwm: depend on GPIOLIB
The PWM backlight driver does not only control PWMs but also GPIOs.

Fixes:
In file included from include/gpio.h:4:0,
                 from drivers/video/backlight-pwm.c:27:
arch/arm/include/asm/gpio.h:5:23: fatal error: mach/gpio.h: No such file or directory

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-29 08:01:15 +02:00
Antony Pavlov
27f79c05ab video: implement framebuffer console
This patch realizes framebuffer console support for barebox. It
supports colors and enough escape sequences to show the barebox
console and editor properly.

fbconsole mini-HOWTO
====================

1. compile sandbox barebox with

    CONFIG_VIDEO=y
    CONFIG_FRAMEBUFFER_CONSOLE=y
    CONFIG_DRIVER_VIDEO_SDL=y

2. run barebox

3. test fbconsole

    fbconsole0.active=oe

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:11:21 +02:00
Sascha Hauer
772ab4f172 fb: sdl: create graphics window on enabling
The framebuffer should be enabled on the fb_enable callback and disabled
in the fb_disable callback. In SDL context this means the grapics window
has to be created / destroyed in fb_enable / fb_disable.

With this change the framebuffer has to be enabled explicitly with
fb0.enable=1 like with other framebuffer driver aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:11:21 +02:00
Sascha Hauer
8a4be80936 fb: Add fb_enable/disable functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:11:21 +02:00
Sascha Hauer
427d637327 video: Add simple-panel support
This adds support for simple panels. These are panels which don't need
special handling but can have enable gpios and such. Unlike the Linux
kernel implementation this one is able to understand display-timings
nodes so that it's not necessary to keep a list of all known displays
with their corresponding timings in barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer
2505fc391c video: ipuv3: match ipu_di_signal_cfg's clk_pol with its description
From this Linux commit:

commit 85de9d17c485c4196f74d45de2206d4802f8a3be
Author: Denis Carikli <denis@eukrea.com>
Date:   Mon Apr 7 14:44:43 2014 +0200

    imx-drm: match ipu_di_signal_cfg's clk_pol with its description.

    According to the datasheet, setting the di0_polarity_disp_clk
    field in the GENERAL di register sets the output clock polarity
    to active high.

    Signed-off-by: Denis Carikli <denis@eukrea.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer
5bda17e1ea video: ipuv3: Replace ipu_output with VPL
The ipuv3 makes heavy use of video encoders internally to the SoC but
also external encoders are common. Switch to VPL support to be able
to handle these properly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer
8904613e61 video: ipuv3: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer
2d8b66ad59 video: Add MTL017 LVDS encoder support
The MTL017 is found on the Efika Smartbook. Not much is known about
this chip, so this driver only programs a register dump which is suitable
for some panels.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer
70007036a5 video: Add Video Pipeline (VPL) support
Complex video pipelines are modelled with the of_graph bindings in
the devicetree. This patch adds a ioctl infrastructure to issue
commands to the remote endpoint of a of_graph. Currently defined
ioctls are prepare/unprepare, enable/disable and get_modes. This
is enough to control LVDS or HDMI encoder or simple panels.

A device node which contains of_graph endpoints can be registered
as a VPL entity. An entity can receive ioctls via the .ioctl callback
and also issue ioctls by calling vpl_ioctl. The core itself will never
iterate over the entire pipeline. Instead, the different VPL entities
should forward an ioctl to the next instance in the pipeline whenever
necessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer
491dc73fe4 video: stm: reserve framebuffer memory for Linux
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:24 +02:00
Sascha Hauer
2f5f0d6aa1 video: Add generic fixup handler to reserve fb memory
When a framebuffer is kept enabled when Linux starts its framebuffer
memory should be reserved. Otherwise Linux may overwrite its contents.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:23 +02:00
Sascha Hauer
7be1519c69 video: stm: honor display_flags
stmfb uses custom flags FB_SYNC_DE_HIGH_ACT and FB_SYNC_CLK_INVERT.
These have generic counterparts in display_flags. Honor them aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:23 +02:00
Sascha Hauer
bbbba8cc13 video: stm: read bits-per-pixel from device tree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:23 +02:00
Sascha Hauer
a4e7ce4225 video: stm: read interface width from device tree
The interface width has not been initialized when probed from device
tree. Fix that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:23 +02:00
Sascha Hauer
55d1fd0247 video: stm: use uncached memory
To avoid caching effects on the display use uncached memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:22 +02:00
Sascha Hauer
dd93a9f6ef video: stm: code buswidth in platform data as decimal
Instead of putting hardware specific bit masks in platform_data just
use the decimal interface width and encode this in the driver. This
makes it easier to create the platform_data and helps device tree
based implementations.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:22 +02:00
Sascha Hauer
4598e92ead video: stm: copy platform_data to driver data
Copy the individual fields of struct imx_fb_platformdata to the
driver data rather than keeping a pointer to platform_data. This
works better with device tree where no platform_data * is
available.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:22 +02:00