diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-29 14:59:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-29 14:59:46 -0400 |
commit | 115619b34f2fd590d2830fd82f9bcb4ca7d9cdd2 (patch) | |
tree | 80a3575fd46f5072dab6b93a8baae715e1524cda /drivers/video | |
parent | d4f03186c8986ffde34d06fe74a99aab08f7ee0b (diff) | |
parent | 4d4e2c003bd6c6bdd85080bd096d54d5d251defa (diff) |
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
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/amba-clcd.c | 23 | ||||
-rw-r--r-- | drivers/video/fbdev/atmel_lcdfb.c | 2 | ||||
-rw-r--r-- | drivers/video/fbdev/chipsfb.c | 2 | ||||
-rw-r--r-- | drivers/video/fbdev/da8xx-fb.c | 2 | ||||
-rw-r--r-- | drivers/video/of_display_timing.c | 1 |
5 files changed, 23 insertions, 7 deletions
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index beadd3edaa17..a7b6217ac87b 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
25 | #include <linux/amba/bus.h> | 25 | #include <linux/amba/bus.h> |
26 | #include <linux/amba/clcd.h> | 26 | #include <linux/amba/clcd.h> |
27 | #include <linux/bitops.h> | ||
27 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
28 | #include <linux/hardirq.h> | 29 | #include <linux/hardirq.h> |
29 | #include <linux/dma-mapping.h> | 30 | #include <linux/dma-mapping.h> |
@@ -650,6 +651,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) | |||
650 | { | 651 | { |
651 | struct device_node *endpoint; | 652 | struct device_node *endpoint; |
652 | int err; | 653 | int err; |
654 | unsigned int bpp; | ||
653 | u32 max_bandwidth; | 655 | u32 max_bandwidth; |
654 | u32 tft_r0b0g0[3]; | 656 | u32 tft_r0b0g0[3]; |
655 | 657 | ||
@@ -667,11 +669,22 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) | |||
667 | 669 | ||
668 | err = of_property_read_u32(fb->dev->dev.of_node, "max-memory-bandwidth", | 670 | err = of_property_read_u32(fb->dev->dev.of_node, "max-memory-bandwidth", |
669 | &max_bandwidth); | 671 | &max_bandwidth); |
670 | if (!err) | 672 | if (!err) { |
671 | fb->panel->bpp = 8 * max_bandwidth / (fb->panel->mode.xres * | 673 | /* |
672 | fb->panel->mode.yres * fb->panel->mode.refresh); | 674 | * max_bandwidth is in bytes per second and pixclock in |
673 | else | 675 | * pico-seconds, so the maximum allowed bits per pixel is |
674 | fb->panel->bpp = 32; | 676 | * 8 * max_bandwidth / (PICOS2KHZ(pixclock) * 1000) |
677 | * Rearrange this calculation to avoid overflow and then ensure | ||
678 | * result is a valid format. | ||
679 | */ | ||
680 | bpp = max_bandwidth / (1000 / 8) | ||
681 | / PICOS2KHZ(fb->panel->mode.pixclock); | ||
682 | bpp = rounddown_pow_of_two(bpp); | ||
683 | if (bpp > 32) | ||
684 | bpp = 32; | ||
685 | } else | ||
686 | bpp = 32; | ||
687 | fb->panel->bpp = bpp; | ||
675 | 688 | ||
676 | #ifdef CONFIG_CPU_BIG_ENDIAN | 689 | #ifdef CONFIG_CPU_BIG_ENDIAN |
677 | fb->panel->cntl |= CNTL_BEBO; | 690 | fb->panel->cntl |= CNTL_BEBO; |
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 92640d46770a..1d8bdb92939b 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c | |||
@@ -1102,12 +1102,14 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) | |||
1102 | timings = of_get_display_timings(display_np); | 1102 | timings = of_get_display_timings(display_np); |
1103 | if (!timings) { | 1103 | if (!timings) { |
1104 | dev_err(dev, "failed to get display timings\n"); | 1104 | dev_err(dev, "failed to get display timings\n"); |
1105 | ret = -EINVAL; | ||
1105 | goto put_display_node; | 1106 | goto put_display_node; |
1106 | } | 1107 | } |
1107 | 1108 | ||
1108 | timings_np = of_find_node_by_name(display_np, "display-timings"); | 1109 | timings_np = of_find_node_by_name(display_np, "display-timings"); |
1109 | if (!timings_np) { | 1110 | if (!timings_np) { |
1110 | dev_err(dev, "failed to find display-timings node\n"); | 1111 | dev_err(dev, "failed to find display-timings node\n"); |
1112 | ret = -ENODEV; | ||
1111 | goto put_display_node; | 1113 | goto put_display_node; |
1112 | } | 1114 | } |
1113 | 1115 | ||
diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c index 206a66b61072..59abdc6a97f6 100644 --- a/drivers/video/fbdev/chipsfb.c +++ b/drivers/video/fbdev/chipsfb.c | |||
@@ -273,7 +273,7 @@ static struct chips_init_reg chips_init_xr[] = { | |||
273 | { 0xa8, 0x00 } | 273 | { 0xa8, 0x00 } |
274 | }; | 274 | }; |
275 | 275 | ||
276 | static void __init chips_hw_init(void) | 276 | static void chips_hw_init(void) |
277 | { | 277 | { |
278 | int i; | 278 | int i; |
279 | 279 | ||
diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index 788f6b37fce7..10c876c95772 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c | |||
@@ -419,7 +419,7 @@ static void lcd_cfg_horizontal_sync(int back_porch, int pulse_width, | |||
419 | { | 419 | { |
420 | u32 reg; | 420 | u32 reg; |
421 | 421 | ||
422 | reg = lcdc_read(LCD_RASTER_TIMING_0_REG) & 0xf; | 422 | reg = lcdc_read(LCD_RASTER_TIMING_0_REG) & 0x3ff; |
423 | reg |= (((back_porch-1) & 0xff) << 24) | 423 | reg |= (((back_porch-1) & 0xff) << 24) |
424 | | (((front_porch-1) & 0xff) << 16) | 424 | | (((front_porch-1) & 0xff) << 16) |
425 | | (((pulse_width-1) & 0x3f) << 10); | 425 | | (((pulse_width-1) & 0x3f) << 10); |
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 987edf110038..5c098d5b4043 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c | |||
@@ -236,6 +236,7 @@ timingfail: | |||
236 | if (native_mode) | 236 | if (native_mode) |
237 | of_node_put(native_mode); | 237 | of_node_put(native_mode); |
238 | display_timings_release(disp); | 238 | display_timings_release(disp); |
239 | disp = NULL; | ||
239 | entryfail: | 240 | entryfail: |
240 | kfree(disp); | 241 | kfree(disp); |
241 | dispfail: | 242 | dispfail: |