summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/SConscript6
-rw-r--r--src/gallium/winsys/i965/drm/i965_drm_buffer.c2
-rw-r--r--src/gallium/winsys/i965/xlib/Makefile2
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_buffer.h3
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_buffer.c7
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_r300.c10
-rw-r--r--src/gallium/winsys/svga/drm/SConscript2
-rw-r--r--src/gallium/winsys/sw/drm/SConscript21
-rw-r--r--src/gallium/winsys/sw/wrapper/SConscript21
-rw-r--r--src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c14
10 files changed, 85 insertions, 3 deletions
diff --git a/src/gallium/winsys/SConscript b/src/gallium/winsys/SConscript
index 2013ee97c1c..330b1ab834c 100644
--- a/src/gallium/winsys/SConscript
+++ b/src/gallium/winsys/SConscript
@@ -1,5 +1,10 @@
Import('*')
+
+SConscript([
+ 'sw/wrapper/SConscript',
+])
+
if 'xlib' in env['winsys']:
SConscript([
'sw/xlib/SConscript',
@@ -12,6 +17,7 @@ if 'gdi' in env['winsys']:
if env['dri']:
SConscript([
+ 'sw/drm/SConscript',
'sw/dri/SConscript',
])
diff --git a/src/gallium/winsys/i965/drm/i965_drm_buffer.c b/src/gallium/winsys/i965/drm/i965_drm_buffer.c
index 33a17496b2b..fb5e50ce810 100644
--- a/src/gallium/winsys/i965/drm/i965_drm_buffer.c
+++ b/src/gallium/winsys/i965/drm/i965_drm_buffer.c
@@ -463,7 +463,7 @@ i965_libdrm_bo_flush_range(struct brw_winsys_buffer *buffer,
brw_dump_data( idws->id,
buf->data_type,
buf->bo->offset + offset,
- buf->bo->virtual + offset,
+ (char*)buf->bo->virtual + offset,
length );
}
diff --git a/src/gallium/winsys/i965/xlib/Makefile b/src/gallium/winsys/i965/xlib/Makefile
index 3730db6997e..cc8249395c5 100644
--- a/src/gallium/winsys/i965/xlib/Makefile
+++ b/src/gallium/winsys/i965/xlib/Makefile
@@ -38,7 +38,7 @@ LIBS = \
$(TOP)/src/gallium/drivers/i965/libi965.a \
$(TOP)/src/gallium/drivers/trace/libtrace.a \
$(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \
- $(TOP)/src/mesa/libglapi.a \
+ $(TOP)/src/mapi/glapi/libglapi.a \
$(TOP)/src/mesa/libmesagallium.a \
$(GALLIUM_AUXILIARIES)
diff --git a/src/gallium/winsys/radeon/drm/radeon_buffer.h b/src/gallium/winsys/radeon/drm/radeon_buffer.h
index b48b6358e01..b9ecf9ded07 100644
--- a/src/gallium/winsys/radeon/drm/radeon_buffer.h
+++ b/src/gallium/winsys/radeon/drm/radeon_buffer.h
@@ -88,4 +88,7 @@ boolean radeon_drm_bufmgr_get_handle(struct pb_buffer *_buf,
boolean radeon_drm_bufmgr_is_buffer_referenced(struct pb_buffer *_buf,
enum r300_reference_domain domain);
+
+void radeon_drm_bufmgr_wait(struct pb_buffer *_buf);
+
#endif
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
index b8366498922..a05205da886 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
@@ -419,3 +419,10 @@ void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr)
make_empty_list(&mgr->buffer_map_list);
}
+
+void radeon_drm_bufmgr_wait(struct pb_buffer *_buf)
+{
+ struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
+
+ radeon_bo_wait(buf->bo);
+}
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c
index fb779e4033b..e188f7e7ccd 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -86,7 +86,7 @@ static void *radeon_r300_winsys_buffer_map(struct r300_winsys_screen *ws,
unsigned usage)
{
struct pb_buffer *_buf = radeon_pb_buffer(buf);
-
+
return pb_map(_buf, usage);
}
@@ -98,6 +98,13 @@ static void radeon_r300_winsys_buffer_unmap(struct r300_winsys_screen *ws,
pb_unmap(_buf);
}
+static void radeon_r300_winsys_buffer_wait(struct r300_winsys_screen *ws,
+ struct r300_winsys_buffer *buf)
+{
+ struct pb_buffer *_buf = radeon_pb_buffer(buf);
+ radeon_drm_bufmgr_wait(_buf);
+}
+
static void radeon_r300_winsys_buffer_reference(struct r300_winsys_screen *rws,
struct r300_winsys_buffer **pdst,
struct r300_winsys_buffer *src)
@@ -343,6 +350,7 @@ radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws)
ws->base.buffer_get_tiling = radeon_r300_winsys_buffer_get_tiling;
ws->base.buffer_map = radeon_r300_winsys_buffer_map;
ws->base.buffer_unmap = radeon_r300_winsys_buffer_unmap;
+ ws->base.buffer_wait = radeon_r300_winsys_buffer_wait;
ws->base.buffer_reference = radeon_r300_winsys_buffer_reference;
ws->base.buffer_from_handle = radeon_r300_winsys_buffer_from_handle;
ws->base.buffer_get_handle = radeon_r300_winsys_buffer_get_handle;
diff --git a/src/gallium/winsys/svga/drm/SConscript b/src/gallium/winsys/svga/drm/SConscript
index edaf9458bee..3ad4c725727 100644
--- a/src/gallium/winsys/svga/drm/SConscript
+++ b/src/gallium/winsys/svga/drm/SConscript
@@ -2,6 +2,8 @@ Import('*')
env = env.Clone()
+env.ParseConfig('pkg-config --cflags libdrm')
+
if env['gcc']:
env.Append(CCFLAGS = ['-fvisibility=hidden'])
env.Append(CPPDEFINES = [
diff --git a/src/gallium/winsys/sw/drm/SConscript b/src/gallium/winsys/sw/drm/SConscript
new file mode 100644
index 00000000000..15a2e05d5af
--- /dev/null
+++ b/src/gallium/winsys/sw/drm/SConscript
@@ -0,0 +1,21 @@
+#######################################################################
+# SConscript for xlib winsys
+
+
+Import('*')
+
+env = env.Clone()
+
+env.Append(CPPPATH = [
+ '#/src/gallium/include',
+ '#/src/gallium/auxiliary',
+ '#/src/gallium/drivers',
+])
+
+ws_drm = env.ConvenienceLibrary(
+ target = 'ws_drm',
+ source = [
+ 'sw_drm_api.c',
+ ]
+)
+Export('ws_drm')
diff --git a/src/gallium/winsys/sw/wrapper/SConscript b/src/gallium/winsys/sw/wrapper/SConscript
new file mode 100644
index 00000000000..4c60488df0b
--- /dev/null
+++ b/src/gallium/winsys/sw/wrapper/SConscript
@@ -0,0 +1,21 @@
+#######################################################################
+# SConscript for xlib winsys
+
+
+Import('*')
+
+env = env.Clone()
+
+env.Append(CPPPATH = [
+ '#/src/gallium/include',
+ '#/src/gallium/auxiliary',
+ '#/src/gallium/drivers',
+])
+
+ws_wrapper = env.ConvenienceLibrary(
+ target = 'ws_wrapper',
+ source = [
+ 'wrapper_sw_winsys.c',
+ ]
+)
+Export('ws_wrapper')
diff --git a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
index d4d4270eb86..b997abda9b0 100644
--- a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
+++ b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
@@ -145,6 +145,7 @@ wsw_dt_create(struct sw_winsys *ws,
* XXX Why don't we just get the template.
*/
memset(&templ, 0, sizeof(templ));
+ templ.target = PIPE_TEXTURE_2D;
templ.width0 = width;
templ.height0 = height;
templ.format = format;
@@ -175,6 +176,18 @@ wsw_dt_from_handle(struct sw_winsys *ws,
return wsw_dt_wrap_texture(wsw, tex, stride);
}
+static boolean
+wsw_dt_get_handle(struct sw_winsys *ws,
+ struct sw_displaytarget *dt,
+ struct winsys_handle *whandle)
+{
+ struct wrapper_sw_winsys *wsw = wrapper_sw_winsys(ws);
+ struct wrapper_sw_displaytarget *wdt = wrapper_sw_displaytarget(dt);
+ struct pipe_resource *tex = wdt->tex;
+
+ return wsw->screen->resource_get_handle(wsw->screen, tex, whandle);
+}
+
static void *
wsw_dt_map(struct sw_winsys *ws,
struct sw_displaytarget *dt,
@@ -267,6 +280,7 @@ wrapper_sw_winsys_warp_pipe_screen(struct pipe_screen *screen)
wsw->base.displaytarget_create = wsw_dt_create;
wsw->base.displaytarget_from_handle = wsw_dt_from_handle;
+ wsw->base.displaytarget_get_handle = wsw_dt_get_handle;
wsw->base.displaytarget_map = wsw_dt_map;
wsw->base.displaytarget_unmap = wsw_dt_unmap;
wsw->base.displaytarget_destroy = wsw_dt_destroy;