Merge branch 'mesa_7_7_branch'
[mesa.git] / src / gallium / winsys / g3dvl / xlib / xsp_winsys.c
index 0e5f5a587b440a51d3dfd062c038891e0719362b..f15bcd37b501ec11a144b166d955049c93996896 100644 (file)
@@ -30,6 +30,7 @@
 #include <pipe/internal/p_winsys_screen.h>
 #include <pipe/p_state.h>
 #include <pipe/p_inlines.h>
+#include <util/u_format.h>
 #include <util/u_memory.h>
 #include <util/u_math.h>
 #include <softpipe/sp_winsys.h>
@@ -138,13 +139,10 @@ static struct pipe_buffer* xsp_surface_buffer_create
 )
 {
    const unsigned int ALIGNMENT = 1;
-   struct pipe_format_block block;
-   unsigned nblocksx, nblocksy;
+   unsigned nblocksy;
 
-   pf_get_block(format, &block);
-   nblocksx = pf_get_nblocksx(&block, width);
-   nblocksy = pf_get_nblocksy(&block, height);
-   *stride = align(nblocksx * block.size, ALIGNMENT);
+   nblocksy = util_format_get_nblocksy(format, height);
+   *stride = align(util_format_get_stride(format, width), ALIGNMENT);
 
    return pws->buffer_create(pws, ALIGNMENT, usage,
                              *stride * nblocksy);
@@ -300,7 +298,8 @@ vl_screen_create(Display *display, int screen)
 }
 
 struct pipe_video_context*
-vl_video_create(struct pipe_screen *screen,
+vl_video_create(Display *display, int screen,
+                struct pipe_screen *p_screen,
                 enum pipe_video_profile profile,
                 enum pipe_video_chroma_format chroma_format,
                 unsigned width, unsigned height)
@@ -308,10 +307,10 @@ vl_video_create(struct pipe_screen *screen,
    struct pipe_video_context *vpipe;
    struct xsp_context *xsp_context;
 
-   assert(screen);
+   assert(p_screen);
    assert(width && height);
 
-   vpipe = sp_video_create(screen, profile, chroma_format, width, height);
+   vpipe = sp_video_create(p_screen, profile, chroma_format, width, height);
    if (!vpipe)
       return NULL;