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
f692775d
Commit
f692775d
authored
Jul 29, 2009
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intel-agp: fix sglist allocation to avoid vmalloc()
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
91b8e305
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
20 deletions
+10
-20
drivers/char/agp/intel-agp.c
drivers/char/agp/intel-agp.c
+10
-19
include/linux/agp_backend.h
include/linux/agp_backend.h
+0
-1
No files found.
drivers/char/agp/intel-agp.c
View file @
f692775d
...
...
@@ -198,39 +198,30 @@ static void intel_agp_unmap_page(struct page *page, dma_addr_t dma)
static
void
intel_agp_free_sglist
(
struct
agp_memory
*
mem
)
{
struct
sg_table
st
;
st
.
sgl
=
mem
->
sg_list
;
st
.
orig_nents
=
st
.
nents
=
mem
->
page_count
;
sg_free_table
(
&
st
);
if
(
mem
->
sg_vmalloc_flag
)
vfree
(
mem
->
sg_list
);
else
kfree
(
mem
->
sg_list
);
mem
->
sg_vmalloc_flag
=
0
;
mem
->
sg_list
=
NULL
;
mem
->
num_sg
=
0
;
}
static
int
intel_agp_map_memory
(
struct
agp_memory
*
mem
)
{
struct
sg_table
st
;
struct
scatterlist
*
sg
;
int
i
;
DBG
(
"try mapping %lu pages
\n
"
,
(
unsigned
long
)
mem
->
page_count
);
if
((
mem
->
page_count
*
sizeof
(
*
mem
->
sg_list
))
<
2
*
PAGE_SIZE
)
mem
->
sg_list
=
kcalloc
(
mem
->
page_count
,
sizeof
(
*
mem
->
sg_list
),
GFP_KERNEL
);
if
(
mem
->
sg_list
==
NULL
)
{
mem
->
sg_list
=
vmalloc
(
mem
->
page_count
*
sizeof
(
*
mem
->
sg_list
));
mem
->
sg_vmalloc_flag
=
1
;
}
if
(
!
mem
->
sg_list
)
{
mem
->
sg_vmalloc_flag
=
0
;
if
(
sg_alloc_table
(
&
st
,
mem
->
page_count
,
GFP_KERNEL
))
return
-
ENOMEM
;
}
sg_init_table
(
mem
->
sg_list
,
mem
->
page_count
);
sg
=
mem
->
sg_list
;
mem
->
sg_list
=
sg
=
st
.
sgl
;
for
(
i
=
0
;
i
<
mem
->
page_count
;
i
++
,
sg
=
sg_next
(
sg
))
sg_set_page
(
sg
,
mem
->
pages
[
i
],
PAGE_SIZE
,
0
);
...
...
include/linux/agp_backend.h
View file @
f692775d
...
...
@@ -80,7 +80,6 @@ struct agp_memory {
bool
is_bound
;
bool
is_flushed
;
bool
vmalloc_flag
;
bool
sg_vmalloc_flag
;
/* list of agp_memory mapped to the aperture */
struct
list_head
mapped_list
;
/* DMA-mapped addresses */
...
...
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