Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

pm2fb.c File Reference

#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/malloc.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/fb.h>
#include <linux/selection.h>
#include <linux/console.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb8.h>
#include <video/fbcon-cfb16.h>
#include <video/fbcon-cfb24.h>
#include <video/fbcon-cfb32.h>
#include "pm2fb.h"
#include "cvisionppc.h"

Include dependency graph for pm2fb.c:

Go to the source code of this file.

Defines

#define DPRINTK(a, b...)
#define PICOS2KHZ(a)   (1000000000UL/(a))
#define KHZ2PICOS(a)   (1000000000UL/(a))
#define MMAP(a, b)   ioremap((unsigned long )(a), b)
#define UNMAP(a, b)   iounmap(a)
#define DEFW()   wmb()
#define DEFR()   rmb()
#define DEFRW()   mb()
#define MIN(a, b)   ((a)<(b)?(a):(b))
#define MAX(a, b)   ((a)>(b)?(a):(b))
#define OPTF_OLD_MEM   (1L<<0)
#define OPTF_YPAN   (1L<<1)
#define OPTF_VIRTUAL   (1L<<2)
#define OPTF_USER   (1L<<3)
#define DEFAULT_CURSOR_BLINK_RATE   (20)
#define CURSOR_DRAW_DELAY   (2)
#define pm2fb_cursor   NULL
#define pm2fb_set_font   NULL
#define PACKPP(p0, p1, p2)   (((p2)<<6)|((p1)<<3)|(p0))

Functions

static void pm2fb_detect (void)
static int pm2fb_encode_fix (struct fb_fix_screeninfo *fix, const void *par, struct fb_info_gen *info)
static int pm2fb_decode_var (const struct fb_var_screeninfo *var, void *par, struct fb_info_gen *info)
static int pm2fb_encode_var (struct fb_var_screeninfo *var, const void *par, struct fb_info_gen *info)
static void pm2fb_get_par (void *par, struct fb_info_gen *info)
static void pm2fb_set_par (const void *par, struct fb_info_gen *info)
static int pm2fb_getcolreg (unsigned regno, unsigned *red, unsigned *green, unsigned *blue, unsigned *transp, struct fb_info *info)
static int pm2fb_setcolreg (unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info)
static int pm2fb_blank (int blank_mode, struct fb_info_gen *info)
static int pm2fb_pan_display (const struct fb_var_screeninfo *var, struct fb_info_gen *info)
static void pm2fb_set_disp (const void *par, struct display *disp, struct fb_info_gen *info)
static int pm2fb_open (struct fb_info *info, int user)
static int pm2fb_release (struct fb_info *info, int user)
static u32 RD32 (unsigned char *base, s32 off)
static void WR32 (unsigned char *base, s32 off, u32 v)
static u32 pm2_RD (struct pm2fb_info *p, s32 off)
static void pm2_WR (struct pm2fb_info *p, s32 off, u32 v)
static u32 pm2_RDAC_RD (struct pm2fb_info *p, s32 idx)
static void pm2_RDAC_WR (struct pm2fb_info *p, s32 idx, u32 v)
static u32 pm2v_RDAC_RD (struct pm2fb_info *p, s32 idx)
static void pm2v_RDAC_WR (struct pm2fb_info *p, s32 idx, u32 v)
static void WAIT_FIFO (struct pm2fb_info *p, u32 a)
static u32 partprod (u32 xres)
static u32 to3264 (u32 timing, int bpp, int is64)
static u32 from3264 (u32 timing, int bpp, int is64)
static void pm2_mnp (u32 clk, unsigned char *mm, unsigned char *nn, unsigned char *pp)
static void pm2v_mnp (u32 clk, unsigned char *mm, unsigned char *nn, unsigned char *pp)
static void wait_pm2 (struct pm2fb_info *i)
static void pm2_set_memclock (struct pm2fb_info *info, u32 clk)
static void pm2_set_pixclock (struct pm2fb_info *info, u32 clk)
static void clear_palette (struct pm2fb_info *p)
static void set_color (struct pm2fb_info *p, unsigned char regno, unsigned char r, unsigned char g, unsigned char b)
static void set_aperture (struct pm2fb_info *i, struct pm2fb_par *p)
static void set_screen (struct pm2fb_info *i, struct pm2fb_par *p)
static void pm2fb_pp_copy (struct pm2fb_info *i, s32 xsrc, s32 ysrc, s32 x, s32 y, s32 w, s32 h)
static void pm2fb_block_op (struct pm2fb_info *i, int copy, s32 xsrc, s32 ysrc, s32 x, s32 y, s32 w, s32 h, u32 color)
static void pm2fb_reset (struct pm2fb_info *p)
 __initfunc (static int pm2fb_conf(struct pm2fb_info *p))
static void pm2fb_pp_bmove (struct display *p, int sy, int sx, int dy, int dx, int height, int width)
static void pm2fb_bmove (struct display *p, int sy, int sx, int dy, int dx, int height, int width)
static void set_user_mode (struct pm2fb_info *i)
void pm2fb_cleanup (struct fb_info *info)
int __init pm2fb_init (void)
static void __init pm2fb_mode_setup (char *options)
static void __init pm2fb_font_setup (char *options)
void __init pm2fb_setup (char *options, int *ints)

Variables

struct {
   char   font [40]
   u32   flags
   pm2fb_par   user_mode
pm2fb_options
static char curblink __initdata = 1
static const char permedia2_name [16] = "Permedia2"
static struct pm2fb_info fb_info
struct {
   int(*   detect )(struct pm2fb_info *)
   void(*   init )(struct pm2fb_info *)
   void(*   cleanup )(struct pm2fb_info *)
   char   name [32]
board_table []
struct {
   u16   width
   u16   pp
pp_table []
static struct fbgen_hwswitch pm2fb_hwswitch
static struct fb_ops pm2fb_ops


Define Documentation

#define CURSOR_DRAW_DELAY   (2)
 

Definition at line 209 of file pm2fb.c.

#define DEFAULT_CURSOR_BLINK_RATE   (20)
 

Definition at line 208 of file pm2fb.c.

 
#define DEFR  )     rmb()
 

Definition at line 85 of file pm2fb.c.

Referenced by pm2_set_memclock(), pm2_set_pixclock(), and wait_pm2().

 
#define DEFRW  )     mb()
 

Definition at line 86 of file pm2fb.c.

Referenced by pm2_RDAC_RD(), pm2_RDAC_WR(), pm2fb_reset(), pm2v_RDAC_RD(), pm2v_RDAC_WR(), set_screen(), WAIT_FIFO(), and wait_pm2().

 
#define DEFW  )     wmb()
 

Definition at line 84 of file pm2fb.c.

Referenced by clear_palette(), pm2_set_memclock(), pm2_set_pixclock(), pm2fb_block_op(), pm2fb_pp_copy(), set_color(), and set_screen().

#define DPRINTK a,
b...   ) 
 

Definition at line 67 of file pm2fb.c.

#define KHZ2PICOS a   )     (1000000000UL/(a))
 

Definition at line 71 of file pm2fb.c.

Referenced by pm2fb_encode_var().

#define MAX a,
 )     ((a)>(b)?(a):(b))
 

Definition at line 93 of file pm2fb.c.

#define MIN a,
 )     ((a)<(b)?(a):(b))
 

Definition at line 89 of file pm2fb.c.

#define MMAP a,
 )     ioremap((unsigned long )(a), b)
 

Definition at line 77 of file pm2fb.c.

Referenced by __initfunc().

#define OPTF_OLD_MEM   (1L<<0)
 

Definition at line 114 of file pm2fb.c.

Referenced by pm2fb_setup().

#define OPTF_USER   (1L<<3)
 

Definition at line 117 of file pm2fb.c.

Referenced by pm2fb_mode_setup().

#define OPTF_VIRTUAL   (1L<<2)
 

Definition at line 116 of file pm2fb.c.

Referenced by pm2fb_setup().

#define OPTF_YPAN   (1L<<1)
 

Definition at line 115 of file pm2fb.c.

Referenced by pm2fb_setup(), and set_user_mode().

#define PACKPP p0,
p1,
p2   )     (((p2)<<6)|((p1)<<3)|(p0))
 

Definition at line 331 of file pm2fb.c.

#define PICOS2KHZ a   )     (1000000000UL/(a))
 

Definition at line 70 of file pm2fb.c.

Referenced by pm2fb_decode_var().

#define pm2fb_cursor   NULL
 

Definition at line 295 of file pm2fb.c.

#define pm2fb_set_font   NULL
 

Definition at line 296 of file pm2fb.c.

#define UNMAP a,
 )     iounmap(a)
 

Definition at line 78 of file pm2fb.c.


Function Documentation

__initfunc static int   pm2fb_conf(struct pm2fb_info *p)  ) 
 

Definition at line 913 of file pm2fb.c.

References board_table, DPRINTK, MMAP, and PM2_REGS_SIZE.

static void clear_palette struct pm2fb_info p  )  [static]
 

Definition at line 636 of file pm2fb.c.

References DEFW, i, pm2_WR(), PM2R_RD_PALETTE_DATA, PM2R_RD_PALETTE_WRITE_ADDRESS, and WAIT_FIFO().

Referenced by pm2fb_reset().

Here is the call graph for this function:

static u32 from3264 u32  timing,
int  bpp,
int  is64
[static]
 

Definition at line 502 of file pm2fb.c.

Referenced by pm2fb_encode_var().

static u32 partprod u32  xres  )  [static]
 

Definition at line 473 of file pm2fb.c.

References DPRINTK, i, pp_table, and width.

Referenced by pm2fb_decode_var(), and set_screen().

static void pm2_mnp u32  clk,
unsigned char *  mm,
unsigned char *  nn,
unsigned char *  pp
[static]
 

Definition at line 522 of file pm2fb.c.

References curr, f, m, n, p, PM2_REFERENCE_CLOCK, s32, and u32.

Referenced by pm2_set_memclock(), and pm2_set_pixclock().

static u32 pm2_RD struct pm2fb_info p,
s32  off
[inline, static]
 

Definition at line 405 of file pm2fb.c.

References RD32(), and pm2fb_info::regions.

Referenced by pm2_RDAC_RD(), pm2_set_memclock(), pm2_set_pixclock(), pm2fb_reset(), pm2v_RDAC_RD(), WAIT_FIFO(), and wait_pm2().

Here is the call graph for this function:

static u32 pm2_RDAC_RD struct pm2fb_info p,
s32  idx
[inline, static]
 

Definition at line 415 of file pm2fb.c.

References DEFRW, index, pm2_RD(), PM2_TYPE_PERMEDIA2, PM2_TYPE_PERMEDIA2V, pm2_WR(), PM2R_RD_INDEXED_DATA, PM2R_RD_PALETTE_WRITE_ADDRESS, PM2VR_RD_INDEX_LOW, PM2VR_RD_INDEXED_DATA, pm2fb_info::type, and xff.

Referenced by pm2_set_memclock(), and pm2_set_pixclock().

Here is the call graph for this function:

static void pm2_RDAC_WR struct pm2fb_info p,
s32  idx,
u32  v
[inline, static]
 

Definition at line 431 of file pm2fb.c.

References DEFRW, index, PM2_TYPE_PERMEDIA2, PM2_TYPE_PERMEDIA2V, pm2_WR(), PM2R_RD_INDEXED_DATA, PM2R_RD_PALETTE_WRITE_ADDRESS, PM2VR_RD_INDEX_LOW, PM2VR_RD_INDEXED_DATA, pm2fb_info::type, and xff.

Referenced by pm2_set_memclock(), pm2_set_pixclock(), pm2fb_reset(), and set_screen().

Here is the call graph for this function:

static void pm2_set_memclock struct pm2fb_info info,
u32  clk
[static]
 

Definition at line 585 of file pm2fb.c.

References DEFR, DEFW, i, m, n, p, pm2_mnp(), pm2_RD(), pm2_RDAC_RD(), pm2_RDAC_WR(), PM2F_PLL_LOCKED, PM2I_RD_MEMORY_CLOCK_1, PM2I_RD_MEMORY_CLOCK_2, PM2I_RD_MEMORY_CLOCK_3, PM2I_RD_MEMORY_CLOCK_STATUS, PM2R_RD_INDEXED_DATA, and WAIT_FIFO().

Referenced by pm2fb_reset().

Here is the call graph for this function:

static void pm2_set_pixclock struct pm2fb_info info,
u32  clk
[static]
 

Definition at line 604 of file pm2fb.c.

References DEFR, DEFW, i, m, n, p, pm2_mnp(), pm2_RD(), pm2_RDAC_RD(), pm2_RDAC_WR(), PM2_TYPE_PERMEDIA2, PM2_TYPE_PERMEDIA2V, pm2_WR(), PM2F_PLL_LOCKED, PM2I_RD_PIXEL_CLOCK_A1, PM2I_RD_PIXEL_CLOCK_A2, PM2I_RD_PIXEL_CLOCK_A3, PM2I_RD_PIXEL_CLOCK_STATUS, PM2R_RD_INDEXED_DATA, pm2v_mnp(), pm2v_RDAC_WR(), PM2VI_RD_CLK0_FEEDBACK, PM2VI_RD_CLK0_POSTSCALE, PM2VI_RD_CLK0_PRESCALE, PM2VR_RD_INDEX_HIGH, pm2fb_info::type, and WAIT_FIFO().

Referenced by set_screen().

Here is the call graph for this function:

static void pm2_WR struct pm2fb_info p,
s32  off,
u32  v
[inline, static]
 

Definition at line 410 of file pm2fb.c.

References pm2fb_info::regions, and WR32().

Referenced by clear_palette(), pm2_RDAC_RD(), pm2_RDAC_WR(), pm2_set_pixclock(), pm2fb_blank(), pm2fb_block_op(), pm2fb_pan_display(), pm2fb_pp_copy(), pm2fb_reset(), pm2fb_set_par(), pm2v_RDAC_RD(), pm2v_RDAC_WR(), set_aperture(), set_color(), set_screen(), and wait_pm2().

Here is the call graph for this function:

static int pm2fb_blank int  blank_mode,
struct fb_info_gen *  info
[static]
 

Definition at line 1155 of file pm2fb.c.

References pm2fb_info::current_par, pm2fb_info::current_par_valid, pm2_WR(), PM2F_BLANK_LOW, PM2F_HSYNC_MASK, PM2F_VIDEO_ENABLE, PM2F_VSYNC_MASK, PM2R_VIDEO_CONTROL, u32, VESA_HSYNC_SUSPEND, VESA_NO_BLANKING, VESA_POWERDOWN, VESA_VSYNC_SUSPEND, pm2fb_par::video, and WAIT_FIFO().

Here is the call graph for this function:

static void pm2fb_block_op struct pm2fb_info i,
int  copy,
s32  xsrc,
s32  ysrc,
s32  x,
s32  y,
s32  w,
s32  h,
u32  color
[static]
 

Definition at line 812 of file pm2fb.c.

References DEFW, pm2_WR(), PM2F_CONFIG_FB_READ_SOURCE_ENABLE, PM2F_CONFIG_FB_WRITE_ENABLE, PM2F_RENDER_FASTFILL, PM2F_RENDER_RECTANGLE, PM2R_CONFIG, PM2R_FB_BLOCK_COLOR, PM2R_FB_PIXEL_OFFSET, PM2R_FB_SOURCE_DELTA, PM2R_RECTANGLE_ORIGIN, PM2R_RECTANGLE_SIZE, PM2R_RENDER, WAIT_FIFO(), wait_pm2(), and xfff.

Referenced by pm2fb_bmove().

Here is the call graph for this function:

static void pm2fb_bmove struct display *  p,
int  sy,
int  sx,
int  dy,
int  dx,
int  height,
int  width
[static]
 

Definition at line 1220 of file pm2fb.c.

References fontheight, fontwidth, fontwidthlog, and pm2fb_block_op().

Here is the call graph for this function:

void pm2fb_cleanup struct fb_info info  ) 
 

Definition at line 2034 of file pm2fb.c.

References pm2fb_info::board, board_table, pm2fb_reset(), and unregister_framebuffer().

Here is the call graph for this function:

static int pm2fb_decode_var const struct fb_var_screeninfo var,
void *  par,
struct fb_info_gen *  info
[static]
 

Definition at line 1487 of file pm2fb.c.

References fb_var_screeninfo::activate, pm2fb_par::base, fb_var_screeninfo::bits_per_pixel, pm2fb_par::depth, DPRINTK, EINVAL, FB_ACTIVATE_NOW, FB_SYNC_HOR_HIGH_ACT, FB_SYNC_VERT_HIGH_ACT, FB_VMODE_DOUBLE, FB_VMODE_INTERLACED, FB_VMODE_MASK, pm2fb_par::hbend, pm2fb_par::height, pm2fb_par::hsend, pm2fb_par::hsstart, fb_var_screeninfo::hsync_len, pm2fb_par::htotal, fb_var_screeninfo::left_margin, fb_var_screeninfo::lower_margin, memset, partprod(), PICOS2KHZ, fb_var_screeninfo::pixclock, pm2fb_par::pixclock, PM2_MAX_PIXCLOCK, PM2_TYPE_PERMEDIA2V, PM2F_DATA_64_ENABLE, PM2F_HSYNC_ACT_HIGH, PM2F_HSYNC_ACT_LOW, PM2F_LINE_DOUBLE, PM2F_VIDEO_ENABLE, PM2F_VSYNC_ACT_HIGH, PM2F_VSYNC_ACT_LOW, pm2fb_info::regions, fb_var_screeninfo::right_margin, pm2fb_par::stride, fb_var_screeninfo::sync, to3264(), pm2fb_info::type, u32, fb_var_screeninfo::upper_margin, pm2fb_par::vbend, pm2fb_par::video, fb_var_screeninfo::vmode, pm2fb_par::vsend, pm2fb_par::vsstart, fb_var_screeninfo::vsync_len, pm2fb_par::vtotal, pm2fb_par::width, fb_var_screeninfo::xoffset, fb_var_screeninfo::xres, xres, fb_var_screeninfo::xres_virtual, fb_var_screeninfo::yoffset, fb_var_screeninfo::yres, and fb_var_screeninfo::yres_virtual.

Here is the call graph for this function:

static void pm2fb_detect void   )  [static]
 

Definition at line 1428 of file pm2fb.c.

static int pm2fb_encode_fix struct fb_fix_screeninfo fix,
const void *  par,
struct fb_info_gen *  info
[static]
 

Definition at line 1430 of file pm2fb.c.

References fb_fix_screeninfo::accel, pm2fb_info::current_par, pm2fb_info::current_par_valid, pm2fb_par::depth, FB_ACCEL_3DLABS_PERMEDIA2, FB_TYPE_PACKED_PIXELS, FB_VISUAL_PSEUDOCOLOR, FB_VISUAL_TRUECOLOR, fb_fix_screeninfo::id, fb_fix_screeninfo::line_length, fb_fix_screeninfo::mmio_len, fb_fix_screeninfo::mmio_start, permedia2_name, PM2_REGS_SIZE, pm2fb_info::regions, fb_fix_screeninfo::smem_len, fb_fix_screeninfo::smem_start, strcpy, fb_fix_screeninfo::type, fb_fix_screeninfo::visual, pm2fb_par::width, fb_fix_screeninfo::xpanstep, fb_fix_screeninfo::ypanstep, and fb_fix_screeninfo::ywrapstep.

static int pm2fb_encode_var struct fb_var_screeninfo var,
const void *  par,
struct fb_info_gen *  info
[static]
 

Definition at line 1581 of file pm2fb.c.

References pm2fb_par::base, fb_var_screeninfo::bits_per_pixel, fb_var_screeninfo::blue, pm2fb_par::depth, FB_SYNC_HOR_HIGH_ACT, FB_SYNC_VERT_HIGH_ACT, FB_VMODE_DOUBLE, from3264(), fb_var_screeninfo::green, pm2fb_par::hbend, fb_var_screeninfo::height, pm2fb_par::height, pm2fb_par::hsend, pm2fb_par::hsstart, fb_var_screeninfo::hsync_len, pm2fb_par::htotal, KHZ2PICOS, fb_var_screeninfo::left_margin, fb_bitfield::length, fb_var_screeninfo::lower_margin, memset, fb_bitfield::offset, pm2fb_par::pixclock, fb_var_screeninfo::pixclock, PM2F_DATA_64_ENABLE, PM2F_HSYNC_ACT_HIGH, PM2F_HSYNC_MASK, PM2F_LINE_DOUBLE, PM2F_VSYNC_ACT_HIGH, PM2F_VSYNC_MASK, fb_var_screeninfo::red, fb_var_screeninfo::right_margin, fb_var_screeninfo::sync, fb_var_screeninfo::transp, u32, fb_var_screeninfo::upper_margin, pm2fb_par::vbend, pm2fb_par::video, fb_var_screeninfo::vmode, pm2fb_par::vsend, pm2fb_par::vsstart, fb_var_screeninfo::vsync_len, pm2fb_par::vtotal, fb_var_screeninfo::width, pm2fb_par::width, fb_var_screeninfo::xoffset, fb_var_screeninfo::xres, fb_var_screeninfo::xres_virtual, fb_var_screeninfo::yoffset, fb_var_screeninfo::yres, and fb_var_screeninfo::yres_virtual.

Here is the call graph for this function:

static void __init pm2fb_font_setup char *  options  )  [static]
 

Definition at line 2091 of file pm2fb.c.

References pm2fb_options, and strncpy.

Referenced by pm2fb_setup().

static void pm2fb_get_par void *  par,
struct fb_info_gen *  info
[static]
 

Definition at line 1667 of file pm2fb.c.

References pm2fb_info::current_par, pm2fb_info::current_par_valid, pm2fb_reset(), set_screen(), and set_user_mode().

Here is the call graph for this function:

static int pm2fb_getcolreg unsigned  regno,
unsigned *  red,
unsigned *  green,
unsigned *  blue,
unsigned *  transp,
struct fb_info info
[static]
 

Definition at line 1703 of file pm2fb.c.

References pm2fb_info::palette.

int __init pm2fb_init void   ) 
 

Definition at line 2044 of file pm2fb.c.

References board_table, fb_info, fbgen_blank(), fbgen_do_set_var(), fbgen_get_var(), fbgen_install_cmap(), fbgen_set_disp(), fbgen_switch(), fbgen_update_var(), GET_FB_IDX, memcpy, memset, MOD_INC_USE_COUNT, permedia2_name, pm2fb_hwswitch, pm2fb_ops, pm2fb_options, pm2fb_reset(), printk, register_framebuffer(), SCROLL_YNOMOVE, strcpy, and u32.

Here is the call graph for this function:

static void __init pm2fb_mode_setup char *  options  )  [static]
 

Definition at line 2079 of file pm2fb.c.

References memcpy, name, OPTF_USER, pm2fb_options, strcmp, and user_mode.

Referenced by pm2fb_setup().

static int pm2fb_open struct fb_info info,
int  user
[static]
 

Definition at line 1814 of file pm2fb.c.

References MOD_INC_USE_COUNT.

static int pm2fb_pan_display const struct fb_var_screeninfo var,
struct fb_info_gen *  info
[static]
 

Definition at line 1187 of file pm2fb.c.

References pm2fb_par::base, pm2fb_info::current_par, pm2fb_info::current_par_valid, pm2fb_par::depth, EINVAL, pm2_WR(), PM2R_SCREEN_BASE, to3264(), WAIT_FIFO(), pm2fb_par::width, fb_var_screeninfo::xoffset, and fb_var_screeninfo::yoffset.

Here is the call graph for this function:

static void pm2fb_pp_bmove struct display *  p,
int  sy,
int  sx,
int  dy,
int  dx,
int  height,
int  width
[static]
 

Definition at line 1200 of file pm2fb.c.

References fontheight, fontwidth, fontwidthlog, and pm2fb_pp_copy().

Here is the call graph for this function:

static void pm2fb_pp_copy struct pm2fb_info i,
s32  xsrc,
s32  ysrc,
s32  x,
s32  y,
s32  w,
s32  h
[static]
 

Definition at line 784 of file pm2fb.c.

References pm2fb_info::current_par, DEFW,