Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
1af3131d
Commit
1af3131d
authored
Dec 25, 2002
by
Richard Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FB] First cut at updating tgafb to 2.5 fb api. A large
scale rewrite modeled off of skeletonfb.c.
parent
a83c24f3
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
695 additions
and
955 deletions
+695
-955
drivers/video/Makefile
drivers/video/Makefile
+1
-1
drivers/video/tgafb.c
drivers/video/tgafb.c
+614
-885
include/video/tgafb.h
include/video/tgafb.h
+80
-69
No files found.
drivers/video/Makefile
View file @
1af3131d
...
...
@@ -48,7 +48,7 @@ obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o
obj-$(CONFIG_FB_CLGEN)
+=
clgenfb.o
obj-$(CONFIG_FB_TRIDENT)
+=
tridentfb.o
obj-$(CONFIG_FB_S3TRIO)
+=
S3triofb.o
obj-$(CONFIG_FB_TGA)
+=
tgafb.o
obj-$(CONFIG_FB_TGA)
+=
tgafb.o
cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_VESA)
+=
vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_VGA16)
+=
vga16fb.o cfbfillrect.o cfbcopyarea.o
\
cfbimgblt.o vgastate.o
...
...
drivers/video/tgafb.c
View file @
1af3131d
This diff is collapsed.
Click to expand it.
drivers
/video/tgafb.h
→
include
/video/tgafb.h
View file @
1af3131d
...
...
@@ -13,17 +13,17 @@
#ifndef TGAFB_H
#define TGAFB_H
/*
* TGA hardware description (minimal)
*/
/*
* TGA hardware description (minimal)
*/
#define TGA_TYPE_8PLANE 0
#define TGA_TYPE_24PLANE 1
#define TGA_TYPE_24PLUSZ 3
/*
* Offsets within Memory Space
*/
/*
* Offsets within Memory Space
*/
#define TGA_ROM_OFFSET 0x0000000
#define TGA_REGS_OFFSET 0x0100000
...
...
@@ -52,9 +52,9 @@
#define TGA_CMD_STAT_REG 0x01f8
/*
* u
seful defines for managing the registers
*/
/*
* U
seful defines for managing the registers
*/
#define TGA_HORIZ_ODD 0x80000000
#define TGA_HORIZ_POLARITY 0x40000000
...
...
@@ -77,17 +77,17 @@
#define TGA_VALID_CURSOR 0x04
/*
* u
seful defines for managing the ICS1562 PLL clock
*/
/*
* U
seful defines for managing the ICS1562 PLL clock
*/
#define TGA_PLL_BASE_FREQ 14318
/* .18 */
#define TGA_PLL_MAX_FREQ 230000
/*
* u
seful defines for managing the BT485 on the 8-plane TGA
*/
/*
* U
seful defines for managing the BT485 on the 8-plane TGA
*/
#define BT485_READ_BIT 0x01
#define BT485_WRITE_BIT 0x00
...
...
@@ -111,9 +111,9 @@
#define BT485_CUR_HIGH_Y 0x1e
/*
* u
seful defines for managing the BT463 on the 24-plane TGAs
*/
/*
* U
seful defines for managing the BT463 on the 24-plane TGAs
*/
#define BT463_ADDR_LO 0x0
#define BT463_ADDR_HI 0x1
...
...
@@ -139,61 +139,72 @@
#define BT463_WINDOW_TYPE_BASE 0x0300
/*
* The framebuffer driver private data.
*/
/*
* Macros for reading/writing TGA and RAMDAC registers
*/
#define TGA_WRITE_REG(v,r) \
{ writel((v), fb_info.tga_regs_base+(r)); mb(); }
#define TGA_READ_REG(r) readl(fb_info.tga_regs_base+(r))
#define BT485_WRITE(v,r) \
TGA_WRITE_REG((r),TGA_RAMDAC_SETUP_REG); \
TGA_WRITE_REG(((v)&0xff)|((r)<<8),TGA_RAMDAC_REG);
#define BT463_LOAD_ADDR(a) \
TGA_WRITE_REG(BT463_ADDR_LO<<2, TGA_RAMDAC_SETUP_REG); \
TGA_WRITE_REG((BT463_ADDR_LO<<10)|((a)&0xff), TGA_RAMDAC_REG); \
TGA_WRITE_REG(BT463_ADDR_HI<<2, TGA_RAMDAC_SETUP_REG); \
TGA_WRITE_REG((BT463_ADDR_HI<<10)|(((a)>>8)&0xff), TGA_RAMDAC_REG);
#define BT463_WRITE(m,a,v) \
BT463_LOAD_ADDR((a)); \
TGA_WRITE_REG(((m)<<2),TGA_RAMDAC_SETUP_REG); \
TGA_WRITE_REG(((m)<<10)|((v)&0xff),TGA_RAMDAC_REG);
/*
* This structure describes the board.
*/
struct
tgafb_info
{
/* Use the generic framebuffer ops */
struct
fb_info_gen
gen
;
/* Device dependent information */
u8
tga_type
;
/* TGA_TYPE_XXX */
u8
tga_chip_rev
;
/* dc21030 revision */
u64
tga_mem_base
;
u64
tga_fb_base
;
u64
tga_regs_base
;
struct
fb_var_screeninfo
default_var
;
/* default video mode */
struct
tga_par
{
/* PCI device. */
struct
pci_dev
*
pdev
;
/* Device dependent information. */
void
*
tga_mem_base
;
void
*
tga_fb_base
;
void
*
tga_regs_base
;
u8
tga_type
;
/* TGA_TYPE_XXX */
u8
tga_chip_rev
;
/* dc21030 revision */
/* Remember blank mode. */
u8
vesa_blanked
;
/* Define the video mode. */
u32
xres
,
yres
;
/* resolution in pixels */
u32
htimings
;
/* horizontal timing register */
u32
vtimings
;
/* vertical timing register */
u32
pll_freq
;
/* pixclock in mhz */
u32
bits_per_pixel
;
/* bits per pixel */
u32
sync_on_green
;
/* set if sync is on green */
};
/*
* This structure uniquely defines a video mode.
*/
/*
* Macros for reading/writing TGA and RAMDAC registers
*/
struct
tgafb_par
{
u32
xres
,
yres
;
/* resolution in pixels */
u32
htimings
;
/* horizontal timing register */
u32
vtimings
;
/* vertical timing register */
u32
pll_freq
;
/* pixclock in mhz */
u32
bits_per_pixel
;
/* bits per pixel */
u32
sync_on_green
;
/* set if sync is on green */
};
static
inline
void
TGA_WRITE_REG
(
struct
tga_par
*
par
,
u32
v
,
u32
r
)
{
writel
(
v
,
par
->
tga_regs_base
+
r
);
}
static
inline
u32
TGA_READ_REG
(
struct
tga_par
*
par
,
u32
r
)
{
return
readl
(
par
->
tga_regs_base
+
r
);
}
static
inline
void
BT485_WRITE
(
struct
tga_par
*
par
,
u8
v
,
u8
r
)
{
TGA_WRITE_REG
(
par
,
r
,
TGA_RAMDAC_SETUP_REG
);
TGA_WRITE_REG
(
par
,
v
|
(
r
<<
8
),
TGA_RAMDAC_REG
);
}
static
inline
void
BT463_LOAD_ADDR
(
struct
tga_par
*
par
,
u16
a
)
{
TGA_WRITE_REG
(
par
,
BT463_ADDR_LO
<<
2
,
TGA_RAMDAC_SETUP_REG
);
TGA_WRITE_REG
(
par
,
(
BT463_ADDR_LO
<<
10
)
|
(
a
&
0xff
),
TGA_RAMDAC_REG
);
TGA_WRITE_REG
(
par
,
BT463_ADDR_HI
<<
2
,
TGA_RAMDAC_SETUP_REG
);
TGA_WRITE_REG
(
par
,
(
BT463_ADDR_HI
<<
10
)
|
(
a
>>
8
),
TGA_RAMDAC_REG
);
}
static
inline
void
BT463_WRITE
(
struct
tga_par
*
par
,
u32
m
,
u16
a
,
u8
v
)
{
BT463_LOAD_ADDR
(
par
,
a
);
TGA_WRITE_REG
(
par
,
m
<<
2
,
TGA_RAMDAC_SETUP_REG
);
TGA_WRITE_REG
(
par
,
m
<<
10
|
v
,
TGA_RAMDAC_REG
);
}
#endif
/* TGAFB_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment