/* * linux/drivers/video/bt431.h * * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> * Copyright 2016 Maciej W. Rozycki <macro@linux-mips.org> * * 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.
*/ struct bt431_regs { volatile u16 addr_lo;
u16 pad0; volatile u16 addr_hi;
u16 pad1; volatile u16 addr_cmap;
u16 pad2; volatile u16 addr_reg;
u16 pad3;
};
staticinlinevoid bt431_select_reg(struct bt431_regs *regs, int ir)
{ /* * The compiler splits the write in two bytes without these * helper variables.
*/ volatile u16 *lo = &(regs->addr_lo); volatile u16 *hi = &(regs->addr_hi);
/* Autoincrement read/write. */ staticinline u8 bt431_read_reg_inc(struct bt431_regs *regs)
{ /* * The compiler splits the write in two bytes without the * helper variable.
*/ volatile u16 *r = &(regs->addr_reg);
mb(); return bt431_get_value(*r);
}
staticinlinevoid bt431_write_reg_inc(struct bt431_regs *regs, u8 value)
{ /* * The compiler splits the write in two bytes without the * helper variable.
*/ volatile u16 *r = &(regs->addr_reg);
staticinlinevoid bt431_write_reg(struct bt431_regs *regs, int ir, u8 value)
{
bt431_select_reg(regs, ir);
bt431_write_reg_inc(regs, value);
}
/* Autoincremented read/write for the cursor map. */ staticinline u16 bt431_read_cmap_inc(struct bt431_regs *regs)
{ /* * The compiler splits the write in two bytes without the * helper variable.
*/ volatile u16 *r = &(regs->addr_cmap);
mb(); return *r;
}
staticinlinevoid bt431_write_cmap_inc(struct bt431_regs *regs, u16 value)
{ /* * The compiler splits the write in two bytes without the * helper variable.
*/ volatile u16 *r = &(regs->addr_cmap);
staticinlinevoid bt431_position_cursor(struct bt431_regs *regs, u16 x, u16 y)
{ /* * Magic from the MACH sources. * * Cx = x + D + H - P * P = 37 if 1:1, 52 if 4:1, 57 if 5:1 * D = pixel skew between outdata and external data * H = pixels between HSYNCH falling and active video * * Cy = y + V - 32 * V = scanlines between HSYNCH falling, two or more * clocks after VSYNCH falling, and active video
*/
x += 412 - 52;
y += 68 - 32;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.