mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
Make regions screen-based instead of context based.
This commit is contained in:
parent
607c474f2d
commit
980a25cd92
22 changed files with 297 additions and 216 deletions
|
|
@ -407,10 +407,10 @@ meta_draw_region(struct intel_context *intel,
|
|||
GLuint format;
|
||||
GLuint depth_format = DEPTH_FRMT_16_FIXED;
|
||||
|
||||
intel_region_release(intel, &i830->meta.draw_region);
|
||||
intel_region_release(intel->intelScreen, &i830->meta.draw_region);
|
||||
intel_region_reference(&i830->meta.draw_region, draw_region);
|
||||
|
||||
intel_region_release(intel, &i830->meta.depth_region);
|
||||
intel_region_release(intel->intelScreen, &i830->meta.depth_region);
|
||||
intel_region_reference(&i830->meta.depth_region, depth_region);
|
||||
|
||||
/* XXX FBO: grab code from i915 meta_draw_region */
|
||||
|
|
@ -459,8 +459,8 @@ static void
|
|||
leave_meta_state(struct intel_context *intel)
|
||||
{
|
||||
struct i830_context *i830 = i830_context(&intel->ctx);
|
||||
intel_region_release(intel, &i830->meta.draw_region);
|
||||
intel_region_release(intel, &i830->meta.depth_region);
|
||||
intel_region_release(intel->intelScreen, &i830->meta.draw_region);
|
||||
intel_region_release(intel->intelScreen, &i830->meta.depth_region);
|
||||
/* intel_region_release(intel, &i830->meta.tex_region[0]); */
|
||||
SET_STATE(i830, state);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -520,8 +520,8 @@ i830_set_draw_region(struct intel_context *intel,
|
|||
{
|
||||
struct i830_context *i830 = i830_context(&intel->ctx);
|
||||
|
||||
intel_region_release(intel, &i830->state.draw_region);
|
||||
intel_region_release(intel, &i830->state.depth_region);
|
||||
intel_region_release(intel->intelScreen, &i830->state.draw_region);
|
||||
intel_region_release(intel->intelScreen, &i830->state.depth_region);
|
||||
intel_region_reference(&i830->state.draw_region, draw_region);
|
||||
intel_region_reference(&i830->state.depth_region, depth_region);
|
||||
|
||||
|
|
|
|||
|
|
@ -483,8 +483,8 @@ static void
|
|||
leave_meta_state(struct intel_context *intel)
|
||||
{
|
||||
struct i915_context *i915 = i915_context(&intel->ctx);
|
||||
intel_region_release(intel, &i915->meta.draw_region);
|
||||
intel_region_release(intel, &i915->meta.depth_region);
|
||||
intel_region_release(intel->intelScreen, &i915->meta.draw_region);
|
||||
intel_region_release(intel->intelScreen, &i915->meta.depth_region);
|
||||
/* intel_region_release(intel, &i915->meta.tex_region[0]); */
|
||||
SET_STATE(i915, state);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,11 +443,11 @@ i915_state_draw_region(struct intel_context *intel,
|
|||
ASSERT(state == &i915->state || state == &i915->meta);
|
||||
|
||||
if (state->draw_region != color_region) {
|
||||
intel_region_release(intel, &state->draw_region);
|
||||
intel_region_release(intel->intelScreen, &state->draw_region);
|
||||
intel_region_reference(&state->draw_region, color_region);
|
||||
}
|
||||
if (state->depth_region != depth_region) {
|
||||
intel_region_release(intel, &state->depth_region);
|
||||
intel_region_release(intel->intelScreen, &state->depth_region);
|
||||
intel_region_reference(&state->depth_region, depth_region);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ pool_waitIdle(struct _DriBufferPool *pool, void *private, int lazy)
|
|||
{
|
||||
BBuf *buf = (BBuf *) private;
|
||||
driFenceFinish(buf->fence, 0, lazy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void
|
|||
intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
|
||||
const drm_clip_rect_t * rect)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
struct intel_context *intel;
|
||||
GLboolean missed_target;
|
||||
int64_t ust;
|
||||
|
|
@ -60,15 +60,10 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
|
|||
|
||||
assert(dPriv);
|
||||
|
||||
/* We need a rendering context in order to issue the blit cmd.
|
||||
* Use the current context.
|
||||
* XXX need to fix this someday.
|
||||
*/
|
||||
if (!ctx) {
|
||||
_mesa_problem(NULL, "No current context in intelCopyBuffer()");
|
||||
intel = intelScreenContext(dPriv->driScreenPriv->private);
|
||||
if (!intel)
|
||||
return;
|
||||
}
|
||||
intel = (struct intel_context *) ctx;
|
||||
|
||||
if (intel->last_swap_fence) {
|
||||
driFenceFinish(intel->last_swap_fence, DRM_FENCE_TYPE_EXE, GL_TRUE);
|
||||
driFenceUnReference(intel->last_swap_fence);
|
||||
|
|
@ -444,7 +439,7 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask, GLboolean all,
|
|||
= intel_renderbuffer(ctx->DrawBuffer->
|
||||
Attachment[buf].Renderbuffer);
|
||||
struct _DriBufferObject *write_buffer =
|
||||
intel_region_buffer(intel, irb->region,
|
||||
intel_region_buffer(intel->intelScreen, irb->region,
|
||||
all ? INTEL_WRITE_FULL :
|
||||
INTEL_WRITE_PART);
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ intel_bufferobj_cow(struct intel_context *intel,
|
|||
struct intel_buffer_object *intel_obj)
|
||||
{
|
||||
assert(intel_obj->region);
|
||||
intel_region_cow(intel, intel_obj->region);
|
||||
intel_region_cow(intel->intelScreen, intel_obj->region);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -452,15 +452,15 @@ intelRotateWindow(struct intel_context *intel,
|
|||
intel->numClipRects = 1;
|
||||
intel->pClipRects = &fullRect;
|
||||
|
||||
intel->vtbl.meta_draw_region(intel, intel->rotated_region, NULL); /* ? */
|
||||
intel->vtbl.meta_draw_region(intel, screen->rotated_region, NULL); /* ? */
|
||||
|
||||
if (srcBuf == BUFFER_BIT_FRONT_LEFT) {
|
||||
src = intel->front_region;
|
||||
src = intel->intelScreen->front_region;
|
||||
clipRects = dPriv->pClipRects;
|
||||
numClipRects = dPriv->numClipRects;
|
||||
}
|
||||
else {
|
||||
src = intel->back_region;
|
||||
src = intel->intelScreen->back_region;
|
||||
clipRects = dPriv->pBackClipRects;
|
||||
numClipRects = dPriv->numBackClipRects;
|
||||
}
|
||||
|
|
@ -915,9 +915,9 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb)
|
|||
intel_region_release(intel, &intel->draw_region);
|
||||
intel_region_reference(&intel->draw_region, colorRegion);
|
||||
}
|
||||
if (intel->depth_region != depthRegion) {
|
||||
intel_region_release(intel, &intel->depth_region);
|
||||
intel_region_reference(&intel->depth_region, depthRegion);
|
||||
if (intel->intelScreen->depth_region != depthRegion) {
|
||||
intel_region_release(intel, &intel->intelScreen->depth_region);
|
||||
intel_region_reference(&intel->intelScreen->depth_region, depthRegion);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -266,78 +266,6 @@ intelFlush(GLcontext * ctx)
|
|||
}
|
||||
|
||||
|
||||
/* Create intel_region structs to describe the static front,back,depth
|
||||
* buffers created by the xserver. This is strictly speaking screen
|
||||
* state, but the buffer manager is context state, so these must also
|
||||
* be.
|
||||
*
|
||||
* Although FBO's mean we now no longer use these as render targets in
|
||||
* all circumstances, they won't go away until the back and depth
|
||||
* buffers become private, and the front and rotated buffers will
|
||||
* remain even then.
|
||||
*
|
||||
* Note that these don't allocate video memory, just describe
|
||||
* allocations alread made by the X server.
|
||||
*/
|
||||
static void
|
||||
intel_recreate_static_regions(struct intel_context *intel)
|
||||
{
|
||||
intelScreenPrivate *intelScreen = intel->intelScreen;
|
||||
|
||||
if (intel->front_region)
|
||||
intel_region_release(intel, &intel->front_region);
|
||||
|
||||
if (intel->rotated_region)
|
||||
intel_region_release(intel, &intel->rotated_region);
|
||||
|
||||
if (intel->back_region)
|
||||
intel_region_release(intel, &intel->back_region);
|
||||
|
||||
if (intel->depth_region)
|
||||
intel_region_release(intel, &intel->depth_region);
|
||||
|
||||
intel->front_region =
|
||||
intel_region_create_static(intel,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->front.offset,
|
||||
intelScreen->front.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->front.pitch / intelScreen->cpp,
|
||||
intelScreen->height);
|
||||
|
||||
|
||||
intel->rotated_region =
|
||||
intel_region_create_static(intel,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->rotated.offset,
|
||||
intelScreen->rotated.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->rotated.pitch /
|
||||
intelScreen->cpp, intelScreen->height);
|
||||
|
||||
|
||||
intel->back_region =
|
||||
intel_region_create_static(intel,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->back.offset,
|
||||
intelScreen->back.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->back.pitch / intelScreen->cpp,
|
||||
intelScreen->height);
|
||||
|
||||
/* Still assuming front.cpp == depth.cpp
|
||||
*/
|
||||
intel->depth_region =
|
||||
intel_region_create_static(intel,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->depth.offset,
|
||||
intelScreen->depth.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->depth.pitch / intelScreen->cpp,
|
||||
intelScreen->height);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if we need to rotate/warp the front color buffer to the
|
||||
* rotated screen. We generally need to do this when we get a glFlush
|
||||
|
|
@ -530,7 +458,6 @@ intelInitContext(struct intel_context *intel,
|
|||
intel->last_swap_fence = NULL;
|
||||
intel->first_swap_fence = NULL;
|
||||
|
||||
intel_recreate_static_regions(intel);
|
||||
intel_bufferobj_init(intel);
|
||||
intel_fbo_init(intel);
|
||||
|
||||
|
|
@ -645,16 +572,16 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
|||
= intel_get_renderbuffer(drawFb, BUFFER_STENCIL);
|
||||
|
||||
if (irbFront && !irbFront->region) {
|
||||
intel_region_reference(&irbFront->region, intel->front_region);
|
||||
intel_region_reference(&irbFront->region, intel->intelScreen->front_region);
|
||||
}
|
||||
if (irbBack && !irbBack->region) {
|
||||
intel_region_reference(&irbBack->region, intel->back_region);
|
||||
intel_region_reference(&irbBack->region, intel->intelScreen->back_region);
|
||||
}
|
||||
if (irbDepth && !irbDepth->region) {
|
||||
intel_region_reference(&irbDepth->region, intel->depth_region);
|
||||
intel_region_reference(&irbDepth->region, intel->intelScreen->depth_region);
|
||||
}
|
||||
if (irbStencil && !irbStencil->region) {
|
||||
intel_region_reference(&irbStencil->region, intel->depth_region);
|
||||
intel_region_reference(&irbStencil->region, intel->intelScreen->depth_region);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -669,33 +596,6 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the information in the sarea to update the screen parameters
|
||||
* related to screen rotation.
|
||||
*/
|
||||
static void
|
||||
intelUpdateScreenRotation(struct intel_context *intel,
|
||||
__DRIscreenPrivate * sPriv, drmI830Sarea * sarea)
|
||||
{
|
||||
intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
|
||||
intelRegion *colorBuf;
|
||||
|
||||
intelUnmapScreenRegions(intelScreen);
|
||||
intelUpdateScreenFromSAREA(intelScreen, sarea);
|
||||
|
||||
/* update the current hw offsets for the color and depth buffers */
|
||||
if (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT)
|
||||
colorBuf = &intelScreen->back;
|
||||
else
|
||||
colorBuf = &intelScreen->front;
|
||||
|
||||
if (!intelMapScreenRegions(sPriv)) {
|
||||
fprintf(stderr, "ERROR Remapping screen regions!!!\n");
|
||||
}
|
||||
|
||||
intel_recreate_static_regions(intel);
|
||||
}
|
||||
|
||||
void
|
||||
intelGetLock(struct intel_context *intel, GLuint flags)
|
||||
{
|
||||
|
|
@ -717,7 +617,8 @@ intelGetLock(struct intel_context *intel, GLuint flags)
|
|||
if (sarea->width != intelScreen->width ||
|
||||
sarea->height != intelScreen->height ||
|
||||
sarea->rotation != intelScreen->current_rotation) {
|
||||
intelUpdateScreenRotation(intel, sPriv, sarea);
|
||||
|
||||
intelUpdateScreenRotation(sPriv, sarea);
|
||||
|
||||
/*
|
||||
* This will drop the outstanding batchbuffer on the floor
|
||||
|
|
|
|||
|
|
@ -228,13 +228,13 @@ struct intel_context
|
|||
GLuint vertex_size;
|
||||
GLubyte *verts; /* points to tnl->clipspace.vertex_buf */
|
||||
|
||||
|
||||
#if 0
|
||||
struct intel_region *front_region; /* XXX FBO: obsolete */
|
||||
struct intel_region *rotated_region; /* XXX FBO: obsolete */
|
||||
struct intel_region *back_region; /* XXX FBO: obsolete */
|
||||
struct intel_region *draw_region; /* XXX FBO: rename to color_region */
|
||||
struct intel_region *depth_region; /**< currently bound depth/Z region */
|
||||
|
||||
#endif
|
||||
|
||||
/* Fallback rasterization functions
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -95,12 +95,12 @@ map_regions(GLcontext * ctx,
|
|||
{
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
if (depthRb && depthRb->region) {
|
||||
intel_region_map(intel, depthRb->region);
|
||||
intel_region_map(intel->intelScreen, depthRb->region);
|
||||
depthRb->pfMap = depthRb->region->map;
|
||||
depthRb->pfPitch = depthRb->region->pitch;
|
||||
}
|
||||
if (stencilRb && stencilRb->region) {
|
||||
intel_region_map(intel, stencilRb->region);
|
||||
intel_region_map(intel->intelScreen, stencilRb->region);
|
||||
stencilRb->pfMap = stencilRb->region->map;
|
||||
stencilRb->pfPitch = stencilRb->region->pitch;
|
||||
}
|
||||
|
|
@ -113,12 +113,12 @@ unmap_regions(GLcontext * ctx,
|
|||
{
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
if (depthRb && depthRb->region) {
|
||||
intel_region_unmap(intel, depthRb->region);
|
||||
intel_region_unmap(intel->intelScreen, depthRb->region);
|
||||
depthRb->pfMap = NULL;
|
||||
depthRb->pfPitch = 0;
|
||||
}
|
||||
if (stencilRb && stencilRb->region) {
|
||||
intel_region_unmap(intel, stencilRb->region);
|
||||
intel_region_unmap(intel->intelScreen, stencilRb->region);
|
||||
stencilRb->pfMap = NULL;
|
||||
stencilRb->pfPitch = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb)
|
|||
}
|
||||
|
||||
if (intel && irb->region) {
|
||||
intel_region_release(intel, &irb->region);
|
||||
intel_region_release(intel->intelScreen, &irb->region);
|
||||
}
|
||||
|
||||
_mesa_free(irb);
|
||||
|
|
@ -228,7 +228,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
|||
/* free old region */
|
||||
if (irb->region) {
|
||||
/*LOCK_HARDWARE(intel); */
|
||||
intel_region_release(intel, &irb->region);
|
||||
intel_region_release(intel->intelScreen, &irb->region);
|
||||
/*UNLOCK_HARDWARE(intel); */
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
|||
DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width,
|
||||
height, pitch);
|
||||
|
||||
irb->region = intel_region_alloc(intel, cpp, pitch, height);
|
||||
irb->region = intel_region_alloc(intel->intelScreen, cpp, pitch, height);
|
||||
if (!irb->region)
|
||||
return GL_FALSE; /* out of memory? */
|
||||
|
||||
|
|
@ -595,7 +595,7 @@ intel_finish_render_texture(GLcontext * ctx,
|
|||
|
||||
if (irb) {
|
||||
/* just release the region */
|
||||
intel_region_release(intel, &irb->region);
|
||||
intel_region_release(intel->intelScreen, &irb->region);
|
||||
}
|
||||
else if (att->Renderbuffer) {
|
||||
/* software fallback */
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ intel_miptree_create(struct intel_context *intel,
|
|||
}
|
||||
|
||||
if (ok)
|
||||
mt->region = intel_region_alloc(intel,
|
||||
mt->region = intel_region_alloc(intel->intelScreen,
|
||||
mt->cpp, mt->pitch, mt->total_height);
|
||||
|
||||
if (!mt->region) {
|
||||
|
|
@ -128,7 +128,7 @@ intel_miptree_release(struct intel_context *intel,
|
|||
|
||||
DBG("%s deleting %p\n", __FUNCTION__, *mt);
|
||||
|
||||
intel_region_release(intel, &((*mt)->region));
|
||||
intel_region_release(intel->intelScreen, &((*mt)->region));
|
||||
|
||||
for (i = 0; i < MAX_TEXTURE_LEVELS; i++)
|
||||
if ((*mt)->level[i].image_offset)
|
||||
|
|
@ -274,7 +274,7 @@ intel_miptree_image_map(struct intel_context * intel,
|
|||
memcpy(image_offsets, mt->level[level].image_offset,
|
||||
mt->level[level].depth * sizeof(GLuint));
|
||||
|
||||
return (intel_region_map(intel, mt->region) +
|
||||
return (intel_region_map(intel->intelScreen, mt->region) +
|
||||
intel_miptree_image_offset(mt, face, level));
|
||||
}
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ intel_miptree_image_unmap(struct intel_context *intel,
|
|||
struct intel_mipmap_tree *mt)
|
||||
{
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
intel_region_unmap(intel, mt->region);
|
||||
intel_region_unmap(intel->intelScreen, mt->region);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ intel_miptree_image_data(struct intel_context *intel,
|
|||
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
for (i = 0; i < depth; i++) {
|
||||
intel_region_data(intel, dst->region, dst_offset + dst_depth_offset[i], 0, 0, src, src_row_pitch, 0, 0, /* source x,y */
|
||||
intel_region_data(intel->intelScreen, dst->region, dst_offset + dst_depth_offset[i], 0, 0, src, src_row_pitch, 0, 0, /* source x,y */
|
||||
dst->level[level].width, dst->level[level].height);
|
||||
|
||||
src += src_image_pitch;
|
||||
|
|
@ -330,7 +330,7 @@ intel_miptree_image_copy(struct intel_context *intel,
|
|||
GLuint i;
|
||||
|
||||
for (i = 0; i < depth; i++) {
|
||||
intel_region_copy(intel,
|
||||
intel_region_copy(intel->intelScreen,
|
||||
dst->region, dst_offset + dst_depth_offset[i],
|
||||
0,
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -54,8 +54,9 @@ copypix_src_region(struct intel_context *intel, GLenum type)
|
|||
case GL_DEPTH:
|
||||
/* Don't think this is really possible execpt at 16bpp, when we have no stencil.
|
||||
*/
|
||||
if (intel->depth_region && intel->depth_region->cpp == 2)
|
||||
return intel->depth_region;
|
||||
if (intel->intelScreen->depth_region &&
|
||||
intel->intelScreen->depth_region->cpp == 2)
|
||||
return intel->intelScreen->depth_region;
|
||||
case GL_STENCIL:
|
||||
/* Don't think this is really possible.
|
||||
*/
|
||||
|
|
@ -63,7 +64,7 @@ copypix_src_region(struct intel_context *intel, GLenum type)
|
|||
case GL_DEPTH_STENCIL_EXT:
|
||||
/* Does it matter whether it is stencil/depth or depth/stencil?
|
||||
*/
|
||||
return intel->depth_region;
|
||||
return intel->intelScreen->depth_region;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -163,7 +164,7 @@ do_texture_copypixels(GLcontext * ctx,
|
|||
|
||||
/* Set the 3d engine to draw into the destination region:
|
||||
*/
|
||||
intel->vtbl.meta_draw_region(intel, dst, intel->depth_region);
|
||||
intel->vtbl.meta_draw_region(intel, dst, intel->intelScreen->depth_region);
|
||||
|
||||
intel->vtbl.meta_import_pixel_state(intel);
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ do_texture_drawpixels(GLcontext * ctx,
|
|||
|
||||
/* Set the 3d engine to draw into the destination region:
|
||||
*/
|
||||
intel->vtbl.meta_draw_region(intel, dst, intel->depth_region);
|
||||
intel->vtbl.meta_draw_region(intel, dst, intel->intelScreen->depth_region);
|
||||
|
||||
intel->vtbl.meta_import_pixel_state(intel);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
#define FILE_DEBUG_FLAG DEBUG_REGION
|
||||
|
||||
void
|
||||
intel_region_idle(struct intel_context *intel, struct intel_region *region)
|
||||
intel_region_idle(intelScreenPrivate *intelScreen, struct intel_region *region)
|
||||
{
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
driBOWaitIdle(region->buffer, GL_FALSE);
|
||||
|
|
@ -58,12 +58,12 @@ intel_region_idle(struct intel_context *intel, struct intel_region *region)
|
|||
/* XXX: Thread safety?
|
||||
*/
|
||||
GLubyte *
|
||||
intel_region_map(struct intel_context *intel, struct intel_region *region)
|
||||
intel_region_map(intelScreenPrivate *intelScreen, struct intel_region *region)
|
||||
{
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
if (!region->map_refcount++) {
|
||||
if (region->pbo)
|
||||
intel_region_cow(intel, region);
|
||||
intel_region_cow(intelScreen, region);
|
||||
|
||||
region->map = driBOMap(region->buffer,
|
||||
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
|
||||
|
|
@ -73,7 +73,7 @@ intel_region_map(struct intel_context *intel, struct intel_region *region)
|
|||
}
|
||||
|
||||
void
|
||||
intel_region_unmap(struct intel_context *intel, struct intel_region *region)
|
||||
intel_region_unmap(intelScreenPrivate *intelScreen, struct intel_region *region)
|
||||
{
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
if (!--region->map_refcount) {
|
||||
|
|
@ -83,7 +83,7 @@ intel_region_unmap(struct intel_context *intel, struct intel_region *region)
|
|||
}
|
||||
|
||||
struct intel_region *
|
||||
intel_region_alloc(struct intel_context *intel,
|
||||
intel_region_alloc(intelScreenPrivate *intelScreen,
|
||||
GLuint cpp, GLuint pitch, GLuint height)
|
||||
{
|
||||
struct intel_region *region = calloc(sizeof(*region), 1);
|
||||
|
|
@ -95,7 +95,7 @@ intel_region_alloc(struct intel_context *intel,
|
|||
region->height = height; /* needed? */
|
||||
region->refcount = 1;
|
||||
|
||||
driGenBuffers(intel->intelScreen->regionPool,
|
||||
driGenBuffers(intelScreen->regionPool,
|
||||
"region", 1, ®ion->buffer, 64, 0, 0);
|
||||
driBOData(region->buffer, pitch * cpp * height, NULL, 0);
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ intel_region_reference(struct intel_region **dst, struct intel_region *src)
|
|||
}
|
||||
|
||||
void
|
||||
intel_region_release(struct intel_context *intel,
|
||||
intel_region_release(intelScreenPrivate *intelScreen,
|
||||
struct intel_region **region)
|
||||
{
|
||||
if (!*region)
|
||||
|
|
@ -128,7 +128,7 @@ intel_region_release(struct intel_context *intel,
|
|||
assert((*region)->map_refcount == 0);
|
||||
|
||||
if ((*region)->pbo)
|
||||
intel_region_release_pbo(intel, *region);
|
||||
intel_region_release_pbo(intelScreen, *region);
|
||||
else
|
||||
driDeleteBuffers(1, &(*region)->buffer);
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ intel_region_release(struct intel_context *intel,
|
|||
|
||||
|
||||
struct intel_region *
|
||||
intel_region_create_static(struct intel_context *intel,
|
||||
intel_region_create_static(intelScreenPrivate *intelScreen,
|
||||
GLuint mem_type,
|
||||
GLuint offset,
|
||||
void *virtual,
|
||||
|
|
@ -158,7 +158,7 @@ intel_region_create_static(struct intel_context *intel,
|
|||
* shared by others.
|
||||
*/
|
||||
|
||||
driGenBuffers(intel->intelScreen->staticPool, "static region", 1,
|
||||
driGenBuffers(intelScreen->staticPool, "static region", 1,
|
||||
®ion->buffer, 64,
|
||||
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_EVICT |
|
||||
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
|
||||
|
|
@ -169,6 +169,36 @@ intel_region_create_static(struct intel_context *intel,
|
|||
|
||||
|
||||
|
||||
void
|
||||
intel_region_update_static(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region,
|
||||
GLuint mem_type,
|
||||
GLuint offset,
|
||||
void *virtual,
|
||||
GLuint cpp, GLuint pitch, GLuint height)
|
||||
{
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
|
||||
region->cpp = cpp;
|
||||
region->pitch = pitch;
|
||||
region->height = height; /* needed? */
|
||||
|
||||
/*
|
||||
* We use a "shared" buffer type to indicate buffers created and
|
||||
* shared by others.
|
||||
*/
|
||||
|
||||
driDeleteBuffers(1, ®ion->buffer);
|
||||
driGenBuffers(intelScreen->staticPool, "static region", 1,
|
||||
®ion->buffer, 64,
|
||||
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_NO_EVICT |
|
||||
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0);
|
||||
driBOSetStatic(region->buffer, offset, pitch * cpp * height, virtual, 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* XXX Move this into core Mesa?
|
||||
*/
|
||||
|
|
@ -212,32 +242,37 @@ _mesa_copy_rect(GLubyte * dst,
|
|||
* Currently always memcpy.
|
||||
*/
|
||||
void
|
||||
intel_region_data(struct intel_context *intel,
|
||||
intel_region_data(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *dst,
|
||||
GLuint dst_offset,
|
||||
GLuint dstx, GLuint dsty,
|
||||
void *src, GLuint src_pitch,
|
||||
GLuint srcx, GLuint srcy, GLuint width, GLuint height)
|
||||
{
|
||||
struct intel_context *intel = intelScreenContext(intelScreen);
|
||||
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
|
||||
if (intel == NULL)
|
||||
return;
|
||||
|
||||
if (dst->pbo) {
|
||||
if (dstx == 0 &&
|
||||
dsty == 0 && width == dst->pitch && height == dst->height)
|
||||
intel_region_release_pbo(intel, dst);
|
||||
intel_region_release_pbo(intelScreen, dst);
|
||||
else
|
||||
intel_region_cow(intel, dst);
|
||||
intel_region_cow(intelScreen, dst);
|
||||
}
|
||||
|
||||
|
||||
LOCK_HARDWARE(intel);
|
||||
|
||||
_mesa_copy_rect(intel_region_map(intel, dst) + dst_offset,
|
||||
_mesa_copy_rect(intel_region_map(intelScreen, dst) + dst_offset,
|
||||
dst->cpp,
|
||||
dst->pitch,
|
||||
dstx, dsty, width, height, src, src_pitch, srcx, srcy);
|
||||
|
||||
intel_region_unmap(intel, dst);
|
||||
intel_region_unmap(intelScreen, dst);
|
||||
|
||||
UNLOCK_HARDWARE(intel);
|
||||
|
||||
|
|
@ -247,7 +282,7 @@ intel_region_data(struct intel_context *intel,
|
|||
* push buffers into AGP - will currently do so whenever possible.
|
||||
*/
|
||||
void
|
||||
intel_region_copy(struct intel_context *intel,
|
||||
intel_region_copy(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *dst,
|
||||
GLuint dst_offset,
|
||||
GLuint dstx, GLuint dsty,
|
||||
|
|
@ -255,14 +290,19 @@ intel_region_copy(struct intel_context *intel,
|
|||
GLuint src_offset,
|
||||
GLuint srcx, GLuint srcy, GLuint width, GLuint height)
|
||||
{
|
||||
struct intel_context *intel = intelScreenContext(intelScreen);
|
||||
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
|
||||
if (intel == NULL)
|
||||
return;
|
||||
|
||||
if (dst->pbo) {
|
||||
if (dstx == 0 &&
|
||||
dsty == 0 && width == dst->pitch && height == dst->height)
|
||||
intel_region_release_pbo(intel, dst);
|
||||
intel_region_release_pbo(intelScreen, dst);
|
||||
else
|
||||
intel_region_cow(intel, dst);
|
||||
intel_region_cow(intelScreen, dst);
|
||||
}
|
||||
|
||||
assert(src->cpp == dst->cpp);
|
||||
|
|
@ -278,20 +318,25 @@ intel_region_copy(struct intel_context *intel,
|
|||
* push buffers into AGP - will currently do so whenever possible.
|
||||
*/
|
||||
void
|
||||
intel_region_fill(struct intel_context *intel,
|
||||
intel_region_fill(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *dst,
|
||||
GLuint dst_offset,
|
||||
GLuint dstx, GLuint dsty,
|
||||
GLuint width, GLuint height, GLuint color)
|
||||
{
|
||||
struct intel_context *intel = intelScreenContext(intelScreen);
|
||||
|
||||
DBG("%s\n", __FUNCTION__);
|
||||
|
||||
if (intel == NULL)
|
||||
return;
|
||||
|
||||
if (dst->pbo) {
|
||||
if (dstx == 0 &&
|
||||
dsty == 0 && width == dst->pitch && height == dst->height)
|
||||
intel_region_release_pbo(intel, dst);
|
||||
intel_region_release_pbo(intelScreen, dst);
|
||||
else
|
||||
intel_region_cow(intel, dst);
|
||||
intel_region_cow(intelScreen, dst);
|
||||
}
|
||||
|
||||
intelEmitFillBlit(intel,
|
||||
|
|
@ -304,7 +349,7 @@ intel_region_fill(struct intel_context *intel,
|
|||
* the pbo's data.
|
||||
*/
|
||||
void
|
||||
intel_region_attach_pbo(struct intel_context *intel,
|
||||
intel_region_attach_pbo(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region,
|
||||
struct intel_buffer_object *pbo)
|
||||
{
|
||||
|
|
@ -336,7 +381,7 @@ intel_region_attach_pbo(struct intel_context *intel,
|
|||
/* Break the COW tie to the pbo. The pbo gets to keep the data.
|
||||
*/
|
||||
void
|
||||
intel_region_release_pbo(struct intel_context *intel,
|
||||
intel_region_release_pbo(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region)
|
||||
{
|
||||
assert(region->buffer == region->pbo->buffer);
|
||||
|
|
@ -344,7 +389,7 @@ intel_region_release_pbo(struct intel_context *intel,
|
|||
region->pbo = NULL;
|
||||
region->buffer = NULL; /* refcount? */
|
||||
|
||||
driGenBuffers(intel->intelScreen->regionPool,
|
||||
driGenBuffers(intelScreen->regionPool,
|
||||
"region", 1, ®ion->buffer, 64, 0, 0);
|
||||
driBOData(region->buffer,
|
||||
region->cpp * region->pitch * region->height, NULL, 0);
|
||||
|
|
@ -354,11 +399,15 @@ intel_region_release_pbo(struct intel_context *intel,
|
|||
* with a copy of the data.
|
||||
*/
|
||||
void
|
||||
intel_region_cow(struct intel_context *intel, struct intel_region *region)
|
||||
intel_region_cow(intelScreenPrivate *intelScreen, struct intel_region *region)
|
||||
{
|
||||
struct intel_context *intel = intelScreenContext(intelScreen);
|
||||
struct intel_buffer_object *pbo = region->pbo;
|
||||
|
||||
intel_region_release_pbo(intel, region);
|
||||
if (intel == NULL)
|
||||
return;
|
||||
|
||||
intel_region_release_pbo(intelScreen, region);
|
||||
|
||||
assert(region->cpp * region->pitch * region->height == pbo->Base.Size);
|
||||
|
||||
|
|
@ -396,14 +445,14 @@ intel_region_cow(struct intel_context *intel, struct intel_region *region)
|
|||
}
|
||||
|
||||
struct _DriBufferObject *
|
||||
intel_region_buffer(struct intel_context *intel,
|
||||
intel_region_buffer(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region, GLuint flag)
|
||||
{
|
||||
if (region->pbo) {
|
||||
if (flag == INTEL_WRITE_PART)
|
||||
intel_region_cow(intel, region);
|
||||
intel_region_cow(intelScreen, region);
|
||||
else if (flag == INTEL_WRITE_FULL)
|
||||
intel_region_release_pbo(intel, region);
|
||||
intel_region_release_pbo(intelScreen, region);
|
||||
}
|
||||
|
||||
return region->buffer;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#define INTEL_REGIONS_H
|
||||
|
||||
#include "mtypes.h"
|
||||
#include "intel_screen.h"
|
||||
|
||||
struct intel_context;
|
||||
struct intel_buffer_object;
|
||||
|
|
@ -60,38 +61,46 @@ struct intel_region
|
|||
/* Allocate a refcounted region. Pointers to regions should only be
|
||||
* copied by calling intel_reference_region().
|
||||
*/
|
||||
struct intel_region *intel_region_alloc(struct intel_context *intel,
|
||||
struct intel_region *intel_region_alloc(intelScreenPrivate *intelScreen,
|
||||
GLuint cpp,
|
||||
GLuint pitch, GLuint height);
|
||||
|
||||
void intel_region_reference(struct intel_region **dst,
|
||||
struct intel_region *src);
|
||||
|
||||
void intel_region_release(struct intel_context *intel,
|
||||
void intel_region_release(intelScreenPrivate *intelScreen,
|
||||
struct intel_region **ib);
|
||||
|
||||
extern struct intel_region
|
||||
*intel_region_create_static(intelScreenPrivate *intelScreen,
|
||||
GLuint mem_type,
|
||||
GLuint offset,
|
||||
void *virtual,
|
||||
GLuint cpp,
|
||||
GLuint pitch, GLuint height);
|
||||
extern void
|
||||
intel_region_update_static(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region,
|
||||
GLuint mem_type,
|
||||
GLuint offset,
|
||||
void *virtual,
|
||||
GLuint cpp, GLuint pitch, GLuint height);
|
||||
|
||||
struct intel_region *intel_region_create_static(struct intel_context *intel,
|
||||
GLuint mem_type,
|
||||
GLuint offset,
|
||||
void *virtual,
|
||||
GLuint cpp,
|
||||
GLuint pitch, GLuint height);
|
||||
|
||||
void intel_region_idle(struct intel_context *intel,
|
||||
void intel_region_idle(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *ib);
|
||||
|
||||
/* Map/unmap regions. This is refcounted also:
|
||||
*/
|
||||
GLubyte *intel_region_map(struct intel_context *intel,
|
||||
GLubyte *intel_region_map(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *ib);
|
||||
|
||||
void intel_region_unmap(struct intel_context *intel, struct intel_region *ib);
|
||||
void intel_region_unmap(intelScreenPrivate *intelScreen, struct intel_region *ib);
|
||||
|
||||
|
||||
/* Upload data to a rectangular sub-region
|
||||
*/
|
||||
void intel_region_data(struct intel_context *intel,
|
||||
void intel_region_data(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *dest,
|
||||
GLuint dest_offset,
|
||||
GLuint destx, GLuint desty,
|
||||
|
|
@ -100,7 +109,7 @@ void intel_region_data(struct intel_context *intel,
|
|||
|
||||
/* Copy rectangular sub-regions
|
||||
*/
|
||||
void intel_region_copy(struct intel_context *intel,
|
||||
void intel_region_copy(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *dest,
|
||||
GLuint dest_offset,
|
||||
GLuint destx, GLuint desty,
|
||||
|
|
@ -110,7 +119,7 @@ void intel_region_copy(struct intel_context *intel,
|
|||
|
||||
/* Fill a rectangular sub-region
|
||||
*/
|
||||
void intel_region_fill(struct intel_context *intel,
|
||||
void intel_region_fill(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *dest,
|
||||
GLuint dest_offset,
|
||||
GLuint destx, GLuint desty,
|
||||
|
|
@ -118,15 +127,15 @@ void intel_region_fill(struct intel_context *intel,
|
|||
|
||||
/* Helpers for zerocopy uploads, particularly texture image uploads:
|
||||
*/
|
||||
void intel_region_attach_pbo(struct intel_context *intel,
|
||||
void intel_region_attach_pbo(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region,
|
||||
struct intel_buffer_object *pbo);
|
||||
void intel_region_release_pbo(struct intel_context *intel,
|
||||
void intel_region_release_pbo(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region);
|
||||
void intel_region_cow(struct intel_context *intel,
|
||||
void intel_region_cow(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region);
|
||||
|
||||
struct _DriBufferObject *intel_region_buffer(struct intel_context *intel,
|
||||
struct _DriBufferObject *intel_region_buffer(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region,
|
||||
GLuint flag);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
#include "i830_dri.h"
|
||||
#include "dri_bufpool.h"
|
||||
#include "intel_regions.h"
|
||||
|
||||
PUBLIC const char __driConfigOptions[] =
|
||||
DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE
|
||||
|
|
@ -123,6 +124,101 @@ intelMapScreenRegions(__DRIscreenPrivate * sPriv)
|
|||
}
|
||||
|
||||
|
||||
static struct intel_region *
|
||||
intel_recreate_static(intelScreenPrivate *intelScreen,
|
||||
struct intel_region *region,
|
||||
GLuint mem_type,
|
||||
GLuint offset,
|
||||
void *virtual,
|
||||
GLuint cpp, GLuint pitch, GLuint height)
|
||||
{
|
||||
if (region) {
|
||||
intel_region_update_static(intelScreen, region, mem_type, offset,
|
||||
virtual, cpp, pitch, height);
|
||||
} else {
|
||||
region = intel_region_create_static(intelScreen, mem_type, offset,
|
||||
virtual, cpp, pitch, height);
|
||||
}
|
||||
return region;
|
||||
}
|
||||
|
||||
|
||||
/* Create intel_region structs to describe the static front,back,depth
|
||||
* buffers created by the xserver.
|
||||
*
|
||||
* Although FBO's mean we now no longer use these as render targets in
|
||||
* all circumstances, they won't go away until the back and depth
|
||||
* buffers become private, and the front and rotated buffers will
|
||||
* remain even then.
|
||||
*
|
||||
* Note that these don't allocate video memory, just describe
|
||||
* allocations alread made by the X server.
|
||||
*/
|
||||
static void
|
||||
intel_recreate_static_regions(intelScreenPrivate *intelScreen)
|
||||
{
|
||||
intelScreen->front_region =
|
||||
intel_recreate_static(intelScreen,
|
||||
intelScreen->front_region,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->front.offset,
|
||||
intelScreen->front.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->front.pitch / intelScreen->cpp,
|
||||
intelScreen->height);
|
||||
|
||||
intelScreen->rotated_region =
|
||||
intel_recreate_static(intelScreen,
|
||||
intelScreen->rotated_region,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->rotated.offset,
|
||||
intelScreen->rotated.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->rotated.pitch /
|
||||
intelScreen->cpp, intelScreen->height);
|
||||
|
||||
|
||||
intelScreen->back_region =
|
||||
intel_recreate_static(intelScreen,
|
||||
intelScreen->back_region,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->back.offset,
|
||||
intelScreen->back.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->back.pitch / intelScreen->cpp,
|
||||
intelScreen->height);
|
||||
|
||||
/* Still assuming front.cpp == depth.cpp
|
||||
*/
|
||||
intelScreen->depth_region =
|
||||
intel_recreate_static(intelScreen,
|
||||
intelScreen->depth_region,
|
||||
DRM_BO_FLAG_MEM_TT,
|
||||
intelScreen->depth.offset,
|
||||
intelScreen->depth.map,
|
||||
intelScreen->cpp,
|
||||
intelScreen->depth.pitch / intelScreen->cpp,
|
||||
intelScreen->height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the information in the sarea to update the screen parameters
|
||||
* related to screen rotation. Needs to be called locked.
|
||||
*/
|
||||
void
|
||||
intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea)
|
||||
{
|
||||
intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
|
||||
|
||||
intelUnmapScreenRegions(intelScreen);
|
||||
intelUpdateScreenFromSAREA(intelScreen, sarea);
|
||||
if (!intelMapScreenRegions(sPriv)) {
|
||||
fprintf(stderr, "ERROR Remapping screen regions!!!\n");
|
||||
}
|
||||
intel_recreate_static_regions(intelScreen);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
intelUnmapScreenRegions(intelScreenPrivate * intelScreen)
|
||||
{
|
||||
|
|
@ -385,6 +481,8 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
|
|||
DRM_BO_FLAG_MEM_TT |
|
||||
DRM_BO_FLAG_MEM_LOCAL,
|
||||
4096, 100, 5);
|
||||
intel_recreate_static_regions(intelScreen);
|
||||
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
@ -728,3 +826,19 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
|
|||
|
||||
return (void *) psp;
|
||||
}
|
||||
|
||||
struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen)
|
||||
{
|
||||
/*
|
||||
* This should probably change to have the screen allocate a dummy
|
||||
* context at screen creation. For now just use the current context.
|
||||
*/
|
||||
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (ctx == NULL) {
|
||||
_mesa_problem(NULL, "No current context in intelScreenContext\n");
|
||||
return NULL;
|
||||
}
|
||||
return intel_context(ctx);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,11 @@ typedef struct
|
|||
intelRegion depth;
|
||||
intelRegion tex;
|
||||
|
||||
struct intel_region *front_region;
|
||||
struct intel_region *back_region;
|
||||
struct intel_region *depth_region;
|
||||
struct intel_region *rotated_region;
|
||||
|
||||
int deviceID;
|
||||
int width;
|
||||
int height;
|
||||
|
|
@ -90,6 +95,7 @@ typedef struct
|
|||
} intelScreenPrivate;
|
||||
|
||||
|
||||
|
||||
extern GLboolean intelMapScreenRegions(__DRIscreenPrivate * sPriv);
|
||||
|
||||
extern void intelUnmapScreenRegions(intelScreenPrivate * intelScreen);
|
||||
|
|
@ -117,4 +123,9 @@ extern struct _DriBufferPool *driBatchPoolInit(int fd, unsigned flags,
|
|||
unsigned numBufs,
|
||||
unsigned checkDelayed);
|
||||
|
||||
extern struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen);
|
||||
|
||||
extern void
|
||||
intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -195,9 +195,9 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
|
|||
/* this is a user-created intel_renderbuffer */
|
||||
if (irb->region) {
|
||||
if (map)
|
||||
intel_region_map(intel, irb->region);
|
||||
intel_region_map(intel->intelScreen, irb->region);
|
||||
else
|
||||
intel_region_unmap(intel, irb->region);
|
||||
intel_region_unmap(intel->intelScreen, irb->region);
|
||||
}
|
||||
irb->pfMap = irb->region->map;
|
||||
irb->pfPitch = irb->region->pitch;
|
||||
|
|
@ -228,9 +228,9 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
|
|||
irb = intel_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
|
||||
if (irb && irb->region) {
|
||||
if (map)
|
||||
intel_region_map(intel, irb->region);
|
||||
intel_region_map(intel->intelScreen, irb->region);
|
||||
else
|
||||
intel_region_unmap(intel, irb->region);
|
||||
intel_region_unmap(intel->intelScreen, irb->region);
|
||||
irb->pfMap = irb->region->map;
|
||||
irb->pfPitch = irb->region->pitch;
|
||||
}
|
||||
|
|
@ -269,12 +269,12 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
|
|||
irb = intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped);
|
||||
if (irb && irb->region && irb->Base.Name != 0) {
|
||||
if (map) {
|
||||
intel_region_map(intel, irb->region);
|
||||
intel_region_map(intel->intelScreen, irb->region);
|
||||
irb->pfMap = irb->region->map;
|
||||
irb->pfPitch = irb->region->pitch;
|
||||
}
|
||||
else {
|
||||
intel_region_unmap(intel, irb->region);
|
||||
intel_region_unmap(intel->intelScreen, irb->region);
|
||||
irb->pfMap = NULL;
|
||||
irb->pfPitch = 0;
|
||||
}
|
||||
|
|
@ -286,12 +286,12 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
|
|||
irb = intel_renderbuffer(ctx->DrawBuffer->_StencilBuffer->Wrapped);
|
||||
if (irb && irb->region && irb->Base.Name != 0) {
|
||||
if (map) {
|
||||
intel_region_map(intel, irb->region);
|
||||
intel_region_map(intel->intelScreen, irb->region);
|
||||
irb->pfMap = irb->region->map;
|
||||
irb->pfPitch = irb->region->pitch;
|
||||
}
|
||||
else {
|
||||
intel_region_unmap(intel, irb->region);
|
||||
intel_region_unmap(intel->intelScreen, irb->region);
|
||||
irb->pfMap = NULL;
|
||||
irb->pfPitch = 0;
|
||||
}
|
||||
|
|
@ -320,9 +320,9 @@ intelSpanRenderStart(GLcontext * ctx)
|
|||
/* Just map the framebuffer and all textures. Bufmgr code will
|
||||
* take care of waiting on the necessary fences:
|
||||
*/
|
||||
intel_region_map(intel, intel->front_region);
|
||||
intel_region_map(intel, intel->back_region);
|
||||
intel_region_map(intel, intel->depth_region);
|
||||
intel_region_map(intel->intelScreen, intel->front_region);
|
||||
intel_region_map(intel->intelScreen, intel->back_region);
|
||||
intel_region_map(intel->intelScreen, intel->intelScreen->depth_region);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
||||
|
|
@ -352,7 +352,7 @@ intelSpanRenderFinish(GLcontext * ctx)
|
|||
#if 0
|
||||
intel_region_unmap(intel, intel->front_region);
|
||||
intel_region_unmap(intel, intel->back_region);
|
||||
intel_region_unmap(intel, intel->depth_region);
|
||||
intel_region_unmap(intel, intel->intelScreen->depth_region);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ try_pbo_upload(struct intel_context *intel,
|
|||
struct _DriBufferObject *src_buffer =
|
||||
intel_bufferobj_buffer(intel, pbo, INTEL_READ);
|
||||
struct _DriBufferObject *dst_buffer =
|
||||
intel_region_buffer(intel, intelImage->mt->region,
|
||||
intel_region_buffer(intel->intelScreen, intelImage->mt->region,
|
||||
INTEL_WRITE_FULL);
|
||||
|
||||
|
||||
|
|
@ -278,7 +278,7 @@ try_pbo_zcopy(struct intel_context *intel,
|
|||
return GL_FALSE;
|
||||
}
|
||||
|
||||
intel_region_attach_pbo(intel, intelImage->mt->region, pbo);
|
||||
intel_region_attach_pbo(intel->intelScreen, intelImage->mt->region, pbo);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
@ -461,7 +461,7 @@ intelTexImage(GLcontext * ctx,
|
|||
|
||||
|
||||
if (intelImage->mt)
|
||||
intel_region_idle(intel, intelImage->mt->region);
|
||||
intel_region_idle(intel->intelScreen, intelImage->mt->region);
|
||||
|
||||
LOCK_HARDWARE(intel);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ intelTexSubimage(GLcontext * ctx,
|
|||
return;
|
||||
|
||||
if (intelImage->mt)
|
||||
intel_region_idle(intel, intelImage->mt->region);
|
||||
intel_region_idle(intel->intelScreen, intelImage->mt->region);
|
||||
|
||||
LOCK_HARDWARE(intel);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue