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
Kirill Smelkov
linux
Commits
73a324ba
Commit
73a324ba
authored
Jun 19, 2002
by
James Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanusp for the 3Dfx driver.
parent
06b34423
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
21 deletions
+30
-21
drivers/video/tdfxfb.c
drivers/video/tdfxfb.c
+29
-21
include/linux/pci_ids.h
include/linux/pci_ids.h
+1
-0
No files found.
drivers/video/tdfxfb.c
View file @
73a324ba
...
...
@@ -79,10 +79,6 @@
#include <video/tdfx.h>
#include <video/fbcon.h>
#ifndef PCI_DEVICE_ID_3DFX_VOODOO5
#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
#endif
#undef TDFXFB_DEBUG
#ifdef TDFXFB_DEBUG
#define DPRINTK(a,b...) printk(KERN_DEBUG "fb: %s: " a, __FUNCTION__ , ## b)
...
...
@@ -995,7 +991,7 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
info
=
kmalloc
(
sizeof
(
struct
fb_info
)
+
sizeof
(
struct
display
)
+
sizeof
(
u32
)
*
16
,
GFP_KERNEL
);
if
(
!
info
)
return
-
EN
XIO
;
if
(
!
info
)
return
-
EN
OMEM
;
memset
(
info
,
0
,
sizeof
(
info
)
+
sizeof
(
struct
display
)
+
sizeof
(
u32
)
*
16
);
...
...
@@ -1016,25 +1012,25 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
}
tdfx_fix
.
mmio_start
=
pci_resource_start
(
pdev
,
0
);
tdfx_fix
.
mmio_len
=
1
<<
24
;
default_par
.
regbase_virt
=
ioremap_nocache
(
tdfx_fix
.
mmio_start
,
1
<<
24
);
tdfx_fix
.
mmio_len
=
pci_resource_len
(
pdev
,
0
)
;
default_par
.
regbase_virt
=
ioremap_nocache
(
tdfx_fix
.
mmio_start
,
tdfx_fix
.
mmio_len
);
if
(
!
default_par
.
regbase_virt
)
{
printk
(
"fb: Can't remap %s register area.
\n
"
,
tdfx_fix
.
id
);
return
-
ENXIO
;
goto
out_err
;
}
if
(
!
request_mem_region
(
pci_resource_start
(
pdev
,
0
),
pci_resource_len
(
pdev
,
0
),
"tdfx regbase"
))
{
printk
(
KERN_WARNING
"tdfxfb: Can't reserve regbase
\n
"
);
iounmap
(
default_par
.
regbase_virt
);
return
-
ENXIO
;
goto
out_err
;
}
tdfx_fix
.
smem_start
=
pci_resource_start
(
pdev
,
1
);
if
(
!
(
tdfx_fix
.
smem_len
=
do_lfb_size
(
pdev
->
device
)))
{
iounmap
(
default_par
.
regbase_virt
);
printk
(
"fb: Can't count %s memory.
\n
"
,
tdfx_fix
.
id
);
return
-
ENXIO
;
release_mem_region
(
pci_resource_start
(
pdev
,
0
),
pci_resource_len
(
pdev
,
0
));
goto
out_err
;
}
if
(
!
request_mem_region
(
pci_resource_start
(
pdev
,
1
),
...
...
@@ -1042,16 +1038,18 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
printk
(
KERN_WARNING
"tdfxfb: Can't reserve smem
\n
"
);
release_mem_region
(
pci_resource_start
(
pdev
,
0
),
pci_resource_len
(
pdev
,
0
));
iounmap
(
default_par
.
regbase_virt
);
return
-
ENXIO
;
goto
out_err
;
}
info
->
screen_base
=
ioremap_nocache
(
tdfx_fix
.
smem_start
,
tdfx_fix
.
smem_len
);
tdfx_fix
.
smem_len
);
if
(
!
info
->
screen_base
)
{
printk
(
"fb: Can't remap %s framebuffer.
\n
"
,
tdfx_fix
.
id
);
iounmap
(
default_par
.
regbase_virt
);
return
-
ENXIO
;
release_mem_region
(
pci_resource_start
(
pdev
,
1
),
pci_resource_len
(
pdev
,
1
));
release_mem_region
(
pci_resource_start
(
pdev
,
0
),
pci_resource_len
(
pdev
,
0
));
goto
out_err
;
}
default_par
.
iobase
=
pci_resource_start
(
pdev
,
2
);
...
...
@@ -1063,9 +1061,7 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
pci_resource_len
(
pdev
,
1
));
release_mem_region
(
pci_resource_start
(
pdev
,
0
),
pci_resource_len
(
pdev
,
0
));
iounmap
(
default_par
.
regbase_virt
);
iounmap
(
info
->
screen_base
);
return
-
ENXIO
;
goto
out_err
;
}
printk
(
"fb: %s memory = %dK
\n
"
,
tdfx_fix
.
id
,
tdfx_fix
.
smem_len
>>
10
);
...
...
@@ -1104,13 +1100,24 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev,
if
(
register_framebuffer
(
info
)
<
0
)
{
printk
(
"tdfxfb: can't register framebuffer
\n
"
);
return
-
ENXIO
;
goto
out_err
;
}
/*
* Our driver data
*/
pci_set_drvdata
(
pdev
,
info
);
return
0
;
out_err:
/*
* Cleanup after anything that was remapped/allocated.
*/
if
(
default_par
.
regbase_virt
)
iounmap
(
default_par
.
regbase_virt
);
if
(
info
->
screen_base
)
iounmap
(
info
->
screen_base
);
kfree
(
info
);
return
-
ENXIO
;
}
/**
...
...
@@ -1139,6 +1146,7 @@ static void __devexit tdfxfb_remove(struct pci_dev *pdev)
release_mem_region
(
pci_resource_start
(
pdev
,
0
),
pci_resource_len
(
pdev
,
0
));
pci_set_drvdata
(
pdev
,
NULL
);
kfree
(
info
);
}
int
__init
tdfxfb_init
(
void
)
...
...
include/linux/pci_ids.h
View file @
73a324ba
...
...
@@ -1258,6 +1258,7 @@
#define PCI_DEVICE_ID_3DFX_VOODOO2 0x0002
#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003
#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005
#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
#define PCI_VENDOR_ID_SIGMADES 0x1236
#define PCI_DEVICE_ID_SIGMADES_6425 0x6401
...
...
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