diff options
author | Brian Paul <brianp@vmware.com> | 2009-02-10 16:44:02 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-02-10 16:44:02 -0700 |
commit | 5340b6dff73a0a23531ce2a5f28fba8303adab6e (patch) | |
tree | b141fc3648568dd8b941c966059e6ed32a8bd0ad /src/gallium/winsys/drm/intel/egl/intel_context.c | |
parent | 9fd26daec24f21dbe17afcb2e2ab272667ee9a69 (diff) | |
parent | ee4c921b65fb76998711f3c40330505cbc49a0e0 (diff) |
Merge commit 'origin/gallium-master-merge'
This is the big merge of the gallium-0.2 branch into master.
gallium-master-merge was just the staging area for it.
Both gallium-0.2 and gallium-master-merge are considered closed now.
Conflicts:
progs/demos/Makefile
src/mesa/main/state.c
src/mesa/main/texenvprogram.c
Diffstat (limited to 'src/gallium/winsys/drm/intel/egl/intel_context.c')
-rw-r--r-- | src/gallium/winsys/drm/intel/egl/intel_context.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/gallium/winsys/drm/intel/egl/intel_context.c b/src/gallium/winsys/drm/intel/egl/intel_context.c new file mode 100644 index 0000000000..57e5ff7bc1 --- /dev/null +++ b/src/gallium/winsys/drm/intel/egl/intel_context.c @@ -0,0 +1,83 @@ + +#include "i915simple/i915_screen.h" + +#include "intel_be_device.h" +#include "intel_be_context.h" + +#include "pipe/p_defines.h" +#include "pipe/p_context.h" + +#include "intel_api.h" + +struct intel_context +{ + struct intel_be_context base; + + /* stuff */ +}; + +/* + * Hardware lock functions. + * Doesn't do anything in EGL + */ + +static void +intel_lock_hardware(struct intel_be_context *context) +{ + (void)context; +} + +static void +intel_unlock_hardware(struct intel_be_context *context) +{ + (void)context; +} + +static boolean +intel_locked_hardware(struct intel_be_context *context) +{ + (void)context; + return FALSE; +} + + +/* + * Misc functions. + */ +static void +intel_destroy_be_context(struct i915_winsys *winsys) +{ + struct intel_context *intel = (struct intel_context *)winsys; + + intel_be_destroy_context(&intel->base); + free(intel); +} + +struct pipe_context * +intel_create_context(struct pipe_screen *screen) +{ + struct intel_context *intel; + struct pipe_context *pipe; + struct intel_be_device *device = (struct intel_be_device *)screen->winsys; + + intel = (struct intel_context *)malloc(sizeof(*intel)); + memset(intel, 0, sizeof(*intel)); + + intel->base.hardware_lock = intel_lock_hardware; + intel->base.hardware_unlock = intel_unlock_hardware; + intel->base.hardware_locked = intel_locked_hardware; + + intel_be_init_context(&intel->base, device); + + intel->base.base.destroy = intel_destroy_be_context; + +#if 0 + pipe = intel_create_softpipe(intel, screen->winsys); +#else + pipe = i915_create_context(screen, &device->base, &intel->base.base); +#endif + + pipe->priv = intel; + + return pipe; +} |