Commit 1df703fa authored by Linus Torvalds's avatar Linus Torvalds

More drm updates from Keith Whitwell

parent bae651dd
......@@ -714,6 +714,7 @@ do { \
n, __FUNCTION__ ); \
} \
if ( dev_priv->ring.space <= (n) * sizeof(u32) ) { \
COMMIT_RING(); \
radeon_wait_ring( dev_priv, (n) * sizeof(u32) ); \
} \
_nr = n; dev_priv->ring.space -= (n) * sizeof(u32); \
......@@ -756,20 +757,25 @@ do { \
#define OUT_RING_USER_TABLE( tab, sz ) do { \
if (write + (sz) > mask) { \
int i; \
for ( i = 0 ; i < (sz) ; i++ ) { \
if (__get_user( tmp, &(tab)[i] )) \
return -EFAULT; \
OUT_RING( tmp ); \
} \
} \
else { \
int _size = (sz); \
int *_tab = (tab); \
\
if (write + _size > mask) { \
int i = (mask+1) - write; \
if (__copy_from_user( (int *)(ring+write), \
(tab), (sz)*4 )) \
_tab, i*4 )) \
return -EFAULT; \
write += (sz); \
write = 0; \
_size -= i; \
_tab += i; \
} \
\
if (_size && __copy_from_user( (int *)(ring+write), \
_tab, _size*4 )) \
return -EFAULT; \
\
write += _size; \
write &= mask; \
} while (0)
......
......@@ -1587,7 +1587,7 @@ static int radeon_emit_packets(
{
int sz = packet[(int)header.packet.packet_id].len;
int reg = packet[(int)header.packet.packet_id].start;
int tmp, *data = (int *)cmdbuf->buf;
int *data = (int *)cmdbuf->buf;
RING_LOCALS;
if (sz * sizeof(int) > cmdbuf->bufsz)
......@@ -1610,7 +1610,7 @@ static inline int radeon_emit_scalars(
drm_radeon_cmd_buffer_t *cmdbuf )
{
int sz = header.scalars.count;
int tmp, *data = (int *)cmdbuf->buf;
int *data = (int *)cmdbuf->buf;
int start = header.scalars.offset;
int stride = header.scalars.stride;
RING_LOCALS;
......@@ -1632,7 +1632,7 @@ static inline int radeon_emit_vectors(
drm_radeon_cmd_buffer_t *cmdbuf )
{
int sz = header.vectors.count;
int tmp, *data = (int *)cmdbuf->buf;
int *data = (int *)cmdbuf->buf;
int start = header.vectors.offset;
int stride = header.vectors.stride;
RING_LOCALS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment