int prim = mmesa->hw_primitive;
int fd = mmesa->driScreen->fd;
drm_mach64_vertex_t vertex;
- int i, ret;
+ int i;
mmesa->num_verts = 0;
mmesa->vert_used = 0;
mmesa->dirty |= MACH64_UPLOAD_CLIPRECTS;
if ( !count || !(mmesa->dirty & MACH64_UPLOAD_CLIPRECTS) ) {
+ int to = 0;
+ int ret;
+
/* FIXME: Is this really necessary */
if ( nbox == 1 )
mmesa->sarea->nbox = 0;
vertex.buf = buffer;
vertex.used = count;
vertex.discard = 1;
- ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
+ do {
+ ret = drmCommandWrite( fd, DRM_MACH64_VERTEX,
+ &vertex, sizeof(drm_mach64_vertex_t) );
+ } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
int nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS, nbox );
drm_clip_rect_t *b = mmesa->sarea->boxes;
int discard = 0;
+ int to = 0;
+ int ret;
mmesa->sarea->nbox = nr - i;
for ( ; i < nr ; i++ ) {
vertex.buf = buffer;
vertex.used = count;
vertex.discard = discard;
- ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
+ do {
+ ret = drmCommandWrite( fd, DRM_MACH64_VERTEX,
+ &vertex, sizeof(drm_mach64_vertex_t) );
+ } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
* Texture uploads
*/
-void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
+void mach64FireBlitLocked( mach64ContextPtr mmesa, void *buffer,
GLint offset, GLint pitch, GLint format,
GLint x, GLint y, GLint width, GLint height )
{
drm_mach64_blit_t blit;
- GLint ret;
+ int to = 0;
+ int ret;
- blit.idx = buffer->idx;
+ blit.buf = buffer;
blit.offset = offset;
blit.pitch = pitch;
blit.format = format;
blit.width = width;
blit.height = height;
- ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT,
- &blit, sizeof(drm_mach64_blit_t) );
+ do {
+ ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT,
+ &blit, sizeof(drm_mach64_blit_t) );
+ } while ( ( ret == -EAGAIN ) && ( to++ < MACH64_TIMEOUT ) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
remaining > 0 ;
remaining -= rows, y += rows, i++ )
{
- drmBufPtr buffer;
- CARD32 *dst;
-
height = MIN2(remaining, rows);
- /* Grab the dma buffer for the texture blit */
- buffer = mach64GetBufferLocked( mmesa );
-
- dst = (CARD32 *)((char *)buffer->address + MACH64_HOSTDATA_BLIT_OFFSET);
-
assert(image->Data);
{
const GLubyte *src = (const GLubyte *) image->Data +
(y * image->Width + x) * image->TexFormat->TexelBytes;
- const GLuint bytes = width * height * image->TexFormat->TexelBytes;
- memcpy(dst, src, bytes);
- }
- mach64FireBlitLocked( mmesa, buffer, offset, pitch, format,
- x, y, width, height );
+ mach64FireBlitLocked( mmesa, (void *)src, offset, pitch, format,
+ x, y, width, height );
+ }
}