diff options
38 files changed, 516 insertions, 563 deletions
diff --git a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt index c870b6478ec8..2871e218a0fb 100644 --- a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt +++ b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt | |||
| @@ -5,58 +5,32 @@ Required properties: | |||
| 5 | - compatible : "via,vt8500-fb" | 5 | - compatible : "via,vt8500-fb" |
| 6 | - reg : Should contain 1 register ranges(address and length) | 6 | - reg : Should contain 1 register ranges(address and length) |
| 7 | - interrupts : framebuffer controller interrupt | 7 | - interrupts : framebuffer controller interrupt |
| 8 | - display: a phandle pointing to the display node | 8 | - bits-per-pixel : bit depth of framebuffer (16 or 32) |
| 9 | 9 | ||
| 10 | Required nodes: | 10 | Required subnodes: |
| 11 | - display: a display node is required to initialize the lcd panel | 11 | - display-timings: see display-timing.txt for information |
| 12 | This should be in the board dts. | ||
| 13 | - default-mode: a videomode within the display with timing parameters | ||
| 14 | as specified below. | ||
| 15 | 12 | ||
| 16 | Example: | 13 | Example: |
| 17 | 14 | ||
| 18 | fb@d800e400 { | 15 | fb@d8050800 { |
| 19 | compatible = "via,vt8500-fb"; | 16 | compatible = "via,vt8500-fb"; |
| 20 | reg = <0xd800e400 0x400>; | 17 | reg = <0xd800e400 0x400>; |
| 21 | interrupts = <12>; | 18 | interrupts = <12>; |
| 22 | display = <&display>; | 19 | bits-per-pixel = <16>; |
| 23 | default-mode = <&mode0>; | ||
| 24 | }; | ||
| 25 | |||
| 26 | VIA VT8500 Display | ||
| 27 | ----------------------------------------------------- | ||
| 28 | Required properties (as per of_videomode_helper): | ||
| 29 | |||
| 30 | - hactive, vactive: Display resolution | ||
| 31 | - hfront-porch, hback-porch, hsync-len: Horizontal Display timing parameters | ||
| 32 | in pixels | ||
| 33 | vfront-porch, vback-porch, vsync-len: Vertical display timing parameters in | ||
| 34 | lines | ||
| 35 | - clock: displayclock in Hz | ||
| 36 | - bpp: lcd panel bit-depth. | ||
| 37 | <16> for RGB565, <32> for RGB888 | ||
| 38 | |||
| 39 | Optional properties (as per of_videomode_helper): | ||
| 40 | - width-mm, height-mm: Display dimensions in mm | ||
| 41 | - hsync-active-high (bool): Hsync pulse is active high | ||
| 42 | - vsync-active-high (bool): Vsync pulse is active high | ||
| 43 | - interlaced (bool): This is an interlaced mode | ||
| 44 | - doublescan (bool): This is a doublescan mode | ||
| 45 | 20 | ||
| 46 | Example: | 21 | display-timings { |
| 47 | display: display@0 { | 22 | native-mode = <&timing0>; |
| 48 | modes { | 23 | timing0: 800x480 { |
| 49 | mode0: mode@0 { | 24 | clock-frequency = <0>; /* unused but required */ |
| 50 | hactive = <800>; | 25 | hactive = <800>; |
| 51 | vactive = <480>; | 26 | vactive = <480>; |
| 52 | hback-porch = <88>; | ||
| 53 | hfront-porch = <40>; | 27 | hfront-porch = <40>; |
| 28 | hback-porch = <88>; | ||
| 54 | hsync-len = <0>; | 29 | hsync-len = <0>; |
| 55 | vback-porch = <32>; | 30 | vback-porch = <32>; |
| 56 | vfront-porch = <11>; | 31 | vfront-porch = <11>; |
| 57 | vsync-len = <1>; | 32 | vsync-len = <1>; |
| 58 | clock = <0>; /* unused but required */ | ||
| 59 | bpp = <16>; /* non-standard but required */ | ||
| 60 | }; | 33 | }; |
| 61 | }; | 34 | }; |
| 62 | }; | 35 | }; |
| 36 | |||
diff --git a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt index 3d325e1d11ee..0bcadb2840a5 100644 --- a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt +++ b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt | |||
| @@ -4,20 +4,30 @@ Wondermedia WM8505 Framebuffer | |||
| 4 | Required properties: | 4 | Required properties: |
| 5 | - compatible : "wm,wm8505-fb" | 5 | - compatible : "wm,wm8505-fb" |
| 6 | - reg : Should contain 1 register ranges(address and length) | 6 | - reg : Should contain 1 register ranges(address and length) |
| 7 | - via,display: a phandle pointing to the display node | 7 | - bits-per-pixel : bit depth of framebuffer (16 or 32) |
| 8 | 8 | ||
| 9 | Required nodes: | 9 | Required subnodes: |
| 10 | - display: a display node is required to initialize the lcd panel | 10 | - display-timings: see display-timing.txt for information |
| 11 | This should be in the board dts. See definition in | ||
| 12 | Documentation/devicetree/bindings/video/via,vt8500-fb.txt | ||
| 13 | - default-mode: a videomode node as specified in | ||
| 14 | Documentation/devicetree/bindings/video/via,vt8500-fb.txt | ||
| 15 | 11 | ||
| 16 | Example: | 12 | Example: |
| 17 | 13 | ||
| 18 | fb@d8050800 { | 14 | fb@d8051700 { |
| 19 | compatible = "wm,wm8505-fb"; | 15 | compatible = "wm,wm8505-fb"; |
| 20 | reg = <0xd8050800 0x200>; | 16 | reg = <0xd8051700 0x200>; |
| 21 | display = <&display>; | 17 | bits-per-pixel = <16>; |
| 22 | default-mode = <&mode0>; | 18 | |
| 19 | display-timings { | ||
| 20 | native-mode = <&timing0>; | ||
| 21 | timing0: 800x480 { | ||
| 22 | clock-frequency = <0>; /* unused but required */ | ||
| 23 | hactive = <800>; | ||
| 24 | vactive = <480>; | ||
| 25 | hfront-porch = <40>; | ||
| 26 | hback-porch = <88>; | ||
| 27 | hsync-len = <0>; | ||
| 28 | vback-porch = <32>; | ||
| 29 | vfront-porch = <11>; | ||
| 30 | vsync-len = <1>; | ||
| 31 | }; | ||
| 32 | }; | ||
| 23 | }; | 33 | }; |
diff --git a/arch/arm/boot/dts/vt8500-bv07.dts b/arch/arm/boot/dts/vt8500-bv07.dts index 567cf4e8ab84..877b33afa7ed 100644 --- a/arch/arm/boot/dts/vt8500-bv07.dts +++ b/arch/arm/boot/dts/vt8500-bv07.dts | |||
| @@ -11,26 +11,22 @@ | |||
| 11 | 11 | ||
| 12 | / { | 12 | / { |
| 13 | model = "Benign BV07 Netbook"; | 13 | model = "Benign BV07 Netbook"; |
| 14 | }; | ||
| 14 | 15 | ||
| 15 | /* | 16 | &fb { |
| 16 | * Display node is based on Sascha Hauer's patch on dri-devel. | 17 | bits-per-pixel = <16>; |
| 17 | * Added a bpp property to calculate the size of the framebuffer | 18 | display-timings { |
| 18 | * until the binding is formalized. | 19 | native-mode = <&timing0>; |
| 19 | */ | 20 | timing0: 800x480 { |
| 20 | display: display@0 { | 21 | clock-frequency = <0>; /* unused but required */ |
| 21 | modes { | 22 | hactive = <800>; |
| 22 | mode0: mode@0 { | 23 | vactive = <480>; |
| 23 | hactive = <800>; | 24 | hfront-porch = <40>; |
| 24 | vactive = <480>; | 25 | hback-porch = <88>; |
| 25 | hback-porch = <88>; | 26 | hsync-len = <0>; |
| 26 | hfront-porch = <40>; | 27 | vback-porch = <32>; |
| 27 | hsync-len = <0>; | 28 | vfront-porch = <11>; |
| 28 | vback-porch = <32>; | 29 | vsync-len = <1>; |
| 29 | vfront-porch = <11>; | ||
| 30 | vsync-len = <1>; | ||
| 31 | clock = <0>; /* unused but required */ | ||
| 32 | bpp = <16>; /* non-standard but required */ | ||
| 33 | }; | ||
| 34 | }; | 30 | }; |
| 35 | }; | 31 | }; |
| 36 | }; | 32 | }; |
diff --git a/arch/arm/boot/dts/vt8500.dtsi b/arch/arm/boot/dts/vt8500.dtsi index cf31ced46602..68c8dc644383 100644 --- a/arch/arm/boot/dts/vt8500.dtsi +++ b/arch/arm/boot/dts/vt8500.dtsi | |||
| @@ -98,12 +98,10 @@ | |||
| 98 | interrupts = <43>; | 98 | interrupts = <43>; |
| 99 | }; | 99 | }; |
| 100 | 100 | ||
| 101 | fb@d800e400 { | 101 | fb: fb@d8050800 { |
| 102 | compatible = "via,vt8500-fb"; | 102 | compatible = "via,vt8500-fb"; |
| 103 | reg = <0xd800e400 0x400>; | 103 | reg = <0xd800e400 0x400>; |
| 104 | interrupts = <12>; | 104 | interrupts = <12>; |
| 105 | display = <&display>; | ||
| 106 | default-mode = <&mode0>; | ||
| 107 | }; | 105 | }; |
| 108 | 106 | ||
| 109 | ge_rops@d8050400 { | 107 | ge_rops@d8050400 { |
diff --git a/arch/arm/boot/dts/wm8505-ref.dts b/arch/arm/boot/dts/wm8505-ref.dts index fd4e248074c6..edd2cec3d37f 100644 --- a/arch/arm/boot/dts/wm8505-ref.dts +++ b/arch/arm/boot/dts/wm8505-ref.dts | |||
| @@ -11,26 +11,22 @@ | |||
| 11 | 11 | ||
| 12 | / { | 12 | / { |
| 13 | model = "Wondermedia WM8505 Netbook"; | 13 | model = "Wondermedia WM8505 Netbook"; |
| 14 | }; | ||
| 14 | 15 | ||
| 15 | /* | 16 | &fb { |
| 16 | * Display node is based on Sascha Hauer's patch on dri-devel. | 17 | bits-per-pixel = <32>; |
| 17 | * Added a bpp property to calculate the size of the framebuffer | 18 | display-timings { |
| 18 | * until the binding is formalized. | 19 | native-mode = <&timing0>; |
| 19 | */ | 20 | timing0: 800x480 { |
| 20 | display: display@0 { | 21 | clock-frequency = <0>; /* unused but required */ |
| 21 | modes { | 22 | hactive = <800>; |
| 22 | mode0: mode@0 { | 23 | vactive = <480>; |
| 23 | hactive = <800>; | 24 | hfront-porch = <40>; |
| 24 | vactive = <480>; | 25 | hback-porch = <88>; |
| 25 | hback-porch = <88>; | 26 | hsync-len = <0>; |
| 26 | hfront-porch = <40>; | 27 | vback-porch = <32>; |
| 27 | hsync-len = <0>; | 28 | vfront-porch = <11>; |
| 28 | vback-porch = <32>; | 29 | vsync-len = <1>; |
| 29 | vfront-porch = <11>; | ||
| 30 | vsync-len = <1>; | ||
| 31 | clock = <0>; /* unused but required */ | ||
| 32 | bpp = <32>; /* non-standard but required */ | ||
| 33 | }; | ||
| 34 | }; | 30 | }; |
| 35 | }; | 31 | }; |
| 36 | }; | 32 | }; |
diff --git a/arch/arm/boot/dts/wm8505.dtsi b/arch/arm/boot/dts/wm8505.dtsi index e74a1c0fb9a2..bcf668d31b28 100644 --- a/arch/arm/boot/dts/wm8505.dtsi +++ b/arch/arm/boot/dts/wm8505.dtsi | |||
| @@ -128,11 +128,9 @@ | |||
| 128 | interrupts = <0>; | 128 | interrupts = <0>; |
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | fb@d8050800 { | 131 | fb: fb@d8050800 { |
| 132 | compatible = "wm,wm8505-fb"; | 132 | compatible = "wm,wm8505-fb"; |
| 133 | reg = <0xd8050800 0x200>; | 133 | reg = <0xd8050800 0x200>; |
| 134 | display = <&display>; | ||
| 135 | default-mode = <&mode0>; | ||
| 136 | }; | 134 | }; |
| 137 | 135 | ||
| 138 | ge_rops@d8050400 { | 136 | ge_rops@d8050400 { |
diff --git a/arch/arm/boot/dts/wm8650-mid.dts b/arch/arm/boot/dts/wm8650-mid.dts index cefd938f842f..61671a0d9ede 100644 --- a/arch/arm/boot/dts/wm8650-mid.dts +++ b/arch/arm/boot/dts/wm8650-mid.dts | |||
| @@ -11,26 +11,24 @@ | |||
| 11 | 11 | ||
| 12 | / { | 12 | / { |
| 13 | model = "Wondermedia WM8650-MID Tablet"; | 13 | model = "Wondermedia WM8650-MID Tablet"; |
| 14 | }; | ||
| 15 | |||
| 16 | &fb { | ||
| 17 | bits-per-pixel = <16>; | ||
| 14 | 18 | ||
| 15 | /* | 19 | display-timings { |
| 16 | * Display node is based on Sascha Hauer's patch on dri-devel. | 20 | native-mode = <&timing0>; |
| 17 | * Added a bpp property to calculate the size of the framebuffer | 21 | timing0: 800x480 { |
| 18 | * until the binding is formalized. | 22 | clock-frequency = <0>; /* unused but required */ |
| 19 | */ | 23 | hactive = <800>; |
| 20 | display: display@0 { | 24 | vactive = <480>; |
| 21 | modes { | 25 | hfront-porch = <40>; |
| 22 | mode0: mode@0 { | 26 | hback-porch = <88>; |
| 23 | hactive = <800>; | 27 | hsync-len = <0>; |
| 24 | vactive = <480>; | 28 | vback-porch = <32>; |
| 25 | hback-porch = <88>; | 29 | vfront-porch = <11>; |
| 26 | hfront-porch = <40>; | 30 | vsync-len = <1>; |
| 27 | hsync-len = <0>; | ||
| 28 | vback-porch = <32>; | ||
| 29 | vfront-porch = <11>; | ||
| 30 | vsync-len = <1>; | ||
| 31 | clock = <0>; /* unused but required */ | ||
| 32 | bpp = <16>; /* non-standard but required */ | ||
| 33 | }; | ||
| 34 | }; | 31 | }; |
| 35 | }; | 32 | }; |
| 36 | }; | 33 | }; |
| 34 | |||
diff --git a/arch/arm/boot/dts/wm8650.dtsi b/arch/arm/boot/dts/wm8650.dtsi index db3c0a12e052..9313407bbc30 100644 --- a/arch/arm/boot/dts/wm8650.dtsi +++ b/arch/arm/boot/dts/wm8650.dtsi | |||
| @@ -128,11 +128,9 @@ | |||
| 128 | interrupts = <43>; | 128 | interrupts = <43>; |
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | fb@d8050800 { | 131 | fb: fb@d8050800 { |
| 132 | compatible = "wm,wm8505-fb"; | 132 | compatible = "wm,wm8505-fb"; |
| 133 | reg = <0xd8050800 0x200>; | 133 | reg = <0xd8050800 0x200>; |
| 134 | display = <&display>; | ||
| 135 | default-mode = <&mode0>; | ||
| 136 | }; | 134 | }; |
| 137 | 135 | ||
| 138 | ge_rops@d8050400 { | 136 | ge_rops@d8050400 { |
diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts index fcc660c89540..32d22532cd6c 100644 --- a/arch/arm/boot/dts/wm8850-w70v2.dts +++ b/arch/arm/boot/dts/wm8850-w70v2.dts | |||
| @@ -15,28 +15,6 @@ | |||
| 15 | / { | 15 | / { |
| 16 | model = "Wondermedia WM8850-W70v2 Tablet"; | 16 | model = "Wondermedia WM8850-W70v2 Tablet"; |
| 17 | 17 | ||
| 18 | /* | ||
| 19 | * Display node is based on Sascha Hauer's patch on dri-devel. | ||
| 20 | * Added a bpp property to calculate the size of the framebuffer | ||
| 21 | * until the binding is formalized. | ||
| 22 | */ | ||
| 23 | display: display@0 { | ||
| 24 | modes { | ||
| 25 | mode0: mode@0 { | ||
| 26 | hactive = <800>; | ||
| 27 | vactive = <480>; | ||
| 28 | hback-porch = <88>; | ||
| 29 | hfront-porch = <40>; | ||
| 30 | hsync-len = <0>; | ||
| 31 | vback-porch = <32>; | ||
| 32 | vfront-porch = <11>; | ||
| 33 | vsync-len = <1>; | ||
| 34 | clock = <0>; /* unused but required */ | ||
| 35 | bpp = <16>; /* non-standard but required */ | ||
| 36 | }; | ||
| 37 | }; | ||
| 38 | }; | ||
| 39 | |||
| 40 | backlight { | 18 | backlight { |
| 41 | compatible = "pwm-backlight"; | 19 | compatible = "pwm-backlight"; |
| 42 | pwms = <&pwm 0 50000 1>; /* duty inverted */ | 20 | pwms = <&pwm 0 50000 1>; /* duty inverted */ |
| @@ -45,3 +23,21 @@ | |||
| 45 | default-brightness-level = <5>; | 23 | default-brightness-level = <5>; |
| 46 | }; | 24 | }; |
| 47 | }; | 25 | }; |
| 26 | |||
| 27 | &fb { | ||
| 28 | bits-per-pixel = <16>; | ||
| 29 | display-timings { | ||
| 30 | native-mode = <&timing0>; | ||
| 31 | timing0: 800x480 { | ||
| 32 | clock-frequency = <0>; /* unused but required */ | ||
| 33 | hactive = <800>; | ||
| 34 | vactive = <480>; | ||
| 35 | hfront-porch = <40>; | ||
| 36 | hback-porch = <88>; | ||
| 37 | hsync-len = <0>; | ||
| 38 | vback-porch = <32>; | ||
| 39 | vfront-porch = <11>; | ||
| 40 | vsync-len = <1>; | ||
| 41 | }; | ||
| 42 | }; | ||
| 43 | }; | ||
diff --git a/arch/arm/boot/dts/wm8850.dtsi b/arch/arm/boot/dts/wm8850.dtsi index e8cbfdc87bba..7149cd13e3b9 100644 --- a/arch/arm/boot/dts/wm8850.dtsi +++ b/arch/arm/boot/dts/wm8850.dtsi | |||
| @@ -135,11 +135,9 @@ | |||
| 135 | }; | 135 | }; |
| 136 | }; | 136 | }; |
| 137 | 137 | ||
| 138 | fb@d8051700 { | 138 | fb: fb@d8051700 { |
| 139 | compatible = "wm,wm8505-fb"; | 139 | compatible = "wm,wm8505-fb"; |
| 140 | reg = <0xd8051700 0x200>; | 140 | reg = <0xd8051700 0x200>; |
| 141 | display = <&display>; | ||
| 142 | default-mode = <&mode0>; | ||
| 143 | }; | 141 | }; |
| 144 | 142 | ||
| 145 | ge_rops@d8050400 { | 143 | ge_rops@d8050400 { |
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h index b885322717a1..9ae507270785 100644 --- a/arch/arm/plat-samsung/include/plat/fb.h +++ b/arch/arm/plat-samsung/include/plat/fb.h | |||
| @@ -15,55 +15,7 @@ | |||
| 15 | #ifndef __PLAT_S3C_FB_H | 15 | #ifndef __PLAT_S3C_FB_H |
| 16 | #define __PLAT_S3C_FB_H __FILE__ | 16 | #define __PLAT_S3C_FB_H __FILE__ |
| 17 | 17 | ||
| 18 | /* S3C_FB_MAX_WIN | 18 | #include <linux/platform_data/video_s3c.h> |
| 19 | * Set to the maximum number of windows that any of the supported hardware | ||
| 20 | * can use. Since the platform data uses this for an array size, having it | ||
| 21 | * set to the maximum of any version of the hardware can do is safe. | ||
| 22 | */ | ||
| 23 | #define S3C_FB_MAX_WIN (5) | ||
| 24 | |||
| 25 | /** | ||
| 26 | * struct s3c_fb_pd_win - per window setup data | ||
| 27 | * @xres : The window X size. | ||
| 28 | * @yres : The window Y size. | ||
| 29 | * @virtual_x: The virtual X size. | ||
| 30 | * @virtual_y: The virtual Y size. | ||
| 31 | */ | ||
| 32 | struct s3c_fb_pd_win { | ||
| 33 | unsigned short default_bpp; | ||
| 34 | unsigned short max_bpp; | ||
| 35 | unsigned short xres; | ||
| 36 | unsigned short yres; | ||
| 37 | unsigned short virtual_x; | ||
| 38 | unsigned short virtual_y; | ||
| 39 | }; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * struct s3c_fb_platdata - S3C driver platform specific information | ||
| 43 | * @setup_gpio: Setup the external GPIO pins to the right state to transfer | ||
| 44 | * the data from the display system to the connected display | ||
| 45 | * device. | ||
| 46 | * @vidcon0: The base vidcon0 values to control the panel data format. | ||
| 47 | * @vidcon1: The base vidcon1 values to control the panel data output. | ||
| 48 | * @vtiming: Video timing when connected to a RGB type panel. | ||
| 49 | * @win: The setup data for each hardware window, or NULL for unused. | ||
| 50 | * @display_mode: The LCD output display mode. | ||
| 51 | * | ||
| 52 | * The platform data supplies the video driver with all the information | ||
| 53 | * it requires to work with the display(s) attached to the machine. It | ||
| 54 | * controls the initial mode, the number of display windows (0 is always | ||
| 55 | * the base framebuffer) that are initialised etc. | ||
| 56 | * | ||
| 57 | */ | ||
| 58 | struct s3c_fb_platdata { | ||
| 59 | void (*setup_gpio)(void); | ||
| 60 | |||
| 61 | struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN]; | ||
| 62 | struct fb_videomode *vtiming; | ||
| 63 | |||
| 64 | u32 vidcon0; | ||
| 65 | u32 vidcon1; | ||
| 66 | }; | ||
| 67 | 19 | ||
| 68 | /** | 20 | /** |
| 69 | * s3c_fb_set_platdata() - Setup the FB device with platform data. | 21 | * s3c_fb_set_platdata() - Setup the FB device with platform data. |
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 04fa6f1808d1..f83f0719922e 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
| @@ -506,7 +506,7 @@ drm_gtf_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh, | |||
| 506 | } | 506 | } |
| 507 | EXPORT_SYMBOL(drm_gtf_mode); | 507 | EXPORT_SYMBOL(drm_gtf_mode); |
| 508 | 508 | ||
| 509 | #if IS_ENABLED(CONFIG_VIDEOMODE) | 509 | #ifdef CONFIG_VIDEOMODE_HELPERS |
| 510 | int drm_display_mode_from_videomode(const struct videomode *vm, | 510 | int drm_display_mode_from_videomode(const struct videomode *vm, |
| 511 | struct drm_display_mode *dmode) | 511 | struct drm_display_mode *dmode) |
| 512 | { | 512 | { |
| @@ -523,26 +523,25 @@ int drm_display_mode_from_videomode(const struct videomode *vm, | |||
| 523 | dmode->clock = vm->pixelclock / 1000; | 523 | dmode->clock = vm->pixelclock / 1000; |
| 524 | 524 | ||
| 525 | dmode->flags = 0; | 525 | dmode->flags = 0; |
| 526 | if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH) | 526 | if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) |
| 527 | dmode->flags |= DRM_MODE_FLAG_PHSYNC; | 527 | dmode->flags |= DRM_MODE_FLAG_PHSYNC; |
| 528 | else if (vm->dmt_flags & VESA_DMT_HSYNC_LOW) | 528 | else if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW) |
| 529 | dmode->flags |= DRM_MODE_FLAG_NHSYNC; | 529 | dmode->flags |= DRM_MODE_FLAG_NHSYNC; |
| 530 | if (vm->dmt_flags & VESA_DMT_VSYNC_HIGH) | 530 | if (vm->flags & DISPLAY_FLAGS_VSYNC_HIGH) |
| 531 | dmode->flags |= DRM_MODE_FLAG_PVSYNC; | 531 | dmode->flags |= DRM_MODE_FLAG_PVSYNC; |
| 532 | else if (vm->dmt_flags & VESA_DMT_VSYNC_LOW) | 532 | else if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW) |
| 533 | dmode->flags |= DRM_MODE_FLAG_NVSYNC; | 533 | dmode->flags |= DRM_MODE_FLAG_NVSYNC; |
| 534 | if (vm->data_flags & DISPLAY_FLAGS_INTERLACED) | 534 | if (vm->flags & DISPLAY_FLAGS_INTERLACED) |
| 535 | dmode->flags |= DRM_MODE_FLAG_INTERLACE; | 535 | dmode->flags |= DRM_MODE_FLAG_INTERLACE; |
| 536 | if (vm->data_flags & DISPLAY_FLAGS_DOUBLESCAN) | 536 | if (vm->flags & DISPLAY_FLAGS_DOUBLESCAN) |
| 537 | dmode->flags |= DRM_MODE_FLAG_DBLSCAN; | 537 | dmode->flags |= DRM_MODE_FLAG_DBLSCAN; |
| 538 | drm_mode_set_name(dmode); | 538 | drm_mode_set_name(dmode); |
| 539 | 539 | ||
| 540 | return 0; | 540 | return 0; |
| 541 | } | 541 | } |
| 542 | EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode); | 542 | EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode); |
| 543 | #endif | ||
| 544 | 543 | ||
| 545 | #if IS_ENABLED(CONFIG_OF_VIDEOMODE) | 544 | #ifdef CONFIG_OF |
| 546 | /** | 545 | /** |
| 547 | * of_get_drm_display_mode - get a drm_display_mode from devicetree | 546 | * of_get_drm_display_mode - get a drm_display_mode from devicetree |
| 548 | * @np: device_node with the timing specification | 547 | * @np: device_node with the timing specification |
| @@ -572,7 +571,8 @@ int of_get_drm_display_mode(struct device_node *np, | |||
| 572 | return 0; | 571 | return 0; |
| 573 | } | 572 | } |
| 574 | EXPORT_SYMBOL_GPL(of_get_drm_display_mode); | 573 | EXPORT_SYMBOL_GPL(of_get_drm_display_mode); |
| 575 | #endif | 574 | #endif /* CONFIG_OF */ |
| 575 | #endif /* CONFIG_VIDEOMODE_HELPERS */ | ||
| 576 | 576 | ||
| 577 | /** | 577 | /** |
| 578 | * drm_mode_set_name - set the name on a mode | 578 | * drm_mode_set_name - set the name on a mode |
diff --git a/drivers/gpu/drm/tilcdc/Kconfig b/drivers/gpu/drm/tilcdc/Kconfig index d24d04013476..e461e9972455 100644 --- a/drivers/gpu/drm/tilcdc/Kconfig +++ b/drivers/gpu/drm/tilcdc/Kconfig | |||
| @@ -4,8 +4,7 @@ config DRM_TILCDC | |||
| 4 | select DRM_KMS_HELPER | 4 | select DRM_KMS_HELPER |
| 5 | select DRM_KMS_CMA_HELPER | 5 | select DRM_KMS_CMA_HELPER |
| 6 | select DRM_GEM_CMA_HELPER | 6 | select DRM_GEM_CMA_HELPER |
| 7 | select OF_VIDEOMODE | 7 | select VIDEOMODE_HELPERS |
| 8 | select OF_DISPLAY_TIMING | ||
| 9 | select BACKLIGHT_CLASS_DEVICE | 8 | select BACKLIGHT_CLASS_DEVICE |
| 10 | help | 9 | help |
| 11 | Choose this option if you have an TI SoC with LCDC display | 10 | Choose this option if you have an TI SoC with LCDC display |
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 580b74e2022b..90ee49786372 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c | |||
| @@ -173,7 +173,7 @@ static int panel_connector_get_modes(struct drm_connector *connector) | |||
| 173 | struct drm_display_mode *mode = drm_mode_create(dev); | 173 | struct drm_display_mode *mode = drm_mode_create(dev); |
| 174 | struct videomode vm; | 174 | struct videomode vm; |
| 175 | 175 | ||
| 176 | if (videomode_from_timing(timings, &vm, i)) | 176 | if (videomode_from_timings(timings, &vm, i)) |
| 177 | break; | 177 | break; |
| 178 | 178 | ||
| 179 | drm_display_mode_from_videomode(&vm, mode); | 179 | drm_display_mode_from_videomode(&vm, mode); |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 4c1546f71d56..714d32a279e2 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
| @@ -31,26 +31,8 @@ config VIDEO_OUTPUT_CONTROL | |||
| 31 | This framework adds support for low-level control of the video | 31 | This framework adds support for low-level control of the video |
| 32 | output switch. | 32 | output switch. |
| 33 | 33 | ||
| 34 | config DISPLAY_TIMING | 34 | config VIDEOMODE_HELPERS |
| 35 | bool | 35 | bool |
| 36 | |||
| 37 | config VIDEOMODE | ||
| 38 | bool | ||
| 39 | |||
| 40 | config OF_DISPLAY_TIMING | ||
| 41 | bool "Enable device tree display timing support" | ||
| 42 | depends on OF | ||
| 43 | select DISPLAY_TIMING | ||
| 44 | help | ||
| 45 | helper to parse display timings from the devicetree | ||
| 46 | |||
| 47 | config OF_VIDEOMODE | ||
| 48 | bool "Enable device tree videomode support" | ||
| 49 | depends on OF | ||
| 50 | select VIDEOMODE | ||
| 51 | select OF_DISPLAY_TIMING | ||
| 52 | help | ||
| 53 | helper to get videomodes from the devicetree | ||
| 54 | 36 | ||
| 55 | config HDMI | 37 | config HDMI |
| 56 | bool | 38 | bool |
| @@ -212,14 +194,6 @@ config FB_SYS_FOPS | |||
| 212 | depends on FB | 194 | depends on FB |
| 213 | default n | 195 | default n |
| 214 | 196 | ||
| 215 | config FB_WMT_GE_ROPS | ||
| 216 | tristate | ||
| 217 | depends on FB | ||
| 218 | default n | ||
| 219 | ---help--- | ||
| 220 | Include functions for accelerated rectangle filling and area | ||
| 221 | copying using WonderMedia Graphics Engine operations. | ||
| 222 | |||
| 223 | config FB_DEFERRED_IO | 197 | config FB_DEFERRED_IO |
| 224 | bool | 198 | bool |
| 225 | depends on FB | 199 | depends on FB |
| @@ -1797,22 +1771,39 @@ config FB_AU1200 | |||
| 1797 | option au1200fb:panel=<name>. | 1771 | option au1200fb:panel=<name>. |
| 1798 | 1772 | ||
| 1799 | config FB_VT8500 | 1773 | config FB_VT8500 |
| 1800 | bool "VT8500 LCD Driver" | 1774 | bool "VIA VT8500 framebuffer support" |
| 1801 | depends on (FB = y) && ARM && ARCH_VT8500 | 1775 | depends on (FB = y) && ARM && ARCH_VT8500 |
| 1802 | select FB_WMT_GE_ROPS | 1776 | select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) |
| 1777 | select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) | ||
| 1803 | select FB_SYS_IMAGEBLIT | 1778 | select FB_SYS_IMAGEBLIT |
| 1779 | select FB_MODE_HELPERS | ||
| 1780 | select OF_DISPLAY_TIMING | ||
| 1781 | select OF_VIDEOMODE | ||
| 1804 | help | 1782 | help |
| 1805 | This is the framebuffer driver for VIA VT8500 integrated LCD | 1783 | This is the framebuffer driver for VIA VT8500 integrated LCD |
| 1806 | controller. | 1784 | controller. |
| 1807 | 1785 | ||
| 1808 | config FB_WM8505 | 1786 | config FB_WM8505 |
| 1809 | bool "WM8505 frame buffer support" | 1787 | bool "Wondermedia WM8xxx-series frame buffer support" |
| 1810 | depends on (FB = y) && ARM && ARCH_VT8500 | 1788 | depends on (FB = y) && ARM && ARCH_VT8500 |
| 1811 | select FB_WMT_GE_ROPS | 1789 | select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS) |
| 1790 | select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS) | ||
| 1812 | select FB_SYS_IMAGEBLIT | 1791 | select FB_SYS_IMAGEBLIT |
| 1792 | select FB_MODE_HELPERS | ||
| 1793 | select OF_DISPLAY_TIMING | ||
| 1794 | select OF_VIDEOMODE | ||
| 1795 | help | ||
| 1796 | This is the framebuffer driver for WonderMedia WM8xxx-series | ||
| 1797 | integrated LCD controller. This driver covers the WM8505, WM8650 | ||
| 1798 | and WM8850 SoCs. | ||
| 1799 | |||
| 1800 | config FB_WMT_GE_ROPS | ||
| 1801 | bool "VT8500/WM8xxx accelerated raster ops support" | ||
| 1802 | depends on (FB = y) && (FB_VT8500 || FB_WM8505) | ||
| 1803 | default n | ||
| 1813 | help | 1804 | help |
| 1814 | This is the framebuffer driver for WonderMedia WM8505/WM8650 | 1805 | This adds support for accelerated raster operations on the |
| 1815 | integrated LCD controller. | 1806 | VIA VT8500 and Wondermedia 85xx series SoCs. |
| 1816 | 1807 | ||
| 1817 | source "drivers/video/geode/Kconfig" | 1808 | source "drivers/video/geode/Kconfig" |
| 1818 | 1809 | ||
diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 9df387334cb7..e414378d6a51 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile | |||
| @@ -171,7 +171,7 @@ obj-$(CONFIG_FB_VIRTUAL) += vfb.o | |||
| 171 | 171 | ||
| 172 | #video output switch sysfs driver | 172 | #video output switch sysfs driver |
| 173 | obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o | 173 | obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o |
| 174 | obj-$(CONFIG_DISPLAY_TIMING) += display_timing.o | 174 | obj-$(CONFIG_VIDEOMODE_HELPERS) += display_timing.o videomode.o |
| 175 | obj-$(CONFIG_OF_DISPLAY_TIMING) += of_display_timing.o | 175 | ifeq ($(CONFIG_OF),y) |
| 176 | obj-$(CONFIG_VIDEOMODE) += videomode.o | 176 | obj-$(CONFIG_VIDEOMODE_HELPERS) += of_display_timing.o of_videomode.o |
| 177 | obj-$(CONFIG_OF_VIDEOMODE) += of_videomode.o | 177 | endif |
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index 7fa1bf823729..77cb4ffa1fe4 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c | |||
| @@ -3788,19 +3788,7 @@ static struct platform_driver amifb_driver = { | |||
| 3788 | }, | 3788 | }, |
| 3789 | }; | 3789 | }; |
| 3790 | 3790 | ||
| 3791 | static int __init amifb_init(void) | 3791 | module_platform_driver_probe(amifb_driver, amifb_probe); |
| 3792 | { | ||
| 3793 | return platform_driver_probe(&amifb_driver, amifb_probe); | ||
| 3794 | } | ||
| 3795 | |||
| 3796 | module_init(amifb_init); | ||
| 3797 | |||
| 3798 | static void __exit amifb_exit(void) | ||
| 3799 | { | ||
| 3800 | platform_driver_unregister(&amifb_driver); | ||
| 3801 | } | ||
| 3802 | |||
| 3803 | module_exit(amifb_exit); | ||
| 3804 | 3792 | ||
| 3805 | MODULE_LICENSE("GPL"); | 3793 | MODULE_LICENSE("GPL"); |
| 3806 | MODULE_ALIAS("platform:amiga-video"); | 3794 | MODULE_ALIAS("platform:amiga-video"); |
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 025428e04c33..98348ec0b3ce 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
| @@ -1158,18 +1158,7 @@ static struct platform_driver atmel_lcdfb_driver = { | |||
| 1158 | }, | 1158 | }, |
| 1159 | }; | 1159 | }; |
| 1160 | 1160 | ||
| 1161 | static int __init atmel_lcdfb_init(void) | 1161 | module_platform_driver_probe(atmel_lcdfb_driver, atmel_lcdfb_probe); |
| 1162 | { | ||
| 1163 | return platform_driver_probe(&atmel_lcdfb_driver, atmel_lcdfb_probe); | ||
| 1164 | } | ||
| 1165 | |||
| 1166 | static void __exit atmel_lcdfb_exit(void) | ||
| 1167 | { | ||
| 1168 | platform_driver_unregister(&atmel_lcdfb_driver); | ||
| 1169 | } | ||
| 1170 | |||
| 1171 | module_init(atmel_lcdfb_init); | ||
| 1172 | module_exit(atmel_lcdfb_exit); | ||
| 1173 | 1162 | ||
| 1174 | MODULE_DESCRIPTION("AT91/AT32 LCD Controller framebuffer driver"); | 1163 | MODULE_DESCRIPTION("AT91/AT32 LCD Controller framebuffer driver"); |
| 1175 | MODULE_AUTHOR("Nicolas Ferre <nicolas.ferre@atmel.com>"); | 1164 | MODULE_AUTHOR("Nicolas Ferre <nicolas.ferre@atmel.com>"); |
diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index fac7df6d1aba..3dd43ca2b95f 100644 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c | |||
| @@ -35,8 +35,6 @@ | |||
| 35 | 35 | ||
| 36 | #include <video/exynos_mipi_dsim.h> | 36 | #include <video/exynos_mipi_dsim.h> |
| 37 | 37 | ||
| 38 | #include <plat/fb.h> | ||
| 39 | |||
| 40 | #include "exynos_mipi_dsi_common.h" | 38 | #include "exynos_mipi_dsi_common.h" |
| 41 | #include "exynos_mipi_dsi_lowlevel.h" | 39 | #include "exynos_mipi_dsi_lowlevel.h" |
| 42 | 40 | ||
diff --git a/drivers/video/exynos/exynos_mipi_dsi_common.c b/drivers/video/exynos/exynos_mipi_dsi_common.c index c70cb8926df6..520fc9bd887b 100644 --- a/drivers/video/exynos/exynos_mipi_dsi_common.c +++ b/drivers/video/exynos/exynos_mipi_dsi_common.c | |||
| @@ -31,8 +31,6 @@ | |||
| 31 | #include <video/mipi_display.h> | 31 | #include <video/mipi_display.h> |
| 32 | #include <video/exynos_mipi_dsim.h> | 32 | #include <video/exynos_mipi_dsim.h> |
| 33 | 33 | ||
| 34 | #include <mach/map.h> | ||
| 35 | |||
| 36 | #include "exynos_mipi_dsi_regs.h" | 34 | #include "exynos_mipi_dsi_regs.h" |
| 37 | #include "exynos_mipi_dsi_lowlevel.h" | 35 | #include "exynos_mipi_dsi_lowlevel.h" |
| 38 | #include "exynos_mipi_dsi_common.h" | 36 | #include "exynos_mipi_dsi_common.h" |
diff --git a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c index 95cb99a1fe2d..15c5abd408dc 100644 --- a/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c +++ b/drivers/video/exynos/exynos_mipi_dsi_lowlevel.c | |||
| @@ -26,8 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | #include <video/exynos_mipi_dsim.h> | 27 | #include <video/exynos_mipi_dsim.h> |
| 28 | 28 | ||
| 29 | #include <mach/map.h> | ||
| 30 | |||
| 31 | #include "exynos_mipi_dsi_regs.h" | 29 | #include "exynos_mipi_dsi_regs.h" |
| 32 | 30 | ||
| 33 | void exynos_mipi_dsi_func_reset(struct mipi_dsim_device *dsim) | 31 | void exynos_mipi_dsi_func_reset(struct mipi_dsim_device *dsim) |
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c index 94ad0f71383c..e5cc2fdb4c8d 100644 --- a/drivers/video/fbmon.c +++ b/drivers/video/fbmon.c | |||
| @@ -1376,7 +1376,7 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf | |||
| 1376 | return err; | 1376 | return err; |
| 1377 | } | 1377 | } |
| 1378 | 1378 | ||
| 1379 | #if IS_ENABLED(CONFIG_VIDEOMODE) | 1379 | #ifdef CONFIG_VIDEOMODE_HELPERS |
| 1380 | int fb_videomode_from_videomode(const struct videomode *vm, | 1380 | int fb_videomode_from_videomode(const struct videomode *vm, |
| 1381 | struct fb_videomode *fbmode) | 1381 | struct fb_videomode *fbmode) |
| 1382 | { | 1382 | { |
| @@ -1398,13 +1398,13 @@ int fb_videomode_from_videomode(const struct videomode *vm, | |||
| 1398 | 1398 | ||
| 1399 | fbmode->sync = 0; | 1399 | fbmode->sync = 0; |
| 1400 | fbmode->vmode = 0; | 1400 | fbmode->vmode = 0; |
| 1401 | if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH) | 1401 | if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) |
| 1402 | fbmode->sync |= FB_SYNC_HOR_HIGH_ACT; | 1402 | fbmode->sync |= FB_SYNC_HOR_HIGH_ACT; |
| 1403 | if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH) | 1403 | if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) |
| 1404 | fbmode->sync |= FB_SYNC_VERT_HIGH_ACT; | 1404 | fbmode->sync |= FB_SYNC_VERT_HIGH_ACT; |
| 1405 | if (vm->data_flags & DISPLAY_FLAGS_INTERLACED) | 1405 | if (vm->flags & DISPLAY_FLAGS_INTERLACED) |
| 1406 | fbmode->vmode |= FB_VMODE_INTERLACED; | 1406 | fbmode->vmode |= FB_VMODE_INTERLACED; |
| 1407 | if (vm->data_flags & DISPLAY_FLAGS_DOUBLESCAN) | 1407 | if (vm->flags & DISPLAY_FLAGS_DOUBLESCAN) |
| 1408 | fbmode->vmode |= FB_VMODE_DOUBLE; | 1408 | fbmode->vmode |= FB_VMODE_DOUBLE; |
| 1409 | fbmode->flag = 0; | 1409 | fbmode->flag = 0; |
| 1410 | 1410 | ||
| @@ -1424,9 +1424,8 @@ int fb_videomode_from_videomode(const struct videomode *vm, | |||
| 1424 | return 0; | 1424 | return 0; |
| 1425 | } | 1425 | } |
| 1426 | EXPORT_SYMBOL_GPL(fb_videomode_from_videomode); | 1426 | EXPORT_SYMBOL_GPL(fb_videomode_from_videomode); |
| 1427 | #endif | ||
| 1428 | 1427 | ||
| 1429 | #if IS_ENABLED(CONFIG_OF_VIDEOMODE) | 1428 | #ifdef CONFIG_OF |
| 1430 | static inline void dump_fb_videomode(const struct fb_videomode *m) | 1429 | static inline void dump_fb_videomode(const struct fb_videomode *m) |
| 1431 | { | 1430 | { |
| 1432 | pr_debug("fb_videomode = %ux%u@%uHz (%ukHz) %u %u %u %u %u %u %u %u %u\n", | 1431 | pr_debug("fb_videomode = %ux%u@%uHz (%ukHz) %u %u %u %u %u %u %u %u %u\n", |
| @@ -1465,7 +1464,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb, | |||
| 1465 | return 0; | 1464 | return 0; |
| 1466 | } | 1465 | } |
| 1467 | EXPORT_SYMBOL_GPL(of_get_fb_videomode); | 1466 | EXPORT_SYMBOL_GPL(of_get_fb_videomode); |
| 1468 | #endif | 1467 | #endif /* CONFIG_OF */ |
| 1468 | #endif /* CONFIG_VIDEOMODE_HELPERS */ | ||
| 1469 | 1469 | ||
| 1470 | #else | 1470 | #else |
| 1471 | int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var) | 1471 | int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var) |
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 41fbd9453c5f..6c278056fc60 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
| @@ -375,7 +375,10 @@ struct fsl_diu_data { | |||
| 375 | struct diu_ad dummy_ad __aligned(8); | 375 | struct diu_ad dummy_ad __aligned(8); |
| 376 | struct diu_ad ad[NUM_AOIS] __aligned(8); | 376 | struct diu_ad ad[NUM_AOIS] __aligned(8); |
| 377 | u8 gamma[256 * 3] __aligned(32); | 377 | u8 gamma[256 * 3] __aligned(32); |
| 378 | u8 cursor[MAX_CURS * MAX_CURS * 2] __aligned(32); | 378 | /* It's easier to parse the cursor data as little-endian */ |
| 379 | __le16 cursor[MAX_CURS * MAX_CURS] __aligned(32); | ||
| 380 | /* Blank cursor data -- used to hide the cursor */ | ||
| 381 | __le16 blank_cursor[MAX_CURS * MAX_CURS] __aligned(32); | ||
| 379 | uint8_t edid_data[EDID_LENGTH]; | 382 | uint8_t edid_data[EDID_LENGTH]; |
| 380 | bool has_edid; | 383 | bool has_edid; |
| 381 | } __aligned(32); | 384 | } __aligned(32); |
| @@ -824,7 +827,6 @@ static void update_lcdc(struct fb_info *info) | |||
| 824 | /* Program DIU registers */ | 827 | /* Program DIU registers */ |
| 825 | 828 | ||
| 826 | out_be32(&hw->gamma, DMA_ADDR(data, gamma)); | 829 | out_be32(&hw->gamma, DMA_ADDR(data, gamma)); |
| 827 | out_be32(&hw->cursor, DMA_ADDR(data, cursor)); | ||
| 828 | 830 | ||
| 829 | out_be32(&hw->bgnd, 0x007F7F7F); /* Set background to grey */ | 831 | out_be32(&hw->bgnd, 0x007F7F7F); /* Set background to grey */ |
| 830 | out_be32(&hw->disp_size, (var->yres << 16) | var->xres); | 832 | out_be32(&hw->disp_size, (var->yres << 16) | var->xres); |
| @@ -968,6 +970,156 @@ static u32 fsl_diu_get_pixel_format(unsigned int bits_per_pixel) | |||
| 968 | } | 970 | } |
| 969 | 971 | ||
| 970 | /* | 972 | /* |
| 973 | * Copies a cursor image from user space to the proper place in driver | ||
| 974 | * memory so that the hardware can display the cursor image. | ||
| 975 | * | ||
| 976 | * Cursor data is represented as a sequence of 'width' bits packed into bytes. | ||
| 977 | * That is, the first 8 bits are in the first byte, the second 8 bits in the | ||
| 978 | * second byte, and so on. Therefore, the each row of the cursor is (width + | ||
| 979 | * 7) / 8 bytes of 'data' | ||
| 980 | * | ||
| 981 | * The DIU only supports cursors up to 32x32 (MAX_CURS). We reject cursors | ||
| 982 | * larger than this, so we already know that 'width' <= 32. Therefore, we can | ||
| 983 | * simplify our code by using a 32-bit big-endian integer ("line") to read in | ||
| 984 | * a single line of pixels, and only look at the top 'width' bits of that | ||
| 985 | * integer. | ||
| 986 | * | ||
| 987 | * This could result in an unaligned 32-bit read. For example, if the cursor | ||
| 988 | * is 24x24, then the first three bytes of 'image' contain the pixel data for | ||
| 989 | * the top line of the cursor. We do a 32-bit read of 'image', but we look | ||
| 990 | * only at the top 24 bits. Then we increment 'image' by 3 bytes. The next | ||
| 991 | * read is unaligned. The only problem is that we might read past the end of | ||
| 992 | * 'image' by 1-3 bytes, but that should not cause any problems. | ||
| 993 | */ | ||
| 994 | static void fsl_diu_load_cursor_image(struct fb_info *info, | ||
| 995 | const void *image, uint16_t bg, uint16_t fg, | ||
| 996 | unsigned int width, unsigned int height) | ||
| 997 | { | ||
| 998 | struct mfb_info *mfbi = info->par; | ||
| 999 | struct fsl_diu_data *data = mfbi->parent; | ||
| 1000 | __le16 *cursor = data->cursor; | ||
| 1001 | __le16 _fg = cpu_to_le16(fg); | ||
| 1002 | __le16 _bg = cpu_to_le16(bg); | ||
| 1003 | unsigned int h, w; | ||
| 1004 | |||
| 1005 | for (h = 0; h < height; h++) { | ||
| 1006 | uint32_t mask = 1 << 31; | ||
| 1007 | uint32_t line = be32_to_cpup(image); | ||
| 1008 | |||
| 1009 | for (w = 0; w < width; w++) { | ||
| 1010 | cursor[w] = (line & mask) ? _fg : _bg; | ||
| 1011 | mask >>= 1; | ||
| 1012 | } | ||
| 1013 | |||
| 1014 | cursor += MAX_CURS; | ||
| 1015 | image += DIV_ROUND_UP(width, 8); | ||
| 1016 | } | ||
| 1017 | } | ||
| 1018 | |||
| 1019 | /* | ||
| 1020 | * Set a hardware cursor. The image data for the cursor is passed via the | ||
| 1021 | * fb_cursor object. | ||
| 1022 | */ | ||
| 1023 | static int fsl_diu_cursor(struct fb_info *info, struct fb_cursor *cursor) | ||
| 1024 | { | ||
| 1025 | struct mfb_info *mfbi = info->par; | ||
| 1026 | struct fsl_diu_data *data = mfbi->parent; | ||
| 1027 | struct diu __iomem *hw = data->diu_reg; | ||
| 1028 | |||
| 1029 | if (cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS) | ||
| 1030 | return -EINVAL; | ||
| 1031 | |||
| 1032 | /* The cursor size has changed */ | ||
| 1033 | if (cursor->set & FB_CUR_SETSIZE) { | ||
| 1034 | /* | ||
| 1035 | * The DIU cursor is a fixed size, so when we get this | ||
| 1036 | * message, instead of resizing the cursor, we just clear | ||
| 1037 | * all the image data, in expectation of new data. However, | ||
| 1038 | * in tests this control does not appear to be normally | ||
| 1039 | * called. | ||
| 1040 | */ | ||
| 1041 | memset(data->cursor, 0, sizeof(data->cursor)); | ||
| 1042 | } | ||
| 1043 | |||
| 1044 | /* The cursor position has changed (cursor->image.dx|dy) */ | ||
| 1045 | if (cursor->set & FB_CUR_SETPOS) { | ||
| 1046 | uint32_t xx, yy; | ||
| 1047 | |||
| 1048 | yy = (cursor->image.dy - info->var.yoffset) & 0x7ff; | ||
| 1049 | xx = (cursor->image.dx - info->var.xoffset) & 0x7ff; | ||
| 1050 | |||
| 1051 | out_be32(&hw->curs_pos, yy << 16 | xx); | ||
| 1052 | } | ||
| 1053 | |||
| 1054 | /* | ||
| 1055 | * FB_CUR_SETIMAGE - the cursor image has changed | ||
| 1056 | * FB_CUR_SETCMAP - the cursor colors has changed | ||
| 1057 | * FB_CUR_SETSHAPE - the cursor bitmask has changed | ||
| 1058 | */ | ||
| 1059 | if (cursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETCMAP | FB_CUR_SETIMAGE)) { | ||
| 1060 | unsigned int image_size = | ||
| 1061 | DIV_ROUND_UP(cursor->image.width, 8) * cursor->image.height; | ||
| 1062 | unsigned int image_words = | ||
| 1063 | DIV_ROUND_UP(image_size, sizeof(uint32_t)); | ||
| 1064 | unsigned int bg_idx = cursor->image.bg_color; | ||
| 1065 | unsigned int fg_idx = cursor->image.fg_color; | ||
| 1066 | uint8_t buffer[image_size]; | ||
| 1067 | uint32_t *image, *source, *mask; | ||
| 1068 | uint16_t fg, bg; | ||
| 1069 | unsigned int i; | ||
| 1070 | |||
| 1071 | if (info->state != FBINFO_STATE_RUNNING) | ||
| 1072 | return 0; | ||
| 1073 | |||
| 1074 | /* | ||
| 1075 | * Determine the size of the cursor image data. Normally, | ||
| 1076 | * it's 8x16. | ||
| 1077 | */ | ||
| 1078 | image_size = DIV_ROUND_UP(cursor->image.width, 8) * | ||
| 1079 | cursor->image.height; | ||
| 1080 | |||
| 1081 | bg = ((info->cmap.red[bg_idx] & 0xf8) << 7) | | ||
| 1082 | ((info->cmap.green[bg_idx] & 0xf8) << 2) | | ||
| 1083 | ((info->cmap.blue[bg_idx] & 0xf8) >> 3) | | ||
| 1084 | 1 << 15; | ||
| 1085 | |||
| 1086 | fg = ((info->cmap.red[fg_idx] & 0xf8) << 7) | | ||
| 1087 | ((info->cmap.green[fg_idx] & 0xf8) << 2) | | ||
| 1088 | ((info->cmap.blue[fg_idx] & 0xf8) >> 3) | | ||
| 1089 | 1 << 15; | ||
| 1090 | |||
| 1091 | /* Use 32-bit operations on the data to improve performance */ | ||
| 1092 | image = (uint32_t *)buffer; | ||
| 1093 | source = (uint32_t *)cursor->image.data; | ||
| 1094 | mask = (uint32_t *)cursor->mask; | ||
| 1095 | |||
| 1096 | if (cursor->rop == ROP_XOR) | ||
| 1097 | for (i = 0; i < image_words; i++) | ||
| 1098 | image[i] = source[i] ^ mask[i]; | ||
| 1099 | else | ||
| 1100 | for (i = 0; i < image_words; i++) | ||
| 1101 | image[i] = source[i] & mask[i]; | ||
| 1102 | |||
| 1103 | fsl_diu_load_cursor_image(info, image, bg, fg, | ||
| 1104 | cursor->image.width, cursor->image.height); | ||
| 1105 | }; | ||
| 1106 | |||
| 1107 | /* | ||
| 1108 | * Show or hide the cursor. The cursor data is always stored in the | ||
| 1109 | * 'cursor' memory block, and the actual cursor position is always in | ||
| 1110 | * the DIU's CURS_POS register. To hide the cursor, we redirect the | ||
| 1111 | * CURSOR register to a blank cursor. The show the cursor, we | ||
| 1112 | * redirect the CURSOR register to the real cursor data. | ||
| 1113 | */ | ||
| 1114 | if (cursor->enable) | ||
| 1115 | out_be32(&hw->cursor, DMA_ADDR(data, cursor)); | ||
| 1116 | else | ||
| 1117 | out_be32(&hw->cursor, DMA_ADDR(data, blank_cursor)); | ||
| 1118 | |||
| 1119 | return 0; | ||
| 1120 | } | ||
| 1121 | |||
| 1122 | /* | ||
| 971 | * Using the fb_var_screeninfo in fb_info we set the resolution of this | 1123 | * Using the fb_var_screeninfo in fb_info we set the resolution of this |
| 972 | * particular framebuffer. This function alters the fb_fix_screeninfo stored | 1124 | * particular framebuffer. This function alters the fb_fix_screeninfo stored |
| 973 | * in fb_info. It does not alter var in fb_info since we are using that | 1125 | * in fb_info. It does not alter var in fb_info since we are using that |
| @@ -1312,6 +1464,7 @@ static struct fb_ops fsl_diu_ops = { | |||
| 1312 | .fb_ioctl = fsl_diu_ioctl, | 1464 | .fb_ioctl = fsl_diu_ioctl, |
| 1313 | .fb_open = fsl_diu_open, | 1465 | .fb_open = fsl_diu_open, |
| 1314 | .fb_release = fsl_diu_release, | 1466 | .fb_release = fsl_diu_release, |
| 1467 | .fb_cursor = fsl_diu_cursor, | ||
| 1315 | }; | 1468 | }; |
| 1316 | 1469 | ||
| 1317 | static int install_fb(struct fb_info *info) | 1470 | static int install_fb(struct fb_info *info) |
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 13ecd9897010..56009bc02b02 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c | |||
| @@ -79,25 +79,24 @@ static struct display_timing *of_get_display_timing(struct device_node *np) | |||
| 79 | ret |= parse_timing_property(np, "vsync-len", &dt->vsync_len); | 79 | ret |= parse_timing_property(np, "vsync-len", &dt->vsync_len); |
| 80 | ret |= parse_timing_property(np, "clock-frequency", &dt->pixelclock); | 80 | ret |= parse_timing_property(np, "clock-frequency", &dt->pixelclock); |
| 81 | 81 | ||
| 82 | dt->dmt_flags = 0; | 82 | dt->flags = 0; |
| 83 | dt->data_flags = 0; | ||
| 84 | if (!of_property_read_u32(np, "vsync-active", &val)) | 83 | if (!of_property_read_u32(np, "vsync-active", &val)) |
| 85 | dt->dmt_flags |= val ? VESA_DMT_VSYNC_HIGH : | 84 | dt->flags |= val ? DISPLAY_FLAGS_VSYNC_HIGH : |
| 86 | VESA_DMT_VSYNC_LOW; | 85 | DISPLAY_FLAGS_VSYNC_LOW; |
| 87 | if (!of_property_read_u32(np, "hsync-active", &val)) | 86 | if (!of_property_read_u32(np, "hsync-active", &val)) |
| 88 | dt->dmt_flags |= val ? VESA_DMT_HSYNC_HIGH : | 87 | dt->flags |= val ? DISPLAY_FLAGS_HSYNC_HIGH : |
| 89 | VESA_DMT_HSYNC_LOW; | 88 | DISPLAY_FLAGS_HSYNC_LOW; |
| 90 | if (!of_property_read_u32(np, "de-active", &val)) | 89 | if (!of_property_read_u32(np, "de-active", &val)) |
| 91 | dt->data_flags |= val ? DISPLAY_FLAGS_DE_HIGH : | 90 | dt->flags |= val ? DISPLAY_FLAGS_DE_HIGH : |
| 92 | DISPLAY_FLAGS_DE_LOW; | 91 | DISPLAY_FLAGS_DE_LOW; |
| 93 | if (!of_property_read_u32(np, "pixelclk-active", &val)) | 92 | if (!of_property_read_u32(np, "pixelclk-active", &val)) |
| 94 | dt->data_flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : | 93 | dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : |
| 95 | DISPLAY_FLAGS_PIXDATA_NEGEDGE; | 94 | DISPLAY_FLAGS_PIXDATA_NEGEDGE; |
| 96 | 95 | ||
| 97 | if (of_property_read_bool(np, "interlaced")) | 96 | if (of_property_read_bool(np, "interlaced")) |
| 98 | dt->data_flags |= DISPLAY_FLAGS_INTERLACED; | 97 | dt->flags |= DISPLAY_FLAGS_INTERLACED; |
| 99 | if (of_property_read_bool(np, "doublescan")) | 98 | if (of_property_read_bool(np, "doublescan")) |
| 100 | dt->data_flags |= DISPLAY_FLAGS_DOUBLESCAN; | 99 | dt->flags |= DISPLAY_FLAGS_DOUBLESCAN; |
| 101 | 100 | ||
| 102 | if (ret) { | 101 | if (ret) { |
| 103 | pr_err("%s: error reading timing properties\n", | 102 | pr_err("%s: error reading timing properties\n", |
diff --git a/drivers/video/of_videomode.c b/drivers/video/of_videomode.c index 5b8066cd397f..111c2d1911d3 100644 --- a/drivers/video/of_videomode.c +++ b/drivers/video/of_videomode.c | |||
| @@ -43,7 +43,7 @@ int of_get_videomode(struct device_node *np, struct videomode *vm, | |||
| 43 | if (index == OF_USE_NATIVE_MODE) | 43 | if (index == OF_USE_NATIVE_MODE) |
| 44 | index = disp->native_mode; | 44 | index = disp->native_mode; |
| 45 | 45 | ||
| 46 | ret = videomode_from_timing(disp, vm, index); | 46 | ret = videomode_from_timings(disp, vm, index); |
| 47 | if (ret) | 47 | if (ret) |
| 48 | return ret; | 48 | return ret; |
| 49 | 49 | ||
diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig index e512581300fc..0bc3a936ce2b 100644 --- a/drivers/video/omap/Kconfig +++ b/drivers/video/omap/Kconfig | |||
| @@ -39,17 +39,6 @@ config FB_OMAP_LCD_MIPID | |||
| 39 | the Mobile Industry Processor Interface DBI-C/DCS | 39 | the Mobile Industry Processor Interface DBI-C/DCS |
| 40 | specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3) | 40 | specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3) |
| 41 | 41 | ||
| 42 | config FB_OMAP_CONSISTENT_DMA_SIZE | ||
| 43 | int "Consistent DMA memory size (MB)" | ||
| 44 | depends on FB_OMAP | ||
| 45 | range 1 14 | ||
| 46 | default 2 | ||
| 47 | help | ||
| 48 | Increase the DMA consistent memory size according to your video | ||
| 49 | memory needs, for example if you want to use multiple planes. | ||
| 50 | The size must be 2MB aligned. | ||
| 51 | If unsure say 1. | ||
| 52 | |||
| 53 | config FB_OMAP_DMA_TUNE | 42 | config FB_OMAP_DMA_TUNE |
| 54 | bool "Set DMA SDRAM access priority high" | 43 | bool "Set DMA SDRAM access priority high" |
| 55 | depends on FB_OMAP | 44 | depends on FB_OMAP |
diff --git a/drivers/video/omap2/vrfb.c b/drivers/video/omap2/vrfb.c index 10560efeb35a..5261229c79af 100644 --- a/drivers/video/omap2/vrfb.c +++ b/drivers/video/omap2/vrfb.c | |||
| @@ -397,18 +397,7 @@ static struct platform_driver vrfb_driver = { | |||
| 397 | .remove = __exit_p(vrfb_remove), | 397 | .remove = __exit_p(vrfb_remove), |
| 398 | }; | 398 | }; |
| 399 | 399 | ||
| 400 | static int __init vrfb_init(void) | 400 | module_platform_driver_probe(vrfb_driver, vrfb_probe); |
| 401 | { | ||
| 402 | return platform_driver_probe(&vrfb_driver, &vrfb_probe); | ||
| 403 | } | ||
| 404 | |||
| 405 | static void __exit vrfb_exit(void) | ||
| 406 | { | ||
| 407 | platform_driver_unregister(&vrfb_driver); | ||
| 408 | } | ||
| 409 | |||
| 410 | module_init(vrfb_init); | ||
| 411 | module_exit(vrfb_exit); | ||
| 412 | 401 | ||
| 413 | MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>"); | 402 | MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>"); |
| 414 | MODULE_DESCRIPTION("OMAP VRFB"); | 403 | MODULE_DESCRIPTION("OMAP VRFB"); |
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 968a62571df7..2e7991c7ca08 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
| @@ -24,10 +24,9 @@ | |||
| 24 | #include <linux/uaccess.h> | 24 | #include <linux/uaccess.h> |
| 25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
| 26 | #include <linux/pm_runtime.h> | 26 | #include <linux/pm_runtime.h> |
| 27 | #include <linux/platform_data/video_s3c.h> | ||
| 27 | 28 | ||
| 28 | #include <video/samsung_fimd.h> | 29 | #include <video/samsung_fimd.h> |
| 29 | #include <mach/map.h> | ||
| 30 | #include <plat/fb.h> | ||
| 31 | 30 | ||
| 32 | /* This driver will export a number of framebuffer interfaces depending | 31 | /* This driver will export a number of framebuffer interfaces depending |
| 33 | * on the configuration passed in via the platform data. Each fb instance | 32 | * on the configuration passed in via the platform data. Each fb instance |
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c index 701b461cf8a9..6cad53075e99 100644 --- a/drivers/video/sh_mipi_dsi.c +++ b/drivers/video/sh_mipi_dsi.c | |||
| @@ -581,17 +581,7 @@ static struct platform_driver sh_mipi_driver = { | |||
| 581 | }, | 581 | }, |
| 582 | }; | 582 | }; |
| 583 | 583 | ||
| 584 | static int __init sh_mipi_init(void) | 584 | module_platform_driver_probe(sh_mipi_driver, sh_mipi_probe); |
| 585 | { | ||
| 586 | return platform_driver_probe(&sh_mipi_driver, sh_mipi_probe); | ||
| 587 | } | ||
| 588 | module_init(sh_mipi_init); | ||
| 589 | |||
| 590 | static void __exit sh_mipi_exit(void) | ||
| 591 | { | ||
| 592 | platform_driver_unregister(&sh_mipi_driver); | ||
| 593 | } | ||
| 594 | module_exit(sh_mipi_exit); | ||
| 595 | 585 | ||
| 596 | MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); | 586 | MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); |
| 597 | MODULE_DESCRIPTION("SuperH / ARM-shmobile MIPI DSI driver"); | 587 | MODULE_DESCRIPTION("SuperH / ARM-shmobile MIPI DSI driver"); |
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 930e550e752a..bfe4728480fd 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
| @@ -1445,17 +1445,7 @@ static struct platform_driver sh_hdmi_driver = { | |||
| 1445 | }, | 1445 | }, |
| 1446 | }; | 1446 | }; |
| 1447 | 1447 | ||
| 1448 | static int __init sh_hdmi_init(void) | 1448 | module_platform_driver_probe(sh_hdmi_driver, sh_hdmi_probe); |
| 1449 | { | ||
| 1450 | return platform_driver_probe(&sh_hdmi_driver, sh_hdmi_probe); | ||
| 1451 | } | ||
| 1452 | module_init(sh_hdmi_init); | ||
| 1453 | |||
| 1454 | static void __exit sh_hdmi_exit(void) | ||
| 1455 | { | ||
| 1456 | platform_driver_unregister(&sh_hdmi_driver); | ||
| 1457 | } | ||
| 1458 | module_exit(sh_hdmi_exit); | ||
| 1459 | 1449 | ||
| 1460 | MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); | 1450 | MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); |
| 1461 | MODULE_DESCRIPTION("SuperH / ARM-shmobile HDMI driver"); | 1451 | MODULE_DESCRIPTION("SuperH / ARM-shmobile HDMI driver"); |
diff --git a/drivers/video/videomode.c b/drivers/video/videomode.c index 21c47a202afa..df375c96c5d3 100644 --- a/drivers/video/videomode.c +++ b/drivers/video/videomode.c | |||
| @@ -11,7 +11,25 @@ | |||
| 11 | #include <video/display_timing.h> | 11 | #include <video/display_timing.h> |
| 12 | #include <video/videomode.h> | 12 | #include <video/videomode.h> |
| 13 | 13 | ||
| 14 | int videomode_from_timing(const struct display_timings *disp, | 14 | void videomode_from_timing(const struct display_timing *dt, |
| 15 | struct videomode *vm) | ||
| 16 | { | ||
| 17 | vm->pixelclock = dt->pixelclock.typ; | ||
| 18 | vm->hactive = dt->hactive.typ; | ||
| 19 | vm->hfront_porch = dt->hfront_porch.typ; | ||
| 20 | vm->hback_porch = dt->hback_porch.typ; | ||
| 21 | vm->hsync_len = dt->hsync_len.typ; | ||
| 22 | |||
| 23 | vm->vactive = dt->vactive.typ; | ||
| 24 | vm->vfront_porch = dt->vfront_porch.typ; | ||
| 25 | vm->vback_porch = dt->vback_porch.typ; | ||
| 26 | vm->vsync_len = dt->vsync_len.typ; | ||
| 27 | |||
| 28 | vm->flags = dt->flags; | ||
| 29 | } | ||
| 30 | EXPORT_SYMBOL_GPL(videomode_from_timing); | ||
| 31 | |||
| 32 | int videomode_from_timings(const struct display_timings *disp, | ||
| 15 | struct videomode *vm, unsigned int index) | 33 | struct videomode *vm, unsigned int index) |
| 16 | { | 34 | { |
| 17 | struct display_timing *dt; | 35 | struct display_timing *dt; |
| @@ -20,20 +38,8 @@ int videomode_from_timing(const struct display_timings *disp, | |||
| 20 | if (!dt) | 38 | if (!dt) |
| 21 | return -EINVAL; | 39 | return -EINVAL; |
| 22 | 40 | ||
| 23 | vm->pixelclock = display_timing_get_value(&dt->pixelclock, TE_TYP); | 41 | videomode_from_timing(dt, vm); |
| 24 | vm->hactive = display_timing_get_value(&dt->hactive, TE_TYP); | ||
| 25 | vm->hfront_porch = display_timing_get_value(&dt->hfront_porch, TE_TYP); | ||
| 26 | vm->hback_porch = display_timing_get_value(&dt->hback_porch, TE_TYP); | ||
| 27 | vm->hsync_len = display_timing_get_value(&dt->hsync_len, TE_TYP); | ||
| 28 | |||
| 29 | vm->vactive = display_timing_get_value(&dt->vactive, TE_TYP); | ||
| 30 | vm->vfront_porch = display_timing_get_value(&dt->vfront_porch, TE_TYP); | ||
| 31 | vm->vback_porch = display_timing_get_value(&dt->vback_porch, TE_TYP); | ||
| 32 | vm->vsync_len = display_timing_get_value(&dt->vsync_len, TE_TYP); | ||
| 33 | |||
| 34 | vm->dmt_flags = dt->dmt_flags; | ||
| 35 | vm->data_flags = dt->data_flags; | ||
| 36 | 42 | ||
| 37 | return 0; | 43 | return 0; |
| 38 | } | 44 | } |
| 39 | EXPORT_SYMBOL_GPL(videomode_from_timing); | 45 | EXPORT_SYMBOL_GPL(videomode_from_timings); |
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c index aa2579c2364a..9547e1831e03 100644 --- a/drivers/video/vt8500lcdfb.c +++ b/drivers/video/vt8500lcdfb.c | |||
| @@ -15,22 +15,21 @@ | |||
| 15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <linux/module.h> | ||
| 19 | #include <linux/kernel.h> | ||
| 20 | #include <linux/errno.h> | ||
| 21 | #include <linux/string.h> | ||
| 22 | #include <linux/mm.h> | ||
| 23 | #include <linux/slab.h> | ||
| 24 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
| 19 | #include <linux/dma-mapping.h> | ||
| 20 | #include <linux/errno.h> | ||
| 25 | #include <linux/fb.h> | 21 | #include <linux/fb.h> |
| 26 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 27 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
| 28 | #include <linux/io.h> | 24 | #include <linux/io.h> |
| 29 | #include <linux/dma-mapping.h> | 25 | #include <linux/kernel.h> |
| 26 | #include <linux/mm.h> | ||
| 27 | #include <linux/module.h> | ||
| 30 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
| 29 | #include <linux/slab.h> | ||
| 30 | #include <linux/string.h> | ||
| 31 | #include <linux/wait.h> | 31 | #include <linux/wait.h> |
| 32 | 32 | #include <video/of_display_timing.h> | |
| 33 | #include <linux/platform_data/video-vt8500lcdfb.h> | ||
| 34 | 33 | ||
| 35 | #include "vt8500lcdfb.h" | 34 | #include "vt8500lcdfb.h" |
| 36 | #include "wmt_ge_rops.h" | 35 | #include "wmt_ge_rops.h" |
| @@ -277,11 +276,11 @@ static int vt8500lcd_probe(struct platform_device *pdev) | |||
| 277 | { | 276 | { |
| 278 | struct vt8500lcd_info *fbi; | 277 | struct vt8500lcd_info *fbi; |
| 279 | struct resource *res; | 278 | struct resource *res; |
| 279 | struct display_timings *disp_timing; | ||
| 280 | void *addr; | 280 | void *addr; |
| 281 | int irq, ret; | 281 | int irq, ret; |
| 282 | 282 | ||
| 283 | struct fb_videomode of_mode; | 283 | struct fb_videomode of_mode; |
| 284 | struct device_node *np; | ||
| 285 | u32 bpp; | 284 | u32 bpp; |
| 286 | dma_addr_t fb_mem_phys; | 285 | dma_addr_t fb_mem_phys; |
| 287 | unsigned long fb_mem_len; | 286 | unsigned long fb_mem_len; |
| @@ -346,32 +345,18 @@ static int vt8500lcd_probe(struct platform_device *pdev) | |||
| 346 | goto failed_free_res; | 345 | goto failed_free_res; |
| 347 | } | 346 | } |
| 348 | 347 | ||
| 349 | np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0); | 348 | disp_timing = of_get_display_timings(pdev->dev.of_node); |
| 350 | if (!np) { | 349 | if (!disp_timing) |
| 351 | pr_err("%s: No display description in Device Tree\n", __func__); | 350 | return -EINVAL; |
| 352 | ret = -EINVAL; | ||
| 353 | goto failed_free_res; | ||
| 354 | } | ||
| 355 | 351 | ||
| 356 | /* | 352 | ret = of_get_fb_videomode(pdev->dev.of_node, &of_mode, |
| 357 | * This code is copied from Sascha Hauer's of_videomode helper | 353 | OF_USE_NATIVE_MODE); |
| 358 | * and can be replaced with a call to the helper once mainlined | 354 | if (ret) |
| 359 | */ | 355 | return ret; |
| 360 | ret = 0; | 356 | |
| 361 | ret |= of_property_read_u32(np, "hactive", &of_mode.xres); | 357 | ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp); |
| 362 | ret |= of_property_read_u32(np, "vactive", &of_mode.yres); | 358 | if (ret) |
| 363 | ret |= of_property_read_u32(np, "hback-porch", &of_mode.left_margin); | 359 | return ret; |
| 364 | ret |= of_property_read_u32(np, "hfront-porch", &of_mode.right_margin); | ||
| 365 | ret |= of_property_read_u32(np, "hsync-len", &of_mode.hsync_len); | ||
| 366 | ret |= of_property_read_u32(np, "vback-porch", &of_mode.upper_margin); | ||
| 367 | ret |= of_property_read_u32(np, "vfront-porch", &of_mode.lower_margin); | ||
| 368 | ret |= of_property_read_u32(np, "vsync-len", &of_mode.vsync_len); | ||
| 369 | ret |= of_property_read_u32(np, "bpp", &bpp); | ||
| 370 | if (ret) { | ||
| 371 | pr_err("%s: Unable to read display properties\n", __func__); | ||
| 372 | goto failed_free_res; | ||
| 373 | } | ||
| 374 | of_mode.vmode = FB_VMODE_NONINTERLACED; | ||
| 375 | 360 | ||
| 376 | /* try allocating the framebuffer */ | 361 | /* try allocating the framebuffer */ |
| 377 | fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8); | 362 | fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8); |
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c index 4dd0580f96fd..01f9ace068e2 100644 --- a/drivers/video/wm8505fb.c +++ b/drivers/video/wm8505fb.c | |||
| @@ -14,25 +14,25 @@ | |||
| 14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <linux/module.h> | ||
| 18 | #include <linux/kernel.h> | ||
| 19 | #include <linux/errno.h> | ||
| 20 | #include <linux/string.h> | ||
| 21 | #include <linux/mm.h> | ||
| 22 | #include <linux/slab.h> | ||
| 23 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
| 18 | #include <linux/dma-mapping.h> | ||
| 24 | #include <linux/fb.h> | 19 | #include <linux/fb.h> |
| 20 | #include <linux/errno.h> | ||
| 21 | #include <linux/err.h> | ||
| 25 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 26 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
| 27 | #include <linux/io.h> | 24 | #include <linux/io.h> |
| 28 | #include <linux/dma-mapping.h> | 25 | #include <linux/kernel.h> |
| 29 | #include <linux/platform_device.h> | 26 | #include <linux/memblock.h> |
| 30 | #include <linux/wait.h> | 27 | #include <linux/mm.h> |
| 28 | #include <linux/module.h> | ||
| 31 | #include <linux/of.h> | 29 | #include <linux/of.h> |
| 32 | #include <linux/of_fdt.h> | 30 | #include <linux/of_fdt.h> |
| 33 | #include <linux/memblock.h> | 31 | #include <linux/platform_device.h> |
| 34 | 32 | #include <linux/slab.h> | |
| 35 | #include <linux/platform_data/video-vt8500lcdfb.h> | 33 | #include <linux/string.h> |
| 34 | #include <linux/wait.h> | ||
| 35 | #include <video/of_display_timing.h> | ||
| 36 | 36 | ||
| 37 | #include "wm8505fb_regs.h" | 37 | #include "wm8505fb_regs.h" |
| 38 | #include "wmt_ge_rops.h" | 38 | #include "wmt_ge_rops.h" |
| @@ -263,26 +263,22 @@ static struct fb_ops wm8505fb_ops = { | |||
| 263 | static int wm8505fb_probe(struct platform_device *pdev) | 263 | static int wm8505fb_probe(struct platform_device *pdev) |
| 264 | { | 264 | { |
| 265 | struct wm8505fb_info *fbi; | 265 | struct wm8505fb_info *fbi; |
| 266 | struct resource *res; | 266 | struct resource *res; |
| 267 | struct display_timings *disp_timing; | ||
| 267 | void *addr; | 268 | void *addr; |
| 268 | int ret; | 269 | int ret; |
| 269 | 270 | ||
| 270 | struct fb_videomode of_mode; | 271 | struct fb_videomode mode; |
| 271 | struct device_node *np; | ||
| 272 | u32 bpp; | 272 | u32 bpp; |
| 273 | dma_addr_t fb_mem_phys; | 273 | dma_addr_t fb_mem_phys; |
| 274 | unsigned long fb_mem_len; | 274 | unsigned long fb_mem_len; |
| 275 | void *fb_mem_virt; | 275 | void *fb_mem_virt; |
| 276 | 276 | ||
| 277 | ret = -ENOMEM; | ||
| 278 | fbi = NULL; | ||
| 279 | |||
| 280 | fbi = devm_kzalloc(&pdev->dev, sizeof(struct wm8505fb_info) + | 277 | fbi = devm_kzalloc(&pdev->dev, sizeof(struct wm8505fb_info) + |
| 281 | sizeof(u32) * 16, GFP_KERNEL); | 278 | sizeof(u32) * 16, GFP_KERNEL); |
| 282 | if (!fbi) { | 279 | if (!fbi) { |
| 283 | dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); | 280 | dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); |
| 284 | ret = -ENOMEM; | 281 | return -ENOMEM; |
| 285 | goto failed; | ||
| 286 | } | 282 | } |
| 287 | 283 | ||
| 288 | strcpy(fbi->fb.fix.id, DRIVER_NAME); | 284 | strcpy(fbi->fb.fix.id, DRIVER_NAME); |
| @@ -308,54 +304,23 @@ static int wm8505fb_probe(struct platform_device *pdev) | |||
| 308 | fbi->fb.pseudo_palette = addr; | 304 | fbi->fb.pseudo_palette = addr; |
| 309 | 305 | ||
| 310 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 306 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 311 | if (res == NULL) { | 307 | fbi->regbase = devm_ioremap_resource(&pdev->dev, res); |
| 312 | dev_err(&pdev->dev, "no I/O memory resource defined\n"); | 308 | if (IS_ERR(fbi->regbase)) |
| 313 | ret = -ENODEV; | 309 | return PTR_ERR(fbi->regbase); |
| 314 | goto failed_fbi; | ||
| 315 | } | ||
| 316 | 310 | ||
| 317 | res = request_mem_region(res->start, resource_size(res), DRIVER_NAME); | 311 | disp_timing = of_get_display_timings(pdev->dev.of_node); |
| 318 | if (res == NULL) { | 312 | if (!disp_timing) |
| 319 | dev_err(&pdev->dev, "failed to request I/O memory\n"); | 313 | return -EINVAL; |
| 320 | ret = -EBUSY; | ||
| 321 | goto failed_fbi; | ||
| 322 | } | ||
| 323 | |||
| 324 | fbi->regbase = ioremap(res->start, resource_size(res)); | ||
| 325 | if (fbi->regbase == NULL) { | ||
| 326 | dev_err(&pdev->dev, "failed to map I/O memory\n"); | ||
| 327 | ret = -EBUSY; | ||
| 328 | goto failed_free_res; | ||
| 329 | } | ||
| 330 | 314 | ||
| 331 | np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0); | 315 | ret = of_get_fb_videomode(pdev->dev.of_node, &mode, OF_USE_NATIVE_MODE); |
| 332 | if (!np) { | 316 | if (ret) |
| 333 | pr_err("%s: No display description in Device Tree\n", __func__); | 317 | return ret; |
| 334 | ret = -EINVAL; | ||
| 335 | goto failed_free_res; | ||
| 336 | } | ||
| 337 | 318 | ||
| 338 | /* | 319 | ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp); |
| 339 | * This code is copied from Sascha Hauer's of_videomode helper | 320 | if (ret) |
| 340 | * and can be replaced with a call to the helper once mainlined | 321 | return ret; |
| 341 | */ | ||
| 342 | ret = 0; | ||
| 343 | ret |= of_property_read_u32(np, "hactive", &of_mode.xres); | ||
| 344 | ret |= of_property_read_u32(np, "vactive", &of_mode.yres); | ||
| 345 | ret |= of_property_read_u32(np, "hback-porch", &of_mode.left_margin); | ||
| 346 | ret |= of_property_read_u32(np, "hfront-porch", &of_mode.right_margin); | ||
| 347 | ret |= of_property_read_u32(np, "hsync-len", &of_mode.hsync_len); | ||
| 348 | ret |= of_property_read_u32(np, "vback-porch", &of_mode.upper_margin); | ||
| 349 | ret |= of_property_read_u32(np, "vfront-porch", &of_mode.lower_margin); | ||
| 350 | ret |= of_property_read_u32(np, "vsync-len", &of_mode.vsync_len); | ||
| 351 | ret |= of_property_read_u32(np, "bpp", &bpp); | ||
| 352 | if (ret) { | ||
| 353 | pr_err("%s: Unable to read display properties\n", __func__); | ||
| 354 | goto failed_free_res; | ||
| 355 | } | ||
| 356 | 322 | ||
| 357 | of_mode.vmode = FB_VMODE_NONINTERLACED; | 323 | fb_videomode_to_var(&fbi->fb.var, &mode); |
| 358 | fb_videomode_to_var(&fbi->fb.var, &of_mode); | ||
| 359 | 324 | ||
| 360 | fbi->fb.var.nonstd = 0; | 325 | fbi->fb.var.nonstd = 0; |
| 361 | fbi->fb.var.activate = FB_ACTIVATE_NOW; | 326 | fbi->fb.var.activate = FB_ACTIVATE_NOW; |
| @@ -364,16 +329,16 @@ static int wm8505fb_probe(struct platform_device *pdev) | |||
| 364 | fbi->fb.var.width = -1; | 329 | fbi->fb.var.width = -1; |
| 365 | 330 | ||
| 366 | /* try allocating the framebuffer */ | 331 | /* try allocating the framebuffer */ |
| 367 | fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8); | 332 | fb_mem_len = mode.xres * mode.yres * 2 * (bpp / 8); |
| 368 | fb_mem_virt = dma_alloc_coherent(&pdev->dev, fb_mem_len, &fb_mem_phys, | 333 | fb_mem_virt = dmam_alloc_coherent(&pdev->dev, fb_mem_len, &fb_mem_phys, |
| 369 | GFP_KERNEL); | 334 | GFP_KERNEL); |
| 370 | if (!fb_mem_virt) { | 335 | if (!fb_mem_virt) { |
| 371 | pr_err("%s: Failed to allocate framebuffer\n", __func__); | 336 | pr_err("%s: Failed to allocate framebuffer\n", __func__); |
| 372 | return -ENOMEM; | 337 | return -ENOMEM; |
| 373 | }; | 338 | } |
| 374 | 339 | ||
| 375 | fbi->fb.var.xres_virtual = of_mode.xres; | 340 | fbi->fb.var.xres_virtual = mode.xres; |
| 376 | fbi->fb.var.yres_virtual = of_mode.yres * 2; | 341 | fbi->fb.var.yres_virtual = mode.yres * 2; |
| 377 | fbi->fb.var.bits_per_pixel = bpp; | 342 | fbi->fb.var.bits_per_pixel = bpp; |
| 378 | 343 | ||
| 379 | fbi->fb.fix.smem_start = fb_mem_phys; | 344 | fbi->fb.fix.smem_start = fb_mem_phys; |
| @@ -381,28 +346,29 @@ static int wm8505fb_probe(struct platform_device *pdev) | |||
| 381 | fbi->fb.screen_base = fb_mem_virt; | 346 | fbi->fb.screen_base = fb_mem_virt; |
| 382 | fbi->fb.screen_size = fb_mem_len; | 347 | fbi->fb.screen_size = fb_mem_len; |
| 383 | 348 | ||
| 349 | fbi->contrast = 0x10; | ||
| 350 | ret = wm8505fb_set_par(&fbi->fb); | ||
| 351 | if (ret) { | ||
| 352 | dev_err(&pdev->dev, "Failed to set parameters\n"); | ||
| 353 | return ret; | ||
| 354 | } | ||
| 355 | |||
| 384 | if (fb_alloc_cmap(&fbi->fb.cmap, 256, 0) < 0) { | 356 | if (fb_alloc_cmap(&fbi->fb.cmap, 256, 0) < 0) { |
| 385 | dev_err(&pdev->dev, "Failed to allocate color map\n"); | 357 | dev_err(&pdev->dev, "Failed to allocate color map\n"); |
| 386 | ret = -ENOMEM; | 358 | return -ENOMEM; |
| 387 | goto failed_free_io; | ||
| 388 | } | 359 | } |
| 389 | 360 | ||
| 390 | wm8505fb_init_hw(&fbi->fb); | 361 | wm8505fb_init_hw(&fbi->fb); |
| 391 | 362 | ||
| 392 | fbi->contrast = 0x80; | ||
| 393 | ret = wm8505fb_set_par(&fbi->fb); | ||
| 394 | if (ret) { | ||
| 395 | dev_err(&pdev->dev, "Failed to set parameters\n"); | ||
| 396 | goto failed_free_cmap; | ||
| 397 | } | ||
| 398 | |||
| 399 | platform_set_drvdata(pdev, fbi); | 363 | platform_set_drvdata(pdev, fbi); |
| 400 | 364 | ||
| 401 | ret = register_framebuffer(&fbi->fb); | 365 | ret = register_framebuffer(&fbi->fb); |
| 402 | if (ret < 0) { | 366 | if (ret < 0) { |
| 403 | dev_err(&pdev->dev, | 367 | dev_err(&pdev->dev, |
| 404 | "Failed to register framebuffer device: %d\n", ret); | 368 | "Failed to register framebuffer device: %d\n", ret); |
| 405 | goto failed_free_cmap; | 369 | if (fbi->fb.cmap.len) |
| 370 | fb_dealloc_cmap(&fbi->fb.cmap); | ||
| 371 | return ret; | ||
| 406 | } | 372 | } |
| 407 | 373 | ||
| 408 | ret = device_create_file(&pdev->dev, &dev_attr_contrast); | 374 | ret = device_create_file(&pdev->dev, &dev_attr_contrast); |
| @@ -416,25 +382,11 @@ static int wm8505fb_probe(struct platform_device *pdev) | |||
| 416 | fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1); | 382 | fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1); |
| 417 | 383 | ||
| 418 | return 0; | 384 | return 0; |
| 419 | |||
| 420 | failed_free_cmap: | ||
| 421 | if (fbi->fb.cmap.len) | ||
| 422 | fb_dealloc_cmap(&fbi->fb.cmap); | ||
| 423 | failed_free_io: | ||
| 424 | iounmap(fbi->regbase); | ||
| 425 | failed_free_res: | ||
| 426 | release_mem_region(res->start, resource_size(res)); | ||
| 427 | failed_fbi: | ||
| 428 | platform_set_drvdata(pdev, NULL); | ||
| 429 | kfree(fbi); | ||
| 430 | failed: | ||
| 431 | return ret; | ||
| 432 | } | 385 | } |
| 433 | 386 | ||
| 434 | static int wm8505fb_remove(struct platform_device *pdev) | 387 | static int wm8505fb_remove(struct platform_device *pdev) |
| 435 | { | 388 | { |
| 436 | struct wm8505fb_info *fbi = platform_get_drvdata(pdev); | 389 | struct wm8505fb_info *fbi = platform_get_drvdata(pdev); |
| 437 | struct resource *res; | ||
| 438 | 390 | ||
| 439 | device_remove_file(&pdev->dev, &dev_attr_contrast); | 391 | device_remove_file(&pdev->dev, &dev_attr_contrast); |
| 440 | 392 | ||
| @@ -445,13 +397,6 @@ static int wm8505fb_remove(struct platform_device *pdev) | |||
| 445 | if (fbi->fb.cmap.len) | 397 | if (fbi->fb.cmap.len) |
| 446 | fb_dealloc_cmap(&fbi->fb.cmap); | 398 | fb_dealloc_cmap(&fbi->fb.cmap); |
| 447 | 399 | ||
| 448 | iounmap(fbi->regbase); | ||
| 449 | |||
| 450 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 451 | release_mem_region(res->start, resource_size(res)); | ||
| 452 | |||
| 453 | kfree(fbi); | ||
| 454 | |||
| 455 | return 0; | 400 | return 0; |
| 456 | } | 401 | } |
| 457 | 402 | ||
diff --git a/drivers/video/wmt_ge_rops.h b/drivers/video/wmt_ge_rops.h index 87380751a443..f73ec6377a46 100644 --- a/drivers/video/wmt_ge_rops.h +++ b/drivers/video/wmt_ge_rops.h | |||
| @@ -1,5 +1,28 @@ | |||
| 1 | #ifdef CONFIG_FB_WMT_GE_ROPS | ||
| 2 | |||
| 1 | extern void wmt_ge_fillrect(struct fb_info *info, | 3 | extern void wmt_ge_fillrect(struct fb_info *info, |
| 2 | const struct fb_fillrect *rect); | 4 | const struct fb_fillrect *rect); |
| 3 | extern void wmt_ge_copyarea(struct fb_info *info, | 5 | extern void wmt_ge_copyarea(struct fb_info *info, |
| 4 | const struct fb_copyarea *area); | 6 | const struct fb_copyarea *area); |
| 5 | extern int wmt_ge_sync(struct fb_info *info); | 7 | extern int wmt_ge_sync(struct fb_info *info); |
| 8 | |||
| 9 | #else | ||
| 10 | |||
| 11 | static inline int wmt_ge_sync(struct fb_info *p) | ||
| 12 | { | ||
| 13 | return 0; | ||
| 14 | } | ||
| 15 | |||
| 16 | static inline void wmt_ge_fillrect(struct fb_info *p, | ||
| 17 | const struct fb_fillrect *rect) | ||
| 18 | { | ||
| 19 | sys_fillrect(p, rect); | ||
| 20 | } | ||
| 21 | |||
| 22 | static inline void wmt_ge_copyarea(struct fb_info *p, | ||
| 23 | const struct fb_copyarea *area) | ||
| 24 | { | ||
| 25 | sys_copyarea(p, area); | ||
| 26 | } | ||
| 27 | |||
| 28 | #endif | ||
diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h deleted file mode 100644 index 7f399c370fe0..000000000000 --- a/include/linux/platform_data/video-vt8500lcdfb.h +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * VT8500/WM8505 Frame Buffer platform data definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com> | ||
| 5 | * | ||
| 6 | * This software is licensed under the terms of the GNU General Public | ||
| 7 | * License version 2, as published by the Free Software Foundation, and | ||
| 8 | * may be copied, distributed, and modified under those terms. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _VT8500FB_H | ||
| 17 | #define _VT8500FB_H | ||
| 18 | |||
| 19 | #include <linux/fb.h> | ||
| 20 | |||
| 21 | struct vt8500fb_platform_data { | ||
| 22 | struct fb_videomode mode; | ||
| 23 | u32 xres_virtual; | ||
| 24 | u32 yres_virtual; | ||
| 25 | u32 bpp; | ||
| 26 | unsigned long video_mem_phys; | ||
| 27 | void *video_mem_virt; | ||
| 28 | unsigned long video_mem_len; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif /* _VT8500FB_H */ | ||
diff --git a/include/linux/platform_data/video_s3c.h b/include/linux/platform_data/video_s3c.h new file mode 100644 index 000000000000..48883995f47f --- /dev/null +++ b/include/linux/platform_data/video_s3c.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #ifndef __PLATFORM_DATA_VIDEO_S3C | ||
| 2 | #define __PLATFORM_DATA_VIDEO_S3C | ||
| 3 | |||
| 4 | /* S3C_FB_MAX_WIN | ||
| 5 | * Set to the maximum number of windows that any of the supported hardware | ||
| 6 | * can use. Since the platform data uses this for an array size, having it | ||
| 7 | * set to the maximum of any version of the hardware can do is safe. | ||
| 8 | */ | ||
| 9 | #define S3C_FB_MAX_WIN (5) | ||
| 10 | |||
| 11 | /** | ||
| 12 | * struct s3c_fb_pd_win - per window setup data | ||
| 13 | * @xres : The window X size. | ||
| 14 | * @yres : The window Y size. | ||
| 15 | * @virtual_x: The virtual X size. | ||
| 16 | * @virtual_y: The virtual Y size. | ||
| 17 | */ | ||
| 18 | struct s3c_fb_pd_win { | ||
| 19 | unsigned short default_bpp; | ||
| 20 | unsigned short max_bpp; | ||
| 21 | unsigned short xres; | ||
| 22 | unsigned short yres; | ||
| 23 | unsigned short virtual_x; | ||
| 24 | unsigned short virtual_y; | ||
| 25 | }; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * struct s3c_fb_platdata - S3C driver platform specific information | ||
| 29 | * @setup_gpio: Setup the external GPIO pins to the right state to transfer | ||
| 30 | * the data from the display system to the connected display | ||
| 31 | * device. | ||
| 32 | * @vidcon0: The base vidcon0 values to control the panel data format. | ||
| 33 | * @vidcon1: The base vidcon1 values to control the panel data output. | ||
| 34 | * @vtiming: Video timing when connected to a RGB type panel. | ||
| 35 | * @win: The setup data for each hardware window, or NULL for unused. | ||
| 36 | * @display_mode: The LCD output display mode. | ||
| 37 | * | ||
| 38 | * The platform data supplies the video driver with all the information | ||
| 39 | * it requires to work with the display(s) attached to the machine. It | ||
| 40 | * controls the initial mode, the number of display windows (0 is always | ||
| 41 | * the base framebuffer) that are initialised etc. | ||
| 42 | * | ||
| 43 | */ | ||
| 44 | struct s3c_fb_platdata { | ||
| 45 | void (*setup_gpio)(void); | ||
| 46 | |||
| 47 | struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN]; | ||
| 48 | struct fb_videomode *vtiming; | ||
| 49 | |||
| 50 | u32 vidcon0; | ||
| 51 | u32 vidcon1; | ||
| 52 | }; | ||
| 53 | |||
| 54 | #endif | ||
diff --git a/include/video/display_timing.h b/include/video/display_timing.h index 71e9a383a981..5d0259b08e01 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h | |||
| @@ -12,19 +12,22 @@ | |||
| 12 | #include <linux/bitops.h> | 12 | #include <linux/bitops.h> |
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | 14 | ||
| 15 | /* VESA display monitor timing parameters */ | 15 | enum display_flags { |
| 16 | #define VESA_DMT_HSYNC_LOW BIT(0) | 16 | DISPLAY_FLAGS_HSYNC_LOW = BIT(0), |
| 17 | #define VESA_DMT_HSYNC_HIGH BIT(1) | 17 | DISPLAY_FLAGS_HSYNC_HIGH = BIT(1), |
| 18 | #define VESA_DMT_VSYNC_LOW BIT(2) | 18 | DISPLAY_FLAGS_VSYNC_LOW = BIT(2), |
| 19 | #define VESA_DMT_VSYNC_HIGH BIT(3) | 19 | DISPLAY_FLAGS_VSYNC_HIGH = BIT(3), |
| 20 | 20 | ||
| 21 | /* display specific flags */ | 21 | /* data enable flag */ |
| 22 | #define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */ | 22 | DISPLAY_FLAGS_DE_LOW = BIT(4), |
| 23 | #define DISPLAY_FLAGS_DE_HIGH BIT(1) | 23 | DISPLAY_FLAGS_DE_HIGH = BIT(5), |
| 24 | #define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */ | 24 | /* drive data on pos. edge */ |
| 25 | #define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */ | 25 | DISPLAY_FLAGS_PIXDATA_POSEDGE = BIT(6), |
| 26 | #define DISPLAY_FLAGS_INTERLACED BIT(4) | 26 | /* drive data on neg. edge */ |
| 27 | #define DISPLAY_FLAGS_DOUBLESCAN BIT(5) | 27 | DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7), |
| 28 | DISPLAY_FLAGS_INTERLACED = BIT(8), | ||
| 29 | DISPLAY_FLAGS_DOUBLESCAN = BIT(9), | ||
| 30 | }; | ||
| 28 | 31 | ||
| 29 | /* | 32 | /* |
| 30 | * A single signal can be specified via a range of minimal and maximal values | 33 | * A single signal can be specified via a range of minimal and maximal values |
| @@ -36,12 +39,6 @@ struct timing_entry { | |||
| 36 | u32 max; | 39 | u32 max; |
| 37 | }; | 40 | }; |
| 38 | 41 | ||
| 39 | enum timing_entry_index { | ||
| 40 | TE_MIN = 0, | ||
| 41 | TE_TYP = 1, | ||
| 42 | TE_MAX = 2, | ||
| 43 | }; | ||
| 44 | |||
| 45 | /* | 42 | /* |
| 46 | * Single "mode" entry. This describes one set of signal timings a display can | 43 | * Single "mode" entry. This describes one set of signal timings a display can |
| 47 | * have in one setting. This struct can later be converted to struct videomode | 44 | * have in one setting. This struct can later be converted to struct videomode |
| @@ -72,8 +69,7 @@ struct display_timing { | |||
| 72 | struct timing_entry vback_porch; /* ver. back porch */ | 69 | struct timing_entry vback_porch; /* ver. back porch */ |
| 73 | struct timing_entry vsync_len; /* ver. sync len */ | 70 | struct timing_entry vsync_len; /* ver. sync len */ |
| 74 | 71 | ||
| 75 | unsigned int dmt_flags; /* VESA DMT flags */ | 72 | enum display_flags flags; /* display flags */ |
| 76 | unsigned int data_flags; /* video data flags */ | ||
| 77 | }; | 73 | }; |
| 78 | 74 | ||
| 79 | /* | 75 | /* |
| @@ -89,25 +85,6 @@ struct display_timings { | |||
| 89 | struct display_timing **timings; | 85 | struct display_timing **timings; |
| 90 | }; | 86 | }; |
| 91 | 87 | ||
| 92 | /* get value specified by index from struct timing_entry */ | ||
| 93 | static inline u32 display_timing_get_value(const struct timing_entry *te, | ||
| 94 | enum timing_entry_index index) | ||
| 95 | { | ||
| 96 | switch (index) { | ||
| 97 | case TE_MIN: | ||
| 98 | return te->min; | ||
| 99 | break; | ||
| 100 | case TE_TYP: | ||
| 101 | return te->typ; | ||
| 102 | break; | ||
| 103 | case TE_MAX: | ||
| 104 | return te->max; | ||
| 105 | break; | ||
| 106 | default: | ||
| 107 | return te->typ; | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 111 | /* get one entry from struct display_timings */ | 88 | /* get one entry from struct display_timings */ |
| 112 | static inline struct display_timing *display_timings_get(const struct | 89 | static inline struct display_timing *display_timings_get(const struct |
| 113 | display_timings *disp, | 90 | display_timings *disp, |
diff --git a/include/video/videomode.h b/include/video/videomode.h index a42156234dd4..3f1049d870d5 100644 --- a/include/video/videomode.h +++ b/include/video/videomode.h | |||
| @@ -29,20 +29,30 @@ struct videomode { | |||
| 29 | u32 vback_porch; | 29 | u32 vback_porch; |
| 30 | u32 vsync_len; | 30 | u32 vsync_len; |
| 31 | 31 | ||
| 32 | unsigned int dmt_flags; /* VESA DMT flags */ | 32 | enum display_flags flags; /* display flags */ |
| 33 | unsigned int data_flags; /* video data flags */ | ||
| 34 | }; | 33 | }; |
| 35 | 34 | ||
| 36 | /** | 35 | /** |
| 37 | * videomode_from_timing - convert display timing to videomode | 36 | * videomode_from_timing - convert display timing to videomode |
| 37 | * @dt: display_timing structure | ||
| 38 | * @vm: return value | ||
| 39 | * | ||
| 40 | * DESCRIPTION: | ||
| 41 | * This function converts a struct display_timing to a struct videomode. | ||
| 42 | */ | ||
| 43 | void videomode_from_timing(const struct display_timing *dt, | ||
| 44 | struct videomode *vm); | ||
| 45 | |||
| 46 | /** | ||
| 47 | * videomode_from_timings - convert one display timings entry to videomode | ||
| 38 | * @disp: structure with all possible timing entries | 48 | * @disp: structure with all possible timing entries |
| 39 | * @vm: return value | 49 | * @vm: return value |
| 40 | * @index: index into the list of display timings in devicetree | 50 | * @index: index into the list of display timings in devicetree |
| 41 | * | 51 | * |
| 42 | * DESCRIPTION: | 52 | * DESCRIPTION: |
| 43 | * This function converts a struct display_timing to a struct videomode. | 53 | * This function converts one struct display_timing entry to a struct videomode. |
| 44 | */ | 54 | */ |
| 45 | int videomode_from_timing(const struct display_timings *disp, | 55 | int videomode_from_timings(const struct display_timings *disp, |
| 46 | struct videomode *vm, unsigned int index); | 56 | struct videomode *vm, unsigned int index); |
| 47 | 57 | ||
| 48 | #endif | 58 | #endif |
