Merge branch 'gallium-winsys-private' into gallium-0.2

This commit is contained in:
Zack Rusin 2009-02-01 18:48:16 -05:00
commit 1c90cdd878
101 changed files with 424 additions and 411 deletions

View file

@ -14,8 +14,7 @@ C_SOURCES = \
pb_bufmgr_ondemand.c \
pb_bufmgr_pool.c \
pb_bufmgr_slab.c \
pb_validate.c \
pb_winsys.c
pb_validate.c
include ../../Makefile.template

View file

@ -14,7 +14,6 @@ pipebuffer = env.ConvenienceLibrary(
'pb_bufmgr_pool.c',
'pb_bufmgr_slab.c',
'pb_validate.c',
'pb_winsys.c',
])
auxiliaries.insert(0, pipebuffer)

View file

@ -44,7 +44,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_error.h"
#include "pipe/p_debug.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_thread.h"
#include "util/u_memory.h"
#include "util/u_double_list.h"

View file

@ -36,7 +36,6 @@
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
#include "pipe/p_winsys.h"
#include "pipe/p_thread.h"
#include "util/u_memory.h"
#include "util/u_double_list.h"

View file

@ -35,7 +35,6 @@
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
#include "pipe/p_winsys.h"
#include "pipe/p_thread.h"
#include "util/u_math.h"
#include "util/u_memory.h"

View file

@ -1,191 +0,0 @@
/**************************************************************************
*
* Copyright 2007 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.
*
**************************************************************************/
/**
* \file
* Implementation of client buffer (also designated as "user buffers"), which
* are just state-tracker owned data masqueraded as buffers.
*
* \author Jose Fonseca <jrfonseca@tungstengraphics.com>
*/
#include "pipe/p_winsys.h"
#include "util/u_memory.h"
#include "pb_buffer.h"
#include "pb_winsys.h"
/**
* User buffers are special buffers that initially reference memory
* held by the user but which may if necessary copy that memory into
* device memory behind the scenes, for submission to hardware.
*
* These are particularly useful when the referenced data is never
* submitted to hardware at all, in the particular case of software
* vertex processing.
*/
struct pb_user_buffer
{
struct pb_buffer base;
void *data;
};
extern const struct pb_vtbl pb_user_buffer_vtbl;
static INLINE struct pb_user_buffer *
pb_user_buffer(struct pb_buffer *buf)
{
assert(buf);
assert(buf->vtbl == &pb_user_buffer_vtbl);
return (struct pb_user_buffer *)buf;
}
static void
pb_user_buffer_destroy(struct pb_buffer *buf)
{
assert(buf);
FREE(buf);
}
static void *
pb_user_buffer_map(struct pb_buffer *buf,
unsigned flags)
{
return pb_user_buffer(buf)->data;
}
static void
pb_user_buffer_unmap(struct pb_buffer *buf)
{
/* No-op */
}
static enum pipe_error
pb_user_buffer_validate(struct pb_buffer *buf,
struct pb_validate *vl,
unsigned flags)
{
assert(0);
return PIPE_ERROR;
}
static void
pb_user_buffer_fence(struct pb_buffer *buf,
struct pipe_fence_handle *fence)
{
assert(0);
}
static void
pb_user_buffer_get_base_buffer(struct pb_buffer *buf,
struct pb_buffer **base_buf,
unsigned *offset)
{
*base_buf = buf;
*offset = 0;
}
const struct pb_vtbl
pb_user_buffer_vtbl = {
pb_user_buffer_destroy,
pb_user_buffer_map,
pb_user_buffer_unmap,
pb_user_buffer_validate,
pb_user_buffer_fence,
pb_user_buffer_get_base_buffer
};
struct pipe_buffer *
pb_winsys_user_buffer_create(struct pipe_winsys *winsys,
void *data,
unsigned bytes)
{
struct pb_user_buffer *buf = CALLOC_STRUCT(pb_user_buffer);
if(!buf)
return NULL;
buf->base.base.refcount = 1;
buf->base.base.size = bytes;
buf->base.base.alignment = 0;
buf->base.base.usage = 0;
buf->base.vtbl = &pb_user_buffer_vtbl;
buf->data = data;
return &buf->base.base;
}
void *
pb_winsys_buffer_map(struct pipe_winsys *winsys,
struct pipe_buffer *buf,
unsigned flags)
{
(void)winsys;
return pb_map(pb_buffer(buf), flags);
}
void
pb_winsys_buffer_unmap(struct pipe_winsys *winsys,
struct pipe_buffer *buf)
{
(void)winsys;
pb_unmap(pb_buffer(buf));
}
void
pb_winsys_buffer_destroy(struct pipe_winsys *winsys,
struct pipe_buffer *buf)
{
(void)winsys;
pb_destroy(pb_buffer(buf));
}
void
pb_init_winsys(struct pipe_winsys *winsys)
{
winsys->user_buffer_create = pb_winsys_user_buffer_create;
winsys->buffer_map = pb_winsys_buffer_map;
winsys->buffer_unmap = pb_winsys_buffer_unmap;
winsys->buffer_destroy = pb_winsys_buffer_destroy;
}

View file

@ -23,7 +23,8 @@ C_SOURCES = \
u_stream_wd.c \
u_tile.c \
u_time.c \
u_timed_winsys.c
u_timed_winsys.c \
u_simple_screen.c
include ../../Makefile.template

View file

@ -24,6 +24,7 @@ util = env.ConvenienceLibrary(
'u_tile.c',
'u_time.c',
'u_timed_winsys.c',
'u_simple_screen.c',
])
auxiliaries.insert(0, util)

View file

@ -37,7 +37,6 @@
#include "pipe/p_debug.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_blit.h"

View file

@ -29,7 +29,6 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "util/u_draw_quad.h"

View file

@ -38,7 +38,6 @@
#include "pipe/p_debug.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_memory.h"

View file

@ -0,0 +1,143 @@
/**************************************************************************
*
* Copyright 2009 VMware, Inc.
* 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 "u_simple_screen.h"
#include "pipe/p_screen.h"
#include "pipe/internal/p_winsys_screen.h"
static struct pipe_buffer *
pass_buffer_create(struct pipe_screen *screen,
unsigned alignment,
unsigned usage,
unsigned size)
{
return screen->winsys->buffer_create(screen->winsys,
alignment, usage, size);
}
static struct pipe_buffer *
pass_user_buffer_create(struct pipe_screen *screen,
void *ptr,
unsigned bytes)
{
return screen->winsys->user_buffer_create(screen->winsys,
ptr, bytes);
}
static struct pipe_buffer *
pass_surface_buffer_create(struct pipe_screen *screen,
unsigned width, unsigned height,
enum pipe_format format,
unsigned usage,
unsigned *stride)
{
return screen->winsys->surface_buffer_create(screen->winsys,
width, height,
format, usage, stride);
}
static void *
pass_buffer_map(struct pipe_screen *screen,
struct pipe_buffer *buf,
unsigned usage)
{
return screen->winsys->buffer_map(screen->winsys,
buf, usage);
}
static void
pass_buffer_unmap(struct pipe_screen *screen,
struct pipe_buffer *buf)
{
screen->winsys->buffer_unmap(screen->winsys, buf);
}
static void
pass_buffer_destroy(struct pipe_screen *screen,
struct pipe_buffer *buf)
{
screen->winsys->buffer_destroy(screen->winsys, buf);
}
static void
pass_flush_frontbuffer(struct pipe_screen *screen,
struct pipe_surface *surf,
void *context_private)
{
screen->winsys->flush_frontbuffer(screen->winsys,
surf, context_private);
}
static void
pass_fence_reference(struct pipe_screen *screen,
struct pipe_fence_handle **ptr,
struct pipe_fence_handle *fence)
{
screen->winsys->fence_reference(screen->winsys,
ptr, fence);
}
static int
pass_fence_signalled(struct pipe_screen *screen,
struct pipe_fence_handle *fence,
unsigned flag)
{
return screen->winsys->fence_signalled(screen->winsys,
fence, flag);
}
static int
pass_fence_finish(struct pipe_screen *screen,
struct pipe_fence_handle *fence,
unsigned flag)
{
return screen->winsys->fence_finish(screen->winsys,
fence, flag);
}
void u_simple_screen_init(struct pipe_screen *screen)
{
screen->buffer_create = pass_buffer_create;
screen->user_buffer_create = pass_user_buffer_create;
screen->surface_buffer_create = pass_surface_buffer_create;
screen->buffer_map = pass_buffer_map;
screen->buffer_unmap = pass_buffer_unmap;
screen->buffer_destroy = pass_buffer_destroy;
screen->flush_frontbuffer = pass_flush_frontbuffer;
screen->fence_reference = pass_fence_reference;
screen->fence_signalled = pass_fence_signalled;
screen->fence_finish = pass_fence_finish;
}
const char* u_simple_screen_winsys_name(struct pipe_screen *screen)
{
return screen->winsys->get_name(screen->winsys);
}

View file

@ -1,6 +1,6 @@
/**************************************************************************
*
* Copyright 2009 VMWare, Inc.
* Copyright 2009 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@ -18,62 +18,30 @@
* 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 VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* 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 U_SIMPLE_SCREEN_H
#define U_SIMPLE_SCREEN_H
struct pipe_screen;
struct pipe_winsys;
/**
* @file
* Drop-in replacements for winsys buffer callbacks.
* The following function initializes a simple passthrough screen.
*
* The requirement to use this functions is that all pipe_buffers must be in
* fact pb_buffers.
*
* @author Jose Fonseca <jfonseca@vmware.com>
* All the relevant screen function pointers will forwarded to the
* winsys.
*/
void u_simple_screen_init(struct pipe_screen *screen);
#ifndef PB_WINSYS_H_
#define PB_WINSYS_H_
/**
* Returns the name of the winsys associated with this screen.
*/
const char* u_simple_screen_winsys_name(struct pipe_screen *screen);
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
#ifdef __cplusplus
extern "C" {
#endif
struct pipe_buffer *
pb_winsys_user_buffer_create(struct pipe_winsys *winsys,
void *data,
unsigned bytes);
void *
pb_winsys_buffer_map(struct pipe_winsys *winsys,
struct pipe_buffer *buf,
unsigned flags);
void
pb_winsys_buffer_unmap(struct pipe_winsys *winsys,
struct pipe_buffer *buf);
void
pb_winsys_buffer_destroy(struct pipe_winsys *winsys,
struct pipe_buffer *buf);
void
pb_init_winsys(struct pipe_winsys *winsys);
#ifdef __cplusplus
}
#endif
#endif /*PB_WINSYS_H_*/

View file

@ -37,7 +37,7 @@
#include "pipe/p_debug.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/p_screen.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_memory.h"

View file

@ -29,7 +29,7 @@
* Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
*/
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "u_timed_winsys.h"
#include "util/u_memory.h"
#include "util/u_time.h"
@ -121,7 +121,8 @@ timed_buffer_create(struct pipe_winsys *winsys,
struct pipe_winsys *backend = timed_winsys(winsys)->backend;
uint64_t start = time_start();
struct pipe_buffer *buf = backend->buffer_create( backend, alignment, usage, size );
struct pipe_buffer *buf =
backend->buffer_create( backend, alignment, usage, size );
time_finish(winsys, start, 0, __FUNCTION__);
@ -300,9 +301,9 @@ struct pipe_winsys *u_timed_winsys_create( struct pipe_winsys *backend )
ws->base.buffer_unmap = timed_buffer_unmap;
ws->base.buffer_destroy = timed_buffer_destroy;
ws->base.buffer_create = timed_buffer_create;
ws->base.surface_buffer_create = timed_surface_buffer_create;
ws->base.flush_frontbuffer = timed_flush_frontbuffer;
ws->base.get_name = timed_get_name;
ws->base.surface_buffer_create = timed_surface_buffer_create;
ws->base.fence_reference = timed_fence_reference;
ws->base.fence_signalled = timed_fence_signalled;
ws->base.fence_finish = timed_fence_finish;

View file

@ -36,7 +36,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_format.h"
#include "util/u_memory.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_screen.h"
#include "draw/draw_context.h"

View file

@ -33,7 +33,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "cell_context.h"
@ -53,7 +53,7 @@ cell_map_constant_buffers(struct cell_context *sp)
for (i = 0; i < 2; i++) {
if (sp->constants[i].size) {
sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer,
PIPE_BUFFER_USAGE_CPU_READ);
PIPE_BUFFER_USAGE_CPU_READ);
cell_flush_buffer_range(sp, sp->mapped_constants[i],
sp->constants[i].buffer->size);
}

View file

@ -27,7 +27,8 @@
#include "util/u_memory.h"
#include "pipe/p_winsys.h"
#include "util/u_simple_screen.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
@ -169,6 +170,7 @@ cell_create_screen(struct pipe_winsys *winsys)
screen->is_format_supported = cell_is_format_supported;
cell_init_screen_texture_funcs(screen);
u_simple_screen_init(screen);
return screen;
}

View file

@ -28,7 +28,7 @@
#include "pipe/p_defines.h"
#include "util/u_memory.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "draw/draw_context.h"
#include "tgsi/tgsi_parse.h"
@ -194,9 +194,9 @@ cell_set_constant_buffer(struct pipe_context *pipe,
draw_flush(cell->draw);
/* note: reference counting */
winsys_buffer_reference(ws,
&cell->constants[shader].buffer,
buf->buffer);
pipe_buffer_reference(pipe->screen,
&cell->constants[shader].buffer,
buf->buffer);
cell->constants[shader].size = buf->size;
if (shader == PIPE_SHADER_VERTEX)

View file

@ -34,7 +34,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@ -113,7 +113,7 @@ cell_texture_create(struct pipe_screen *screen,
cell_texture_layout(ct);
ct->buffer = ws->buffer_create(ws, 32, PIPE_BUFFER_USAGE_PIXEL,
ct->buffer_size);
ct->buffer_size);
if (!ct->buffer) {
FREE(ct);
@ -154,7 +154,7 @@ cell_texture_release(struct pipe_screen *screen,
*/
if (ct->tiled_buffer[i]) {
ct->tiled_mapped[i] = NULL;
winsys_buffer_reference(screen->winsys, &ct->tiled_buffer[i], NULL);
pipe_buffer_reference(screen, &ct->tiled_buffer[i], NULL);
}
}
@ -325,11 +325,11 @@ cell_twiddle_texture(struct pipe_screen *screen,
struct pipe_winsys *ws = screen->winsys;
uint bytes = bufWidth * bufHeight * 4 * numFaces;
ct->tiled_buffer[level] = ws->buffer_create(ws, 16,
PIPE_BUFFER_USAGE_PIXEL,
bytes);
PIPE_BUFFER_USAGE_PIXEL,
bytes);
/* and map it */
ct->tiled_mapped[level] = ws->buffer_map(ws, ct->tiled_buffer[level],
PIPE_BUFFER_USAGE_GPU_READ);
PIPE_BUFFER_USAGE_GPU_READ);
}
dst = (uint *) ((ubyte *) ct->tiled_mapped[level] + offset);
@ -406,7 +406,7 @@ cell_get_tex_surface(struct pipe_screen *screen,
if (ps) {
assert(ps->refcount);
assert(ps->winsys);
winsys_buffer_reference(ws, &ps->buffer, ct->buffer);
pipe_buffer_reference(screen, &ps->buffer, ct->buffer);
ps->format = pt->format;
ps->block = pt->block;
ps->width = pt->width[level];

View file

@ -31,7 +31,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "cell_context.h"

View file

@ -27,7 +27,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_memory.h"
#include "pipe/p_context.h"

View file

@ -34,7 +34,7 @@
#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_memory.h"
#include "pipe/p_screen.h"

View file

@ -30,7 +30,7 @@
#include "i915_winsys.h"
#include "i915_debug.h"
#include "i915_batch.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_debug.h"

View file

@ -72,7 +72,7 @@ void i915_print_ureg(const char *msg, unsigned ureg);
#if defined(DEBUG) && defined(FILE_DEBUG_FLAG)
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
static INLINE void
I915_DBG(

View file

@ -28,7 +28,7 @@
#include "i915_reg.h"
#include "i915_debug.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_memory.h"

View file

@ -42,7 +42,7 @@
#include "draw/draw_vbuf.h"
#include "pipe/p_debug.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "util/u_memory.h"

View file

@ -27,7 +27,8 @@
#include "util/u_memory.h"
#include "pipe/p_winsys.h"
#include "util/u_simple_screen.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_string.h"
@ -279,6 +280,7 @@ i915_create_screen(struct pipe_winsys *winsys, uint pci_id)
i915screen->screen.surface_unmap = i915_surface_unmap;
i915_init_screen_texture_functions(&i915screen->screen);
u_simple_screen_init(&i915screen->screen);
return &i915screen->screen;
}

View file

@ -30,7 +30,7 @@
#include "draw/draw_context.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@ -537,7 +537,7 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
void *mapped;
if (buf->buffer && buf->buffer->size &&
(mapped = ws->buffer_map(ws, buf->buffer,
PIPE_BUFFER_USAGE_CPU_READ))) {
PIPE_BUFFER_USAGE_CPU_READ))) {
memcpy(i915->current.constants[shader], mapped, buf->buffer->size);
ws->buffer_unmap(ws, buf->buffer);
i915->current.num_user_constants[shader]

View file

@ -31,7 +31,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_tile.h"
#include "util/u_rect.h"

View file

@ -34,7 +34,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@ -606,8 +606,8 @@ i915_texture_create(struct pipe_screen *screen,
tex_size = tex->stride * tex->total_nblocksy;
tex->buffer = ws->buffer_create(ws, 64,
PIPE_BUFFER_USAGE_PIXEL,
tex_size);
PIPE_BUFFER_USAGE_PIXEL,
tex_size);
if (!tex->buffer)
goto fail;

View file

@ -35,7 +35,7 @@
#include "brw_reg.h"
#include "pipe/p_context.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#define FILE_DEBUG_FLAG DEBUG_BLIT

View file

@ -37,7 +37,7 @@
#include "brw_tex_layout.h"
#include "brw_winsys.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_context.h"
#include "util/u_memory.h"
#include "pipe/p_screen.h"

View file

@ -38,7 +38,7 @@
#include "brw_util.h"
#include "brw_wm.h"
#include "pipe/p_state.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "util/u_memory.h"

View file

@ -34,7 +34,7 @@
#include "brw_state.h"
#include "pipe/p_context.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
static unsigned hw_prim[PIPE_PRIM_POLYGON+1] = {
_3DPRIM_POINTLIST,

View file

@ -27,8 +27,9 @@
#include "util/u_memory.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_string.h"
#include "util/u_simple_screen.h"
#include "brw_context.h"
#include "brw_screen.h"
@ -239,6 +240,7 @@ brw_create_screen(struct pipe_winsys *winsys, uint pci_id)
brwscreen->screen.is_format_supported = brw_is_format_supported;
brw_init_screen_texture_funcs(&brwscreen->screen);
u_simple_screen_init(&brwscreen->screen);
return &brwscreen->screen;
}

View file

@ -30,7 +30,7 @@
*/
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_memory.h"
#include "pipe/p_inlines.h"
#include "pipe/p_shader_tokens.h"

View file

@ -42,7 +42,7 @@
* the pool.
*/
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "pipe/p_inlines.h"

View file

@ -30,7 +30,7 @@
#include "brw_state.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_tile.h"
#include "util/u_rect.h"

View file

@ -37,7 +37,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "brw_context.h"
@ -296,9 +296,9 @@ brw_texture_create_screen(struct pipe_screen *screen,
if (brw_miptree_layout(tex))
tex->buffer = ws->buffer_create(ws, 64,
PIPE_BUFFER_USAGE_PIXEL,
tex->stride *
tex->total_nblocksy);
PIPE_BUFFER_USAGE_PIXEL,
tex->stride *
tex->total_nblocksy);
if (!tex->buffer) {
FREE(tex);
@ -322,7 +322,6 @@ brw_texture_release_screen(struct pipe_screen *screen,
__FUNCTION__, (void *) *pt, (*pt)->refcount - 1);
*/
if (--(*pt)->refcount <= 0) {
struct pipe_winsys *ws = screen->winsys;
struct brw_texture *tex = (struct brw_texture *)*pt;
uint i;
@ -330,7 +329,7 @@ brw_texture_release_screen(struct pipe_screen *screen,
DBG("%s deleting %p\n", __FUNCTION__, (void *) tex);
*/
winsys_buffer_reference(ws, &tex->buffer, NULL);
pipe_buffer_reference(screen, &tex->buffer, NULL);
for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++)
if (tex->image_offset[i])
@ -347,7 +346,6 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
struct pipe_texture *pt,
unsigned face, unsigned level, unsigned zslice)
{
struct pipe_winsys *ws = screen->winsys;
struct brw_texture *tex = (struct brw_texture *)pt;
struct pipe_surface *ps;
unsigned offset; /* in bytes */
@ -369,7 +367,7 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
if (ps) {
ps->refcount = 1;
pipe_texture_reference(&ps->texture, pt);
winsys_buffer_reference(ws, &ps->buffer, tex->buffer);
pipe_buffer_reference(screen, &ps->buffer, tex->buffer);
ps->format = pt->format;
ps->width = pt->width[level];
ps->height = pt->height[level];

View file

@ -2,7 +2,7 @@
#define NOUVEAU_WINSYS_H
#include <stdint.h>
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_defines.h"
#include "nouveau/nouveau_bo.h"

View file

@ -1,6 +1,6 @@
#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv04_context.h"
#include "nv04_screen.h"

View file

@ -1,7 +1,7 @@
#include "pipe/p_debug.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_compiler.h"
#include "draw/draw_vbuf.h"

View file

@ -1,4 +1,5 @@
#include "pipe/p_screen.h"
#include "util/u_simple_screen.h"
#include "nv04_context.h"
#include "nv04_screen.h"
@ -208,6 +209,7 @@ nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
screen->pipe.surface_unmap = nv04_surface_unmap;
nv04_screen_init_miptree_functions(&screen->pipe);
u_simple_screen_init(&screen->pipe);
return &screen->pipe;
}

View file

@ -28,7 +28,7 @@
#include "nv04_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_tile.h"

View file

@ -1,6 +1,6 @@
#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv10_context.h"
#include "nv10_screen.h"

View file

@ -40,7 +40,7 @@
#include "pipe/p_debug.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv10_context.h"
#include "nv10_state.h"

View file

@ -1,4 +1,5 @@
#include "pipe/p_screen.h"
#include "util/u_simple_screen.h"
#include "nv10_context.h"
#include "nv10_screen.h"
@ -204,6 +205,7 @@ nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
screen->pipe.surface_unmap = nv10_surface_unmap;
nv10_screen_init_miptree_functions(&screen->pipe);
u_simple_screen_init(&screen->pipe);
return &screen->pipe;
}

View file

@ -28,7 +28,7 @@
#include "nv10_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_tile.h"

View file

@ -1,6 +1,6 @@
#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv20_context.h"
#include "nv20_screen.h"

View file

@ -40,7 +40,7 @@
#include "pipe/p_debug.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv20_context.h"
#include "nv20_state.h"

View file

@ -1,4 +1,5 @@
#include "pipe/p_screen.h"
#include "util/u_simple_screen.h"
#include "nv20_context.h"
#include "nv20_screen.h"
@ -200,6 +201,7 @@ nv20_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
screen->pipe.surface_unmap = nv20_surface_unmap;
nv20_screen_init_miptree_functions(&screen->pipe);
u_simple_screen_init(&screen->pipe);
return &screen->pipe;
}

View file

@ -28,7 +28,7 @@
#include "nv20_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_tile.h"

View file

@ -1,6 +1,6 @@
#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv30_context.h"
#include "nv30_screen.h"

View file

@ -181,7 +181,7 @@ nv30_miptree_surface_del(struct pipe_screen *pscreen,
return;
pipe_texture_reference(&ps->texture, NULL);
pipe_buffer_reference(pscreen->winsys, &ps->buffer, NULL);
pipe_buffer_reference(pscreen, &ps->buffer, NULL);
FREE(ps);
}

View file

@ -1,4 +1,5 @@
#include "pipe/p_screen.h"
#include "util/u_simple_screen.h"
#include "nv30_context.h"
#include "nv30_screen.h"
@ -381,6 +382,7 @@ nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
screen->pipe.surface_unmap = nv30_surface_unmap;
nv30_screen_init_miptree_functions(&screen->pipe);
u_simple_screen_init(&screen->pipe);
return &screen->pipe;
}

View file

@ -28,7 +28,7 @@
#include "nv30_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_tile.h"

View file

@ -1,6 +1,6 @@
#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv40_context.h"
#include "nv40_screen.h"

View file

@ -242,7 +242,7 @@ nv40_draw_elements_swtnl(struct pipe_context *pipe,
for (i = 0; i < nv40->vtxbuf_nr; i++) {
map = ws->buffer_map(ws, nv40->vtxbuf[i].buffer,
PIPE_BUFFER_USAGE_CPU_READ);
PIPE_BUFFER_USAGE_CPU_READ);
draw_set_mapped_vertex_buffer(nv40->draw, i, map);
}

View file

@ -1,4 +1,5 @@
#include "pipe/p_screen.h"
#include "util/u_simple_screen.h"
#include "nv40_context.h"
#include "nv40_screen.h"
@ -363,6 +364,7 @@ nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
screen->pipe.surface_unmap = nv40_surface_unmap;
nv40_screen_init_miptree_functions(&screen->pipe);
u_simple_screen_init(&screen->pipe);
return &screen->pipe;
}

View file

@ -28,7 +28,7 @@
#include "nv40_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_tile.h"

View file

@ -22,7 +22,7 @@
#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nv50_context.h"
#include "nv50_screen.h"

View file

@ -62,7 +62,7 @@ nv50_query_destroy(struct pipe_context *pipe, struct pipe_query *pq)
struct nv50_query *q = nv50_query(pq);
if (q) {
pipe_buffer_reference(pipe, &q->buffer, NULL);
pipe_buffer_reference(pipe->screen, &q->buffer, NULL);
FREE(q);
}
}

View file

@ -22,6 +22,8 @@
#include "pipe/p_screen.h"
#include "util/u_simple_screen.h"
#include "nv50_context.h"
#include "nv50_screen.h"
@ -323,6 +325,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
nv50_screen_init_miptree_functions(&screen->pipe);
nv50_surface_init_screen_functions(&screen->pipe);
u_simple_screen_init(&screen->pipe);
return &screen->pipe;
}

View file

@ -22,7 +22,7 @@
#include "nv50_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_tile.h"

View file

@ -87,7 +87,7 @@ softpipe_unmap_surfaces(struct softpipe_context *sp)
static void softpipe_destroy( struct pipe_context *pipe )
{
struct softpipe_context *softpipe = softpipe_context( pipe );
struct pipe_winsys *ws = pipe->winsys;
struct pipe_screen *screen = pipe->screen;
uint i;
if (softpipe->draw)
@ -116,7 +116,7 @@ static void softpipe_destroy( struct pipe_context *pipe )
for (i = 0; i < Elements(softpipe->constants); i++) {
if (softpipe->constants[i].buffer) {
winsys_buffer_reference(ws, &softpipe->constants[i].buffer, NULL);
pipe_buffer_reference(screen, &softpipe->constants[i].buffer, NULL);
}
}

View file

@ -33,7 +33,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "sp_context.h"

View file

@ -27,7 +27,8 @@
#include "util/u_memory.h"
#include "pipe/p_winsys.h"
#include "util/u_simple_screen.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
@ -174,6 +175,7 @@ softpipe_create_screen(struct pipe_winsys *winsys)
screen->base.is_format_supported = softpipe_is_format_supported;
softpipe_init_screen_texture_funcs(&screen->base);
u_simple_screen_init(&screen->base);
return &screen->base;
}

View file

@ -32,7 +32,7 @@
#include "pipe/p_defines.h"
#include "util/u_memory.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_shader_tokens.h"
#include "draw/draw_context.h"
#include "tgsi/tgsi_dump.h"
@ -146,13 +146,13 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
const struct pipe_constant_buffer *buf)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
struct pipe_winsys *ws = pipe->winsys;
struct pipe_screen *screen = pipe->screen;
assert(shader < PIPE_SHADER_TYPES);
assert(index == 0);
/* note: reference counting */
winsys_buffer_reference(ws,
pipe_buffer_reference(screen,
&softpipe->constants[shader].buffer,
buf ? buf->buffer : NULL);

View file

@ -33,7 +33,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_math.h"
#include "util/u_memory.h"
@ -106,11 +106,11 @@ softpipe_displaytarget_layout(struct pipe_screen *screen,
spt->base.nblocksy[0] = pf_get_nblocksy(&spt->base.block, spt->base.height[0]);
spt->buffer = ws->surface_buffer_create( ws,
spt->base.width[0],
spt->base.height[0],
spt->base.format,
usage,
&spt->stride[0]);
spt->base.width[0],
spt->base.height[0],
spt->base.format,
usage,
&spt->stride[0]);
return spt->buffer != NULL;
}

View file

@ -31,7 +31,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_debug.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
/**

View file

@ -36,7 +36,7 @@
#define P_WINSYS_H
#include "p_format.h"
#include "pipe/p_format.h"
#ifdef __cplusplus
@ -178,7 +178,6 @@ struct pipe_winsys
};
#ifdef __cplusplus
}
#endif

View file

@ -31,7 +31,6 @@
#include "p_context.h"
#include "p_defines.h"
#include "p_screen.h"
#include "p_winsys.h"
#ifdef __cplusplus
@ -89,29 +88,6 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
}
/* XXX: thread safety issues!
*/
static INLINE void
winsys_buffer_reference(struct pipe_winsys *winsys,
struct pipe_buffer **ptr,
struct pipe_buffer *buf)
{
if (buf) {
assert(buf->refcount);
buf->refcount++;
}
if (*ptr) {
assert((*ptr)->refcount);
if(--(*ptr)->refcount == 0)
winsys->buffer_destroy( winsys, *ptr );
}
*ptr = buf;
}
/**
* \sa pipe_surface_reference
*/
@ -152,20 +128,20 @@ pipe_texture_release(struct pipe_texture **ptr)
/**
* Convenience wrappers for winsys buffer functions.
* Convenience wrappers for screen buffer functions.
*/
static INLINE struct pipe_buffer *
pipe_buffer_create( struct pipe_screen *screen,
unsigned alignment, unsigned usage, unsigned size )
{
return screen->winsys->buffer_create(screen->winsys, alignment, usage, size);
return screen->buffer_create(screen, alignment, usage, size);
}
static INLINE struct pipe_buffer *
pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
{
return screen->winsys->user_buffer_create(screen->winsys, ptr, size);
return screen->user_buffer_create(screen, ptr, size);
}
static INLINE void *
@ -173,25 +149,36 @@ pipe_buffer_map(struct pipe_screen *screen,
struct pipe_buffer *buf,
unsigned usage)
{
return screen->winsys->buffer_map(screen->winsys, buf, usage);
return screen->buffer_map(screen, buf, usage);
}
static INLINE void
pipe_buffer_unmap(struct pipe_screen *screen,
struct pipe_buffer *buf)
{
screen->winsys->buffer_unmap(screen->winsys, buf);
screen->buffer_unmap(screen, buf);
}
/* XXX when we're using this everywhere, get rid of
* winsys_buffer_reference() above.
/* XXX: thread safety issues!
*/
static INLINE void
pipe_buffer_reference(struct pipe_screen *screen,
struct pipe_buffer **ptr,
struct pipe_buffer *buf)
{
winsys_buffer_reference(screen->winsys, ptr, buf);
if (buf) {
assert(buf->refcount);
buf->refcount++;
}
if (*ptr) {
assert((*ptr)->refcount);
if(--(*ptr)->refcount == 0) {
screen->buffer_destroy( screen, *ptr );
}
}
*ptr = buf;
}

View file

@ -48,6 +48,8 @@ extern "C" {
#endif
/** Opaque type */
struct pipe_fence_handle;
/**
* Gallium screen/adapter context. Basically everything
@ -128,7 +130,108 @@ struct pipe_screen {
void (*surface_unmap)( struct pipe_screen *,
struct pipe_surface *surface );
/**
* Buffer management. Buffer attributes are mostly fixed over its lifetime.
*
*/
struct pipe_buffer *(*buffer_create)( struct pipe_screen *screen,
unsigned alignment,
unsigned usage,
unsigned size );
/**
* Create a buffer that wraps user-space data.
*
* Effectively this schedules a delayed call to buffer_create
* followed by an upload of the data at *some point in the future*,
* or perhaps never. Basically the allocate/upload is delayed
* until the buffer is actually passed to hardware.
*
* The intention is to provide a quick way to turn regular data
* into a buffer, and secondly to avoid a copy operation if that
* data subsequently turns out to be only accessed by the CPU.
*
* Common example is OpenGL vertex buffers that are subsequently
* processed either by software TNL in the driver or by passing to
* hardware.
*
* XXX: What happens if the delayed call to buffer_create() fails?
*
* Note that ptr may be accessed at any time upto the time when the
* buffer is destroyed, so the data must not be freed before then.
*/
struct pipe_buffer *(*user_buffer_create)(struct pipe_screen *screen,
void *ptr,
unsigned bytes);
/**
* Allocate storage for a display target surface.
*
* Often surfaces which are meant to be blitted to the front screen (i.e.,
* display targets) must be allocated with special characteristics, memory
* pools, or obtained directly from the windowing system.
*
* This callback is invoked by the pipe_screenwhen creating a texture marked
* with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying
* buffer storage.
*/
struct pipe_buffer *(*surface_buffer_create)(struct pipe_screen *screen,
unsigned width, unsigned height,
enum pipe_format format,
unsigned usage,
unsigned *stride);
/**
* Map the entire data store of a buffer object into the client's address.
* flags is bitmask of PIPE_BUFFER_USAGE_CPU_READ/WRITE flags.
*/
void *(*buffer_map)( struct pipe_screen *screen,
struct pipe_buffer *buf,
unsigned usage );
void (*buffer_unmap)( struct pipe_screen *screen,
struct pipe_buffer *buf );
void (*buffer_destroy)( struct pipe_screen *screen,
struct pipe_buffer *buf );
/**
* Do any special operations to ensure frontbuffer contents are
* displayed, eg copy fake frontbuffer.
*/
void (*flush_frontbuffer)( struct pipe_screen *screen,
struct pipe_surface *surf,
void *context_private );
/** Set ptr = fence, with reference counting */
void (*fence_reference)( struct pipe_screen *screen,
struct pipe_fence_handle **ptr,
struct pipe_fence_handle *fence );
/**
* Checks whether the fence has been signalled.
* \param flags driver-specific meaning
* \return zero on success.
*/
int (*fence_signalled)( struct pipe_screen *screen,
struct pipe_fence_handle *fence,
unsigned flag );
/**
* Wait for the fence to finish.
* \param flags driver-specific meaning
* \return zero on success.
*/
int (*fence_finish)( struct pipe_screen *screen,
struct pipe_fence_handle *fence,
unsigned flag );
};

View file

@ -10,7 +10,6 @@
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
#include "pipe/p_winsys.h"
#include "state_tracker/st_public.h"
#include "state_tracker/drm_api.h"

View file

@ -10,7 +10,7 @@
#include "state_tracker/drm_api.h"
#include "pipe/p_screen.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
/** HACK */
void* driDriverAPI;

View file

@ -2,7 +2,6 @@
#include "vl_basic_csc.h"
#include <assert.h>
#include <pipe/p_context.h>
#include <pipe/p_winsys.h>
#include <pipe/p_state.h>
#include <pipe/p_inlines.h>
#include <tgsi/tgsi_parse.h>

View file

@ -2,7 +2,6 @@
#include "vl_r16snorm_mc_buf.h"
#include <assert.h>
#include <pipe/p_context.h>
#include <pipe/p_winsys.h>
#include <pipe/p_screen.h>
#include <pipe/p_state.h>
#include <pipe/p_inlines.h>
@ -649,9 +648,9 @@ static int vlFlush
pipe->set_framebuffer_state(pipe, &mc->render_target);
pipe->set_viewport_state(pipe, &mc->viewport);
vs_consts = pipe->winsys->buffer_map
vs_consts = pipe_buffer_map
(
pipe->winsys,
pipe->screen,
mc->vs_const_buf.buffer,
PIPE_BUFFER_USAGE_CPU_WRITE | PIPE_BUFFER_USAGE_DISCARD
);

View file

@ -26,7 +26,7 @@
**************************************************************************/
#include "pipe/p_winsys.h"
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
#include "pipe/p_inlines.h"

View file

@ -36,7 +36,7 @@
*/
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"/* port to just p_screen */
#include "pipe/p_format.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"

View file

@ -10,7 +10,7 @@
#include "ws_dri_bufpool.h"
#include "ws_dri_fencemgr.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"

View file

@ -1,7 +1,7 @@
#ifndef INTEL_DRM_DEVICE_H
#define INTEL_DRM_DEVICE_H
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_context.h"
/*

View file

@ -1,7 +1,7 @@
#include "intel_be_device.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"

View file

@ -2,7 +2,7 @@
#ifndef INTEL_DRM_DEVICE_H
#define INTEL_DRM_DEVICE_H
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_context.h"
#include "drm.h"

View file

@ -1,4 +1,4 @@
#include <pipe/p_winsys.h>
#include "pipe/internal/p_winsys_screen.h"
#include <pipe/p_defines.h>
#include <pipe/p_inlines.h>
#include <util/u_memory.h>

View file

@ -2,7 +2,7 @@
#define NOUVEAU_PIPE_WINSYS_H
#include "pipe/p_context.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "nouveau_context.h"
struct nouveau_pipe_buffer {

View file

@ -29,7 +29,7 @@
* Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
*/
#include <pipe/p_winsys.h>
#include "pipe/internal/p_winsys_screen.h"
#include <pipe/p_screen.h>
#include <pipe/p_defines.h>
#include <pipe/p_format.h>

View file

@ -38,7 +38,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_format.h"
#include "pipe/p_state.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "util/u_memory.h"
#include "softpipe/sp_winsys.h"

View file

@ -35,7 +35,7 @@
*/
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
#include "util/u_math.h"

View file

@ -38,7 +38,7 @@
#include <windows.h>
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_format.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"
@ -268,7 +268,7 @@ gdi_softpipe_context_create(struct pipe_screen *screen)
static void
gdi_softpipe_flush_frontbuffer(struct pipe_winsys *winsys,
gdi_softpipe_flush_frontbuffer(struct pipe_screen *screen,
struct pipe_surface *surface,
HDC hDC)
{

View file

@ -36,7 +36,7 @@
//#include "glxheader.h"
//#include "xmesaP.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_math.h"
#include "util/u_memory.h"

View file

@ -36,7 +36,7 @@
//#include "state_trackers/xlib/glxheader.h"
//#include "state_trackers/xlib/xmesaP.h"
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_inlines.h"
#include "util/u_math.h"
#include "util/u_memory.h"

View file

@ -41,7 +41,7 @@
#undef ASSERT
#undef Elements
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_format.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"

View file

@ -38,7 +38,7 @@
#undef ASSERT
#undef Elements
#include "pipe/p_winsys.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_format.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"

View file

@ -42,7 +42,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "pipe/p_screen.h"
#include "st_context.h"
#include "st_cb_fbo.h"
#include "st_cb_texture.h"

View file

@ -52,7 +52,6 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "cso_cache/cso_cache.h"
#include "draw/draw_context.h"

View file

@ -42,7 +42,7 @@
#include "st_public.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_winsys.h"
#include "pipe/p_screen.h"
#include "util/u_gen_mipmap.h"
#include "util/u_blit.h"
@ -55,7 +55,7 @@ is_front_buffer_dirty(struct st_context *st)
/**
* Tell the winsys to display the front color buffer on-screen.
* Tell the screen to display the front color buffer on-screen.
*/
static void
display_front_buffer(struct st_context *st)
@ -67,7 +67,7 @@ display_front_buffer(struct st_context *st)
/* Hook for copying "fake" frontbuffer if necessary:
*/
st->pipe->winsys->flush_frontbuffer( st->pipe->winsys, front_surf,
st->pipe->screen->flush_frontbuffer( st->pipe->screen, front_surf,
st->pipe->priv );
/*
@ -103,8 +103,8 @@ void st_finish( struct st_context *st )
st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
if(fence) {
st->pipe->winsys->fence_finish(st->pipe->winsys, fence, 0);
st->pipe->winsys->fence_reference(st->pipe->winsys, &fence, NULL);
st->pipe->screen->fence_finish(st->pipe->screen, fence, 0);
st->pipe->screen->fence_reference(st->pipe->screen, &fence, NULL);
}
}

View file

@ -36,7 +36,6 @@
#include "main/version.h"
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
#include "pipe/p_winsys.h"
#include "st_context.h"
#include "st_cb_strings.h"
@ -67,10 +66,9 @@ st_get_string(GLcontext * ctx, GLenum name)
}
case GL_RENDERER:
util_snprintf(st->renderer, sizeof(st->renderer), "Gallium %s, %s on %s",
util_snprintf(st->renderer, sizeof(st->renderer), "Gallium %s on %s",
ST_VERSION_STRING,
screen->get_name( screen ),
screen->winsys->get_name( screen->winsys ));
screen->get_name( screen ));
return (GLubyte *) st->renderer;

View file

@ -28,7 +28,6 @@
#include <windows.h>
#include "pipe/p_debug.h"
#include "pipe/p_winsys.h"
#include "pipe/p_screen.h"
#include "stw_device.h"
@ -40,19 +39,18 @@ struct stw_device *stw_dev = NULL;
/**
* XXX: Dispatch pipe_winsys::flush_front_buffer to our
* XXX: Dispatch pipe_screen::flush_front_buffer to our
* stw_winsys::flush_front_buffer.
*/
static void
st_flush_frontbuffer(struct pipe_winsys *ws,
st_flush_frontbuffer(struct pipe_screen *screen,
struct pipe_surface *surf,
void *context_private )
{
const struct stw_winsys *stw_winsys = stw_dev->stw_winsys;
struct pipe_winsys *winsys = stw_dev->screen->winsys;
HDC hdc = (HDC)context_private;
stw_winsys->flush_frontbuffer(winsys, surf, hdc);
stw_winsys->flush_frontbuffer(screen, surf, hdc);
}
@ -72,8 +70,7 @@ st_init(const struct stw_winsys *stw_winsys)
if(!stw_dev->screen)
goto error1;
/* XXX: pipe_winsys::flush_frontbuffer should go away */
stw_dev->screen->winsys->flush_frontbuffer = st_flush_frontbuffer;
stw_dev->screen->flush_frontbuffer = st_flush_frontbuffer;
pixelformat_init();

View file

@ -27,7 +27,6 @@
#include <windows.h>
#include "pipe/p_winsys.h"
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "state_tracker/st_context.h"
@ -55,7 +54,7 @@ wglSwapBuffers(
st_get_framebuffer_surface( fb->stfb, ST_SURFACE_BACK_LEFT, &surf );
stw_dev->stw_winsys->flush_frontbuffer(stw_dev->screen->winsys,
stw_dev->stw_winsys->flush_frontbuffer(stw_dev->screen,
surf,
hdc );

Some files were not shown because too many files have changed in this diff Show more