Squashed commit of the following:
commit
009598122adf5cad42bf9af067eccaf8e89e1233
Author: Christoph Bumiller <
e0425955@student.tuwien.ac.at>
Date: Mon Feb 8 11:03:26 2010 +0000
nouveau: fix gallium-screen-context branch fallout
commit
7b2ffc2019d72e833afea7eebf3e80121187375d
Merge:
51e190e c036d13
Author: Keith Whitwell <keithw@vmware.com>
Date: Fri Feb 5 09:55:02 2010 +0000
Merge commit 'origin/master' into gallium-screen-context
Conflicts:
src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
This branch has got a pretty tortured history now, I expect
a squash merge will be appropriate when it is done.
commit
51e190e95acf120f72768fafb29e9721e358df1b
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 17:58:02 2010 +0000
gallium: fix some build issues
commit
f524bdaa723fb181637ad30c6ad708aeedabe25b
Merge:
f906212 3aba0a2
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 17:51:32 2010 +0000
Merge commit 'origin/master' into gallium-screen-context
commit
f9062126883199eabf045714c717cd35f4b7b313
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 17:17:12 2010 +0000
gallium/docs: small description of screen::create_context
commit
efcb37bd3d5ed37f06c6105bd2d750b374ec0927
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:42:42 2010 +0000
drm/radeon: more dead create_context wrapper removal
commit
6badc0dd9e06cf2ec936940bcf12b9ef5324b301
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:42:30 2010 +0000
drm/i965: more dead create_context wrapper removal
commit
cf04ebd5a54b18b2d894cfdab2b0f2fd55626ffc
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:42:05 2010 +0000
st/python: more dead create_context wrapper removal
commit
444f114c3516abf71c430e6e9d0d2ae3b80679d3
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:37:58 2010 +0000
idenity: wrapped context creation
commit
5a6d09cb9e468d1ee6c8d54b887618819d8d94f2
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:28:47 2010 +0000
ws/gdi: remove dead context_create wrapper
commit
132b55f4bec39386ac625f09aaa11f609664024c
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:27:52 2010 +0000
ws/gdi: remove dead context_create wrapper
commit
56d2d21a0cdcb197a364049d354c2f15a4fc026a
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:25:38 2010 +0000
st/xorg: use screen::context_create
commit
838c5cfe56b2af6c644909bed3c5e7cdd64c336a
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:23:20 2010 +0000
glx/xlib: simplify creation of trace-wrapped contexts
Trace screen knows how to properly wrap context creation in the
wrapped screen, so nothing special to do here.
commit
c99404c03ebaec4175f08a2f363e43c9085f2635
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:18:24 2010 +0000
st/python: no need to special case context creation for trace
commit
193a527a682b6877bb1faecd8092df4dfd055a18
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:15:30 2010 +0000
drm/radeon: remove dead create_context declaration
commit
bb984eecc25cf23bc77e1c818b81165ba1a07c9a
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:14:58 2010 +0000
nv/drm: remove dead create_context ref
commit
e809313a44287dc4e16c28e9e74ef3b2b5271aa1
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:12:51 2010 +0000
st/egl: remove a layer of wrappers around screen::create_context
commit
39caa6672a04122f185c22e17aab86d1c40938bf
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:05:28 2010 +0000
r300g: fill in screen::context_create
commit
407f12556d16ba0656774d8a1d9ebda22f82f473
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 16:04:04 2010 +0000
cell: adapt for screen::create_context, untested
commit
d02b0c6ce321a04c76fdabb09e0e4380ce1c1376
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:50:24 2010 +0000
drm/nv: adapt for screen::create_context
All contexts now created directly through the screen, so remove
equivalent code here.
Remove apparently un-needed array of contexts in the winsys.
commit
53eec5b1349aa1b6892a75a7bff7e7530957aeae
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:50:08 2010 +0000
stw: adapt for screen::create_context, untested
commit
c6a64de3eb381bc9a88e9fbdecbf87d77925aaf5
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:49:20 2010 +0000
trace: expose the wrapped context's priv data
If we are going to keep this priv idea, really want an accessor
function for it so that trace and other drivers can wrap that.
commit
75d6104e11d86ec2b0749627ed58e35f856ee6eb
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:47:55 2010 +0000
nv30: adapt to screen::context_create
commit
12f5deb6ed9723e9b5d34577052b8365813ca14e
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:44:47 2010 +0000
nv40: adapt to screen::context_create
commit
14baccaa3b6bbb3b91056126f6521828e786dc62
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:35:27 2010 +0000
nv50: adapt to screen::create_context
Not build tested. Need to figure out how to build nouveau.
commit
a0e94505ccd2d7f3e604465a2ac302f1286b73b6
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:22:27 2010 +0000
llvmpipe: update for screen::create_context, untested
commit
0eae17107c950346030e4f7e0ec232f868d3893d
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 15:16:57 2010 +0000
xlib/llvmpipe: remove dead winsys context creation path
commit
2f69f9ffaa7e2a01d2483277246ed13051ae4ca3
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 14:58:27 2010 +0000
gallium: convert most code to use screen::create_context
I wish I could build all of gallium at once to find breakages.
commit
d7b57f4061b82322cbcae176125913d9f0dea6c1
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 12:46:21 2010 +0000
glx: permit building with older protocol headers
I'd like to be able to build mesa on current distro releases without
having to upgrade from the standard dri2proto and glproto headers. With
this change I'm able to build on ancient releases such as Ubuntu 9-10...
In general, it would be nice to be able to build-test mesa to check for
unintended breakages without having to follow the external dependencies
of every group working on the codebase.
commit
57adedd6fb06c98572ed8d4aef19203df4c4eea2
Merge:
da71847 e1906ae
Author: Keith Whitwell <keithw@vmware.com>
Date: Thu Feb 4 11:38:15 2010 +0000
Merge commit 'origin/master' into gallium-screen-context
Conflicts:
src/gallium/drivers/softpipe/sp_video_context.h
src/gallium/drivers/trace/tr_context.c
src/gallium/state_trackers/wgl/shared/stw_context.c
src/gallium/winsys/gdi/gdi_softpipe_winsys.c
commit
da71847ea6414d7e352c6094f8963bb4eda344dc
Author: José Fonseca <jfonseca@vmware.com>
Date: Sat May 2 08:57:39 2009 +0100
wgl: Use pipe_screen::context_create.
commit
2595a188f93fd903600ef5d8517737ee0592035d
Author: José Fonseca <jfonseca@vmware.com>
Date: Sat May 2 08:56:47 2009 +0100
trace: Implement pipe_screen::context_create.
commit
f3640e4ae37a5260cbfba999d079f827de0a313a
Author: José Fonseca <jfonseca@vmware.com>
Date: Sat May 2 08:56:17 2009 +0100
softpipe: Implement pipe_screen::context_create.
commit
347266bddc8bd39c711bacb2193793759d0f3696
Author: José Fonseca <jfonseca@vmware.com>
Date: Sat May 2 08:55:31 2009 +0100
gallium: New pipe_screen::context_create callback.
**param** is one of the :ref:`PIPE_CAP` names.
+context_create
+^^^^^^^^^^^^^^
+
+Create a pipe_context.
+
+**priv** is private data of the caller, which may be put to various
+unspecified uses, typically to do with implementing swapbuffers
+and/or front-buffer rendering.
+
is_format_supported
^^^^^^^^^^^^^^^^^^^
struct pipe_context *
cell_create_context(struct pipe_screen *screen,
- struct cell_winsys *cws)
+ void *priv )
{
struct cell_context *cell;
uint i;
memset(cell, 0, sizeof(*cell));
- cell->winsys = cws;
+ cell->winsys = NULL; /* XXX: fixme - get this from screen? */
cell->pipe.winsys = screen->winsys;
cell->pipe.screen = screen;
+ cell->pipe.priv = priv;
cell->pipe.destroy = cell_destroy_context;
cell->pipe.clear = cell_clear;
}
-extern struct pipe_context *
-cell_create_context(struct pipe_screen *screen, struct cell_winsys *cws);
+struct pipe_context *
+cell_create_context(struct pipe_screen *screen,
+ void *priv );
extern void
cell_vertex_shader_queue_flush(struct draw_context *draw);
screen->get_param = cell_get_param;
screen->get_paramf = cell_get_paramf;
screen->is_format_supported = cell_is_format_supported;
+ screen->context_create = cell_create_context;
cell_init_screen_texture_funcs(screen);
u_simple_screen_init(screen);
*/
struct cell_winsys
{
- uint preferredFormat;
+ uint dummy;
};
-extern struct cell_winsys *
-cell_get_winsys(uint format);
-
#endif
}
struct pipe_context *
-i915_create_context(struct pipe_screen *screen)
+i915_create_context(struct pipe_screen *screen, void *priv)
{
struct i915_context *i915;
i915->iws = i915_screen(screen)->iws;
i915->base.winsys = NULL;
i915->base.screen = screen;
+ i915->base.priv = priv;
i915->base.destroy = i915_destroy;
void i915_init_string_functions( struct i915_context *i915 );
+/************************************************************************
+ * i915_context.c
+ */
+struct pipe_context *i915_create_context(struct pipe_screen *screen,
+ void *priv);
/***********************************************************************
is->base.get_paramf = i915_get_paramf;
is->base.is_format_supported = i915_is_format_supported;
+ is->base.context_create = i915_create_context;
+
is->base.fence_reference = i915_fence_reference;
is->base.fence_signalled = i915_fence_signalled;
is->base.fence_finish = i915_fence_finish;
*/
struct pipe_screen *i915_create_screen(struct intel_winsys *iws, unsigned pci_id);
-/**
- * Create a i915 pipe_context.
- */
-struct pipe_context *i915_create_context(struct pipe_screen *screen);
/**
* Get the intel_winsys buffer backing the texture.
}
-struct pipe_context *brw_create_context(struct pipe_screen *screen)
+struct pipe_context *brw_create_context(struct pipe_screen *screen,
+ void *priv)
{
struct brw_context *brw = (struct brw_context *) CALLOC_STRUCT(brw_context);
}
brw->base.screen = screen;
+ brw->base.priv = priv;
brw->base.destroy = brw_destroy_context;
brw->sws = brw_screen(screen)->sws;
brw->chipset = brw_screen(screen)->chipset;
*/
int brw_upload_cs_urb_state(struct brw_context *brw);
+/* brw_context.c
+ */
+struct pipe_context *brw_create_context(struct pipe_screen *screen,
+ void *priv);
/*======================================================================
* Inline conversion functions. These are better-typed than the
bscreen->base.get_param = brw_get_param;
bscreen->base.get_paramf = brw_get_paramf;
bscreen->base.is_format_supported = brw_is_format_supported;
+ bscreen->base.context_create = brw_create_context;
bscreen->base.fence_reference = brw_fence_reference;
bscreen->base.fence_signalled = brw_fence_signalled;
bscreen->base.fence_finish = brw_fence_finish;
*/
struct pipe_screen *brw_create_screen(struct brw_winsys_screen *iws, unsigned pci_id);
-/**
- * Create a brw pipe_context.
- */
-struct pipe_context *brw_create_context(struct pipe_screen *screen);
/**
* Get the brw_winsys buffer backing the texture.
id_pipe->base.winsys = NULL;
id_pipe->base.screen = _screen;
- id_pipe->base.priv = pipe->priv;
+ id_pipe->base.priv = pipe->priv; /* expose wrapped data */
id_pipe->base.draw = NULL;
id_pipe->base.destroy = identity_destroy;
};
+struct pipe_context *
+identity_context_create(struct pipe_screen *screen, struct pipe_context *pipe);
+
+
static INLINE struct identity_context *
identity_context(struct pipe_context *pipe)
{
return identity_screen_create(screen);
}
-static struct pipe_context *
-identity_drm_create_context(struct drm_api *_api,
- struct pipe_screen *_screen)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct identity_drm_api *id_api = identity_drm_api(_api);
- struct pipe_screen *screen = id_screen->screen;
- struct drm_api *api = id_api->api;
- struct pipe_context *pipe;
-
- pipe = api->create_context(api, screen);
-
- pipe = identity_context_create(_screen, pipe);
-
- return pipe;
-}
static struct pipe_texture *
identity_drm_texture_from_shared_handle(struct drm_api *_api,
goto error;
id_api->base.create_screen = identity_drm_create_screen;
- id_api->base.create_context = identity_drm_create_context;
id_api->base.texture_from_shared_handle = identity_drm_texture_from_shared_handle;
id_api->base.shared_handle_from_texture = identity_drm_shared_handle_from_texture;
id_api->base.local_handle_from_texture = identity_drm_local_handle_from_texture;
struct pipe_screen *
identity_screen_create(struct pipe_screen *screen);
-struct pipe_context *
-identity_context_create(struct pipe_screen *screen, struct pipe_context *pipe);
-
#endif /* ID_PUBLIC_H */
#include "id_public.h"
#include "id_screen.h"
+#include "id_context.h"
#include "id_objects.h"
geom_flags);
}
+static struct pipe_context *
+identity_screen_context_create(struct pipe_screen *_screen,
+ void *priv)
+{
+ struct identity_screen *id_screen = identity_screen(_screen);
+ struct pipe_screen *screen = id_screen->screen;
+ struct pipe_context *result;
+
+ result = screen->context_create(screen, priv);
+ if (result)
+ return identity_context_create(_screen, result);
+ return NULL;
+}
+
static struct pipe_texture *
identity_screen_texture_create(struct pipe_screen *_screen,
const struct pipe_texture *templat)
id_screen->base.get_param = identity_screen_get_param;
id_screen->base.get_paramf = identity_screen_get_paramf;
id_screen->base.is_format_supported = identity_screen_is_format_supported;
+ id_screen->base.context_create = identity_screen_context_create;
id_screen->base.texture_create = identity_screen_texture_create;
id_screen->base.texture_blanket = identity_screen_texture_blanket;
id_screen->base.texture_destroy = identity_screen_texture_destroy;
}
struct pipe_context *
-llvmpipe_create( struct pipe_screen *screen )
+llvmpipe_create_context( struct pipe_screen *screen, void *priv )
{
struct llvmpipe_context *llvmpipe;
llvmpipe->pipe.winsys = screen->winsys;
llvmpipe->pipe.screen = screen;
+ llvmpipe->pipe.priv = priv;
llvmpipe->pipe.destroy = llvmpipe_destroy;
/* state setters */
};
+struct pipe_context *
+llvmpipe_create_context( struct pipe_screen *screen, void *priv );
+
+
static INLINE struct llvmpipe_context *
llvmpipe_context( struct pipe_context *pipe )
{
#include "lp_winsys.h"
#include "lp_jit.h"
#include "lp_screen.h"
+#include "lp_context.h"
#include "lp_debug.h"
#ifdef DEBUG
screen->base.is_format_supported = llvmpipe_is_format_supported;
screen->base.surface_buffer_create = llvmpipe_surface_buffer_create;
+ screen->base.context_create = llvmpipe_create_context;
screen->base.flush_frontbuffer = llvmpipe_flush_frontbuffer;
llvmpipe_init_screen_texture_funcs(&screen->base);
};
-struct pipe_context *
-llvmpipe_create( struct pipe_screen * );
-
struct pipe_screen *
llvmpipe_create_screen( struct llvmpipe_winsys * );
extern struct pipe_screen *
nv30_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
-extern struct pipe_context *
-nv30_create(struct pipe_screen *, unsigned pctx_id);
-
extern struct pipe_screen *
nv40_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
-extern struct pipe_context *
-nv40_create(struct pipe_screen *, unsigned pctx_id);
-
extern struct pipe_screen *
nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
-extern struct pipe_context *
-nv50_create(struct pipe_screen *, unsigned pctx_id);
-
#endif
}
struct pipe_context *
-nv30_create(struct pipe_screen *pscreen, unsigned pctx_id)
+nv30_create(struct pipe_screen *pscreen, void *priv)
{
struct nv30_screen *screen = nv30_screen(pscreen);
struct pipe_winsys *ws = pscreen->winsys;
if (!nv30)
return NULL;
nv30->screen = screen;
- nv30->pctx_id = pctx_id;
nv30->nvws = nvws;
nv30->pipe.winsys = ws;
nv30->pipe.screen = pscreen;
+ nv30->pipe.priv = priv;
nv30->pipe.destroy = nv30_destroy;
nv30->pipe.draw_arrays = nv30_draw_arrays;
nv30->pipe.draw_elements = nv30_draw_elements;
struct nouveau_winsys *nvws;
struct nv30_screen *screen;
- unsigned pctx_id;
struct draw_context *draw;
extern void nv30_clear(struct pipe_context *pipe, unsigned buffers,
const float *rgba, double depth, unsigned stencil);
+/* nv30_context.c */
+struct pipe_context *
+nv30_create(struct pipe_screen *pscreen, void *priv);
+
#endif
struct pipe_screen *pscreen;
- unsigned nr_pctx;
- struct pipe_context **pctx;
-
struct pipe_surface *front;
};
pscreen->get_param = nv30_screen_get_param;
pscreen->get_paramf = nv30_screen_get_paramf;
pscreen->is_format_supported = nv30_screen_surface_format_supported;
+ pscreen->context_create = nv30_create;
nv30_screen_init_miptree_functions(pscreen);
nv30_screen_init_transfer_functions(pscreen);
struct nouveau_winsys *nvws;
- unsigned cur_pctx;
+ struct nv30_context *cur_ctx;
/* HW graphics objects */
struct nv04_surface_2d *eng2d;
unsigned i;
uint64_t states;
- if (nv30->pctx_id != screen->cur_pctx) {
+ /* XXX: racy!
+ */
+ if (nv30 != screen->cur_ctx) {
for (i = 0; i < NV30_STATE_MAX; i++) {
if (state->hw[i] && screen->state[i] != state->hw[i])
state->dirty |= (1ULL << i);
}
- screen->cur_pctx = nv30->pctx_id;
+ screen->cur_ctx = nv30;
}
for (i = 0, states = state->dirty; states; i++) {
}
struct pipe_context *
-nv40_create(struct pipe_screen *pscreen, unsigned pctx_id)
+nv40_create(struct pipe_screen *pscreen, void *priv)
{
struct nv40_screen *screen = nv40_screen(pscreen);
struct pipe_winsys *ws = pscreen->winsys;
if (!nv40)
return NULL;
nv40->screen = screen;
- nv40->pctx_id = pctx_id;
nv40->nvws = nvws;
nv40->pipe.winsys = ws;
+ nv40->pipe.priv = priv;
nv40->pipe.screen = pscreen;
nv40->pipe.destroy = nv40_destroy;
nv40->pipe.draw_arrays = nv40_draw_arrays;
struct nouveau_winsys *nvws;
struct nv40_screen *screen;
- unsigned pctx_id;
struct draw_context *draw;
extern void nv40_clear(struct pipe_context *pipe, unsigned buffers,
const float *rgba, double depth, unsigned stencil);
+/* nv40_context.c */
+struct pipe_context *
+nv40_create(struct pipe_screen *pscreen, void *priv);
+
#endif
pscreen->get_param = nv40_screen_get_param;
pscreen->get_paramf = nv40_screen_get_paramf;
pscreen->is_format_supported = nv40_screen_surface_format_supported;
+ pscreen->context_create = nv40_create;
nv40_screen_init_miptree_functions(pscreen);
nv40_screen_init_transfer_functions(pscreen);
struct nouveau_winsys *nvws;
- unsigned cur_pctx;
+ struct nv40_context *cur_ctx;
/* HW graphics objects */
struct nv04_surface_2d *eng2d;
unsigned i;
uint64_t states;
- if (nv40->pctx_id != screen->cur_pctx) {
+ /* XXX: race conditions
+ */
+ if (nv40 != screen->cur_ctx) {
for (i = 0; i < NV40_STATE_MAX; i++) {
if (state->hw[i] && screen->state[i] != state->hw[i])
state->dirty |= (1ULL << i);
}
- screen->cur_pctx = nv40->pctx_id;
+ screen->cur_ctx = nv40;
}
for (i = 0, states = state->dirty; states; i++) {
struct pipe_context *
-nv50_create(struct pipe_screen *pscreen, unsigned pctx_id)
+nv50_create(struct pipe_screen *pscreen, void *priv)
{
struct pipe_winsys *pipe_winsys = pscreen->winsys;
struct nv50_screen *screen = nv50_screen(pscreen);
if (!nv50)
return NULL;
nv50->screen = screen;
- nv50->pctx_id = pctx_id;
nv50->pipe.winsys = pipe_winsys;
nv50->pipe.screen = pscreen;
+ nv50->pipe.priv = priv;
nv50->pipe.destroy = nv50_destroy;
struct pipe_context pipe;
struct nv50_screen *screen;
- unsigned pctx_id;
struct draw_context *draw;
void *src, unsigned src_format, int src_pitch,
int x, int y, int w, int h, int cpp);
+/* nv50_context.c */
+struct pipe_context *
+nv50_create(struct pipe_screen *pscreen, void *priv);
+
#endif
pscreen->get_param = nv50_screen_get_param;
pscreen->get_paramf = nv50_screen_get_paramf;
pscreen->is_format_supported = nv50_screen_is_format_supported;
+ pscreen->context_create = nv50_create;
screen->base.pre_pipebuffer_map_callback = nv50_pre_pipebuffer_map;
nv50_screen_init_miptree_functions(pscreen);
struct nouveau_winsys *nvws;
- unsigned cur_pctx;
struct nv50_context *cur_ctx;
struct nouveau_grobj *tesla;
struct nv50_screen *screen = nv50->screen;
struct nouveau_channel *chan = screen->base.channel;
- /* I don't want to copy headers from the winsys. */
- screen->cur_ctx = nv50;
-
- if (nv50->pctx_id != screen->cur_pctx) {
+ /* XXX: this is racy for multiple contexts active on separate
+ * threads.
+ */
+ if (screen->cur_ctx != nv50) {
if (nv50->state.fb)
nv50->state.dirty |= NV50_NEW_FRAMEBUFFER;
if (nv50->state.blend)
nv50->state.dirty |= NV50_NEW_TEXTURE;
if (nv50->state.vtxfmt && nv50->state.vtxbuf)
nv50->state.dirty |= NV50_NEW_ARRAYS;
- screen->cur_pctx = nv50->pctx_id;
+ screen->cur_ctx = nv50;
}
if (nv50->state.dirty & NV50_NEW_FRAMEBUFFER)
}
struct pipe_context* r300_create_context(struct pipe_screen* screen,
- struct radeon_winsys* radeon_winsys)
+ void *priv)
{
struct r300_context* r300 = CALLOC_STRUCT(r300_context);
struct r300_screen* r300screen = r300_screen(screen);
+ struct radeon_winsys* radeon_winsys = r300screen->radeon_winsys;
if (!r300)
return NULL;
r300->context.winsys = (struct pipe_winsys*)radeon_winsys;
r300->context.screen = screen;
+ r300->context.priv = priv;
r300->context.destroy = r300_destroy_context;
return (struct r300_context*)context;
}
+
+struct pipe_context* r300_create_context(struct pipe_screen* screen,
+ void *priv);
+
/* Context initialization. */
struct draw_stage* r300_draw_stage(struct r300_context* r300);
void r300_init_state_functions(struct r300_context* r300);
#include "r300_texture.h"
#include "radeon_winsys.h"
+#include "r300_winsys.h"
/* Return the identifier behind whom the brave coders responsible for this
* amalgamation of code, sweat, and duct tape, routinely obscure their names.
r300_parse_chipset(caps);
r300screen->caps = caps;
+ r300screen->radeon_winsys = radeon_winsys;
r300screen->screen.winsys = (struct pipe_winsys*)radeon_winsys;
r300screen->screen.destroy = r300_destroy_screen;
r300screen->screen.get_name = r300_get_name;
r300screen->screen.get_param = r300_get_param;
r300screen->screen.get_paramf = r300_get_paramf;
r300screen->screen.is_format_supported = r300_is_format_supported;
+ r300screen->screen.context_create = r300_create_context;
r300screen->screen.get_tex_transfer = r300_get_tex_transfer;
r300screen->screen.tex_transfer_destroy = r300_tex_transfer_destroy;
r300screen->screen.transfer_map = r300_transfer_map;
/* Parent class */
struct pipe_screen screen;
+ struct radeon_winsys* radeon_winsys;
+
/* Chipset capabilities */
struct r300_capabilities* caps;
return (struct r300_transfer*)transfer;
}
-/* Creates a new r300 screen. */
-struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys);
-
/* Debug functionality. */
/**
/* The public interface header for the r300 pipe driver.
* Any winsys hosting this pipe needs to implement r300_winsys and then
- * call r300_create_context to start things. */
+ * call r300_create_screen to start things. */
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "radeon_winsys.h"
-struct pipe_context* r300_create_context(struct pipe_screen* screen,
- struct radeon_winsys* radeon_winsys);
+/* Creates a new r300 screen. */
+struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys);
+
boolean r300_get_texture_buffer(struct pipe_screen* screen,
struct pipe_texture* texture,
struct pipe_context *
-softpipe_create( struct pipe_screen *screen )
+softpipe_create_context( struct pipe_screen *screen,
+ void *priv )
{
struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
uint i;
softpipe->pipe.winsys = screen->winsys;
softpipe->pipe.screen = screen;
softpipe->pipe.destroy = softpipe_destroy;
+ softpipe->pipe.priv = priv;
/* state setters */
softpipe->pipe.create_blend_state = softpipe_create_blend_state;
void
softpipe_reset_sampler_varients(struct softpipe_context *softpipe);
+struct pipe_context *
+softpipe_create_context( struct pipe_screen *, void *priv );
+
#endif /* SP_CONTEXT_H */
#include "sp_texture.h"
#include "sp_winsys.h"
#include "sp_screen.h"
+#include "sp_context.h"
static const char *
screen->base.get_param = softpipe_get_param;
screen->base.get_paramf = softpipe_get_paramf;
screen->base.is_format_supported = softpipe_is_format_supported;
+ screen->base.context_create = softpipe_create_context;
softpipe_init_screen_texture_funcs(&screen->base);
u_simple_screen_init(&screen->base);
ctx->base.set_decode_target = sp_mpeg12_set_decode_target;
ctx->base.set_csc_matrix = sp_mpeg12_set_csc_matrix;
- ctx->pipe = softpipe_create(screen);
+ ctx->pipe = screen->context_create(screen, NULL);
if (!ctx->pipe) {
FREE(ctx);
return NULL;
struct pipe_buffer;
-struct pipe_context *softpipe_create( struct pipe_screen * );
/**
* Create a softpipe screen that uses the
}
-struct pipe_context *svga_context_create( struct pipe_screen *screen )
+struct pipe_context *svga_context_create( struct pipe_screen *screen,
+ void *priv )
{
struct svga_screen *svgascreen = svga_screen(screen);
struct svga_context *svga = NULL;
svga->pipe.winsys = screen->winsys;
svga->pipe.screen = screen;
+ svga->pipe.priv = priv;
svga->pipe.destroy = svga_destroy;
svga->pipe.clear = svga_clear;
void svga_hwtnl_flush_retry( struct svga_context *svga );
+struct pipe_context *
+svga_context_create(struct pipe_screen *screen,
+ void *priv);
+
/***********************************************************************
* Inline conversion functions. These are better-typed than the
screen->get_param = svga_get_param;
screen->get_paramf = svga_get_paramf;
screen->is_format_supported = svga_is_format_supported;
+ screen->context_create = svga_context_create;
screen->fence_reference = svga_fence_reference;
screen->fence_signalled = svga_fence_signalled;
screen->fence_finish = svga_fence_finish;
};
-struct pipe_context *
-svga_context_create(struct pipe_screen *screen);
-
struct pipe_screen *
svga_screen_create(struct svga_winsys_screen *sws);
};
struct pipe_context *
-trace_context_create(struct pipe_screen *_screen,
+trace_context_create(struct trace_screen *tr_scr,
struct pipe_context *pipe)
{
- struct trace_screen *tr_scr;
struct trace_context *tr_ctx;
- struct pipe_screen *screen;
if(!pipe)
goto error1;
if(!trace_enabled())
goto error1;
- tr_scr = trace_screen(_screen);
- screen = tr_scr->screen;
-
tr_ctx = CALLOC_STRUCT(trace_context);
if(!tr_ctx)
goto error1;
+ tr_ctx->base.winsys = NULL;
+ tr_ctx->base.priv = pipe->priv; /* expose wrapped priv data */
+ tr_ctx->base.screen = &tr_scr->base;
tr_ctx->draw_blocker = debug_get_flags_option("RBUG_BLOCK",
rbug_blocker_flags,
0);
pipe_mutex_init(tr_ctx->list_mutex);
make_empty_list(&tr_ctx->shaders);
- tr_ctx->base.winsys = _screen->winsys;
- tr_ctx->base.screen = _screen;
tr_ctx->base.destroy = trace_context_destroy;
tr_ctx->base.draw_arrays = trace_context_draw_arrays;
tr_ctx->base.draw_elements = trace_context_draw_elements;
tr_ctx->pipe = pipe;
- trace_dump_call_begin("", "pipe_context_create");
- trace_dump_arg(ptr, screen);
- trace_dump_ret(ptr, pipe);
- trace_dump_call_end();
-
trace_screen_add_to_list(tr_scr, contexts, tr_ctx);
return &tr_ctx->base;
#endif
+struct trace_screen;
+
struct trace_context
{
struct pipe_context base;
}
-
struct pipe_context *
-trace_context_create(struct pipe_screen *screen,
+trace_context_create(struct trace_screen *tr_scr,
struct pipe_context *pipe);
void
return trace_screen_create(screen);
}
-static struct pipe_context *
-trace_drm_create_context(struct drm_api *_api,
- struct pipe_screen *_screen)
-{
- struct trace_screen *tr_screen = trace_screen(_screen);
- struct trace_drm_api *tr_api = trace_drm_api(_api);
- struct pipe_screen *screen = tr_screen->screen;
- struct drm_api *api = tr_api->api;
- struct pipe_context *pipe;
-
- /* TODO trace call */
-
- pipe = api->create_context(api, screen);
-
- pipe = trace_context_create(_screen, pipe);
-
- return pipe;
-}
static struct pipe_texture *
trace_drm_texture_from_shared_handle(struct drm_api *_api,
tr_api->base.driver_name = api->driver_name;
tr_api->base.create_screen = trace_drm_create_screen;
- tr_api->base.create_context = trace_drm_create_context;
tr_api->base.texture_from_shared_handle = trace_drm_texture_from_shared_handle;
tr_api->base.shared_handle_from_texture = trace_drm_shared_handle_from_texture;
tr_api->base.local_handle_from_texture = trace_drm_local_handle_from_texture;
#include "tr_dump.h"
#include "tr_dump_state.h"
#include "tr_texture.h"
+#include "tr_context.h"
#include "tr_screen.h"
#include "util/u_inlines.h"
}
+static struct pipe_context *
+trace_screen_context_create(struct pipe_screen *_screen, void *priv)
+{
+ struct trace_screen *tr_scr = trace_screen(_screen);
+ struct pipe_screen *screen = tr_scr->screen;
+ struct pipe_context *result;
+
+ trace_dump_call_begin("pipe_screen", "context_create");
+
+ trace_dump_arg(ptr, screen);
+
+ result = screen->context_create(screen, priv);
+
+ trace_dump_ret(ptr, result);
+
+ trace_dump_call_end();
+
+ result = trace_context_create(tr_scr, result);
+
+ return result;
+}
+
+
static void
trace_screen_flush_frontbuffer(struct pipe_screen *_screen,
struct pipe_surface *_surface,
tr_scr->base.get_param = trace_screen_get_param;
tr_scr->base.get_paramf = trace_screen_get_paramf;
tr_scr->base.is_format_supported = trace_screen_is_format_supported;
+ assert(screen->context_create);
+ tr_scr->base.context_create = trace_screen_context_create;
tr_scr->base.texture_create = trace_screen_texture_create;
tr_scr->base.texture_blanket = trace_screen_texture_blanket;
tr_scr->base.texture_destroy = trace_screen_texture_destroy;
*/
float (*get_paramf)( struct pipe_screen *, int param );
+ struct pipe_context * (*context_create)( struct pipe_screen *,
+ void *priv );
+
/**
* Check if the given pipe_format is supported as a texture or
* drawing surface.
/*@{*/
struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd,
struct drm_create_screen_arg *arg);
- struct pipe_context* (*create_context)(struct drm_api *api,
- struct pipe_screen *screen);
/*@}*/
/**
driParseConfigFiles(&ctx->optionCache,
&screen->optionCache, sPriv->myNum, "dri");
- ctx->pipe = screen->api->create_context(screen->api, screen->pipe_screen);
+ ctx->pipe = screen->pipe_screen->create_context( screen->pipe_screen,
+ ctx );
if (ctx->pipe == NULL)
goto fail;
- /* used in dri_flush_frontbuffer */
- ctx->pipe->priv = ctx;
-
ctx->st = st_create_context(ctx->pipe, visual, st_share);
if (ctx->st == NULL)
goto fail;
}
mode = &gconf->native->mode;
- gctx->pipe =
- gdpy->native->create_context(gdpy->native, (void *) &gctx->base);
+
+ gctx->pipe = gdpy->native->screen->create_context(
+ gdpy->native->screen,
+ (void *) &gctx->base);
+
if (!gctx->pipe) {
free(gctx);
return NULL;
EGLNativePixmapType pix,
const struct native_config *nconf);
- /**
- * Create a pipe context.
- */
- struct pipe_context *(*create_context)(struct native_display *ndpy,
- void *context_private);
/**
* Create a window surface. Required unless no config has GLX_WINDOW_BIT
return &ksurf->base;
}
-static struct pipe_context *
-kms_display_create_context(struct native_display *ndpy, void *context_private)
-{
- struct kms_display *kdpy = kms_display(ndpy);
- struct pipe_context *pctx;
-
- pctx = kdpy->api->create_context(kdpy->api, kdpy->base.screen);
- if (pctx)
- pctx->priv = context_private;
- return pctx;
-}
static boolean
kms_display_is_format_supported(struct native_display *ndpy,
kdpy->base.destroy = kms_display_destroy;
kdpy->base.get_configs = kms_display_get_configs;
- kdpy->base.create_context = kms_display_create_context;
kdpy->base.create_pbuffer_surface = kms_display_create_pbuffer_surface;
kdpy->base.modeset = &kms_display_modeset;
return (dri2surf) ? &dri2surf->base : NULL;
}
-static struct pipe_context *
-dri2_display_create_context(struct native_display *ndpy, void *context_private)
-{
- struct dri2_display *dri2dpy = dri2_display(ndpy);
- struct pipe_context *pctx;
-
- pctx = dri2dpy->api->create_context(dri2dpy->api, dri2dpy->base.screen);
- if (pctx)
- pctx->priv = context_private;
- return pctx;
-}
-
static int
choose_color_format(const __GLcontextModes *mode, enum pipe_format formats[32])
{
dri2dpy->base.destroy = dri2_display_destroy;
dri2dpy->base.get_configs = dri2_display_get_configs;
dri2dpy->base.is_pixmap_supported = dri2_display_is_pixmap_supported;
- dri2dpy->base.create_context = dri2_display_create_context;
dri2dpy->base.create_window_surface = dri2_display_create_window_surface;
dri2dpy->base.create_pixmap_surface = dri2_display_create_pixmap_surface;
dri2dpy->base.create_pbuffer_surface = dri2_display_create_pbuffer_surface;
return (xsurf) ? &xsurf->base : NULL;
}
-static struct pipe_context *
-ximage_display_create_context(struct native_display *ndpy,
- void *context_private)
-{
- struct pipe_context *pctx = softpipe_create(ndpy->screen);
- if (pctx)
- pctx->priv = context_private;
- return pctx;
-}
-
static enum pipe_format
choose_format(const XVisualInfo *vinfo)
{
xdpy->base.get_configs = ximage_display_get_configs;
xdpy->base.is_pixmap_supported = ximage_display_is_pixmap_supported;
- xdpy->base.create_context = ximage_display_create_context;
xdpy->base.create_window_surface = ximage_display_create_window_surface;
xdpy->base.create_pixmap_surface = ximage_display_create_pixmap_surface;
xdpy->base.create_pbuffer_surface = ximage_display_create_pbuffer_surface;
XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
{
static GLboolean firstTime = GL_TRUE;
- struct pipe_context *_pipe = NULL;
struct pipe_context *pipe = NULL;
XMesaContext c;
GLcontext *mesaCtx;
if (screen == NULL)
goto fail;
- _pipe = driver.create_pipe_context(_screen, (void *) c);
- if (_pipe == NULL)
+ /* Trace screen knows how to properly wrap context creation in the
+ * wrapped screen, so nothing special to do here:
+ */
+ pipe = screen->context_create(screen, (void *) c);
+ if (pipe == NULL)
goto fail;
- pipe = trace_context_create(screen, _pipe);
- pipe->priv = c;
c->st = st_create_context(pipe,
&v->mesa_visual,
struct pipe_screen *(*create_pipe_screen)( void );
- /* The context_private argument needs to go away. Is currently used
- * in a round-about way to associate a display-target surface with its
- * Xlib window.
- */
- struct pipe_context *(*create_pipe_context)( struct pipe_screen *,
- void *context_private );
-
void (*display_surface)( struct xmesa_buffer *,
struct pipe_surface * );
{
struct st_device *st_dev;
- if(!st_ws->screen_create ||
- !st_ws->context_create)
+ if(!st_ws->screen_create)
return NULL;
st_dev = CALLOC_STRUCT(st_device);
st_device_reference(&st_ctx->st_dev, st_dev);
- st_ctx->real_pipe = st_dev->st_ws->context_create(st_dev->real_screen);
- if(!st_ctx->real_pipe) {
- st_context_destroy(st_ctx);
- return NULL;
- }
-
- st_ctx->pipe = trace_context_create(st_dev->screen, st_ctx->real_pipe);
+ st_ctx->pipe = st_dev->screen->create_context(st_dev->screen, NULL);
if(!st_ctx->pipe) {
st_context_destroy(st_ctx);
return NULL;
struct st_context {
struct st_device *st_dev;
- struct pipe_context *real_pipe;
struct pipe_context *pipe;
struct cso_context *cso;
}
-static struct pipe_context *
-st_hardpipe_context_create(struct pipe_screen *screen)
-{
- if(st_hardpipe_load()) {
- if(screen == pfnGetGalliumScreenMESA())
- return pfnCreateGalliumContextMESA();
- else
- return NULL;
- }
- else
- return st_softpipe_winsys.context_create(screen);
-}
-
-
const struct st_winsys st_hardpipe_winsys = {
- &st_hardpipe_screen_create,
- &st_hardpipe_context_create
+ &st_hardpipe_screen_create
};
}
-static struct pipe_context *
-st_llvmpipe_context_create(struct pipe_screen *screen)
-{
- return llvmpipe_create(screen);
-}
-
const struct st_winsys st_softpipe_winsys = {
- &st_llvmpipe_screen_create,
- &st_llvmpipe_context_create,
+ &st_llvmpipe_screen_create
};
#include "st_winsys.h"
const struct st_winsys st_softpipe_winsys = {
- &softpipe_create_screen_malloc,
- &softpipe_create,
+ &softpipe_create_screen_malloc
};
{
struct pipe_screen *
(*screen_create)(void);
-
- struct pipe_context *
- (*context_create)(struct pipe_screen *screen);
};
#include "state_tracker/st_context.h"
#include "state_tracker/st_public.h"
-#ifdef DEBUG
-#include "trace/tr_screen.h"
-#include "trace/tr_context.h"
-#endif
-
#include "stw_icd.h"
#include "stw_device.h"
#include "stw_winsys.h"
const struct stw_pixelformat_info *pfi;
GLvisual visual;
struct stw_context *ctx = NULL;
- struct pipe_screen *screen = NULL;
struct pipe_context *pipe = NULL;
if(!stw_dev)
ctx->hdc = hdc;
ctx->iPixelFormat = iPixelFormat;
- screen = stw_dev->screen;
-
-#ifdef DEBUG
- /* Unwrap screen */
- if(stw_dev->trace_running)
- screen = trace_screen(screen)->screen;
-#endif
-
- pipe = stw_dev->stw_winsys->create_context( screen );
+ /* priv == hdc, pass to stw_flush_frontbuffer as context_private
+ */
+ pipe = stw_dev->screen->context_create( stw_dev->screen, hdc );
if (pipe == NULL)
goto no_pipe;
-#ifdef DEBUG
- /* Wrap context */
- if(stw_dev->trace_running)
- pipe = trace_context_create(stw_dev->screen, pipe);
-#endif
-
- /* pass to stw_flush_frontbuffer as context_private */
- assert(!pipe->priv);
- pipe->priv = hdc;
-
ctx->st = st_create_context( pipe, &visual, NULL );
if (ctx->st == NULL)
goto no_st_ctx;
struct pipe_context * APIENTRY
wglCreateGalliumContextMESA(void)
{
- struct pipe_screen *screen = NULL;
- struct pipe_context *pipe = NULL;
-
if(!stw_dev)
return NULL;
- screen = stw_dev->screen;
-
-#ifdef DEBUG
- /* Unwrap screen */
- if(stw_dev->trace_running)
- screen = trace_screen(screen)->screen;
-#endif
-
- pipe = stw_dev->stw_winsys->create_context( screen );
- if (pipe == NULL)
- goto no_pipe;
-
-#ifdef DEBUG
- /* Wrap context */
- if(stw_dev->trace_running)
- pipe = trace_context_create(stw_dev->screen, pipe);
-#endif
-
- return pipe;
-
-no_pipe:
- return NULL;
+ return stw_dev->screen->context_create( stw_dev->screen, NULL );
}
struct pipe_screen *
(*create_screen)( void );
- struct pipe_context *
- (*create_context)( struct pipe_screen *screen );
-
/**
* Present the color buffer to the window associated with the device context.
*/
}
exa->scrn = ms->screen;
- exa->pipe = ms->api->create_context(ms->api, exa->scrn);
+ exa->pipe = exa->scrn->context_create(exa->scrn, NULL);
+ if (exa->pipe == NULL)
+ goto out_err;
+
/* Share context with DRI */
ms->ctx = exa->pipe;
return brw_create_screen(&idws->base, deviceID);
}
-static struct pipe_context *
-i965_libdrm_create_context(struct drm_api *api, struct pipe_screen *screen)
-{
- return brw_create_context(screen);
-}
static void
destroy(struct drm_api *api)
struct drm_api i965_libdrm_api =
{
.name = "i965",
- .create_context = i965_libdrm_create_context,
.create_screen = i965_libdrm_create_screen,
.texture_from_shared_handle = i965_libdrm_texture_from_shared_handle,
.shared_handle_from_texture = i965_libdrm_shared_handle_from_texture,
}
-static struct pipe_context *
-xlib_create_i965_context( struct pipe_screen *screen,
- void *context_private )
-{
- struct pipe_context *pipe;
-
- pipe = brw_create_context(screen);
- if (pipe == NULL)
- goto fail;
-
- pipe->priv = context_private;
- return pipe;
-
-fail:
- /* Free stuff here */
- return NULL;
-}
-
struct xm_driver xlib_i965_driver =
{
.create_pipe_screen = xlib_create_i965_screen,
- .create_pipe_context = xlib_create_i965_context,
.display_surface = xlib_i965_display_surface
};
return i915_create_screen(&idws->base, deviceID);
}
-static struct pipe_context *
-intel_drm_create_context(struct drm_api *api, struct pipe_screen *screen)
-{
- return i915_create_context(screen);
-}
-
static void
destroy(struct drm_api *api)
{
{
.name = "i915",
.driver_name = "i915",
- .create_context = intel_drm_create_context,
.create_screen = intel_drm_create_screen,
.texture_from_shared_handle = intel_drm_texture_from_shared_handle,
.shared_handle_from_texture = intel_drm_shared_handle_from_texture,
struct nouveau_winsys *nv_winsys = nouveau_winsys(s);
struct nouveau_screen *nv_screen= nouveau_screen(nv_winsys->pscreen);
nouveau_device_close(&nv_screen->device);
- FREE(nv_winsys->pctx);
FREE(nv_winsys);
}
return nvws->pscreen;
}
-static struct pipe_context *
-nouveau_drm_create_context(struct drm_api *api, struct pipe_screen *pscreen)
-{
- struct nouveau_winsys *nvws = nouveau_winsys_screen(pscreen);
- struct pipe_context *(*init)(struct pipe_screen *, unsigned);
- unsigned chipset = nouveau_screen(pscreen)->device->chipset;
- int i;
-
- switch (chipset & 0xf0) {
- case 0x30:
- init = nv30_create;
- break;
- case 0x40:
- case 0x60:
- init = nv40_create;
- break;
- case 0x50:
- case 0x80:
- case 0x90:
- case 0xa0:
- init = nv50_create;
- break;
- default:
- debug_printf("%s: unknown chipset nv%02x\n", __func__, chipset);
- return NULL;
- }
-
- /* Find a free slot for a pipe context, allocate a new one if needed */
- for (i = 0; i < nvws->nr_pctx; i++) {
- if (nvws->pctx[i] == NULL)
- break;
- }
-
- if (i == nvws->nr_pctx) {
- nvws->nr_pctx++;
- nvws->pctx = realloc(nvws->pctx,
- sizeof(*nvws->pctx) * nvws->nr_pctx);
- }
-
- nvws->pctx[i] = init(pscreen, i);
- return nvws->pctx[i];
-}
-
static struct pipe_texture *
nouveau_drm_pt_from_name(struct drm_api *api, struct pipe_screen *pscreen,
struct pipe_texture *templ, const char *name,
.name = "nouveau",
.driver_name = "nouveau",
.create_screen = nouveau_drm_create_screen,
- .create_context = nouveau_drm_create_context,
.texture_from_shared_handle = nouveau_drm_pt_from_name,
.shared_handle_from_texture = nouveau_drm_name_from_pt,
.local_handle_from_texture = nouveau_drm_handle_from_pt,
struct pipe_screen *pscreen;
- unsigned nr_pctx;
- struct pipe_context **pctx;
-
struct pipe_surface *front;
};
}
}
-/* Create a pipe_context. */
-struct pipe_context* radeon_create_context(struct drm_api* api,
- struct pipe_screen* screen)
-{
- struct radeon_winsys* rwinsys = (struct radeon_winsys*)screen->winsys;
-
- if (!is_r3xx(rwinsys->pci_id) ||
- debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) {
- return softpipe_create(screen);
- } else {
- return r300_create_context(screen, rwinsys);
- }
-}
boolean radeon_buffer_from_texture(struct drm_api* api,
struct pipe_screen* screen,
.name = "radeon",
.driver_name = "radeon",
.create_screen = radeon_create_screen,
- .create_context = radeon_create_context,
.texture_from_shared_handle = radeon_texture_from_shared_handle,
.shared_handle_from_texture = radeon_shared_handle_from_texture,
.local_handle_from_texture = radeon_local_handle_from_texture,
int drmFB,
struct drm_create_screen_arg *arg);
-struct pipe_context* radeon_create_context(struct drm_api* api,
- struct pipe_screen* screen);
boolean radeon_buffer_from_texture(struct drm_api* api,
struct pipe_screen* screen,
}
-static struct pipe_context *
-radeon_hardpipe_context_create(struct pipe_screen *screen)
-{
- /* FIXME: create a radon pipe_context from screen */
-
- return NULL;
-}
const struct st_winsys st_hardpipe_winsys = {
&radeon_hardpipe_screen_create,
- &radeon_hardpipe_context_create,
};
}
-struct pipe_context *
-vmw_svga_context_create(struct pipe_screen *screen)
-{
- return svga_context_create(screen);
-}
struct svga_winsys_context *
vmw_svga_winsys_context_create(struct svga_winsys_screen *sws);
-struct pipe_context *
-vmw_svga_context_create(struct pipe_screen *screen);
-
#endif /* VMW_CONTEXT_H_ */
return TRUE;
}
-static struct pipe_context*
-vmw_drm_create_context(struct drm_api *drm_api,
- struct pipe_screen *screen)
-{
- return vmw_svga_context_create(screen);
-}
static struct dri1_api dri1_api_hooks = {
.front_srf_locked = NULL,
.name = "vmwgfx",
.driver_name = "vmwgfx",
.create_screen = vmw_drm_create_screen,
- .create_context = vmw_drm_create_context,
.texture_from_shared_handle = vmw_drm_texture_from_handle,
.shared_handle_from_texture = vmw_drm_handle_from_texture,
.local_handle_from_texture = vmw_drm_handle_from_texture,
}
-static struct pipe_context *
-gdi_llvmpipe_context_create(struct pipe_screen *screen)
-{
- return llvmpipe_create(screen);
-}
static void
static const struct stw_winsys stw_winsys = {
&gdi_llvmpipe_screen_create,
- &gdi_llvmpipe_context_create,
&gdi_llvmpipe_present,
NULL, /* get_adapter_luid */
NULL, /* shared_surface_open */
}
-static struct pipe_context *
-gdi_softpipe_context_create(struct pipe_screen *screen)
-{
- return softpipe_create(screen);
-}
-
-
static void
gdi_softpipe_present(struct pipe_screen *screen,
struct pipe_surface *surface,
static const struct stw_winsys stw_winsys = {
&gdi_softpipe_screen_create,
- &gdi_softpipe_context_create,
&gdi_softpipe_present,
NULL, /* get_adapter_luid */
NULL, /* shared_surface_open */
}
-static struct pipe_context *
-xlib_create_cell_context( struct pipe_screen *screen,
- void *priv )
-{
- struct pipe_context *pipe;
-
-
- /* This takes a cell_winsys pointer, but probably that should be
- * created and stored at screen creation, not context creation.
- *
- * The actual cell_winsys value isn't used for anything, so just
- * passing NULL for now.
- */
- pipe = cell_create_context( screen, NULL);
- if (pipe == NULL)
- goto fail;
-
- pipe->priv = priv;
-
- return pipe;
-
-fail:
- return NULL;
-}
struct xm_driver xlib_cell_driver =
{
.create_pipe_screen = xlib_create_cell_screen,
- .create_pipe_context = xlib_create_cell_context,
.display_surface = xlib_cell_display_surface,
};
struct xm_driver xlib_cell_driver =
{
.create_pipe_screen = NULL,
- .create_pipe_context = NULL,
.display_surface = NULL,
};
}
-static struct pipe_context *
-xlib_create_llvmpipe_context( struct pipe_screen *screen,
- void *context_private )
-{
- struct pipe_context *pipe;
-
- pipe = llvmpipe_create(screen);
- if (pipe == NULL)
- goto fail;
-
- pipe->priv = context_private;
- return pipe;
-
-fail:
- /* Free stuff here */
- return NULL;
-}
-
-
static void
xlib_llvmpipe_display_surface(struct xmesa_buffer *xm_buffer,
struct pipe_surface *surf)
struct xm_driver xlib_llvmpipe_driver =
{
.create_pipe_screen = xlib_create_llvmpipe_screen,
- .create_pipe_context = xlib_create_llvmpipe_context,
.display_surface = xlib_llvmpipe_display_surface
};
}
-static struct pipe_context *
-xlib_create_softpipe_context( struct pipe_screen *screen,
- void *context_private )
-{
- struct pipe_context *pipe;
-
- pipe = softpipe_create(screen);
- if (pipe == NULL)
- goto fail;
-
- pipe->priv = context_private;
- return pipe;
-
-fail:
- /* Free stuff here */
- return NULL;
-}
-
struct xm_driver xlib_softpipe_driver =
{
.create_pipe_screen = xlib_create_softpipe_screen,
- .create_pipe_context = xlib_create_softpipe_context,
.display_surface = xlib_softpipe_display_surface
};