-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'fbdev-4.6' of git://git.kernel.org/pub/scm/linux/kernel/gi…
…t/tomba/linux Pull fbdev updates from Tomi Valkeinen: - Miscallaneous small fixes to various fbdev drivers - Remove fb_rotate, which was never used - pmag fb improvements * tag 'fbdev-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (21 commits) xen kconfig: don't "select INPUT_XEN_KBDDEV_FRONTEND" video: fbdev: sis: remove unused variable drivers/video: make fbdev/sunxvr2500.c explicitly non-modular drivers/video: make fbdev/sunxvr1000.c explicitly non-modular drivers/video: make fbdev/sunxvr500.c explicitly non-modular video: exynos: fix modular build fbdev: da8xx-fb: fix videomodes of lcd panels fbdev: kill fb_rotate video: fbdev: bt431: Correct cursor format control macro video: fbdev: pmag-ba-fb: Optimize Bt455 colormap addressing video: fbdev: pmag-ba-fb: Fix and rework Bt455 colormap handling video: fbdev: bt455: Remove unneeded colormap helpers for cursor support video: fbdev: pmag-aa-fb: Report video timings video: fbdev: pmag-aa-fb: Enable building as a module video: fbdev: pmag-aa-fb: Adapt to current APIs video: fbdev: pmag-ba-fb: Fix the lower margin size fbdev: sh_mobile_lcdc: Use ARCH_RENESAS fbdev: n411: check return value fbdev: exynos: fix IS_ERR_VALUE usage video: Use bool instead int pointer for get_opt_bool() argument ...
- Loading branch information
Showing
22 changed files
with
310 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,16 @@ | |
* linux/drivers/video/bt431.h | ||
* | ||
* Copyright 2003 Thiemo Seufer <[email protected]> | ||
* Copyright 2016 Maciej W. Rozycki <[email protected]> | ||
* | ||
* This file is subject to the terms and conditions of the GNU General | ||
* Public License. See the file COPYING in the main directory of this | ||
* archive for more details. | ||
*/ | ||
#include <linux/types.h> | ||
|
||
#define BT431_CURSOR_SIZE 64 | ||
|
||
/* | ||
* Bt431 cursor generator registers, 32-bit aligned. | ||
* Two twin Bt431 are used on the DECstation's PMAG-AA. | ||
|
@@ -60,7 +63,7 @@ static inline u8 bt431_get_value(u16 val) | |
#define BT431_CMD_CURS_ENABLE 0x40 | ||
#define BT431_CMD_XHAIR_ENABLE 0x20 | ||
#define BT431_CMD_OR_CURSORS 0x10 | ||
#define BT431_CMD_AND_CURSORS 0x00 | ||
#define BT431_CMD_XOR_CURSORS 0x00 | ||
#define BT431_CMD_1_1_MUX 0x00 | ||
#define BT431_CMD_4_1_MUX 0x04 | ||
#define BT431_CMD_5_1_MUX 0x08 | ||
|
@@ -196,28 +199,30 @@ static inline void bt431_position_cursor(struct bt431_regs *regs, u16 x, u16 y) | |
bt431_write_reg_inc(regs, (y >> 8) & 0x0f); /* BT431_REG_CYHI */ | ||
} | ||
|
||
static inline void bt431_set_font(struct bt431_regs *regs, u8 fgc, | ||
u16 width, u16 height) | ||
static inline void bt431_set_cursor(struct bt431_regs *regs, | ||
const char *data, const char *mask, | ||
u16 rop, u16 width, u16 height) | ||
{ | ||
u16 x, y; | ||
int i; | ||
u16 fgp = fgc ? 0xffff : 0x0000; | ||
u16 bgp = fgc ? 0x0000 : 0xffff; | ||
|
||
i = 0; | ||
width = DIV_ROUND_UP(width, 8); | ||
bt431_select_reg(regs, BT431_REG_CRAM_BASE); | ||
for (i = BT431_REG_CRAM_BASE; i <= BT431_REG_CRAM_END; i++) { | ||
u16 value; | ||
|
||
if (height << 6 <= i << 3) | ||
value = bgp; | ||
else if (width <= i % 8 << 3) | ||
value = bgp; | ||
else if (((width >> 3) & 0xffff) > i % 8) | ||
value = fgp; | ||
else | ||
value = fgp & ~(bgp << (width % 8 << 1)); | ||
|
||
bt431_write_cmap_inc(regs, value); | ||
} | ||
for (y = 0; y < BT431_CURSOR_SIZE; y++) | ||
for (x = 0; x < BT431_CURSOR_SIZE / 8; x++) { | ||
u16 val = 0; | ||
|
||
if (y < height && x < width) { | ||
val = mask[i]; | ||
if (rop == ROP_XOR) | ||
val = (val << 8) | (val ^ data[i]); | ||
else | ||
val = (val << 8) | (val & data[i]); | ||
i++; | ||
} | ||
bt431_write_cmap_inc(regs, val); | ||
} | ||
} | ||
|
||
static inline void bt431_init_cursor(struct bt431_regs *regs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
* linux/drivers/video/bt455.h | ||
* | ||
* Copyright 2003 Thiemo Seufer <[email protected]> | ||
* Copyright 2016 Maciej W. Rozycki <[email protected]> | ||
* | ||
* This file is subject to the terms and conditions of the GNU General | ||
* Public License. See the file COPYING in the main directory of this | ||
|
@@ -29,66 +30,61 @@ static inline void bt455_select_reg(struct bt455_regs *regs, int ir) | |
regs->addr_cmap = ir & 0x0f; | ||
} | ||
|
||
static inline void bt455_reset_reg(struct bt455_regs *regs) | ||
{ | ||
mb(); | ||
regs->addr_clr = 0; | ||
} | ||
|
||
/* | ||
* Read/write to a Bt455 color map register. | ||
*/ | ||
static inline void bt455_read_cmap_entry(struct bt455_regs *regs, int cr, | ||
u8* red, u8* green, u8* blue) | ||
static inline void bt455_read_cmap_next(struct bt455_regs *regs, u8 *grey) | ||
{ | ||
bt455_select_reg(regs, cr); | ||
mb(); | ||
*red = regs->addr_cmap_data & 0x0f; | ||
regs->addr_cmap_data; | ||
rmb(); | ||
*green = regs->addr_cmap_data & 0x0f; | ||
*grey = regs->addr_cmap_data & 0xf; | ||
rmb(); | ||
*blue = regs->addr_cmap_data & 0x0f; | ||
regs->addr_cmap_data; | ||
} | ||
|
||
static inline void bt455_write_cmap_entry(struct bt455_regs *regs, int cr, | ||
u8 red, u8 green, u8 blue) | ||
static inline void bt455_write_cmap_next(struct bt455_regs *regs, u8 grey) | ||
{ | ||
bt455_select_reg(regs, cr); | ||
wmb(); | ||
regs->addr_cmap_data = red & 0x0f; | ||
regs->addr_cmap_data = 0x0; | ||
wmb(); | ||
regs->addr_cmap_data = green & 0x0f; | ||
regs->addr_cmap_data = grey & 0xf; | ||
wmb(); | ||
regs->addr_cmap_data = blue & 0x0f; | ||
regs->addr_cmap_data = 0x0; | ||
} | ||
|
||
static inline void bt455_write_ovly_entry(struct bt455_regs *regs, int cr, | ||
u8 red, u8 green, u8 blue) | ||
static inline void bt455_write_ovly_next(struct bt455_regs *regs, u8 grey) | ||
{ | ||
bt455_select_reg(regs, cr); | ||
wmb(); | ||
regs->addr_ovly = red & 0x0f; | ||
regs->addr_ovly = 0x0; | ||
wmb(); | ||
regs->addr_ovly = green & 0x0f; | ||
regs->addr_ovly = grey & 0xf; | ||
wmb(); | ||
regs->addr_ovly = blue & 0x0f; | ||
regs->addr_ovly = 0x0; | ||
} | ||
|
||
static inline void bt455_set_cursor(struct bt455_regs *regs) | ||
static inline void bt455_read_cmap_entry(struct bt455_regs *regs, | ||
int cr, u8 *grey) | ||
{ | ||
mb(); | ||
regs->addr_ovly = 0x0f; | ||
wmb(); | ||
regs->addr_ovly = 0x0f; | ||
wmb(); | ||
regs->addr_ovly = 0x0f; | ||
bt455_select_reg(regs, cr); | ||
bt455_read_cmap_next(regs, grey); | ||
} | ||
|
||
static inline void bt455_erase_cursor(struct bt455_regs *regs) | ||
static inline void bt455_write_cmap_entry(struct bt455_regs *regs, | ||
int cr, u8 grey) | ||
{ | ||
/* bt455_write_cmap_entry(regs, 8, 0x00, 0x00, 0x00); */ | ||
/* bt455_write_cmap_entry(regs, 9, 0x00, 0x00, 0x00); */ | ||
bt455_write_ovly_entry(regs, 8, 0x03, 0x03, 0x03); | ||
bt455_write_ovly_entry(regs, 9, 0x07, 0x07, 0x07); | ||
bt455_select_reg(regs, cr); | ||
bt455_write_cmap_next(regs, grey); | ||
} | ||
|
||
wmb(); | ||
regs->addr_ovly = 0x09; | ||
wmb(); | ||
regs->addr_ovly = 0x09; | ||
wmb(); | ||
regs->addr_ovly = 0x09; | ||
static inline void bt455_write_ovly_entry(struct bt455_regs *regs, u8 grey) | ||
{ | ||
bt455_reset_reg(regs); | ||
bt455_write_ovly_next(regs, grey); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.