summaryrefslogtreecommitdiffstats
path: root/drivers/video/fb.c
Commit message (Collapse)AuthorAgeFilesLines
* devfs: Drop dev_lseek_default()Andrey Smirnov2019-01-291-1/+0
| | | | | | | | | | | | | | | | | | | | | Only the following cdevs do not declare an .lseek() operation: - Console devices in common/console.c - Firmware framework in common/firmware.c - JTAG driver in drivers/misc/jtag.c - UBI in drivers/mtd/ubi/barebox.c Of those four, first two are marked DEVFS_IS_CHARACTER_DEV and implement only .write() operation and the last two don't implement anything but .ioctl(). While there's probably no meaningful way to use lseek() against any of those devices, there doesn't seem to be any harm in allowing it either. Change devfs_lseek() to ignore absense of .lseek() callback and drop dev_lseek_default() and all references to it in the codebase. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: Introduce dev_set_name()Andrey Smirnov2018-10-181-1/+1
| | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: reject enable request when framebuffer has no modeLucas Stach2018-04-091-0/+3
| | | | | | | | | | If no display is connected or the display modes are incompatible with the scanout hardware we might end up with a registered framebuffer with no modes. Trying to enable such a framebuffer will blow up with NULL ptr dereferences in various places, so just don't do it. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename file_operations -> cdev_operationsSascha Hauer2018-04-061-1/+1
| | | | | | | | Linux also has struct file_operations which are something different. Rename our file_operations to cdev_operations which better matches what we have. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: make enable/disable ops optionalJean-Christophe PLAGNIOL-VILLARD2017-03-101-2/+4
| | | | | | | | 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>
* video: call fb_[en|dis]able instead of fops directlySascha Hauer2017-03-101-3/+5
| | | | | | | | 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>
* fb: introduce flush for virtual framebufferBastian Stender2017-02-281-0/+26
| | | | | | | | | | | 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>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-1/+1
| | | | | | | | | | 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>
* drivers: video: fb: make locally used fb_set_shadowfb() staticAntony Pavlov2016-02-081-1/+1
| | | | | | | | | | | | 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>
* fb: alloc or free shadowfb whether fb enabled or disabledAleksey Kuleshov2015-11-061-2/+2
| | | | | | | | 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>
* fb: satisfy semantics for shadowfb's alloc/freeAleksey Kuleshov2015-11-061-2/+9
| | | | | | | | | 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>
* fb: Add shadowfb supportSascha Hauer2015-08-201-0/+47
| | | | | | | | | | | | 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>
* fb: return original fb_info in FBIOGET_SCREENINFOSascha Hauer2015-08-201-1/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/video'Sascha Hauer2015-08-061-0/+21
|\
| * video: Add generic fixup handler to reserve fb memorySascha Hauer2015-07-061-0/+21
| | | | | | | | | | | | | | 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>
* | video: implement framebuffer consoleAntony Pavlov2015-07-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | fb: Add fb_enable/disable functionsSascha Hauer2015-07-201-5/+24
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devinfo: make the output of "devinfo DEVICE" nicerHolger Schurig2014-06-021-5/+2
| | | | | | | | | | | | | | | * 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>
* fb: Fix use of unitialized variableSascha Hauer2014-04-081-8/+7
| | | | | | | | '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>
* video: Add edid supportSascha Hauer2014-03-291-3/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: rework mode_name parameter settingSascha Hauer2014-03-291-33/+74
| | | | | | | | 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>
* video: introduce struct display_timingsSascha Hauer2014-03-291-9/+11
| | | | | | | 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>
* video: Add screen_size fieldSascha Hauer2013-12-201-0/+2
| | | | | | | | | 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>
* video: set up the kernel's simple framebuffer driverAndre Heider2013-11-061-0/+7
| | | | | | | | 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>
* fb: add a line_length value to struct fb_infoAndre Heider2013-11-061-2/+9
| | | | | | | | | | | 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>
* fb: make fb device a pure deviceSascha Hauer2013-08-071-63/+35
| | | | | | | Makes the code simpler and makes the framebuffer layer independent of initcalls. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Attach info callback to device, not to driverSascha Hauer2013-05-301-1/+2
| | | | | | | | 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>
* fb: Use dev_add_param_bool for enable parameterSascha Hauer2013-04-111-21/+12
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: calculate resource endJan Weitzel2013-04-021-2/+2
| | | | | | | | 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>
* fb: move add param to bus probeJean-Christophe PLAGNIOL-VILLARD2012-10-041-11/+12
| | | | | | so the param add added only of the device successed to register. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* fb: add it's own bus for fb devicesJean-Christophe PLAGNIOL-VILLARD2012-09-231-4/+27
| | | | | | | 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>
* resource: store 'end' instead of 'size' in struct resourceSascha Hauer2012-07-011-2/+2
| | | | | | | | | | 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>
* fb: switch to "struct resource"Jean-Christophe PLAGNIOL-VILLARD2011-07-301-6/+10
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* fb: For multiple video modes print the available modes in devinfoSascha Hauer2011-02-071-0/+38
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: When setting a mode, also update xres, yres and fb sizeSascha Hauer2011-01-191-3/+9
| | | | | | | 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>
* fb: update cdev map_baseSascha Hauer2011-01-141-0/+2
| | | | | | | 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>
* Add the feature to change the video mode at runtimeJuergen Beisert2010-12-211-0/+35
| | | | | | | | 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>
* Fix default framebuffer 'enable' setJuergen Beisert2010-12-211-5/+4
| | | | | | | | | | | | 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>
* fb: set id for framebuffer device correctlySascha Hauer2010-11-121-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: add a usage counter to prevent double enable/disableSascha Hauer2010-06-241-0/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rework device parametersSascha Hauer2010-06-171-9/+12
| | | | | | | | 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>
* Add framebuffer supportSascha Hauer2009-07-311-0/+86
This patch adds framebuffer support and a driver for i.MX[12] framebuffer devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>