From: Keith Whitwell Date: Tue, 31 Jul 2007 13:37:45 +0000 (+0100) Subject: Merge branch 'i915tex_privbuffers' into softpipe_0_1_branch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9273150f9a8394f4ef630a96f0089ad8cad607f5;p=mesa.git Merge branch 'i915tex_privbuffers' into softpipe_0_1_branch Conflicts: src/mesa/drivers/dri/i915tex/intel_buffers.c src/mesa/drivers/dri/i915tex/intel_context.c src/mesa/drivers/dri/i915tex/intel_fbo.c src/mesa/drivers/dri/i915tex/intel_pixel_draw.c --- 9273150f9a8394f4ef630a96f0089ad8cad607f5 diff --cc src/mesa/drivers/dri/i915tex/intel_buffers.c index 17b4feadf85,4b2a4acaf98..72c7b5ae454 --- a/src/mesa/drivers/dri/i915tex/intel_buffers.c +++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c @@@ -788,10 -583,8 +586,9 @@@ intelScheduleSwap(const __DRIdrawablePr drm_i915_vblank_swap_t swap; GLboolean ret; - if ((intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) || - intelScreen->drmMinor < (intel_fb->pf_active ? 9 : 6)) + if (!intel_fb->vblank_flags || + (intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) || - intelScreen->current_rotation != 0 || + intelScreen->drmMinor < (intel_fb->pf_active ? 9 : 6)) return GL_FALSE; swap.seqtype = DRM_VBLANK_ABSOLUTE; diff --cc src/mesa/drivers/dri/i915tex/intel_context.c index 61842da29d9,f032c97dfbb..5ab919ecb60 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@@ -646,29 -605,22 +617,33 @@@ intelMakeCurrent(__DRIcontextPrivate * if (intel->ctx.DrawBuffer == &intel_fb->Base) { if (intel->driDrawable != driDrawPriv) { - intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0) - ? driGetDefaultVBlankFlags(&intel->optionCache) - : VBLANK_FLAG_NO_IRQ; - (*dri_interface->getUST) (&intel_fb->swap_ust); - driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags, - &intel_fb->vbl_seq); + if (driDrawPriv->pdraw->swap_interval == (unsigned)-1) { + int i; + + intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0) + ? driGetDefaultVBlankFlags(&intel->optionCache) + : VBLANK_FLAG_NO_IRQ; + + (*dri_interface->getUST) (&intel_fb->swap_ust); + driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags, + &intel_fb->vbl_seq); + intel_fb->vbl_waited = intel_fb->vbl_seq; + - for (i = 0; i < (intel->intelScreen->third.handle ? 3 : 2); i++) { ++ for (i = 0; i < 2; i++) { + if (intel_fb->color_rb[i]) + intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_seq; + } + } - intel->driDrawable = driDrawPriv; - intelWindowMoved(intel); } + } - intel_draw_buffer(&intel->ctx, &intel_fb->Base); + if ((intel->driDrawable != driDrawPriv) || + (intel->lastStamp != driDrawPriv->lastStamp)) { + intel->driDrawable = driDrawPriv; + intelWindowMoved(intel); + intel->lastStamp = driDrawPriv->lastStamp; } + } else { _mesa_make_current(NULL, NULL, NULL); diff --cc src/mesa/drivers/dri/i915tex/intel_fbo.c index 5a93eb7ad19,04ca5ae8ba0..559788f20a9 --- a/src/mesa/drivers/dri/i915tex/intel_fbo.c +++ b/src/mesa/drivers/dri/i915tex/intel_fbo.c @@@ -383,101 -352,19 +358,21 @@@ intel_new_renderbuffer_fb(GLuint intFor switch (intFormat) { case GL_RGB5: - irb->Base._ActualFormat = GL_RGB5; - irb->Base._BaseFormat = GL_RGBA; - irb->Base.RedBits = 5; - irb->Base.GreenBits = 6; - irb->Base.BlueBits = 5; - irb->Base.DataType = GL_UNSIGNED_BYTE; - cpp = 2; - break; case GL_RGBA8: - irb->Base._ActualFormat = GL_RGBA8; irb->Base._BaseFormat = GL_RGBA; - irb->Base.RedBits = 8; - irb->Base.GreenBits = 8; - irb->Base.BlueBits = 8; - irb->Base.AlphaBits = 8; - irb->Base.DataType = GL_UNSIGNED_BYTE; - cpp = 4; - break; - case GL_STENCIL_INDEX8_EXT: - irb->Base._ActualFormat = GL_STENCIL_INDEX8_EXT; - irb->Base._BaseFormat = GL_STENCIL_INDEX; - irb->Base.StencilBits = 8; - irb->Base.DataType = GL_UNSIGNED_BYTE; - cpp = 1; break; case GL_DEPTH_COMPONENT16: - irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; - irb->Base.DepthBits = 16; - irb->Base.DataType = GL_UNSIGNED_SHORT; - cpp = 2; - break; - case GL_DEPTH_COMPONENT24: - irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; - irb->Base._BaseFormat = GL_DEPTH_COMPONENT; - irb->Base.DepthBits = 24; - irb->Base.DataType = GL_UNSIGNED_INT; - cpp = 4; break; case GL_DEPTH24_STENCIL8_EXT: - irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT; - irb->Base.DepthBits = 24; - irb->Base.StencilBits = 8; - irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - cpp = 4; break; default: - assert(0); + _mesa_problem(NULL, - "Unexpected intFormat in intel_create_renderbuffer"); ++ "Unexpected intFormat in intel_create_renderbuffer"); + return NULL; } - irb->Base.InternalFormat = intFormat; - - /* intel-specific methods */ - irb->Base.Delete = intel_delete_renderbuffer; - irb->Base.AllocStorage = intel_alloc_window_storage; - irb->Base.GetPointer = intel_get_pointer; - /* This sets the Get/PutRow/Value functions */ - intel_set_span_functions(&irb->Base); - - irb->pfMap = map; - irb->pfPitch = pitch / cpp; /* in pixels */ - - #if 00 - irb->region = intel_region_create_static(intel, - DRM_MM_TT, - offset, map, cpp, width, height); - #endif - - return irb; - } - - - /** - * Create a new renderbuffer which corresponds to an X window buffer - * (color, depth, stencil, etc) - not a user-created GL renderbuffer. - * The internal format is set at creation time and does not change. - */ - struct gl_renderbuffer * - intel_new_renderbuffer_fb(GLcontext * ctx, GLuint intFormat) - { - struct intel_renderbuffer *irb; - - irb = CALLOC_STRUCT(intel_renderbuffer); - if (!irb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer"); - return NULL; - } - - _mesa_init_renderbuffer(&irb->Base, 0); - irb->Base.ClassID = INTEL_RB_CLASS; - irb->Base.InternalFormat = intFormat; - /* intel-specific methods */ irb->Base.Delete = intel_delete_renderbuffer; irb->Base.AllocStorage = intel_alloc_renderbuffer_storage; diff --cc src/mesa/drivers/dri/i915tex/intel_fbo.h index 86c81060845,762aac594e8..7dc39675337 --- a/src/mesa/drivers/dri/i915tex/intel_fbo.h +++ b/src/mesa/drivers/dri/i915tex/intel_fbo.h @@@ -87,11 -82,9 +87,11 @@@ struct intel_renderbuffe GLuint pf_pending; /**< sequence number of pending flip */ GLuint vbl_pending; /**< vblank sequence number of pending flip */ + + struct intel_surface *surface; }; - + #if 0 extern struct intel_renderbuffer *intel_create_renderbuffer(GLenum intFormat, GLsizei width, GLsizei height,