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
abd654f4
Commit
abd654f4
authored
Nov 14, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i810 driver update to DRI CVS tree: use pci_alloc_consistent
instead of home-brew PCI allocations.
parent
47eefa46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
42 deletions
+10
-42
drivers/char/drm/i810_dma.c
drivers/char/drm/i810_dma.c
+8
-42
drivers/char/drm/i810_drv.h
drivers/char/drm/i810_drv.h
+2
-0
No files found.
drivers/char/drm/i810_dma.c
View file @
abd654f4
...
...
@@ -26,7 +26,7 @@
*
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
* Jeff Hartmann <jhartmann@valinux.com>
* Keith Whitwell <keith
_whitwell@yahoo
.com>
* Keith Whitwell <keith
@tungstengraphics
.com>
*
*/
...
...
@@ -264,44 +264,6 @@ static int i810_dma_get_buffer(drm_device_t *dev, drm_i810_dma_t *d,
return
retcode
;
}
static
unsigned
long
i810_alloc_page
(
drm_device_t
*
dev
)
{
unsigned
long
address
;
address
=
__get_free_page
(
GFP_KERNEL
);
if
(
address
==
0UL
)
return
0
;
#if LINUX_VERSION_CODE < 0x020409
atomic_inc
(
&
virt_to_page
(
address
)
->
count
);
set_bit
(
PG_locked
,
&
virt_to_page
(
address
)
->
flags
);
#else
get_page
(
virt_to_page
(
address
));
#if LINUX_VERSION_CODE < 0x020500
LockPage
(
virt_to_page
(
address
));
#else
SetPageLocked
(
virt_to_page
(
address
));
#endif
#endif
return
address
;
}
static
void
i810_free_page
(
drm_device_t
*
dev
,
unsigned
long
page
)
{
if
(
page
)
{
#if LINUX_VERSION_CODE < 0x020409
atomic_dec
(
&
virt_to_page
(
page
)
->
count
);
clear_bit
(
PG_locked
,
&
virt_to_page
(
page
)
->
flags
);
wake_up
(
&
virt_to_page
(
page
)
->
wait
);
#else
struct
page
*
p
=
virt_to_page
(
page
);
put_page
(
p
);
unlock_page
(
p
);
#endif
free_page
(
page
);
}
}
static
int
i810_dma_cleanup
(
drm_device_t
*
dev
)
{
drm_device_dma_t
*
dma
=
dev
->
dma
;
...
...
@@ -316,7 +278,9 @@ static int i810_dma_cleanup(drm_device_t *dev)
dev_priv
->
ring
.
Size
);
}
if
(
dev_priv
->
hw_status_page
!=
0UL
)
{
i810_free_page
(
dev
,
dev_priv
->
hw_status_page
);
pci_free_consistent
(
dev
->
pdev
,
PAGE_SIZE
,
(
void
*
)
dev_priv
->
hw_status_page
,
dev_priv
->
dma_status_page
);
/* Need to rewrite hardware status page */
I810_WRITE
(
0x02080
,
0x1ffff000
);
}
...
...
@@ -476,7 +440,9 @@ static int i810_dma_initialize(drm_device_t *dev,
dev_priv
->
zi1
=
init
->
depth_offset
|
init
->
pitch_bits
;
/* Program Hardware Status Page */
dev_priv
->
hw_status_page
=
i810_alloc_page
(
dev
);
dev_priv
->
hw_status_page
=
(
unsigned
long
)
pci_alloc_consistent
(
dev
->
pdev
,
PAGE_SIZE
,
&
dev_priv
->
dma_status_page
);
if
(
dev_priv
->
hw_status_page
==
0UL
)
{
dev
->
dev_private
=
(
void
*
)
dev_priv
;
i810_dma_cleanup
(
dev
);
...
...
@@ -486,7 +452,7 @@ static int i810_dma_initialize(drm_device_t *dev,
memset
((
void
*
)
dev_priv
->
hw_status_page
,
0
,
PAGE_SIZE
);
DRM_DEBUG
(
"hw status page @ %lx
\n
"
,
dev_priv
->
hw_status_page
);
I810_WRITE
(
0x02080
,
virt_to_bus
((
void
*
)
dev_priv
->
hw_status_page
)
);
I810_WRITE
(
0x02080
,
dev_priv
->
dma_status_page
);
DRM_DEBUG
(
"Enabled hardware status page
\n
"
);
/* Now we need to init our freelist */
...
...
drivers/char/drm/i810_drv.h
View file @
abd654f4
...
...
@@ -64,6 +64,8 @@ typedef struct drm_i810_private {
unsigned
long
hw_status_page
;
unsigned
long
counter
;
dma_addr_t
dma_status_page
;
drm_buf_t
*
mmap_buffer
;
...
...
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