Przeglądaj źródła

intel: Remove client-side vblank code

tags/7.8-rc1
Kristian Høgsberg 16 lat temu
rodzic
commit
a6e1d3edac

+ 0
- 1
src/mesa/drivers/dri/i915/Makefile Wyświetl plik

@@ -34,7 +34,6 @@ DRIVER_SOURCES = \
intel_pixel_read.c \
intel_buffers.c \
intel_blit.c \
intel_swapbuffers.c \
i915_tex_layout.c \
i915_texstate.c \
i915_context.c \

+ 0
- 1
src/mesa/drivers/dri/i965/Makefile Wyświetl plik

@@ -24,7 +24,6 @@ DRIVER_SOURCES = \
intel_pixel_draw.c \
intel_pixel_read.c \
intel_state.c \
intel_swapbuffers.c \
intel_syncobj.c \
intel_tex.c \
intel_tex_copy.c \

+ 0
- 29
src/mesa/drivers/dri/intel/intel_context.c Wyświetl plik

@@ -55,10 +55,8 @@
#include "intel_decode.h"
#include "intel_bufmgr.h"
#include "intel_screen.h"
#include "intel_swapbuffers.h"

#include "drirenderbuffer.h"
#include "vblank.h"
#include "utils.h"
#include "xmlpool.h" /* for symbolic values of enum-type options */

@@ -868,7 +866,6 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
__DRIdrawable * driDrawPriv,
__DRIdrawable * driReadPriv)
{
__DRIscreen *psp = driDrawPriv->driScreenPriv;
struct intel_context *intel;
GET_CURRENT_CONTEXT(curCtx);

@@ -904,32 +901,6 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
_mesa_make_current(&intel->ctx, &intel_fb->Base, readFb);

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);
}
else {

+ 0
- 9
src/mesa/drivers/dri/intel/intel_context.h Wyświetl plik

@@ -298,20 +298,11 @@ struct intel_context
__DRIdrawable *driReadDrawable;
__DRIscreen *driScreen;
intelScreenPrivate *intelScreen;
volatile drm_i915_sarea_t *sarea;

GLuint lastStamp;

/**
* Configuration cache
*/
driOptionCache optionCache;

int64_t swap_ust;
int64_t swap_missed_ust;

GLuint swap_count;
GLuint swap_missed_count;
};

extern char *__progname;

+ 0
- 12
src/mesa/drivers/dri/intel/intel_fbo.h Wyświetl plik

@@ -41,16 +41,6 @@ struct intel_framebuffer
struct gl_framebuffer Base;

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 intel_region *region;

GLuint vbl_pending; /**< vblank sequence number of pending flip */

uint8_t *span_cache;
unsigned long span_cache_offset;
};

+ 0
- 36
src/mesa/drivers/dri/intel/intel_screen.c Wyświetl plik

@@ -31,7 +31,6 @@
#include "main/renderbuffer.h"

#include "utils.h"
#include "vblank.h"
#include "xmlpool.h"

#include "intel_batchbuffer.h"
@@ -41,7 +40,6 @@
#include "intel_extensions.h"
#include "intel_fbo.h"
#include "intel_regions.h"
#include "intel_swapbuffers.h"
#include "intel_screen.h"
#include "intel_span.h"
#include "intel_tex.h"
@@ -117,9 +115,6 @@ static const __DRItexBufferExtension intelTexBufferExtension = {

static const __DRIextension *intelScreenExtensions[] = {
&driReadDrawableExtension,
&driSwapControlExtension.base,
&driFrameTrackingExtension.base,
&driMediaStreamCounterExtension.base,
&intelTexOffsetExtension.base,
&intelTexBufferExtension.base,
NULL
@@ -266,33 +261,6 @@ intelDestroyBuffer(__DRIdrawable * driDrawPriv)
_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
* init-designated function to register chipids and createcontext
* functions.
@@ -513,10 +481,6 @@ const struct __DriverAPIRec driDriverAPI = {
.DestroyBuffer = intelDestroyBuffer,
.MakeCurrent = intelMakeCurrent,
.UnbindContext = intelUnbindContext,
.GetSwapInfo = intelGetSwapInfo,
.GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,

.InitScreen2 = intelInitScreen2,
};


+ 0
- 81
src/mesa/drivers/dri/intel/intel_swapbuffers.c Wyświetl plik

@@ -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;
}
}

+ 0
- 52
src/mesa/drivers/dri/intel/intel_swapbuffers.h Wyświetl plik

@@ -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 */

Ładowanie…
Anuluj
Zapisz