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

More drm updates from Keith Whitwell

parent bae651dd
...@@ -714,6 +714,7 @@ do { \ ...@@ -714,6 +714,7 @@ do { \
n, __FUNCTION__ ); \ n, __FUNCTION__ ); \
} \ } \
if ( dev_priv->ring.space <= (n) * sizeof(u32) ) { \ if ( dev_priv->ring.space <= (n) * sizeof(u32) ) { \
COMMIT_RING(); \
radeon_wait_ring( dev_priv, (n) * sizeof(u32) ); \ radeon_wait_ring( dev_priv, (n) * sizeof(u32) ); \
} \ } \
_nr = n; dev_priv->ring.space -= (n) * sizeof(u32); \ _nr = n; dev_priv->ring.space -= (n) * sizeof(u32); \
...@@ -756,20 +757,25 @@ do { \ ...@@ -756,20 +757,25 @@ do { \
#define OUT_RING_USER_TABLE( tab, sz ) do { \ #define OUT_RING_USER_TABLE( tab, sz ) do { \
if (write + (sz) > mask) { \ int _size = (sz); \
int i; \ int *_tab = (tab); \
for ( i = 0 ; i < (sz) ; i++ ) { \ \
if (__get_user( tmp, &(tab)[i] )) \ if (write + _size > mask) { \
return -EFAULT; \ int i = (mask+1) - write; \
OUT_RING( tmp ); \ if (__copy_from_user( (int *)(ring+write), \
} \ _tab, i*4 )) \
} \
else { \
if (__copy_from_user( (int *)(ring+write), \
(tab), (sz)*4 )) \
return -EFAULT; \ 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) } while (0)
......
...@@ -1587,7 +1587,7 @@ static int radeon_emit_packets( ...@@ -1587,7 +1587,7 @@ static int radeon_emit_packets(
{ {
int sz = packet[(int)header.packet.packet_id].len; int sz = packet[(int)header.packet.packet_id].len;
int reg = packet[(int)header.packet.packet_id].start; int reg = packet[(int)header.packet.packet_id].start;
int tmp, *data = (int *)cmdbuf->buf; int *data = (int *)cmdbuf->buf;
RING_LOCALS; RING_LOCALS;
if (sz * sizeof(int) > cmdbuf->bufsz) if (sz * sizeof(int) > cmdbuf->bufsz)
...@@ -1610,7 +1610,7 @@ static inline int radeon_emit_scalars( ...@@ -1610,7 +1610,7 @@ static inline int radeon_emit_scalars(
drm_radeon_cmd_buffer_t *cmdbuf ) drm_radeon_cmd_buffer_t *cmdbuf )
{ {
int sz = header.scalars.count; int sz = header.scalars.count;
int tmp, *data = (int *)cmdbuf->buf; int *data = (int *)cmdbuf->buf;
int start = header.scalars.offset; int start = header.scalars.offset;
int stride = header.scalars.stride; int stride = header.scalars.stride;
RING_LOCALS; RING_LOCALS;
...@@ -1632,7 +1632,7 @@ static inline int radeon_emit_vectors( ...@@ -1632,7 +1632,7 @@ static inline int radeon_emit_vectors(
drm_radeon_cmd_buffer_t *cmdbuf ) drm_radeon_cmd_buffer_t *cmdbuf )
{ {
int sz = header.vectors.count; int sz = header.vectors.count;
int tmp, *data = (int *)cmdbuf->buf; int *data = (int *)cmdbuf->buf;
int start = header.vectors.offset; int start = header.vectors.offset;
int stride = header.vectors.stride; int stride = header.vectors.stride;
RING_LOCALS; 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