9
0
Fork 0
Commit Graph

37 Commits

Author SHA1 Message Date
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
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
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
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
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
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 19afbd285e Merge branch 'for-next/video' 2015-08-06 12:33:26 +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 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 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
Holger Schurig 287c03267e devinfo: make the output of "devinfo DEVICE" nicer
* some output sections started with "foo: bar", some with "foo = bar". Unify this.
* there was a fixed size to the "foo =" parameters, which wasn't fitting, this
  was especially visible at "devinfo global"
* don't output "resources:", "driver:" and "bus:" lines if there are none
  resources, drivers or busses involved.
* remove some empty lines
* harmonize differentiation between headlines (e.g. "resources:") and values
  by indenting values slightly
* uppercase some texts

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-02 09:07:11 +02:00
Sascha Hauer 7b8779541f fb: Fix use of unitialized variable
'ret' is only initialized when info->fbops->fb_activate_var exists, so
only use it in this case.

Reported-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:37:30 +02:00
Sascha Hauer 939c653328 video: Add edid support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer 25dcdd68fb video: rework mode_name parameter setting
We have dev_add_param_enum() now, so use it for the mode_name
setting. Also drop the special case for single mode framebuffers,
just add the mode_name parameter for this case aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:33:39 +01:00
Sascha Hauer 297b0e4672 video: introduce struct display_timings
And use it inside struct fb_info. This struct has the advantage
that the supported modes can be passed around in a single pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:33:34 +01:00
Sascha Hauer 8bec1f2f16 video: Add screen_size field
barebox does not need the screen size directly, but we pass the
framebuffer to Linux via simnplefb it is desirable to pass the
full size of the framebuffer. Default to calculated values from
the screen resolution.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:38 +01:00
Andre Heider 97607e85cd video: set up the kernel's simple framebuffer driver
Add support to configure the active framebuffer for the kernel through
device tree.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 10:37:24 +01:00
Andre Heider 485544f0fb fb: add a line_length value to struct fb_info
Add support for framebuffers with noncontiguous horizontal lines.

Video drivers can set this value if the hardware requires it.
In case a driver does not set it, the current value of
xres * (bpp / 8) is used instead.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 09:59:04 +01:00
Sascha Hauer 1fd45e07f2 fb: make fb device a pure device
Makes the code simpler and makes the framebuffer layer independent
of initcalls.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-07 08:49:30 +02:00
Sascha Hauer 73b0d228e5 driver: Attach info callback to device, not to driver
Since the info is device specific and not driver specific, attach
the callback to the device. This makes it possible to have a info
callback for a device which does not have a driver attached.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-30 12:18:27 +02:00
Sascha Hauer fb3fcaf2cc fb: Use dev_add_param_bool for enable parameter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-11 11:48:35 +02:00
Jan Weitzel 977625a051 fb: calculate resource end
commit 5f03074 changed storing struct resource end insted of size.
Fix calculation of end in fb

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-02 09:07:31 +02:00
Jean-Christophe PLAGNIOL-VILLARD c0620a4b50 fb: move add param to bus probe
so the param add added only of the device successed to register.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-04 15:19:12 +02:00
Jean-Christophe PLAGNIOL-VILLARD 31a1e46873 fb: add it's own bus for fb devices
This is need for oftree device probing

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-23 21:15:13 +02:00
Sascha Hauer 5f03074ea9 resource: store 'end' instead of 'size' in struct resource
Storing the size instead of the resource end in struct resource was
a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously
leads to problems. 'end' on the other hand will never exceed
UINT[32|64]_MAX. Also this way we can express a iomem region covering
the whole address space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-01 08:18:53 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6147b6a6ca fb: switch to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-30 02:05:26 +08:00
Sascha Hauer dd18f45e0f fb: For multiple video modes print the available modes in devinfo
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-02-07 22:08:09 +01:00
Sascha Hauer 4fb2d9ce0a fb: When setting a mode, also update xres, yres and fb size
Also, set size to 0 when setting up the framebuffer failed so that
the user cannot write to uninitialized framebuffer memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-19 09:30:37 +01:00
Sascha Hauer 0327e12f06 fb: update cdev map_base
Calling fb_activate_var potentially changes the framebuffer address,
so we have to update the fb0 cdev afterwards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-14 20:42:17 +01:00
Juergen Beisert 30aa4efb57 Add the feature to change the video mode at runtime
This patch add the possibility to change the video mode at barebox's runtime
if the graphics driver in use supports it.

Signed-off-by: <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-21 08:26:08 +01:00
Juergen Beisert fed63e249d Fix default framebuffer 'enable' set
To setup the default 'enable' setting the "dev_set_param(dev, "enable", "0");"
does not work as expected. After the call the parameter is still "<NULL>".
This is due to any change of the setting is rejected, if the same setting
is already active.
This patch also let the default setting be successfull, but only calls the
graphics backend if a change happens.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-21 08:26:08 +01:00
Sascha Hauer f38bfd20e7 fb: set id for framebuffer device correctly
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:07:16 +01:00
Sascha Hauer 112d65d3d2 fb: add a usage counter to prevent double enable/disable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:37:40 +02:00
Sascha Hauer c3789cd49b rework device parameters
Change device parameters so that the memory management is in generic
code. This also removes the need of storing statically initialized
parameters as they are stored in a struct list_head for each device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:25 +02:00
Sascha Hauer 79baaa503f Add framebuffer support
This patch adds framebuffer support and a driver for i.MX[12]
framebuffer devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-31 15:08:21 +02:00