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
628c89f7
Commit
628c89f7
authored
May 01, 2003
by
Dave Jones
Committed by
Dave Jones
May 01, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AGPGART] Add some debugging printk's. Based on Linus' earlier patch.
parent
c6ceb94e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
8 deletions
+44
-8
drivers/char/agp/frontend.c
drivers/char/agp/frontend.c
+44
-8
No files found.
drivers/char/agp/frontend.c
View file @
628c89f7
...
...
@@ -40,6 +40,14 @@
#include <asm/pgtable.h>
#include "agp.h"
//#define DEBUG
#ifdef DEBUG
#define DBG(x,y...) printk (KERN_DEBUG "agpgart: %s: " x "\n", __FUNCTION__ , ## y)
#else
#define DBG(x,y...) do { } while (0)
#endif
static
struct
agp_front_data
agp_fe
;
static
agp_memory
*
agp_find_mem_by_key
(
int
key
)
...
...
@@ -53,11 +61,12 @@ static agp_memory *agp_find_mem_by_key(int key)
while
(
curr
!=
NULL
)
{
if
(
curr
->
key
==
key
)
return
curr
;
break
;
curr
=
curr
->
next
;
}
return
NULL
;
DBG
(
"key=%d -> mem=%p"
,
key
,
curr
);
return
curr
;
}
static
void
agp_remove_from_pool
(
agp_memory
*
temp
)
...
...
@@ -67,6 +76,7 @@ static void agp_remove_from_pool(agp_memory * temp)
/* Check to see if this is even in the memory pool */
DBG
(
"mem=%p"
,
temp
);
if
(
agp_find_mem_by_key
(
temp
->
key
)
!=
NULL
)
{
next
=
temp
->
next
;
prev
=
temp
->
prev
;
...
...
@@ -119,10 +129,16 @@ static agp_segment_priv *agp_find_seg_in_client(const agp_client * client,
static
void
agp_remove_seg_from_client
(
agp_client
*
client
)
{
DBG
(
"client=%p"
,
client
);
if
(
client
->
segments
!=
NULL
)
{
if
(
*
(
client
->
segments
)
!=
NULL
)
if
(
*
(
client
->
segments
)
!=
NULL
)
{
DBG
(
"Freeing %p from client"
,
*
(
client
->
segments
),
client
);
kfree
(
*
(
client
->
segments
));
}
DBG
(
"Freeing %p from client %p"
,
client
->
segments
,
client
);
kfree
(
client
->
segments
);
client
->
segments
=
NULL
;
}
}
...
...
@@ -136,6 +152,7 @@ static void agp_add_seg_to_client(agp_client * client,
if
(
prev_seg
!=
NULL
)
agp_remove_seg_from_client
(
client
);
DBG
(
"Adding seg %p (%d segments) to client %p"
,
seg
,
num_segments
,
client
);
client
->
num_segments
=
num_segments
;
client
->
segments
=
seg
;
}
...
...
@@ -599,6 +616,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
current_size
=
kerninfo
.
aper_size
;
current_size
=
current_size
*
0x100000
;
offset
=
vma
->
vm_pgoff
<<
PAGE_SHIFT
;
DBG
(
"%lx:%lx"
,
offset
,
offset
+
size
);
if
(
test_bit
(
AGP_FF_IS_CLIENT
,
&
priv
->
access_flags
))
{
if
((
size
+
offset
)
>
current_size
)
...
...
@@ -612,6 +630,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
if
(
!
agp_find_seg_in_client
(
client
,
offset
,
size
,
vma
->
vm_page_prot
))
goto
out_inval
;
DBG
(
"client vm_ops=%p"
,
kerninfo
.
vm_ops
);
if
(
kerninfo
.
vm_ops
)
{
vma
->
vm_ops
=
kerninfo
.
vm_ops
;
}
else
if
(
remap_page_range
(
vma
,
vma
->
vm_start
,
...
...
@@ -627,6 +646,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
if
(
size
!=
current_size
)
goto
out_inval
;
DBG
(
"controller vm_ops=%p"
,
kerninfo
.
vm_ops
);
if
(
kerninfo
.
vm_ops
)
{
vma
->
vm_ops
=
kerninfo
.
vm_ops
;
}
else
if
(
remap_page_range
(
vma
,
vma
->
vm_start
,
...
...
@@ -657,6 +677,8 @@ static int agp_release(struct inode *inode, struct file *file)
down
(
&
(
agp_fe
.
agp_mutex
));
DBG
(
"priv=%p"
,
priv
);
if
(
test_bit
(
AGP_FF_IS_CONTROLLER
,
&
priv
->
access_flags
))
{
agp_controller
*
controller
;
...
...
@@ -670,9 +692,10 @@ static int agp_release(struct inode *inode, struct file *file)
agp_remove_controller
(
controller
);
}
}
if
(
test_bit
(
AGP_FF_IS_CLIENT
,
&
priv
->
access_flags
))
{
if
(
test_bit
(
AGP_FF_IS_CLIENT
,
&
priv
->
access_flags
))
agp_remove_client
(
priv
->
my_pid
);
}
agp_remove_file_private
(
priv
);
kfree
(
priv
);
up
(
&
(
agp_fe
.
agp_mutex
));
...
...
@@ -711,6 +734,7 @@ static int agp_open(struct inode *inode, struct file *file)
}
file
->
private_data
=
(
void
*
)
priv
;
agp_insert_file_private
(
priv
);
DBG
(
"private=%p, client=%p"
,
priv
,
client
);
up
(
&
(
agp_fe
.
agp_mutex
));
return
0
;
...
...
@@ -760,8 +784,10 @@ static int agpioc_info_wrap(agp_file_private * priv, unsigned long arg)
static
int
agpioc_acquire_wrap
(
agp_file_private
*
priv
,
unsigned
long
arg
)
{
int
ret
;
agp_controller
*
controller
;
DBG
(
""
);
if
(
!
(
test_bit
(
AGP_FF_ALLOW_CONTROLLER
,
&
priv
->
access_flags
)))
return
-
EPERM
;
...
...
@@ -797,6 +823,7 @@ static int agpioc_acquire_wrap(agp_file_private * priv, unsigned long arg)
static
int
agpioc_release_wrap
(
agp_file_private
*
priv
,
unsigned
long
arg
)
{
DBG
(
""
);
agp_controller_release_current
(
agp_fe
.
current_controller
,
priv
);
return
0
;
}
...
...
@@ -805,9 +832,10 @@ static int agpioc_setup_wrap(agp_file_private * priv, unsigned long arg)
{
agp_setup
mode
;
if
(
copy_from_user
(
&
mode
,
(
void
*
)
arg
,
sizeof
(
agp_setup
)))
{
DBG
(
""
);
if
(
copy_from_user
(
&
mode
,
(
void
*
)
arg
,
sizeof
(
agp_setup
)))
return
-
EFAULT
;
}
agp_enable
(
mode
.
agp_mode
);
return
0
;
}
...
...
@@ -818,6 +846,7 @@ static int agpioc_reserve_wrap(agp_file_private * priv, unsigned long arg)
agp_client
*
client
;
agp_file_private
*
client_priv
;
DBG
(
""
);
if
(
copy_from_user
(
&
reserve
,
(
void
*
)
arg
,
sizeof
(
agp_region
)))
return
-
EFAULT
;
...
...
@@ -887,6 +916,7 @@ static int agpioc_reserve_wrap(agp_file_private * priv, unsigned long arg)
static
int
agpioc_protect_wrap
(
agp_file_private
*
priv
,
unsigned
long
arg
)
{
DBG
(
""
);
/* This function is not currently implemented */
return
-
EINVAL
;
}
...
...
@@ -896,6 +926,7 @@ static int agpioc_allocate_wrap(agp_file_private * priv, unsigned long arg)
agp_memory
*
memory
;
agp_allocate
alloc
;
DBG
(
""
);
if
(
copy_from_user
(
&
alloc
,
(
void
*
)
arg
,
sizeof
(
agp_allocate
)))
return
-
EFAULT
;
...
...
@@ -918,6 +949,7 @@ static int agpioc_deallocate_wrap(agp_file_private * priv, unsigned long arg)
{
agp_memory
*
memory
;
DBG
(
""
);
memory
=
agp_find_mem_by_key
((
int
)
arg
);
if
(
memory
==
NULL
)
...
...
@@ -932,6 +964,7 @@ static int agpioc_bind_wrap(agp_file_private * priv, unsigned long arg)
agp_bind
bind_info
;
agp_memory
*
memory
;
DBG
(
""
);
if
(
copy_from_user
(
&
bind_info
,
(
void
*
)
arg
,
sizeof
(
agp_bind
)))
return
-
EFAULT
;
...
...
@@ -948,6 +981,7 @@ static int agpioc_unbind_wrap(agp_file_private * priv, unsigned long arg)
agp_memory
*
memory
;
agp_unbind
unbind
;
DBG
(
""
);
if
(
copy_from_user
(
&
unbind
,
(
void
*
)
arg
,
sizeof
(
agp_unbind
)))
return
-
EFAULT
;
...
...
@@ -965,6 +999,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
agp_file_private
*
curr_priv
=
(
agp_file_private
*
)
file
->
private_data
;
int
ret_val
=
-
ENOTTY
;
DBG
(
"priv=%p, cmd=%x"
,
curr_priv
,
cmd
);
down
(
&
(
agp_fe
.
agp_mutex
));
if
((
agp_fe
.
current_controller
==
NULL
)
&&
...
...
@@ -1034,6 +1069,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
}
ioctl_out:
DBG
(
"ioctl returns %d
\n
"
,
ret_val
);
up
(
&
(
agp_fe
.
agp_mutex
));
return
ret_val
;
}
...
...
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