summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/g3dvl/xsp_winsys.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-03-02 13:27:46 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-03-02 13:27:46 +0000
commit97a1fd158c9acfaa3a8deda7eb5bf0b253e85c15 (patch)
tree37e6c11507c1ef044aa8f0ee009136bb1d8b5bbc /src/gallium/winsys/g3dvl/xsp_winsys.c
parent60e5fe65067da76dea816535bec1e9073adc0ba7 (diff)
parentb70f344e223fc10df8df08a6d82a813505225712 (diff)
Merge commit 'origin/master' into gallium-map-range
Diffstat (limited to 'src/gallium/winsys/g3dvl/xsp_winsys.c')
-rw-r--r--src/gallium/winsys/g3dvl/xsp_winsys.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/winsys/g3dvl/xsp_winsys.c b/src/gallium/winsys/g3dvl/xsp_winsys.c
index 40d683234f..acfb8ec4ea 100644
--- a/src/gallium/winsys/g3dvl/xsp_winsys.c
+++ b/src/gallium/winsys/g3dvl/xsp_winsys.c
@@ -1,9 +1,10 @@
#include "vl_winsys.h"
#include <X11/Xutil.h>
-#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_memory.h>
+#include <util/u_math.h>
#include <softpipe/sp_winsys.h>
/* pipe_winsys implementation */
@@ -96,12 +97,6 @@ static void xsp_buffer_destroy(struct pipe_winsys *pws, struct pipe_buffer *buff
free(xsp_buf);
}
-/* Borrowed from Mesa's xm_winsys */
-static unsigned int round_up(unsigned n, unsigned multiple)
-{
- return (n + multiple - 1) & ~(multiple - 1);
-}
-
static struct pipe_buffer* xsp_surface_buffer_create
(
struct pipe_winsys *pws,
@@ -119,11 +114,11 @@ static struct pipe_buffer* xsp_surface_buffer_create
pf_get_block(format, &block);
nblocksx = pf_get_nblocksx(&block, width);
nblocksy = pf_get_nblocksy(&block, height);
- *stride = round_up(nblocksx * block.size, ALIGNMENT);
+ *stride = align(nblocksx * block.size, ALIGNMENT);
- return winsys->buffer_create(winsys, ALIGNMENT,
- usage,
- *stride * nblocksy);
+ return pws->buffer_create(pws, ALIGNMENT,
+ usage,
+ *stride * nblocksy);
}
static void xsp_fence_reference(struct pipe_winsys *pws, struct pipe_fence_handle **ptr, struct pipe_fence_handle *fence)