diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2008-07-25 18:31:44 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2008-07-25 18:31:44 -0700 |
commit | 1e645b365900cf1c71ca5594bd6b549a1f203040 (patch) | |
tree | d114e55df428550c9829acf929b9fb7bcb89c429 /src/mesa/drivers/dri/intel | |
parent | e5022c3fdf9888857f22f9a1690035ff3f90d36b (diff) | |
parent | 9bc9e0ecb0fb2069b2c123e665eb2118e358098f (diff) |
Merge branch 'master' into drm-gem
Conflicts:
src/mesa/drivers/dri/common/dri_bufmgr.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_batchbuffer.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_blit.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_buffers.c | 50 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_chipset.h | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_image.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_validate.c | 6 |
8 files changed, 41 insertions, 55 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 80b87b40f7..52d6ecc223 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -120,8 +120,10 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, if (batch->cliprect_mode == IGNORE_CLIPRECTS) { batch->cliprect_mode = cliprect_mode; } else { - if (batch->cliprect_mode != cliprect_mode) + if (batch->cliprect_mode != cliprect_mode) { intel_batchbuffer_flush(batch); + batch->cliprect_mode = cliprect_mode; + } } } } diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 2a05d29124..e9076f9ac9 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -115,7 +115,8 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, dst_pitch /= 4; } #endif - + /* do space/cliprects check before going any further */ + intel_batchbuffer_require_space(intel->batch, 8 * 4, REFERENCES_CLIPRECTS); again: ret = dri_bufmgr_check_aperture_space(dst->buffer); ret |= dri_bufmgr_check_aperture_space(src->buffer); @@ -275,6 +276,8 @@ intelEmitCopyBlit(struct intel_context *intel, int ret; BATCH_LOCALS; + /* do space/cliprects check before going any further */ + intel_batchbuffer_require_space(intel->batch, 8 * 4, NO_LOOP_CLIPRECTS); again: ret = dri_bufmgr_check_aperture_space(dst_buffer); ret |= dri_bufmgr_check_aperture_space(src_buffer); diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index d5257ae27e..77352e6a53 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -197,7 +197,6 @@ intelSetBackClipRects(struct intel_context *intel) } } -#ifdef I915 static void intelUpdatePageFlipping(struct intel_context *intel, GLint areaA, GLint areaB) @@ -267,7 +266,6 @@ intelUpdatePageFlipping(struct intel_context *intel, intel_flip_renderbuffers(intel_fb); intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer); } -#endif /* I915 */ /** * This will be called whenever the currently bound window is moved/resized. @@ -318,9 +316,7 @@ intelWindowMoved(struct intel_context *intel) GLint areaB = driIntersectArea( drw_rect, planeB_rect ); GLuint flags = dPriv->vblFlags; -#ifdef I915 intelUpdatePageFlipping(intel, areaA, areaB); -#endif /* Update vblank info */ @@ -645,7 +641,6 @@ intel_wait_flips(struct intel_context *intel) static GLboolean intelPageFlip(const __DRIdrawablePrivate * dPriv) { -#ifdef I915 struct intel_context *intel; int ret; struct intel_framebuffer *intel_fb = dPriv->driverPrivate; @@ -698,40 +693,8 @@ intelPageFlip(const __DRIdrawablePrivate * dPriv) intel_draw_buffer(&intel->ctx, &intel_fb->Base); return GL_TRUE; -#else - return GL_FALSE; -#endif } -#if 0 -void -intelSwapBuffers(__DRIdrawablePrivate * dPriv) -{ - if (dPriv->driverPrivate) { - const struct gl_framebuffer *fb - = (struct gl_framebuffer *) dPriv->driverPrivate; - if (fb->Visual.doubleBufferMode) { - GET_CURRENT_CONTEXT(ctx); - if (ctx && ctx->DrawBuffer == fb) { - _mesa_notifySwapBuffers(ctx); /* flush pending rendering */ - } - if (intel->doPageFlip) { - intelPageFlip(dPriv); - } - else { - intelCopyBuffer(dPriv); - } - } - } - else { - _mesa_problem(NULL, - "dPriv has no gl_framebuffer pointer in intelSwapBuffers"); - } -} -#else -/* Trunk version: - */ - static GLboolean intelScheduleSwap(__DRIdrawablePrivate * dPriv, GLboolean *missed_target) { @@ -755,9 +718,8 @@ intelScheduleSwap(__DRIdrawablePrivate * dPriv, GLboolean *missed_target) if (dPriv->vblFlags & VBLANK_FLAG_SYNC) { swap.seqtype |= DRM_VBLANK_NEXTONMISS; - } else if (interval == 0) { + } else if (interval == 0) return GL_FALSE; - } swap.drawable = dPriv->hHWDrawable; target = swap.sequence = dPriv->vblSeq + interval; @@ -834,6 +796,15 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv) if (!intelScheduleSwap(dPriv, &missed_target)) { driWaitForVBlank(dPriv, &missed_target); + /* + * Update each buffer's vbl_pending so we don't get too out of + * sync + */ + intel_get_renderbuffer(&intel_fb->Base, + BUFFER_BACK_LEFT)->vbl_pending = + intel_get_renderbuffer(&intel_fb->Base, + BUFFER_FRONT_LEFT)->vbl_pending = + dPriv->vblSeq; if (!intelPageFlip(dPriv)) { intelCopyBuffer(dPriv, NULL); } @@ -856,7 +827,6 @@ intelSwapBuffers(__DRIdrawablePrivate * dPriv) fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); } } -#endif void intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h) diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h index 4a5166263a..15b9ef4312 100644 --- a/src/mesa/drivers/dri/intel/intel_chipset.h +++ b/src/mesa/drivers/dri/intel/intel_chipset.h @@ -53,7 +53,7 @@ #define PCI_CHIP_I965_GM 0x2A02 #define PCI_CHIP_I965_GME 0x2A12 -#define PCI_CHIP_IGD_GM 0x2A42 +#define PCI_CHIP_GM45_GM 0x2A42 #define PCI_CHIP_IGD_E_G 0x2E02 #define PCI_CHIP_Q45_G 0x2E12 @@ -65,13 +65,12 @@ devid == PCI_CHIP_I945_GME || \ devid == PCI_CHIP_I965_GM || \ devid == PCI_CHIP_I965_GME || \ - devid == PCI_CHIP_IGD_GM) + devid == PCI_CHIP_GM45_GM) -#define IS_IGD_GM(devid) (devid == PCI_CHIP_IGD_GM) +#define IS_GM45_GM(devid) (devid == PCI_CHIP_GM45_GM) #define IS_G4X(devid) (devid == PCI_CHIP_IGD_E_G || \ devid == PCI_CHIP_Q45_G || \ devid == PCI_CHIP_G45_G) -#define IS_IGD(devid) (IS_IGD_GM(devid) || IS_G4X(devid)) #define IS_915(devid) (devid == PCI_CHIP_I915_G || \ devid == PCI_CHIP_E7221_G || \ @@ -90,7 +89,8 @@ devid == PCI_CHIP_I965_GM || \ devid == PCI_CHIP_I965_GME || \ devid == PCI_CHIP_I946_GZ || \ - IS_IGD(devid)) + IS_GM45_GM(devid) || \ + IS_G4X(devid)) #define IS_9XX(devid) (IS_915(devid) || \ IS_945(devid) || \ diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index f573cf4d4f..082dfe87e3 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -168,7 +168,9 @@ intelGetString(GLcontext * ctx, GLenum name) case PCI_CHIP_I965_GME: chipset = "Intel(R) 965GME/GLE"; break; - case PCI_CHIP_IGD_GM: + case PCI_CHIP_GM45_GM: + chipset = "Mobile Intel® GM45 Express Chipset"; + break; case PCI_CHIP_IGD_E_G: chipset = "Intel(R) Integrated Graphics Device"; break; @@ -196,9 +198,8 @@ intelGetString(GLcontext * ctx, GLenum name) /** * Extension strings exported by the intel driver. * - * \note - * It appears that ARB_texture_env_crossbar has "disappeared" compared to the - * old i830-specific driver. + * Extensions supported by all chips supported by i830_dri, i915_dri, or + * i965_dri. */ static const struct dri_extension card_extensions[] = { {"GL_ARB_multisample", GL_ARB_multisample_functions}, @@ -210,6 +211,7 @@ static const struct dri_extension card_extensions[] = { {"GL_ARB_texture_cube_map", NULL}, {"GL_ARB_texture_env_add", NULL}, {"GL_ARB_texture_env_combine", NULL}, + {"GL_ARB_texture_env_crossbar", NULL}, {"GL_ARB_texture_env_dot3", NULL}, {"GL_ARB_texture_mirrored_repeat", NULL}, {"GL_ARB_texture_non_power_of_two", NULL }, @@ -266,7 +268,6 @@ static const struct dri_extension brw_extensions[] = { { "GL_EXT_shadow_funcs", NULL }, /* ARB extn won't work if not enabled */ { "GL_SGIX_depth_texture", NULL }, - { "GL_ARB_texture_env_crossbar", NULL }, { "GL_EXT_texture_sRGB", NULL}, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 9205627813..1b645c7262 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -265,7 +265,10 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, { /* Images with borders are never pulled into mipmap trees. */ - if (image->Border) + if (image->Border || + ((image->_BaseFormat == GL_DEPTH_COMPONENT) && + ((image->TexObject->WrapS == GL_CLAMP_TO_BORDER) || + (image->TexObject->WrapT == GL_CLAMP_TO_BORDER)))) return GL_FALSE; if (image->InternalFormat != mt->internal_format || diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index b8dcd1e061..c11687a2cf 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -75,7 +75,10 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, DBG("%s\n", __FUNCTION__); - if (intelImage->base.Border) + if (intelImage->base.Border || + ((intelImage->base._BaseFormat == GL_DEPTH_COMPONENT) && + ((intelObj->base.WrapS == GL_CLAMP_TO_BORDER) || + (intelObj->base.WrapT == GL_CLAMP_TO_BORDER)))) return; if (intelImage->level > intelObj->base.BaseLevel && diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index b5803fb813..9fe4aac149 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -43,6 +43,7 @@ intel_calculate_first_last_level(struct intel_texture_object *intelObj) #ifdef I915 firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); firstLevel = MAX2(firstLevel, tObj->BaseLevel); + firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); lastLevel = MAX2(lastLevel, tObj->BaseLevel); lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); @@ -140,7 +141,10 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* Fallback case: */ - if (firstImage->base.Border) { + if (firstImage->base.Border || + ((firstImage->base._BaseFormat == GL_DEPTH_COMPONENT) && + ((tObj->WrapS == GL_CLAMP_TO_BORDER) || + (tObj->WrapT == GL_CLAMP_TO_BORDER)))) { if (intelObj->mt) { intel_miptree_release(intel, &intelObj->mt); } |