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
ad181870
Commit
ad181870
authored
Jun 09, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://drm.bkbits.net/drm-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
53c5395a
648e0d2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
6 deletions
+46
-6
drivers/char/drm/drm_ioctl.h
drivers/char/drm/drm_ioctl.h
+7
-0
drivers/char/drm/gamma_dma.c
drivers/char/drm/gamma_dma.c
+39
-6
No files found.
drivers/char/drm/drm_ioctl.h
View file @
ad181870
...
...
@@ -142,6 +142,13 @@ DRM(set_busid)(drm_device_t *dev)
snprintf
(
dev
->
unique
,
dev
->
unique_len
,
"pci:%04x:%02x:%02x.%d"
,
dev
->
pci_domain
,
dev
->
pci_bus
,
dev
->
pci_slot
,
dev
->
pci_func
);
dev
->
devname
=
DRM
(
alloc
)(
strlen
(
dev
->
name
)
+
dev
->
unique_len
+
2
,
DRM_MEM_DRIVER
);
if
(
dev
->
devname
==
NULL
)
return
ENOMEM
;
sprintf
(
dev
->
devname
,
"%s@%s"
,
dev
->
name
,
dev
->
unique
);
return
0
;
}
...
...
drivers/char/drm/gamma_dma.c
View file @
ad181870
...
...
@@ -346,6 +346,9 @@ static int gamma_dma_priority(struct file *filp,
drm_buf_t
*
buf
;
drm_buf_t
*
last_buf
=
NULL
;
drm_device_dma_t
*
dma
=
dev
->
dma
;
int
*
send_indices
=
NULL
;
int
*
send_sizes
=
NULL
;
DECLARE_WAITQUEUE
(
entry
,
current
);
/* Turn off interrupt handling */
...
...
@@ -365,11 +368,31 @@ static int gamma_dma_priority(struct file *filp,
++
must_free
;
}
send_indices
=
DRM
(
alloc
)(
d
->
send_count
*
sizeof
(
*
send_indices
),
DRM_MEM_DRIVER
);
if
(
send_indices
==
NULL
)
return
-
ENOMEM
;
if
(
copy_from_user
(
send_indices
,
d
->
send_indices
,
d
->
send_count
*
sizeof
(
*
send_indices
)))
{
retcode
=
-
EFAULT
;
goto
cleanup
;
}
send_sizes
=
DRM
(
alloc
)(
d
->
send_count
*
sizeof
(
*
send_sizes
),
DRM_MEM_DRIVER
);
if
(
send_sizes
==
NULL
)
return
-
ENOMEM
;
if
(
copy_from_user
(
send_sizes
,
d
->
send_sizes
,
d
->
send_count
*
sizeof
(
*
send_sizes
)))
{
retcode
=
-
EFAULT
;
goto
cleanup
;
}
for
(
i
=
0
;
i
<
d
->
send_count
;
i
++
)
{
idx
=
d
->
send_indices
[
i
];
idx
=
send_indices
[
i
];
if
(
idx
<
0
||
idx
>=
dma
->
buf_count
)
{
DRM_ERROR
(
"Index %d (of %d max)
\n
"
,
d
->
send_indices
[
i
],
dma
->
buf_count
-
1
);
send_indices
[
i
],
dma
->
buf_count
-
1
);
continue
;
}
buf
=
dma
->
buflist
[
idx
];
...
...
@@ -391,7 +414,7 @@ static int gamma_dma_priority(struct file *filp,
process closes the /dev/drm? handle, so
it can't also be doing DMA. */
buf
->
list
=
DRM_LIST_PRIO
;
buf
->
used
=
d
->
send_sizes
[
i
];
buf
->
used
=
send_sizes
[
i
];
buf
->
context
=
d
->
context
;
buf
->
while_locked
=
d
->
flags
&
_DRM_DMA_WHILE_LOCKED
;
address
=
(
unsigned
long
)
buf
->
address
;
...
...
@@ -402,14 +425,14 @@ static int gamma_dma_priority(struct file *filp,
if
(
buf
->
pending
)
{
DRM_ERROR
(
"Sending pending buffer:"
" buffer %d, offset %d
\n
"
,
d
->
send_indices
[
i
],
i
);
send_indices
[
i
],
i
);
retcode
=
-
EINVAL
;
goto
cleanup
;
}
if
(
buf
->
waiting
)
{
DRM_ERROR
(
"Sending waiting buffer:"
" buffer %d, offset %d
\n
"
,
d
->
send_indices
[
i
],
i
);
send_indices
[
i
],
i
);
retcode
=
-
EINVAL
;
goto
cleanup
;
}
...
...
@@ -458,6 +481,12 @@ static int gamma_dma_priority(struct file *filp,
gamma_dma_ready
(
dev
);
gamma_free_buffer
(
dev
,
last_buf
);
}
if
(
send_indices
)
DRM
(
free
)(
send_indices
,
d
->
send_count
*
sizeof
(
*
send_indices
),
DRM_MEM_DRIVER
);
if
(
send_sizes
)
DRM
(
free
)(
send_sizes
,
d
->
send_count
*
sizeof
(
*
send_sizes
),
DRM_MEM_DRIVER
);
if
(
must_free
&&
!
dev
->
context_flag
)
{
if
(
gamma_lock_free
(
dev
,
&
dev
->
lock
.
hw_lock
->
lock
,
...
...
@@ -476,9 +505,13 @@ static int gamma_dma_send_buffers(struct file *filp,
drm_buf_t
*
last_buf
=
NULL
;
int
retcode
=
0
;
drm_device_dma_t
*
dma
=
dev
->
dma
;
int
send_index
;
if
(
get_user
(
send_index
,
&
d
->
send_indices
[
d
->
send_count
-
1
]))
return
-
EFAULT
;
if
(
d
->
flags
&
_DRM_DMA_BLOCK
)
{
last_buf
=
dma
->
buflist
[
d
->
send_indices
[
d
->
send_count
-
1
]
];
last_buf
=
dma
->
buflist
[
send_index
];
add_wait_queue
(
&
last_buf
->
dma_wait
,
&
entry
);
}
...
...
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