intel: Remove client-side vblank code
This commit is contained in:
@@ -34,7 +34,6 @@ DRIVER_SOURCES = \
|
|||||||
intel_pixel_read.c \
|
intel_pixel_read.c \
|
||||||
intel_buffers.c \
|
intel_buffers.c \
|
||||||
intel_blit.c \
|
intel_blit.c \
|
||||||
intel_swapbuffers.c \
|
|
||||||
i915_tex_layout.c \
|
i915_tex_layout.c \
|
||||||
i915_texstate.c \
|
i915_texstate.c \
|
||||||
i915_context.c \
|
i915_context.c \
|
||||||
|
@@ -24,7 +24,6 @@ DRIVER_SOURCES = \
|
|||||||
intel_pixel_draw.c \
|
intel_pixel_draw.c \
|
||||||
intel_pixel_read.c \
|
intel_pixel_read.c \
|
||||||
intel_state.c \
|
intel_state.c \
|
||||||
intel_swapbuffers.c \
|
|
||||||
intel_syncobj.c \
|
intel_syncobj.c \
|
||||||
intel_tex.c \
|
intel_tex.c \
|
||||||
intel_tex_copy.c \
|
intel_tex_copy.c \
|
||||||
|
@@ -55,10 +55,8 @@
|
|||||||
#include "intel_decode.h"
|
#include "intel_decode.h"
|
||||||
#include "intel_bufmgr.h"
|
#include "intel_bufmgr.h"
|
||||||
#include "intel_screen.h"
|
#include "intel_screen.h"
|
||||||
#include "intel_swapbuffers.h"
|
|
||||||
|
|
||||||
#include "drirenderbuffer.h"
|
#include "drirenderbuffer.h"
|
||||||
#include "vblank.h"
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "xmlpool.h" /* for symbolic values of enum-type options */
|
#include "xmlpool.h" /* for symbolic values of enum-type options */
|
||||||
|
|
||||||
@@ -868,7 +866,6 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
|
|||||||
__DRIdrawable * driDrawPriv,
|
__DRIdrawable * driDrawPriv,
|
||||||
__DRIdrawable * driReadPriv)
|
__DRIdrawable * driReadPriv)
|
||||||
{
|
{
|
||||||
__DRIscreen *psp = driDrawPriv->driScreenPriv;
|
|
||||||
struct intel_context *intel;
|
struct intel_context *intel;
|
||||||
GET_CURRENT_CONTEXT(curCtx);
|
GET_CURRENT_CONTEXT(curCtx);
|
||||||
|
|
||||||
@@ -904,32 +901,6 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
|
|||||||
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
|
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);
|
||||||
|
|
||||||
intel->driReadDrawable = driReadPriv;
|
intel->driReadDrawable = driReadPriv;
|
||||||
|
|
||||||
if (intel->driDrawable != driDrawPriv) {
|
|
||||||
if (driDrawPriv->swap_interval == (unsigned)-1) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
|
|
||||||
? driGetDefaultVBlankFlags(&intel->optionCache)
|
|
||||||
: VBLANK_FLAG_NO_IRQ;
|
|
||||||
|
|
||||||
/* Prevent error printf if one crtc is disabled, this will
|
|
||||||
* be properly calculated in intelWindowMoved() next.
|
|
||||||
*/
|
|
||||||
driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv);
|
|
||||||
|
|
||||||
(*psp->systemTime->getUST) (&intel_fb->swap_ust);
|
|
||||||
driDrawableInitVBlank(driDrawPriv);
|
|
||||||
intel_fb->vbl_waited = driDrawPriv->vblSeq;
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
|
||||||
if (intel_fb->color_rb[i])
|
|
||||||
intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intel->driDrawable = driDrawPriv;
|
|
||||||
}
|
|
||||||
|
|
||||||
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
|
intel_draw_buffer(&intel->ctx, &intel_fb->Base);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -298,20 +298,11 @@ struct intel_context
|
|||||||
__DRIdrawable *driReadDrawable;
|
__DRIdrawable *driReadDrawable;
|
||||||
__DRIscreen *driScreen;
|
__DRIscreen *driScreen;
|
||||||
intelScreenPrivate *intelScreen;
|
intelScreenPrivate *intelScreen;
|
||||||
volatile drm_i915_sarea_t *sarea;
|
|
||||||
|
|
||||||
GLuint lastStamp;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration cache
|
* Configuration cache
|
||||||
*/
|
*/
|
||||||
driOptionCache optionCache;
|
driOptionCache optionCache;
|
||||||
|
|
||||||
int64_t swap_ust;
|
|
||||||
int64_t swap_missed_ust;
|
|
||||||
|
|
||||||
GLuint swap_count;
|
|
||||||
GLuint swap_missed_count;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern char *__progname;
|
extern char *__progname;
|
||||||
|
@@ -41,16 +41,6 @@ struct intel_framebuffer
|
|||||||
struct gl_framebuffer Base;
|
struct gl_framebuffer Base;
|
||||||
|
|
||||||
struct intel_renderbuffer *color_rb[2];
|
struct intel_renderbuffer *color_rb[2];
|
||||||
|
|
||||||
/* VBI
|
|
||||||
*/
|
|
||||||
GLuint vbl_waited;
|
|
||||||
|
|
||||||
int64_t swap_ust;
|
|
||||||
int64_t swap_missed_ust;
|
|
||||||
|
|
||||||
GLuint swap_count;
|
|
||||||
GLuint swap_missed_count;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -62,8 +52,6 @@ struct intel_renderbuffer
|
|||||||
struct gl_renderbuffer Base;
|
struct gl_renderbuffer Base;
|
||||||
struct intel_region *region;
|
struct intel_region *region;
|
||||||
|
|
||||||
GLuint vbl_pending; /**< vblank sequence number of pending flip */
|
|
||||||
|
|
||||||
uint8_t *span_cache;
|
uint8_t *span_cache;
|
||||||
unsigned long span_cache_offset;
|
unsigned long span_cache_offset;
|
||||||
};
|
};
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
#include "main/renderbuffer.h"
|
#include "main/renderbuffer.h"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "vblank.h"
|
|
||||||
#include "xmlpool.h"
|
#include "xmlpool.h"
|
||||||
|
|
||||||
#include "intel_batchbuffer.h"
|
#include "intel_batchbuffer.h"
|
||||||
@@ -41,7 +40,6 @@
|
|||||||
#include "intel_extensions.h"
|
#include "intel_extensions.h"
|
||||||
#include "intel_fbo.h"
|
#include "intel_fbo.h"
|
||||||
#include "intel_regions.h"
|
#include "intel_regions.h"
|
||||||
#include "intel_swapbuffers.h"
|
|
||||||
#include "intel_screen.h"
|
#include "intel_screen.h"
|
||||||
#include "intel_span.h"
|
#include "intel_span.h"
|
||||||
#include "intel_tex.h"
|
#include "intel_tex.h"
|
||||||
@@ -117,9 +115,6 @@ static const __DRItexBufferExtension intelTexBufferExtension = {
|
|||||||
|
|
||||||
static const __DRIextension *intelScreenExtensions[] = {
|
static const __DRIextension *intelScreenExtensions[] = {
|
||||||
&driReadDrawableExtension,
|
&driReadDrawableExtension,
|
||||||
&driSwapControlExtension.base,
|
|
||||||
&driFrameTrackingExtension.base,
|
|
||||||
&driMediaStreamCounterExtension.base,
|
|
||||||
&intelTexOffsetExtension.base,
|
&intelTexOffsetExtension.base,
|
||||||
&intelTexBufferExtension.base,
|
&intelTexBufferExtension.base,
|
||||||
NULL
|
NULL
|
||||||
@@ -266,33 +261,6 @@ intelDestroyBuffer(__DRIdrawable * driDrawPriv)
|
|||||||
_mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
|
_mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get information about previous buffer swaps.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
intelGetSwapInfo(__DRIdrawable * dPriv, __DRIswapInfo * sInfo)
|
|
||||||
{
|
|
||||||
struct intel_framebuffer *intel_fb;
|
|
||||||
|
|
||||||
if ((dPriv == NULL) || (dPriv->driverPrivate == NULL)
|
|
||||||
|| (sInfo == NULL)) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
intel_fb = dPriv->driverPrivate;
|
|
||||||
sInfo->swap_count = intel_fb->swap_count;
|
|
||||||
sInfo->swap_ust = intel_fb->swap_ust;
|
|
||||||
sInfo->swap_missed_count = intel_fb->swap_missed_count;
|
|
||||||
|
|
||||||
sInfo->swap_missed_usage = (sInfo->swap_missed_count != 0)
|
|
||||||
? driCalculateSwapUsage(dPriv, 0, intel_fb->swap_missed_ust)
|
|
||||||
: 0.0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* There are probably better ways to do this, such as an
|
/* There are probably better ways to do this, such as an
|
||||||
* init-designated function to register chipids and createcontext
|
* init-designated function to register chipids and createcontext
|
||||||
* functions.
|
* functions.
|
||||||
@@ -513,10 +481,6 @@ const struct __DriverAPIRec driDriverAPI = {
|
|||||||
.DestroyBuffer = intelDestroyBuffer,
|
.DestroyBuffer = intelDestroyBuffer,
|
||||||
.MakeCurrent = intelMakeCurrent,
|
.MakeCurrent = intelMakeCurrent,
|
||||||
.UnbindContext = intelUnbindContext,
|
.UnbindContext = intelUnbindContext,
|
||||||
.GetSwapInfo = intelGetSwapInfo,
|
|
||||||
.GetDrawableMSC = driDrawableGetMSC32,
|
|
||||||
.WaitForMSC = driWaitForMSC32,
|
|
||||||
|
|
||||||
.InitScreen2 = intelInitScreen2,
|
.InitScreen2 = intelInitScreen2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,81 +0,0 @@
|
|||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sub license, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice (including the
|
|
||||||
* next paragraph) shall be included in all copies or substantial portions
|
|
||||||
* of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
||||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
||||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#include "intel_blit.h"
|
|
||||||
#include "intel_buffers.h"
|
|
||||||
#include "intel_swapbuffers.h"
|
|
||||||
#include "intel_fbo.h"
|
|
||||||
#include "intel_batchbuffer.h"
|
|
||||||
#include "drirenderbuffer.h"
|
|
||||||
#include "vblank.h"
|
|
||||||
#include "i915_drm.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Correct a drawablePrivate's set of vblank flags WRT the current context.
|
|
||||||
* When considering multiple crtcs.
|
|
||||||
*/
|
|
||||||
GLuint
|
|
||||||
intelFixupVblank(struct intel_context *intel, __DRIdrawable *dPriv)
|
|
||||||
{
|
|
||||||
if (!intel->intelScreen->driScrnPriv->dri2.enabled &&
|
|
||||||
intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
|
|
||||||
volatile drm_i915_sarea_t *sarea = intel->sarea;
|
|
||||||
drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
|
|
||||||
.y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
|
|
||||||
drm_clip_rect_t planeA_rect = { .x1 = sarea->planeA_x, .y1 = sarea->planeA_y,
|
|
||||||
.x2 = sarea->planeA_x + sarea->planeA_w,
|
|
||||||
.y2 = sarea->planeA_y + sarea->planeA_h };
|
|
||||||
drm_clip_rect_t planeB_rect = { .x1 = sarea->planeB_x, .y1 = sarea->planeB_y,
|
|
||||||
.x2 = sarea->planeB_x + sarea->planeB_w,
|
|
||||||
.y2 = sarea->planeB_y + sarea->planeB_h };
|
|
||||||
GLint areaA = driIntersectArea( drw_rect, planeA_rect );
|
|
||||||
GLint areaB = driIntersectArea( drw_rect, planeB_rect );
|
|
||||||
GLuint flags;
|
|
||||||
|
|
||||||
/* Update vblank info
|
|
||||||
*/
|
|
||||||
if (areaB > areaA || (areaA == areaB && areaB > 0)) {
|
|
||||||
flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
|
|
||||||
} else {
|
|
||||||
flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do the stupid test: Is one of them actually disabled?
|
|
||||||
*/
|
|
||||||
if (sarea->planeA_w == 0 || sarea->planeA_h == 0) {
|
|
||||||
flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
|
|
||||||
} else if (sarea->planeB_w == 0 || sarea->planeB_h == 0) {
|
|
||||||
flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
|
|
||||||
}
|
|
||||||
|
|
||||||
return flags;
|
|
||||||
} else {
|
|
||||||
return dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,52 +0,0 @@
|
|||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sub license, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice (including the
|
|
||||||
* next paragraph) shall be included in all copies or substantial portions
|
|
||||||
* of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
||||||
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
||||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#ifndef INTEL_SWAPBUFFERS_H
|
|
||||||
#define INTEL_SWAPBUFFERS_H
|
|
||||||
|
|
||||||
#include "dri_util.h"
|
|
||||||
#include "drm.h"
|
|
||||||
|
|
||||||
struct intel_context;
|
|
||||||
struct intel_framebuffer;
|
|
||||||
|
|
||||||
|
|
||||||
extern void
|
|
||||||
intelSwapBuffers(__DRIdrawable * dPriv);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
intelCopySubBuffer(__DRIdrawable * dPriv, int x, int y, int w, int h);
|
|
||||||
|
|
||||||
extern GLuint
|
|
||||||
intelFixupVblank(struct intel_context *intel, __DRIdrawable *dPriv);
|
|
||||||
|
|
||||||
extern void
|
|
||||||
intelWindowMoved(struct intel_context *intel);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* INTEL_SWAPBUFFERS_H */
|
|
Reference in New Issue
Block a user