aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-09-15 21:28:52 -0400
committerDave Airlie <airlied@redhat.com>2014-09-15 21:38:04 -0400
commitb2efb3f0a1db62aff5e824125785ec6731143b6d (patch)
tree67510cec69e18e55d82bed803428b2a5027d92bb /drivers/video/fbdev
parent4ac073640a528662a7c072a30e92e70ce00ded33 (diff)
parent9e82bf014195d6f0054982c463575cdce24292be (diff)
drm: backmerge tag 'v3.17-rc5' into drm-next
This is requested to get the fixes for intel and radeon into the same tree for future development work. i915_display.c: fix missing dev_priv conflict.
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/amba-clcd.c27
-rw-r--r--drivers/video/fbdev/atmel_lcdfb.c2
-rw-r--r--drivers/video/fbdev/chipsfb.c2
-rw-r--r--drivers/video/fbdev/da8xx-fb.c2
4 files changed, 23 insertions, 10 deletions
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index beadd3edaa17..6ad23bd3523a 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>
@@ -638,9 +639,7 @@ static int clcdfb_of_init_tft_panel(struct clcd_fb *fb, u32 r0, u32 g0, u32 b0)
638 if (g0 != panels[i].g0) 639 if (g0 != panels[i].g0)
639 continue; 640 continue;
640 if (r0 == panels[i].r0 && b0 == panels[i].b0) 641 if (r0 == panels[i].r0 && b0 == panels[i].b0)
641 fb->panel->caps = panels[i].caps & CLCD_CAP_RGB; 642 fb->panel->caps = panels[i].caps;
642 if (r0 == panels[i].b0 && b0 == panels[i].r0)
643 fb->panel->caps = panels[i].caps & CLCD_CAP_BGR;
644 } 643 }
645 644
646 return fb->panel->caps ? 0 : -EINVAL; 645 return fb->panel->caps ? 0 : -EINVAL;
@@ -650,6 +649,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
650{ 649{
651 struct device_node *endpoint; 650 struct device_node *endpoint;
652 int err; 651 int err;
652 unsigned int bpp;
653 u32 max_bandwidth; 653 u32 max_bandwidth;
654 u32 tft_r0b0g0[3]; 654 u32 tft_r0b0g0[3];
655 655
@@ -667,11 +667,22 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
667 667
668 err = of_property_read_u32(fb->dev->dev.of_node, "max-memory-bandwidth", 668 err = of_property_read_u32(fb->dev->dev.of_node, "max-memory-bandwidth",
669 &max_bandwidth); 669 &max_bandwidth);
670 if (!err) 670 if (!err) {
671 fb->panel->bpp = 8 * max_bandwidth / (fb->panel->mode.xres * 671 /*
672 fb->panel->mode.yres * fb->panel->mode.refresh); 672 * max_bandwidth is in bytes per second and pixclock in
673 else 673 * pico-seconds, so the maximum allowed bits per pixel is
674 fb->panel->bpp = 32; 674 * 8 * max_bandwidth / (PICOS2KHZ(pixclock) * 1000)
675 * Rearrange this calculation to avoid overflow and then ensure
676 * result is a valid format.
677 */
678 bpp = max_bandwidth / (1000 / 8)
679 / PICOS2KHZ(fb->panel->mode.pixclock);
680 bpp = rounddown_pow_of_two(bpp);
681 if (bpp > 32)
682 bpp = 32;
683 } else
684 bpp = 32;
685 fb->panel->bpp = bpp;
675 686
676#ifdef CONFIG_CPU_BIG_ENDIAN 687#ifdef CONFIG_CPU_BIG_ENDIAN
677 fb->panel->cntl |= CNTL_BEBO; 688 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
276static void __init chips_hw_init(void) 276static 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);