intel: Fix some potential writes to zero-copy PBOs when used as regions.

I was in the midst of fixing some blitting-with-Y-tiled issues when I
noticed this.  Hopefully PBO usage will be a little more robust, as a
result.
This commit is contained in:
Eric Anholt
2009-06-22 11:20:18 -07:00
parent 6a49473ab5
commit 246d59c29e
5 changed files with 13 additions and 10 deletions
@@ -511,7 +511,7 @@ intel_miptree_image_copy(struct intel_context *intel,
0,
0,
src->region, src_offset + src_depth_offset[i],
0, 0, width, height);
0, 0, width, height, GL_COPY);
}
}
@@ -362,11 +362,9 @@ do_blit_copypixels(GLcontext * ctx,
&clip_x, &clip_y, &clip_w, &clip_h))
continue;
intelEmitCopyBlit(intel, dst->cpp,
src->pitch, src->buffer, 0, src->tiling,
dst->pitch, dst->buffer, 0, dst->tiling,
clip_x + delta_x, clip_y + delta_y, /* srcx, srcy */
clip_x, clip_y, /* dstx, dsty */
intel_region_copy(intel,
dst, 0, clip_x, clip_y,
src, 0, clip_x + delta_x, clip_y + delta_y,
clip_w, clip_h,
ctx->Color.ColorLogicOpEnabled ?
ctx->Color.LogicOp : GL_COPY);
+3 -2
View File
@@ -367,7 +367,8 @@ intel_region_copy(struct intel_context *intel,
GLuint dstx, GLuint dsty,
struct intel_region *src,
GLuint src_offset,
GLuint srcx, GLuint srcy, GLuint width, GLuint height)
GLuint srcx, GLuint srcy, GLuint width, GLuint height,
GLenum logicop)
{
_DBG("%s\n", __FUNCTION__);
@@ -389,7 +390,7 @@ intel_region_copy(struct intel_context *intel,
src->pitch, src->buffer, src_offset, src->tiling,
dst->pitch, dst->buffer, dst_offset, dst->tiling,
srcx, srcy, dstx, dsty, width, height,
GL_COPY);
logicop);
}
/* Attach to a pbo, discarding our data. Effectively zero-copy upload
+2 -1
View File
@@ -116,7 +116,8 @@ void intel_region_copy(struct intel_context *intel,
GLuint destx, GLuint desty,
struct intel_region *src,
GLuint src_offset,
GLuint srcx, GLuint srcy, GLuint width, GLuint height);
GLuint srcx, GLuint srcy, GLuint width, GLuint height,
GLenum logicop);
/* Helpers for zerocopy uploads, particularly texture image uploads:
*/
+4 -1
View File
@@ -107,6 +107,9 @@ do_copy_texsubimage(struct intel_context *intel,
intelFlush(ctx);
LOCK_HARDWARE(intel);
{
drm_intel_bo *dst_bo = intel_region_buffer(intel,
intelImage->mt->region,
INTEL_WRITE_PART);
GLuint image_offset = intel_miptree_image_offset(intelImage->mt,
intelImage->face,
intelImage->level);
@@ -151,7 +154,7 @@ do_copy_texsubimage(struct intel_context *intel,
0,
src->tiling,
intelImage->mt->pitch,
intelImage->mt->region->buffer,
dst_bo,
image_offset,
intelImage->mt->region->tiling,
x, y, dstx, dsty, width, height,