Fix some build failures. Move intelScreenContext to intel_context.c

This commit is contained in:
Keith Whitwell 2007-08-11 14:01:37 +01:00
parent a0e48b1ff9
commit 8c4409690d
5 changed files with 38 additions and 36 deletions

View file

@ -25,8 +25,11 @@
*
**************************************************************************/
#include <errno.h>
#include "main/imports.c"
#include "intel_batchbuffer.h"
#include "intel_ioctl.h"
#include "intel_context.h"
#include "intel_screen.h"
#include "intel_reg.h"
#include "drm.h"

View file

@ -36,29 +36,28 @@
#include "drivers/common/driverfuncs.h"
#include "intel_screen.h"
#include "i830_dri.h"
#include "intel_screen.h"
#include "intel_context.h"
#include "intel_buffers.h"
#include "intel_winsys.h"
#include "intel_ioctl.h"
#include "intel_batchbuffer.h"
#include "state_tracker/st_public.h"
#include "state_tracker/st_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
#include "drirenderbuffer.h"
#include "vblank.h"
#include "utils.h"
#include "xmlpool.h" /* for symbolic values of enum-type options */
#include "pipe/p_context.h"
#if DEBUG
#ifdef DEBUG
int __intel_debug = 0;
#endif
@ -145,7 +144,7 @@ const struct dri_extension card_extensions[] = {
#ifdef DEBUG
static const struct dri_debug_control debug_control[] = {
{"ioctl", DEBUG_IOCTL},
{"bat", DEBUG_BATCH},
@ -153,7 +152,7 @@ static const struct dri_debug_control debug_control[] = {
{"swap", DEBUG_SWAP},
{NULL, 0}
};
#endif
static void
intelInvalidateState(GLcontext * ctx, GLuint new_state)
@ -279,7 +278,7 @@ intelCreateContext(const __GLcontextModes * mesaVis,
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
}
#if DEBUG
#ifdef DEBUG
__intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
#endif
@ -442,3 +441,26 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen)
{
/*
* This should probably change to have the screen allocate a dummy
* context at screen creation. For now just use the current context.
*/
GET_CURRENT_CONTEXT(ctx);
if (ctx == NULL) {
/* _mesa_problem(NULL, "No current context in intelScreenContext\n");
return NULL; */
/* need a context for the first time makecurrent is called (for hw lock
when allocating priv buffers) */
if (intelScreen->dummyctxptr == NULL) {
_mesa_problem(NULL, "No current context in intelScreenContext\n");
return NULL;
}
return intelScreen->dummyctxptr;
}
return intel_context(ctx);
}

View file

@ -109,7 +109,7 @@ extern char *__progname;
/* ================================================================
* Debugging:
*/
#if DEBUG
#ifdef DEBUG
extern int __intel_debug;
#define DEBUG_SWAP 0x1

View file

@ -31,11 +31,12 @@
#include "extensions.h"
#include "intel_screen.h"
#include "intel_context.h"
#include "intel_batchbuffer.h"
#include "intel_buffers.h"
#include "i830_dri.h"
#include "intel_ioctl.h"
#include "intel_batchbuffer.h"
#include "state_tracker/st_public.h"
#include "state_tracker/st_context.h"

View file

@ -38,7 +38,6 @@
#include "intel_screen.h"
#include "intel_batchbuffer.h"
#include "intel_buffers.h"
#include "intel_ioctl.h"
#include "i830_dri.h"
#include "dri_bufpool.h"
@ -565,26 +564,3 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
return (void *) psp;
}
struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen)
{
/*
* This should probably change to have the screen allocate a dummy
* context at screen creation. For now just use the current context.
*/
GET_CURRENT_CONTEXT(ctx);
if (ctx == NULL) {
/* _mesa_problem(NULL, "No current context in intelScreenContext\n");
return NULL; */
/* need a context for the first time makecurrent is called (for hw lock
when allocating priv buffers) */
if (intelScreen->dummyctxptr == NULL) {
_mesa_problem(NULL, "No current context in intelScreenContext\n");
return NULL;
}
return intelScreen->dummyctxptr;
}
return intel_context(ctx);
}