diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-01-10 15:27:15 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-01-10 15:27:15 +0000 |
commit | 599c1bb3dc83da295c9423ca3ea96fe1aed946ab (patch) | |
tree | 39316deb715209c646509be0f8fbc98d9cf82d11 | |
parent | 61579ca1b659f6e5ccdbd5e48d7f945356a58152 (diff) |
remove the triple buffering support from the intel driver, the support
from this was removed from the kernel and is very much deprecated.
Pageflipping is also probably broken and should not be used. Similar
change happened in mesa master a while back.
ok matthieu@
6 files changed, 5 insertions, 160 deletions
diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_buffers.c b/dist/Mesa/src/mesa/drivers/dri/intel/intel_buffers.c index 75542a977..4ffd2ff6d 100644 --- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_buffers.c @@ -43,22 +43,6 @@ #include "vblank.h" #include "i915_drm.h" -/* This block can be removed when libdrm >= 2.3.1 is required */ - -#ifndef DRM_IOCTL_I915_FLIP - -#define DRM_VBLANK_FLIP 0x8000000 - -typedef struct drm_i915_flip { - int pipes; -} drm_i915_flip_t; - -#undef DRM_IOCTL_I915_FLIP -#define DRM_IOCTL_I915_FLIP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_FLIP, \ - drm_i915_flip_t) - -#endif - #define FILE_DEBUG_FLAG DEBUG_BLIT /** @@ -218,7 +202,7 @@ intelUpdatePageFlipping(struct intel_context *intel, intel_fb->pf_current_page = (intel->sarea->pf_current_page >> (intel_fb->pf_planes & 0x2)) & 0x3; - intel_fb->pf_num_pages = intel->intelScreen->third.handle ? 3 : 2; + intel_fb->pf_num_pages = 2; pf_active = pf_planes && (pf_planes & intel->sarea->pf_active) == pf_planes; @@ -227,41 +211,6 @@ intelUpdatePageFlipping(struct intel_context *intel, _mesa_printf("%s - Page flipping %sactive\n", __progname, pf_active ? "" : "in"); - if (pf_active) { - /* Sync pages between planes if flipping on both at the same time */ - if (pf_planes == 0x3 && pf_planes != intel_fb->pf_planes && - (intel->sarea->pf_current_page & 0x3) != - (((intel->sarea->pf_current_page) >> 2) & 0x3)) { - drm_i915_flip_t flip; - - if (intel_fb->pf_current_page == - (intel->sarea->pf_current_page & 0x3)) { - /* XXX: This is ugly, but emitting two flips 'in a row' can cause - * lockups for unknown reasons. - */ - intel->sarea->pf_current_page = - intel->sarea->pf_current_page & 0x3; - intel->sarea->pf_current_page |= - ((intel_fb->pf_current_page + intel_fb->pf_num_pages - 1) % - intel_fb->pf_num_pages) << 2; - - flip.pipes = 0x2; - } else { - intel->sarea->pf_current_page = - intel->sarea->pf_current_page & (0x3 << 2); - intel->sarea->pf_current_page |= - (intel_fb->pf_current_page + intel_fb->pf_num_pages - 1) % - intel_fb->pf_num_pages; - - flip.pipes = 0x1; - } - - drmCommandWrite(intel->driFd, DRM_I915_FLIP, &flip, sizeof(flip)); - } - - intel_fb->pf_planes = pf_planes; - } - intel_fb->pf_active = pf_active; intel_flip_renderbuffers(intel_fb); intel_draw_buffer(&intel->ctx, intel->ctx.DrawBuffer); @@ -641,58 +590,7 @@ intel_wait_flips(struct intel_context *intel) static GLboolean intelPageFlip(const __DRIdrawablePrivate * dPriv) { - struct intel_context *intel; - int ret; - struct intel_framebuffer *intel_fb = dPriv->driverPrivate; - - if (INTEL_DEBUG & DEBUG_IOCTL) - fprintf(stderr, "%s\n", __FUNCTION__); - - assert(dPriv); - assert(dPriv->driContextPriv); - assert(dPriv->driContextPriv->driverPrivate); - - intel = (struct intel_context *) dPriv->driContextPriv->driverPrivate; - - if (intel->intelScreen->drmMinor < 9) - return GL_FALSE; - - intelFlush(&intel->ctx); - - ret = 0; - - LOCK_HARDWARE(intel); - - if (dPriv->numClipRects && intel_fb->pf_active) { - drm_i915_flip_t flip; - - flip.pipes = intel_fb->pf_planes; - - ret = drmCommandWrite(intel->driFd, DRM_I915_FLIP, &flip, sizeof(flip)); - } - - UNLOCK_HARDWARE(intel); - - if (ret || !intel_fb->pf_active) - return GL_FALSE; - - if (!dPriv->numClipRects) { - usleep(10000); /* throttle invisible client 10ms */ - } - - intel_fb->pf_current_page = (intel->sarea->pf_current_page >> - (intel_fb->pf_planes & 0x2)) & 0x3; - - if (dPriv->numClipRects != 0) { - intel_get_renderbuffer(&intel_fb->Base, BUFFER_FRONT_LEFT)->pf_pending = - intel_get_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT)->pf_pending = - ++intel_fb->pf_seq; - } - - intel_flip_renderbuffers(intel_fb); - intel_draw_buffer(&intel->ctx, &intel_fb->Base); - - return GL_TRUE; + return GL_FALSE; } static GLboolean diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c index 778e7fc39..66934bc7f 100644 --- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c +++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c @@ -749,12 +749,6 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, intel_renderbuffer_set_region(intel_fb->color_rb[1], intel->back_region); } -#if 0 - if (intel_fb->color_rb[2]) { - intel_renderbuffer_set_region(intel_fb->color_rb[2], - intel->third_region); - } -#endif if (irbDepth) { intel_renderbuffer_set_region(irbDepth, intel->depth_region); } @@ -791,7 +785,7 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, driDrawableInitVBlank(driDrawPriv); intel_fb->vbl_waited = driDrawPriv->vblSeq; - 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 = driDrawPriv->vblSeq; } diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h index df79ab889..11a9ef335 100644 --- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h +++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h @@ -165,7 +165,6 @@ struct intel_context struct intel_region *front_region; struct intel_region *back_region; - struct intel_region *third_region; struct intel_region *depth_region; /** diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_regions.c b/dist/Mesa/src/mesa/drivers/dri/intel/intel_regions.c index 35ab46afe..9867af905 100644 --- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_regions.c +++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_regions.c @@ -483,15 +483,6 @@ intel_recreate_static_regions(struct intel_context *intel) intel->back_region, &intelScreen->back); -#ifdef I915 - if (intelScreen->third.handle) { - intel->third_region = - intel_recreate_static(intel, "third", - intel->third_region, - &intelScreen->third); - } -#endif /* I915 */ - /* Still assumes front.cpp == depth.cpp. We can kill this when we move to * private buffers. */ diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.c b/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.c index c1ead5ff0..84bf2d726 100644 --- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.c +++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.c @@ -113,18 +113,6 @@ intelMapScreenRegions(__DRIscreenPrivate * sPriv) return GL_FALSE; } - if (intelScreen->third.handle) { - if (0) - _mesa_printf("Third 0x%08x ", intelScreen->third.handle); - if (drmMap(sPriv->fd, - intelScreen->third.handle, - intelScreen->third.size, - (drmAddress *) & intelScreen->third.map) != 0) { - intelUnmapScreenRegions(intelScreen); - return GL_FALSE; - } - } - if (0) _mesa_printf("Depth 0x%08x ", intelScreen->depth.handle); if (drmMap(sPriv->fd, @@ -148,9 +136,8 @@ intelMapScreenRegions(__DRIscreenPrivate * sPriv) } if (0) - printf("Mappings: front: %p back: %p third: %p depth: %p tex: %p\n", - intelScreen->front.map, - intelScreen->back.map, intelScreen->third.map, + printf("Mappings: front: %p back: %p depth: %p tex: %p\n", + intelScreen->front.map, intelScreen->back.map, intelScreen->depth.map, intelScreen->tex.map); return GL_TRUE; } @@ -173,13 +160,6 @@ intelUnmapScreenRegions(intelScreenPrivate * intelScreen) #endif intelScreen->back.map = NULL; } - if (intelScreen->third.map) { -#if REALLY_UNMAP - if (drmUnmap(intelScreen->third.map, intelScreen->third.size) != 0) - printf("drmUnmap third failed!\n"); -#endif - intelScreen->third.map = NULL; - } if (intelScreen->depth.map) { #if REALLY_UNMAP drmUnmap(intelScreen->depth.map, intelScreen->depth.size); @@ -258,13 +238,6 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, intelScreen->back.size = sarea->back_size; intelScreen->back.tiled = sarea->back_tiled; - if (intelScreen->driScrnPriv->ddx_version.minor >= 8) { - intelScreen->third.offset = sarea->third_offset; - intelScreen->third.handle = sarea->third_handle; - intelScreen->third.size = sarea->third_size; - intelScreen->third.tiled = sarea->third_tiled; - } - intelScreen->depth.offset = sarea->depth_offset; intelScreen->depth.handle = sarea->depth_handle; intelScreen->depth.size = sarea->depth_size; @@ -273,12 +246,10 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen, if (intelScreen->driScrnPriv->ddx_version.minor >= 9) { intelScreen->front.bo_handle = sarea->front_bo_handle; intelScreen->back.bo_handle = sarea->back_bo_handle; - intelScreen->third.bo_handle = sarea->third_bo_handle; intelScreen->depth.bo_handle = sarea->depth_bo_handle; } else { intelScreen->front.bo_handle = -1; intelScreen->back.bo_handle = -1; - intelScreen->third.bo_handle = -1; intelScreen->depth.bo_handle = -1; } @@ -442,13 +413,6 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, intel_fb->color_rb[1] = intel_create_renderbuffer(rgbFormat); _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT, &intel_fb->color_rb[1]->Base); - - if (screen->third.handle) { - struct gl_renderbuffer *tmp_rb = NULL; - - intel_fb->color_rb[2] = intel_create_renderbuffer(rgbFormat); - _mesa_reference_renderbuffer(&tmp_rb, &intel_fb->color_rb[2]->Base); - } } if (mesaVis->depthBits == 24) { diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.h b/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.h index e62b2d7c8..7c835a1d5 100644 --- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.h +++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_screen.h @@ -55,7 +55,6 @@ typedef struct { intelRegion front; intelRegion back; - intelRegion third; intelRegion depth; intelRegion tex; |