[g3dvl] remove create_surface from video context
authorChristian König <deathsimple@vodafone.de>
Fri, 8 Jul 2011 10:15:48 +0000 (12:15 +0200)
committerChristian König <deathsimple@vodafone.de>
Fri, 8 Jul 2011 10:15:48 +0000 (12:15 +0200)
src/gallium/auxiliary/vl/vl_context.c
src/gallium/include/pipe/p_video_context.h
src/gallium/state_trackers/vdpau/output.c
src/gallium/winsys/g3dvl/dri/dri_winsys.c
src/gallium/winsys/g3dvl/xlib/xsp_winsys.c

index 87de24c540280cea992ed3841fe0896f4fb97e9f..b3340cbe2560f35f9724819b18edbbdbacbdf491 100644 (file)
@@ -45,18 +45,6 @@ vl_context_destroy(struct pipe_video_context *context)
    FREE(ctx);
 }
 
-static struct pipe_surface *
-vl_context_create_surface(struct pipe_video_context *context,
-                          struct pipe_resource *resource,
-                          const struct pipe_surface *templ)
-{
-   struct vl_context *ctx = (struct vl_context*)context;
-
-   assert(ctx);
-
-   return ctx->pipe->create_surface(ctx->pipe, resource, templ);
-}
-
 static struct pipe_sampler_view *
 vl_context_create_sampler_view(struct pipe_video_context *context,
                                struct pipe_resource *resource,
@@ -232,7 +220,6 @@ vl_create_context(struct pipe_context *pipe)
    ctx->base.screen = pipe->screen;
 
    ctx->base.destroy = vl_context_destroy;
-   ctx->base.create_surface = vl_context_create_surface;
    ctx->base.create_sampler_view = vl_context_create_sampler_view;
    ctx->base.clear_sampler = vl_context_clear_sampler;
    ctx->base.upload_sampler = vl_context_upload_sampler;
index 78cf43e2edce3f114a038072c6816f73a59ae7a7..567a892e830b69cc773376d535f41f4afed96e3b 100644 (file)
@@ -55,13 +55,6 @@ struct pipe_video_context
     */
    void (*destroy)(struct pipe_video_context *context);
 
-   /**
-    * create a surface of a texture
-    */
-   struct pipe_surface *(*create_surface)(struct pipe_video_context *context,
-                                          struct pipe_resource *resource,
-                                          const struct pipe_surface *templ);
-
    /**
     * sampler view handling, used for subpictures for example
     */
index 72e63fc2f3222f6f29d90ffd7a729c440f7caa44..b45f699b83f8a0d7a9ba4d6ff4aabf986eaa6ef0 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <util/u_debug.h>
 #include <util/u_memory.h>
+#include <util/u_sampler.h>
 
 #include "vdpau_private.h"
 
@@ -39,6 +40,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
                          uint32_t width, uint32_t height,
                          VdpOutputSurface  *surface)
 {
+   struct pipe_context *pipe;
    struct pipe_video_context *context;
    struct pipe_resource res_tmpl, *res;
    struct pipe_sampler_view sv_templ;
@@ -54,8 +56,9 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
    if (!dev)
       return VDP_STATUS_INVALID_HANDLE;
 
+   pipe = dev->context->pipe;
    context = dev->context->vpipe;
-   if (!context)
+   if (!pipe || !context)
       return VDP_STATUS_INVALID_HANDLE;
 
    vlsurface = CALLOC(1, sizeof(vlVdpOutputSurface));
@@ -85,7 +88,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
    // as long as we don't have a background picture we don't want an alpha channel
    sv_templ.swizzle_a = PIPE_SWIZZLE_ONE;
 
-   vlsurface->sampler_view = context->create_sampler_view(context, res, &sv_templ);
+   vlsurface->sampler_view = pipe->create_sampler_view(pipe, res, &sv_templ);
    if (!vlsurface->sampler_view) {
       FREE(dev);
       return VDP_STATUS_ERROR;
@@ -94,7 +97,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
    memset(&surf_templ, 0, sizeof(surf_templ));
    surf_templ.format = res->format;
    surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
-   vlsurface->surface = context->create_surface(context, res, &surf_templ);
+   vlsurface->surface = pipe->create_surface(pipe, res, &surf_templ);
    if (!vlsurface->surface) {
       FREE(dev);
       return VDP_STATUS_ERROR;
index 42b33d191d46401344faaf494a0c2946275e2cab..29b7d3ea468598bf294caf6305a796f6eb969126 100644 (file)
@@ -95,7 +95,7 @@ vl_dri2_get_front(struct vl_context *vctx, Drawable drawable)
          memset(&surf_template, 0, sizeof(surf_template));
          surf_template.format = front_tex->format;
          surf_template.usage = PIPE_BIND_RENDER_TARGET;
-         front_surf = vctx->vpipe->create_surface(vctx->vpipe, front_tex, &surf_template);
+         front_surf = vctx->pipe->create_surface(vctx->pipe, front_tex, &surf_template);
       }
       pipe_resource_reference(&front_tex, NULL);
       Xfree(dri2_front);
index 3caf6603243254c2ccd9c966c7b283150f0c4b39..5cea6196cf7a0e5b3e07d1c168784e8443575190 100644 (file)
@@ -99,8 +99,8 @@ vl_drawable_surface_get(struct vl_context *vctx, Drawable drawable)
    memset(&surf_template, 0, sizeof(surf_template));
    surf_template.format = templat.format;
    surf_template.usage = PIPE_BIND_RENDER_TARGET;
-   xsp_screen->drawable_surface = vctx->vpipe->create_surface(vctx->vpipe, drawable_tex,
-                                                              &surf_template);
+   xsp_screen->drawable_surface = vctx->pipe->create_surface(vctx->pipe, drawable_tex,
+                                                             &surf_template);
    pipe_resource_reference(&drawable_tex, NULL);
 
    if (!xsp_screen->drawable_surface)
@@ -172,7 +172,7 @@ void vl_screen_destroy(struct vl_screen *vscreen)
 struct vl_context*
 vl_video_create(struct vl_screen *vscreen)
 {
-   struct pipe_video_context *pipe;
+   struct pipe_context *pipe;
    struct pipe_video_context *vpipe;
    struct vl_context *vctx;