diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-01-30 14:07:12 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-01-30 14:07:12 +0000 |
commit | 46edad7d29b6f65de46b9c9da6f66eb0b12e3f8c (patch) | |
tree | 2720cec2d7b8692f32fb64099f166bf2cda03f35 /src/gallium | |
parent | b3028acd98e2b7fd09344f9005c5b20bba91262c (diff) | |
parent | 7996b3e034f92eeceed3f3e7c01eb1f829d98b18 (diff) |
Merge branch 'gallium-0.2' into gallium-winsys-private
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/pipebuffer/pb_buffer.h | 8 | ||||
-rw-r--r-- | src/gallium/drivers/i915simple/i915_blit.c | 30 | ||||
-rw-r--r-- | src/gallium/drivers/i915simple/i915_blit.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/i915simple/i915_surface.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/Makefile | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/egl_surface.c | 16 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c | 10 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_context.c | 4 |
8 files changed, 30 insertions, 52 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index 7cba5fa441..d8f1f02d68 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -255,7 +255,13 @@ pb_reference(struct pb_buffer **dst, static INLINE boolean pb_check_alignment(size_t requested, size_t provided) { - return requested <= provided && (provided % requested) == 0 ? TRUE : FALSE; + if(!requested) + return TRUE; + if(requested > provided) + return FALSE; + if(provided % requested != 0) + return FALSE; + return TRUE; } diff --git a/src/gallium/drivers/i915simple/i915_blit.c b/src/gallium/drivers/i915simple/i915_blit.c index 5a4b829210..448a4708ce 100644 --- a/src/gallium/drivers/i915simple/i915_blit.c +++ b/src/gallium/drivers/i915simple/i915_blit.c @@ -38,7 +38,7 @@ void i915_fill_blit(struct i915_context *i915, unsigned cpp, - short dst_pitch, + unsigned short dst_pitch, struct pipe_buffer *dst_buffer, unsigned dst_offset, short x, short y, @@ -47,15 +47,23 @@ i915_fill_blit(struct i915_context *i915, { unsigned BR13, CMD; + + I915_DBG(i915, + "%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", + __FUNCTION__, + dst_buffer, dst_pitch, dst_offset, x, y, w, h); + switch (cpp) { case 1: case 2: case 3: - BR13 = dst_pitch | (0xF0 << 16) | (1 << 24); + BR13 = (((int) dst_pitch) & 0xffff) | + (0xF0 << 16) | (1 << 24); CMD = XY_COLOR_BLT_CMD; break; case 4: - BR13 = dst_pitch | (0xF0 << 16) | (1 << 24) | (1 << 25); + BR13 = (((int) dst_pitch) & 0xffff) | + (0xF0 << 16) | (1 << 24) | (1 << 25); CMD = (XY_COLOR_BLT_CMD | XY_COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB); break; @@ -63,10 +71,6 @@ i915_fill_blit(struct i915_context *i915, return; } -// DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", -// __FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h); - - if (!BEGIN_BATCH(6, 1)) { FLUSH_BATCH(NULL); assert(BEGIN_BATCH(6, 1)); @@ -85,10 +89,10 @@ void i915_copy_blit( struct i915_context *i915, unsigned do_flip, unsigned cpp, - short src_pitch, + unsigned short src_pitch, struct pipe_buffer *src_buffer, unsigned src_offset, - short dst_pitch, + unsigned short dst_pitch, struct pipe_buffer *dst_buffer, unsigned dst_offset, short src_x, short src_y, @@ -106,20 +110,16 @@ i915_copy_blit( struct i915_context *i915, src_buffer, src_pitch, src_offset, src_x, src_y, dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h); - src_pitch *= (short) cpp; - dst_pitch *= (short) cpp; - switch (cpp) { case 1: case 2: case 3: - BR13 = (((int) dst_pitch) & 0xffff) | + BR13 = (((int) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24); CMD = XY_SRC_COPY_BLT_CMD; break; case 4: - BR13 = - (((int) dst_pitch) & 0xffff) | + BR13 = (((int) dst_pitch) & 0xffff) | (0xCC << 16) | (1 << 24) | (1 << 25); CMD = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA | diff --git a/src/gallium/drivers/i915simple/i915_blit.h b/src/gallium/drivers/i915simple/i915_blit.h index 6e5b44e124..0bb3453861 100644 --- a/src/gallium/drivers/i915simple/i915_blit.h +++ b/src/gallium/drivers/i915simple/i915_blit.h @@ -33,10 +33,10 @@ extern void i915_copy_blit(struct i915_context *i915, unsigned do_flip, unsigned cpp, - short src_pitch, + unsigned short src_pitch, struct pipe_buffer *src_buffer, unsigned src_offset, - short dst_pitch, + unsigned short dst_pitch, struct pipe_buffer *dst_buffer, unsigned dst_offset, short srcx, short srcy, @@ -45,7 +45,7 @@ extern void i915_copy_blit(struct i915_context *i915, extern void i915_fill_blit(struct i915_context *i915, unsigned cpp, - short dst_pitch, + unsigned short dst_pitch, struct pipe_buffer *dst_buffer, unsigned dst_offset, short x, short y, diff --git a/src/gallium/drivers/i915simple/i915_surface.c b/src/gallium/drivers/i915simple/i915_surface.c index 62f1926644..3b3d9217a0 100644 --- a/src/gallium/drivers/i915simple/i915_surface.c +++ b/src/gallium/drivers/i915simple/i915_surface.c @@ -79,8 +79,8 @@ i915_surface_copy(struct pipe_context *pipe, i915_copy_blit( i915_context(pipe), do_flip, dst->block.size, - (short) src->stride, src->buffer, src->offset, - (short) dst->stride, dst->buffer, dst->offset, + (unsigned short) src->stride, src->buffer, src->offset, + (unsigned short) dst->stride, dst->buffer, dst->offset, (short) srcx, (short) srcy, (short) dstx, (short) dsty, (short) width, (short) height ); } } @@ -106,7 +106,7 @@ i915_surface_fill(struct pipe_context *pipe, assert(dst->block.height == 1); i915_fill_blit( i915_context(pipe), dst->block.size, - (short) dst->stride, + (unsigned short) dst->stride, dst->buffer, dst->offset, (short) dstx, (short) dsty, (short) width, (short) height, diff --git a/src/gallium/state_trackers/Makefile b/src/gallium/state_trackers/Makefile index 2f96a46c8d..07b3fbf311 100644 --- a/src/gallium/state_trackers/Makefile +++ b/src/gallium/state_trackers/Makefile @@ -2,7 +2,7 @@ TOP = ../../.. include $(TOP)/configs/current -SUBDIRS = glx egl +SUBDIRS = glx default: subdirs diff --git a/src/gallium/state_trackers/egl/egl_surface.c b/src/gallium/state_trackers/egl/egl_surface.c index 9e13f2fe58..091d437d81 100644 --- a/src/gallium/state_trackers/egl/egl_surface.c +++ b/src/gallium/state_trackers/egl/egl_surface.c @@ -80,7 +80,6 @@ drm_create_texture(_EGLDriver *drv, unsigned stride = 1024; unsigned pitch = 0; unsigned size = 0; - void *ptr; /* ugly */ if (stride < w) @@ -98,14 +97,6 @@ drm_create_texture(_EGLDriver *drv, if (!buf) goto err_buf; -#if DEBUG - ptr = pipe_buffer_map(screen, buf, PIPE_BUFFER_USAGE_CPU_WRITE); - memset(ptr, 0xFF, size); - pipe_buffer_unmap(screen, buf); -#else - (void)ptr; -#endif - memset(&templat, 0, sizeof(templat)); templat.tex_usage |= PIPE_TEXTURE_USAGE_DISPLAY_TARGET; templat.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET; @@ -340,13 +331,6 @@ drm_show_screen_surface_mesa(_EGLDriver *drv, EGLDisplay dpy, if (ret) goto err_crtc; - pipe = drm_api_hocks.create_context(dev->screen); - pipe->surface_fill(pipe, scrn->surface, - 0, 0, - scrn->front.width, scrn->front.height, - 0xFF00FFFF); - pipe->destroy(pipe); - surf->screen = scrn; scrn->surf = surf; diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c b/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c index 517c693a9b..d9556e1f38 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c @@ -68,8 +68,6 @@ intel_be_offset_relocation(struct intel_be_batchbuffer *batch, offset = (unsigned)(batch->base.ptr - batch->base.map); - debug_printf(" - offset: %p\n", offset); - ret = drm_intel_bo_emit_reloc(batch->bo, offset, bo, pre_add, read_domains, @@ -106,18 +104,10 @@ intel_be_batchbuffer_flush(struct intel_be_batchbuffer *batch, i915_batchbuffer_dword(i915, (0x0<<29)|(0xA<<23)); // MI_BATCH_BUFFER_END; } - i915_dump_batchbuffer(i915); - debug_printf("%s\n", __FUNCTION__); - used = batch->base.ptr - batch->base.map; - debug_printf(" - subdata\n"); drm_intel_bo_subdata(batch->bo, 0, used, batch->base.map); - debug_printf(" - exec\n"); ret = drm_intel_bo_exec(batch->bo, used, NULL, 0, 0); - debug_printf(" - waiting\n"); - drm_intel_bo_wait_rendering(batch->bo); - debug_printf(" - done\n"); assert(ret == 0); diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_context.c b/src/gallium/winsys/drm/intel/gem/intel_be_context.c index c1f18a3a04..95e761d78d 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_context.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.c @@ -33,15 +33,13 @@ intel_be_batch_reloc(struct i915_winsys *sws, read |= I915_GEM_DOMAIN_VERTEX; } - debug_printf("%s\n", __FUNCTION__); - debug_printf(" - flags: %u, read: %u, write: %u, delta: %p\n", access_flags, read, write, delta); ret = intel_be_offset_relocation(intel->batch, delta, bo, read, write); - debug_printf(" - ret = %i\n", ret); assert(ret == 0); + /* TODO change return type */ /* return ret; */ } |