fbdev fixes for 3.17
Minor fbdev fixes for da8xx-fb, atmel_lcdfb, arm clcd and chipsfb. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJUAIG5AAoJEPo9qoy8lh71SBcQAJBqtDv+NB+nKIHDvLhneuTz RxWGDjZ3MXFmXj08tjIUNAcOH1WXrryN+1P942n5xxjusJfUCeT4Gfbjg3rO6DMW 5qoCexf5kM8TyCPMMCnonjXF1x7gm1LSQPFsYclQ9u7hAt2Me0liUpQc15rjuQAs kqjQroUihesb5EPbB7ygr3kAdg5fpvmwCgkhYUS4VySgfoM9KTzsuy+ckXTwcdeY QZGycuZTb2CIECVqoKUXBKeK2KuqAYNXxu2LHuEKGefR+gmBWdPvzQ9D1eTAfTsZ MFbQWqRMXYtYv/ueEgmHzyvko0cCJWnuj+75sjuMBceyI25M15uUN7tZ6QAY7DJt +exvSTdQwTxD/OEv604Y7glItsRRwHnasO3FtfNGuKRfKnhwzCK79i55/K8LKA32 JqJhVaVRbgvkufMR3t45U84bROXeA0ccfs8aaCZvFl9B5LoyKDaDA0VpyybKYfqK Ze/Uf333EQOyzNCxc4tm/f+XaOyDfEceHfIxO8SStxJLZNRZ3D8BbA2qeFJSBXC7 y8omdSw2KG7Ae1crATe1KI3RnZm4P03maRIXCmtwyZSGazfpAs+hDKZWnsgFn2j0 Xky6RNBA3RhMk+9i6d6Li65PqFO5qFOTaRodQLvJTbxdafdsNUUu8m8eaNPjXH9Y uftph01uU8N7Pm3HyH1N =g8gz -----END PGP SIGNATURE----- Merge tag 'fbdev-fixes-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux Pull fbdev fixes from Tomi Valkeinen: "Minor fbdev fixes for da8xx-fb, atmel_lcdfb, arm clcd and chipsfb" * tag 'fbdev-fixes-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: video: da8xx-fb: preserve display width when changing HSYNC video: of: display_timing: double free on error drivers: video: fbdev: atmel_lcdfb.c: fix error return code video: ARM CLCD: Fix calculation of bits-per-pixel fbdev: Remove __init from chips_hw_init() to fix build failure
This commit is contained in:
Коммит
115619b34f
|
@ -24,6 +24,7 @@
|
|||
#include <linux/list.h>
|
||||
#include <linux/amba/bus.h>
|
||||
#include <linux/amba/clcd.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/hardirq.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
@ -650,6 +651,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
|
|||
{
|
||||
struct device_node *endpoint;
|
||||
int err;
|
||||
unsigned int bpp;
|
||||
u32 max_bandwidth;
|
||||
u32 tft_r0b0g0[3];
|
||||
|
||||
|
@ -667,11 +669,22 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
|
|||
|
||||
err = of_property_read_u32(fb->dev->dev.of_node, "max-memory-bandwidth",
|
||||
&max_bandwidth);
|
||||
if (!err)
|
||||
fb->panel->bpp = 8 * max_bandwidth / (fb->panel->mode.xres *
|
||||
fb->panel->mode.yres * fb->panel->mode.refresh);
|
||||
else
|
||||
fb->panel->bpp = 32;
|
||||
if (!err) {
|
||||
/*
|
||||
* max_bandwidth is in bytes per second and pixclock in
|
||||
* pico-seconds, so the maximum allowed bits per pixel is
|
||||
* 8 * max_bandwidth / (PICOS2KHZ(pixclock) * 1000)
|
||||
* Rearrange this calculation to avoid overflow and then ensure
|
||||
* result is a valid format.
|
||||
*/
|
||||
bpp = max_bandwidth / (1000 / 8)
|
||||
/ PICOS2KHZ(fb->panel->mode.pixclock);
|
||||
bpp = rounddown_pow_of_two(bpp);
|
||||
if (bpp > 32)
|
||||
bpp = 32;
|
||||
} else
|
||||
bpp = 32;
|
||||
fb->panel->bpp = bpp;
|
||||
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
fb->panel->cntl |= CNTL_BEBO;
|
||||
|
|
|
@ -1102,12 +1102,14 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
|
|||
timings = of_get_display_timings(display_np);
|
||||
if (!timings) {
|
||||
dev_err(dev, "failed to get display timings\n");
|
||||
ret = -EINVAL;
|
||||
goto put_display_node;
|
||||
}
|
||||
|
||||
timings_np = of_find_node_by_name(display_np, "display-timings");
|
||||
if (!timings_np) {
|
||||
dev_err(dev, "failed to find display-timings node\n");
|
||||
ret = -ENODEV;
|
||||
goto put_display_node;
|
||||
}
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ static struct chips_init_reg chips_init_xr[] = {
|
|||
{ 0xa8, 0x00 }
|
||||
};
|
||||
|
||||
static void __init chips_hw_init(void)
|
||||
static void chips_hw_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -419,7 +419,7 @@ static void lcd_cfg_horizontal_sync(int back_porch, int pulse_width,
|
|||
{
|
||||
u32 reg;
|
||||
|
||||
reg = lcdc_read(LCD_RASTER_TIMING_0_REG) & 0xf;
|
||||
reg = lcdc_read(LCD_RASTER_TIMING_0_REG) & 0x3ff;
|
||||
reg |= (((back_porch-1) & 0xff) << 24)
|
||||
| (((front_porch-1) & 0xff) << 16)
|
||||
| (((pulse_width-1) & 0x3f) << 10);
|
||||
|
|
|
@ -236,6 +236,7 @@ timingfail:
|
|||
if (native_mode)
|
||||
of_node_put(native_mode);
|
||||
display_timings_release(disp);
|
||||
disp = NULL;
|
||||
entryfail:
|
||||
kfree(disp);
|
||||
dispfail:
|
||||
|
|
Загрузка…
Ссылка в новой задаче