9
0
Fork 0
Commit Graph

246 Commits

Author SHA1 Message Date
Sascha Hauer 97d2da3d98 Merge branch 'for-next/video' 2017-03-13 08:16:53 +01:00
Sascha Hauer 93c55ce098 Merge branch 'for-next/efi' 2017-03-13 08:16:43 +01:00
Jean-Christophe PLAGNIOL-VILLARD f210382b3f video: make enable/disable ops optional
Some framebuffers cannot be enabled/disabled, so make the corresponding
ops optional.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-10 08:12:11 +01:00
Sascha Hauer f8f3f26f8b video: call fb_[en|dis]able instead of fops directly
We have fb_enable and fb_disable which handle enabling of a
framebuffer, so use it instead of calling into the ops directly.
This gets the enable count straight.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-10 08:07:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6518b21c6c video: add EFI Graphics Output Protocol support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-09 07:36:14 +01:00
Jean-Christophe PLAGNIOL-VILLARD ffdb34022b video: sdl fix typo
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-06 09:11:51 +01:00
Bastian Stender 52e9a842e3 video: add support for Solomon SSD1307 OLED controller family
It was ported from linux v4.10. Like the kernel driver only
communication via I2C is supported.

It has only been tested with a SSD1306 and a 96x16 OLED display:

	&i2c0 {
		status = "okay";

		ssd1306: oled@3c {
			compatible = "solomon,ssd1306fb-i2c";
			reg = <0x3c>;
			reset-gpios = <&gpio1 1 0>;
			solomon,height = <16>;
			solomon,width = <96>;
			solomon,page-offset = <0>;
			solomon,com-invdir;
			solomon,com-seq;
		};

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-06 08:10:36 +01:00
Bastian Stender b9cf45f00c fb: introduce flush for virtual framebuffer
Some drivers need an explicit sync method to flush the virtual
framebuffer to the display. It is called fb_flush().

fb_flush() gets called on fbc_putc, on fb_close and in the pattern cycle
in the fbtest command.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 15:52:53 +01:00
Bastian Stender 1233570798 console: replace set_active by open/close
Opening and closing consoles should be independent from setting them
active. This way it is possible to open e.g. a framebuffer console and
display text on it without showing stdout/stderr.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 15:52:35 +01:00
Bastian Stender 3cade5ec3a fbconsole: implement vt100 cursor shown/hidden
This implements the vt100 show cursor command '[?25h' and the hide
cursor command '[?25l'. It is useful for displaying text on a non-active
(no stdout/stdin/stderr) console with 'echo'.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 07:45:38 +01:00
Bastian Stender 1e2f65d72a fbconsole: check cursor position before moving
Moving the cursor to x=2, y=2 with "\e[3;3H" on a 12x2 framebuffer
console lead to a barebox crash while drawing the cursor. If the
cursor position is out of bounds clip the cursor to the corresponding
edge.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-28 07:44:59 +01:00
Andrey Gusakov 280c65107c video: tc358767: add copyright lines
Add copyright lines for Zodiac who paid for driver development.

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-20 09:10:31 +01:00
Jan Luebbe 34babf2121 video: IPU framebuffer: honor clock and enable polarities
These flags are already parsed from DT, so we can just use them to
configure the timings correctly.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:23 +01:00
Philippe Leduc c6b10f69a9 i.MX: IPUv3: Add parallel display support
Add a driver compatible with "fsl,imx-parallel-display" in order
to enable parallel display with the i.MX IPUv3.

Signed-off-by: Philippe Leduc <ledphilippe@gmail.com>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:23 +01:00
Lucas Stach efe3b512e5 video: tc358767: depend on EDID helpers
The eDP part need to be able to read the panel EDID.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 08:12:19 +02:00
Sascha Hauer f4714e5f6a Merge branch 'for-next/video' 2016-09-13 14:56:07 +02:00
Philipp Zabel 6ed5b755ba video/edid: Fix edid_to_display_timings error path
edid_to_display_timings is called in drivers/video/imx-ipu-v3/imx-hdmi.c,
drivers/video/simple-panel.c, and drivers/video/edid.c with the struct
display_timings *timings parameter pointing to an embedded struct
display_timings inside a struct fb_info. The timings pointer is not to
be freed in the error path.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-05 08:27:02 +02:00
Sascha Hauer ac20c4f03b video: backlight: fix the value of 'brightness_max'
Fixes: 87c6a88 video/backlight-pwm: fix the value of 'brightness_max'.

brightness_max should really contain the number of brightness steps, so
the number of elements in the brightness array.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-29 17:36:36 +02:00
Andrey Gusakov 46e30c9ac0 video: tc358767: add eDP video encoder driver
This patch adds support for the Toshiba TC358767 eDP bridge,
connected via DPI.

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-25 08:28:40 +02:00
Philipp Zabel da03ce9c18 video: add VPL ioctl to get bus format
The i.MX specific DI_MODE VPL ioctl already allows to query the encoder
input bus format. This patch also allows non-i.MX specific encoder drivers
to report their input bus format.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-25 08:28:40 +02:00
Philipp Zabel 1be6d321ef video: switch to media bus formats
V4L2 pixel formats are supposed to describe video frames in memory. To
describe the pixel format on the hardware bus between display interface
and encoders, use media bus formats, which are more expressive.

This allows to get rid of the custom GBR24 and LVDS666 fourccs.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-25 08:28:40 +02:00
iw3gtf@arcor.de 832f9fec6a video/backlight-pwm: properly handle the case of an empty 'brightness-levels' in the device tree.
In case of an empty 'brightness-levels' array in the device tree or
a non empty one but containing only zeros the value of
'pwm_backlight->scale' would remain 0 possibly causing a division by zero
in the function compute_duty_cycle().

To fix it we check the computed value in case we actually have a 'brightness-levels'
array in the device tree otherwise we implicitly assume a simple array
of the form { 0, 1, 2, ..., 100 } and set the scale to 100.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-15 08:07:14 +02:00
iw3gtf@arcor.de ca497ce66d video/backlight-pwm: code readability improvement.
We use the local variable 'length' instead of the lengthy
'pwm_backlight->backlight.brightness_max' within pwm_backlight_parse_dt().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-15 08:07:14 +02:00
iw3gtf@arcor.de 87c6a88f2a video/backlight-pwm: fix the value of 'brightness_max'.
The field pwm_backlight->backlight.brightness_max should be the maximum
allowed brightness value for the backlight, not the max index of the
array 'pwm_backlight->levels[]'.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-15 08:07:14 +02:00
iw3gtf@arcor.de c27b1a93ce video/backlight-pwm: fixed a loop index going out of range.
In the function pwm_backlight_parse_dt() the last iteration of the for
loop accessed memory past the end of the array 'pwm_backlight->levels[]'
because of a wrong test ( '<=' instead of '<').

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-15 08:07:14 +02:00
Andrey Smirnov aa750244ee video/edid: Move int_sqrt() out
Move int_sqrt() out of drivers/video/edid.c so that it is availible to
other parts of Barebox.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-06-30 08:33:53 +02:00
Sascha Hauer 947fb5adf8 string: Fix (v)asprintf prototypes
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-04-15 12:21:45 +02:00
Sascha Hauer 3bd69ad077 driver: replace dev_request_mem_region with dev_request_mem_resource
dev_request_mem_region doesn't work properly one some SoCs on which
PTR_ERR() values clash with valid return values from dev_request_mem_region.
Replace them with dev_request_mem_resource where possible.

This patch has been generated with the following semantic patch:

// <smpl>
@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores)) {
...
-	return PTR_ERR(io);
-}
+	return PTR_ERR(iores);
+}
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores))
-	return PTR_ERR(io);
-}
+	return PTR_ERR(iores);
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
-	ret = PTR_ERR(io);
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores)) {
+	ret = PTR_ERR(iores);
...
}
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores))
+	return PTR_ERR(iores);
+io = IOMEM(iores->start);
...+>
}

@@
identifier func;
@@
func(...) {
<+...
struct resource *iores;
-struct resource *iores;
...+>
}
// </smpl>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-07 08:57:56 +01:00
Sascha Hauer 8ee5479a28 driver: Fix return check of dev_request_mem_region
dev_request_mem_region returns an ERR_PTR, fix places which check for a
NULL pointer instead. This patch has been generated with this semantic
patch, written by me and improved by Andrey Smirnov:

// <smpl>
@@
expression e;
expression e1;
@@
e = dev_request_mem_region(...);
...
-if (!e)
-	return e1;
+if (IS_ERR(e))
+	return PTR_ERR(e);

@ rule1 @
expression e;
@@
e = dev_request_mem_region(...);

@@
expression rule1.e;
identifier ret, label;
constant errno;
@@
if (!e) {
	...
(
-	ret = -errno;
+	ret = PTR_ERR(e);
	...
	goto label;
|
-	return -errno;
+	return PTR_ERR(e);
)
}

@depends on rule1@
expression rule1.e;
@@
-	if (e == NULL)
+	if (IS_ERR(e))
{
...
}
// </smpl>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
2016-02-23 08:14:16 +01:00
Antony Pavlov c976b06e16 drivers: video: drop unused of_get_display_timing()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-08 08:30:02 +01:00
Antony Pavlov 132e226920 drivers: video: fb: make locally used fb_set_shadowfb() static
The patch fixes this compiler's warning:

    drivers/video/fb.c:233:5: warning: no previous prototype for
    'fb_set_shadowfb' [-Wmissing-prototypes]
     int fb_set_shadowfb(struct param_d *p, void *priv)
         ^

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-08 08:28:39 +01:00
Yegor Yefremov 7814ae61ab Introduce include/linux/mutex.h
Move mutex related defines to its original place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-03 07:57:32 +01:00
Yegor Yefremov baa7fe1d15 Introduce include/linux/spinlock.h
Move spinlock related definitions to its original place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Alexander Aring 295d6763bf bcm2835: introduce mach-bcm283x
This patch changes the most part of mach-bcm2835 to mach-bcm283x. This
prepares to add RPi2 support which is a bcm2836. This patch changes the
Kconfig entry namens to BCM283X for drivers only. These drivers should
working the same in bcm2836.

While updating defconfig I added LED support/trigger option.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-04 09:38:12 +01:00
Sascha Hauer 29ac6ac467 Merge branch 'for-next/imx' 2015-12-08 08:27:47 +01:00
Sascha Hauer 7da99e58bd video: i.MX IPUv3: Set ldb clocks correctly
The clocks for the LVDS display bridge have a fixed /3.5 and a
configurable /1,/2 divider in their path. The configurable divider has
to be explicitly configured for single/dual channel support, so we can't
rely on clock rate parent propagation here. Clear the
CLK_SET_RATE_PARENT flag for the configurable divider and configure the
clock explicitly in the ldb driver.
Tested on a custom i.MX6 board, currently untested on i.MX53.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:31 +01:00
Sascha Hauer 42c797b091 video: pwm-backlight: Honour discrete brightness levels from dt
If probed from device tree we have an array of pwm duty cycle levels
in the brightness-levels property. Although the driver parsed the property,
the values have been ignored. Make use of these flags so that the driver
can work for example with inverted PWMs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 09:46:27 +01:00
Du Huanpeng ea682776db font: fbconsole: add custom font supports
Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:21:08 +01:00
Du Huanpeng 3eeac4d2ab fbconsole: move font variable into struct font_desc
replace font related variables with a struct pointer,
font_desc.

Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:26:23 +01:00
Sascha Hauer 1d9295b344 Merge branch 'for-next/misc' 2015-11-06 16:10:42 +01:00
Sascha Hauer 3cdd30342b Merge branch 'for-next/memtest' 2015-11-06 16:10:37 +01:00
Sascha Hauer 5b476ef5e5 Merge branch 'for-next/imx' 2015-11-06 16:10:35 +01:00
Aleksey Kuleshov 6face0e8ab fb: alloc or free shadowfb whether fb enabled or disabled
Resolution can't be changed anyway once fb_enable() has been called,
since no corresponding fb_disable() call appears in the code.

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-06 07:35:11 +01:00
Aleksey Kuleshov f72056d14e fb: satisfy semantics for shadowfb's alloc/free
Console enable -> alloc shadowfb.
Console disable -> free shadowfb.
Otherwise, if resolution gets changed, shadowfb will not be affected.

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-06 07:35:11 +01:00
Aleksey Kuleshov 769ddc6133 fbconsole: no need to copy extra line
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-06 07:35:11 +01:00
Sascha Hauer b792124a7d rework remap_range
remap_range is for remapping regions with different cache attributes.
It is implemented for ARM and PowerPC only, the other architectures only
provide stubs.
Currently the new cache attributes are passed in an architecture specific
way and the attributes have to be retrieved by calls to
mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags().
Make this simpler by providing architecture independent flags which can
be directly passed to remap_range()
Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function.
The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture
has as default. the arch_can_remap() function returns true if the
architecture can change the cache attributes, false otherwise. This
allows the memtest code to better find out what it has to do.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 07:27:44 +01:00
Sascha Hauer 9b31b271ad video: ipuv3: Silence VPL message
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 11:48:53 +01:00
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