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
46baaa69
Commit
46baaa69
authored
Apr 25, 2003
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AGPGART] Add symbolic constants for AGP mode setting.
bye bye icky hardcoded values.
parent
c21c1ae1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
33 deletions
+32
-33
drivers/char/agp/agp.h
drivers/char/agp/agp.h
+7
-0
drivers/char/agp/generic.c
drivers/char/agp/generic.c
+25
-33
No files found.
drivers/char/agp/agp.h
View file @
46baaa69
...
...
@@ -412,4 +412,11 @@ u32 agp_collect_device_status(u32 mode, u32 command);
void
agp_device_command
(
u32
command
,
int
agp_v3
);
int
agp_3_0_node_enable
(
u32
mode
,
u32
minor
);
#define AGPSTAT_RQ_DEPTH (0xff000000)
#define AGPSTAT_SBA (1<<9)
#define AGPSTAT_FW (1<<4)
#define AGPSTAT2_4X (1<<2)
#define AGPSTAT2_2X (1<<1)
#define AGPSTAT2_1X (1)
#endif
/* _AGP_BACKEND_PRIV_H */
drivers/char/agp/generic.c
View file @
46baaa69
...
...
@@ -328,47 +328,39 @@ u32 agp_collect_device_status(u32 mode, u32 command)
pci_read_config_dword
(
device
,
agp
+
PCI_AGP_STATUS
,
&
scratch
);
/* adjust RQ depth */
command
=
((
command
&
~
0xff000000
)
|
min_t
(
u32
,
(
mode
&
0xff000000
),
min_t
(
u32
,
(
command
&
0xff000000
),
(
scratch
&
0xff000000
))));
command
=
((
command
&
~
AGPSTAT_RQ_DEPTH
)
|
min_t
(
u32
,
(
mode
&
AGPSTAT_RQ_DEPTH
),
min_t
(
u32
,
(
command
&
AGPSTAT_RQ_DEPTH
),
(
scratch
&
AGPSTAT_RQ_DEPTH
))));
/* disable SBA if it's not supported */
if
(
!
((
command
&
0x00000200
)
&&
(
scratch
&
0x00000200
)
&&
(
mode
&
0x00000200
)))
command
&=
~
0x00000200
;
if
(
!
((
command
&
AGPSTAT_SBA
)
&&
(
scratch
&
AGPSTAT_SBA
)
&&
(
mode
&
AGPSTAT_SBA
)))
command
&=
~
AGPSTAT_SBA
;
/* disable FW if it's not supported */
if
(
!
((
command
&
0x00000010
)
&&
(
scratch
&
0x00000010
)
&&
(
mode
&
0x00000010
)))
command
&=
~
0x00000010
;
if
(
!
((
command
&
4
)
&&
(
scratch
&
4
)
&&
(
mode
&
4
)))
command
&=
~
0x00000004
;
if
(
!
((
command
&
2
)
&&
(
scratch
&
2
)
&&
(
mode
&
2
)))
command
&=
~
0x00000002
;
if
(
!
((
command
&
1
)
&&
(
scratch
&
1
)
&&
(
mode
&
1
)))
command
&=
~
0x00000001
;
if
(
!
((
command
&
AGPSTAT_FW
)
&&
(
scratch
&
AGPSTAT_FW
)
&&
(
mode
&
AGPSTAT_FW
)))
command
&=
~
AGPSTAT_FW
;
/* Set speed */
if
(
!
((
command
&
AGPSTAT2_4X
)
&&
(
scratch
&
AGPSTAT2_4X
)
&&
(
mode
&
AGPSTAT2_4X
)))
command
&=
~
AGPSTAT2_4X
;
if
(
!
((
command
&
AGPSTAT2_2X
)
&&
(
scratch
&
AGPSTAT2_2X
)
&&
(
mode
&
AGPSTAT2_2X
)))
command
&=
~
AGPSTAT2_2X
;
if
(
!
((
command
&
AGPSTAT2_1X
)
&&
(
scratch
&
AGPSTAT2_1X
)
&&
(
mode
&
AGPSTAT2_1X
)))
command
&=
~
AGPSTAT2_1X
;
}
if
(
command
&
4
)
command
&=
~
3
;
/* 4X */
/* Now we know what mode it should be, clear out the unwanted bits. */
if
(
command
&
AGPSTAT2_4X
)
command
&=
~
(
AGPSTAT2_1X
|
AGPSTAT2_2X
);
/* 4X */
if
(
command
&
2
)
command
&=
~
5
;
/* 2X (8X for AGP3.0)
*/
if
(
command
&
AGPSTAT2_2X
)
command
&=
~
(
AGPSTAT2_1X
|
AGPSTAT2_4X
);
/* 2X
*/
if
(
command
&
1
)
command
&=
~
6
;
/* 1X (4X for AGP3.0)
*/
if
(
command
&
AGPSTAT2_1X
)
command
&=
~
(
AGPSTAT2_2X
|
AGPSTAT2_4X
);
/* 1Xf
*/
return
command
;
}
...
...
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