Skip to content

Commit

Permalink
Merge tag 'fbdev-3.20' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/tomba/linux

Pull fbdev changes from Tomi Valkeinen:

 - omapdss: add DRA7xxx SoC support

 - fbdev: support DMT (Display Monitor Timing) calculation

* tag 'fbdev-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (40 commits)
  omapfb: Return error code when applying overlay settings fails
  OMAPDSS: DPI: DRA7xx support
  OMAPDSS: HDMI: Add DRA7xx support
  OMAPDSS: DISPC: program dispc polarities to control module
  OMAPDSS: DISPC: Add DRA7xx support
  OMAPDSS: Add Video PLLs for DRA7xx
  OMAPDSS: Add functions for external control of PLL
  OMAPDSS: DSS: Add DRA7xx base support
  Doc/DT: Add DT binding doc for DRA7xx DSS
  OMAPDSS: add define for DRA7xx HW version
  OMAPDSS: encoder-tpd12s015: Fix race issue with LS_OE
  OMAPDSS: OMAP5: fix digit output's allowed mgrs
  OMAPDSS: constify port arrays
  OMAPDSS: PLL: add dss_pll_wait_reset_done()
  OMAPDSS: Add enum dss_pll_id
  video: fbdev: fix sys_copyarea
  video/mmpfb: allow modular build
  fb: via: turn gpiolib and i2c selects into dependencies
  fbdev: ssd1307fb: return proper error code if write command fails
  fbdev: fix CVT vertical front and back porch values
  ...
  • Loading branch information
Linus Torvalds committed Feb 11, 2015
2 parents a323ae9 + d6c2152 commit e0c8453
Show file tree
Hide file tree
Showing 43 changed files with 1,342 additions and 302 deletions.
69 changes: 69 additions & 0 deletions Documentation/devicetree/bindings/video/ti,dra7-dss.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Texas Instruments DRA7x Display Subsystem
=========================================

See Documentation/devicetree/bindings/video/ti,omap-dss.txt for generic
description about OMAP Display Subsystem bindings.

DSS Core
--------

Required properties:
- compatible: "ti,dra7-dss"
- reg: address and length of the register spaces for 'dss'
- ti,hwmods: "dss_core"
- clocks: handle to fclk
- clock-names: "fck"
- syscon: phandle to control module core syscon node

Optional properties:

Some DRA7xx SoCs have one dedicated video PLL, some have two. These properties
can be used to describe the video PLLs:

- reg: address and length of the register spaces for 'pll1_clkctrl',
'pll1', 'pll2_clkctrl', 'pll2'
- clocks: handle to video1 pll clock and video2 pll clock
- clock-names: "video1_clk" and "video2_clk"

Required nodes:
- DISPC

Optional nodes:
- DSS Submodules: HDMI
- Video port for DPI output

DPI Endpoint required properties:
- data-lines: number of lines used


DISPC
-----

Required properties:
- compatible: "ti,dra7-dispc"
- reg: address and length of the register space
- ti,hwmods: "dss_dispc"
- interrupts: the DISPC interrupt
- clocks: handle to fclk
- clock-names: "fck"

HDMI
----

Required properties:
- compatible: "ti,dra7-hdmi"
- reg: addresses and lengths of the register spaces for 'wp', 'pll', 'phy',
'core'
- reg-names: "wp", "pll", "phy", "core"
- interrupts: the HDMI interrupt line
- ti,hwmods: "dss_hdmi"
- vdda-supply: vdda power supply
- clocks: handles to fclk and pll clock
- clock-names: "fck", "sys_clk"

Optional nodes:
- Video port for HDMI output

HDMI Endpoint optional properties:
- lanes: list of 8 pin numbers for the HDMI lanes: CLK+, CLK-, D0+, D0-,
D1+, D1-, D2+, D2-. (default: 0,1,2,3,4,5,6,7)
38 changes: 38 additions & 0 deletions Documentation/devicetree/bindings/video/ti,opa362.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
OPA362 analog video amplifier

Required properties:
- compatible: "ti,opa362"
- enable-gpios: enable/disable output gpio

Required node:
- Video port 0 for opa362 input
- Video port 1 for opa362 output

Example:

tv_amp: opa362 {
compatible = "ti,opa362";
enable-gpios = <&gpio1 23 0>; /* GPIO to enable video out amplifier */

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;
opa_in: endpoint@0 {
remote-endpoint = <&venc_out>;
};
};

port@1 {
reg = <1>;
opa_out: endpoint@0 {
remote-endpoint = <&tv_connector_in>;
};
};
};
};



16 changes: 10 additions & 6 deletions drivers/video/console/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,22 @@ config DUMMY_CONSOLE

config DUMMY_CONSOLE_COLUMNS
int "Initial number of console screen columns"
depends on PARISC && DUMMY_CONSOLE
default "160"
depends on DUMMY_CONSOLE && !ARM
default 160 if PARISC
default 80
help
The default value is 160, which should fit a 1280x1024 monitor.
On PA-RISC, the default value is 160, which should fit a 1280x1024
monitor.
Select 80 if you use a 640x480 resolution by default.

config DUMMY_CONSOLE_ROWS
int "Initial number of console screen rows"
depends on PARISC && DUMMY_CONSOLE
default "64"
depends on DUMMY_CONSOLE && !ARM
default 64 if PARISC
default 25
help
The default value is 64, which should fit a 1280x1024 monitor.
On PA-RISC, the default value is 64, which should fit a 1280x1024
monitor.
Select 25 if you use a 640x480 resolution by default.

config FRAMEBUFFER_CONSOLE
Expand Down
5 changes: 1 addition & 4 deletions drivers/video/console/dummycon.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
#if defined(__arm__)
#define DUMMY_COLUMNS screen_info.orig_video_cols
#define DUMMY_ROWS screen_info.orig_video_lines
#elif defined(__hppa__)
#else
/* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
#define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS
#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
#else
#define DUMMY_COLUMNS 80
#define DUMMY_ROWS 25
#endif

static const char *dummycon_startup(void)
Expand Down
4 changes: 0 additions & 4 deletions drivers/video/console/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ static const struct consw fb_con;

static int fbcon_set_origin(struct vc_data *);

#define CURSOR_DRAW_DELAY (1)

static int vbl_cursor_cnt;
static int fbcon_cursor_noblink;

#define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1)
Expand Down Expand Up @@ -1329,7 +1326,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode)

ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1),
get_color(vc, info, c, 0));
vbl_cursor_cnt = CURSOR_DRAW_DELAY;
}

static int scrollback_phys_max = 0;
Expand Down
5 changes: 1 addition & 4 deletions drivers/video/fbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1530,13 +1530,11 @@ config FB_SIS_315

config FB_VIA
tristate "VIA UniChrome (Pro) and Chrome9 display support"
depends on FB && PCI && X86
depends on FB && PCI && X86 && GPIOLIB && I2C
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select I2C_ALGOBIT
select I2C
select GPIOLIB
help
This is the frame buffer device driver for Graphics chips of VIA
UniChrome (Pro) Family (CLE266,PM800/CN400,P4M800CE/P4M800Pro/
Expand Down Expand Up @@ -2151,7 +2149,6 @@ config FB_PS3
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
select FB_SYS_FOPS
select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE
---help---
Include support for the virtual frame buffer in the PS3 platform.

Expand Down
9 changes: 6 additions & 3 deletions drivers/video/fbdev/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3948,7 +3948,7 @@ static struct notifier_block atyfb_reboot_notifier = {
.notifier_call = atyfb_reboot_notify,
};

static const struct dmi_system_id atyfb_reboot_ids[] = {
static const struct dmi_system_id atyfb_reboot_ids[] __initconst = {
{
.ident = "HP OmniBook 500",
.matches = {
Expand All @@ -3960,6 +3960,7 @@ static const struct dmi_system_id atyfb_reboot_ids[] = {

{ }
};
static bool registered_notifier = false;

static int __init atyfb_init(void)
{
Expand All @@ -3982,15 +3983,17 @@ static int __init atyfb_init(void)
if (err1 && err2)
return -ENODEV;

if (dmi_check_system(atyfb_reboot_ids))
if (dmi_check_system(atyfb_reboot_ids)) {
register_reboot_notifier(&atyfb_reboot_notifier);
registered_notifier = true;
}

return 0;
}

static void __exit atyfb_exit(void)
{
if (dmi_check_system(atyfb_reboot_ids))
if (registered_notifier)
unregister_reboot_notifier(&atyfb_reboot_notifier);

#ifdef CONFIG_PCI
Expand Down
6 changes: 3 additions & 3 deletions drivers/video/fbdev/core/fbcvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb)
cvt.h_back_porch = cvt.hblank/2 + cvt.h_margin;
cvt.h_front_porch = cvt.hblank - cvt.hsync - cvt.h_back_porch +
2 * cvt.h_margin;
cvt.v_back_porch = 3 + cvt.v_margin;
cvt.v_front_porch = cvt.vtotal - cvt.yres/cvt.interlace -
cvt.v_back_porch - cvt.vsync;
cvt.v_front_porch = 3 + cvt.v_margin;
cvt.v_back_porch = cvt.vtotal - cvt.yres/cvt.interlace -
cvt.v_front_porch - cvt.vsync;
fb_cvt_print_name(&cvt);
fb_cvt_convert_to_mode(&cvt, mode);

Expand Down
103 changes: 60 additions & 43 deletions drivers/video/fbdev/core/fbmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,56 +496,71 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode)
}

static int get_std_timing(unsigned char *block, struct fb_videomode *mode,
int ver, int rev)
int ver, int rev, const struct fb_monspecs *specs)
{
int xres, yres = 0, refresh, ratio, i;

xres = (block[0] + 31) * 8;
if (xres <= 256)
return 0;
int i;

ratio = (block[1] & 0xc0) >> 6;
switch (ratio) {
case 0:
/* in EDID 1.3 the meaning of 0 changed to 16:10 (prior 1:1) */
if (ver < 1 || (ver == 1 && rev < 3))
yres = xres;
else
yres = (xres * 10)/16;
break;
case 1:
yres = (xres * 3)/4;
break;
case 2:
yres = (xres * 4)/5;
break;
case 3:
yres = (xres * 9)/16;
break;
for (i = 0; i < DMT_SIZE; i++) {
u32 std_2byte_code = block[0] << 8 | block[1];
if (std_2byte_code == dmt_modes[i].std_2byte_code)
break;
}
refresh = (block[1] & 0x3f) + 60;

DPRINTK(" %dx%d@%dHz\n", xres, yres, refresh);
for (i = 0; i < VESA_MODEDB_SIZE; i++) {
if (vesa_modes[i].xres == xres &&
vesa_modes[i].yres == yres &&
vesa_modes[i].refresh == refresh) {
*mode = vesa_modes[i];
mode->flag |= FB_MODE_IS_STANDARD;
return 1;

if (i < DMT_SIZE && dmt_modes[i].mode) {
/* DMT mode found */
*mode = *dmt_modes[i].mode;
mode->flag |= FB_MODE_IS_STANDARD;
DPRINTK(" DMT id=%d\n", dmt_modes[i].dmt_id);

} else {
int xres, yres = 0, refresh, ratio;

xres = (block[0] + 31) * 8;
if (xres <= 256)
return 0;

ratio = (block[1] & 0xc0) >> 6;
switch (ratio) {
case 0:
/* in EDID 1.3 the meaning of 0 changed to 16:10 (prior 1:1) */
if (ver < 1 || (ver == 1 && rev < 3))
yres = xres;
else
yres = (xres * 10)/16;
break;
case 1:
yres = (xres * 3)/4;
break;
case 2:
yres = (xres * 4)/5;
break;
case 3:
yres = (xres * 9)/16;
break;
}
refresh = (block[1] & 0x3f) + 60;
DPRINTK(" %dx%d@%dHz\n", xres, yres, refresh);

calc_mode_timings(xres, yres, refresh, mode);
}
calc_mode_timings(xres, yres, refresh, mode);

/* Check the mode we got is within valid spec of the monitor */
if (specs && specs->dclkmax
&& PICOS2KHZ(mode->pixclock) * 1000 > specs->dclkmax) {
DPRINTK(" mode exceed max DCLK\n");
return 0;
}

return 1;
}

static int get_dst_timing(unsigned char *block,
struct fb_videomode *mode, int ver, int rev)
static int get_dst_timing(unsigned char *block, struct fb_videomode *mode,
int ver, int rev, const struct fb_monspecs *specs)
{
int j, num = 0;

for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE)
num += get_std_timing(block, &mode[num], ver, rev);
num += get_std_timing(block, &mode[num], ver, rev, specs);

return num;
}
Expand Down Expand Up @@ -601,7 +616,8 @@ static void get_detailed_timing(unsigned char *block,
* This function builds a mode database using the contents of the EDID
* data
*/
static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize,
const struct fb_monspecs *specs)
{
struct fb_videomode *mode, *m;
unsigned char *block;
Expand Down Expand Up @@ -643,12 +659,13 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
DPRINTK(" Standard Timings\n");
block = edid + STD_TIMING_DESCRIPTIONS_START;
for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE)
num += get_std_timing(block, &mode[num], ver, rev);
num += get_std_timing(block, &mode[num], ver, rev, specs);

block = edid + DETAILED_TIMING_DESCRIPTIONS_START;
for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) {
if (block[0] == 0x00 && block[1] == 0x00 && block[3] == 0xfa)
num += get_dst_timing(block + 5, &mode[num], ver, rev);
num += get_dst_timing(block + 5, &mode[num],
ver, rev, specs);
}

/* Yikes, EDID data is totally useless */
Expand Down Expand Up @@ -707,7 +724,7 @@ static int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs)
int num_modes, hz, hscan, pixclock;
int vtotal, htotal;

modes = fb_create_modedb(edid, &num_modes);
modes = fb_create_modedb(edid, &num_modes, specs);
if (!modes) {
DPRINTK("None Available\n");
return 1;
Expand Down Expand Up @@ -964,7 +981,7 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
DPRINTK(" Display Characteristics:\n");
get_monspecs(edid, specs);

specs->modedb = fb_create_modedb(edid, &specs->modedb_len);
specs->modedb = fb_create_modedb(edid, &specs->modedb_len, specs);

/*
* Workaround for buggy EDIDs that sets that the first
Expand Down
Loading

0 comments on commit e0c8453

Please sign in to comment.