gallium: remove PIPE_USAGE_STATIC
[mesa.git] / src / gallium / state_trackers / vdpau / output.c
index ecf15796df513d4a914de95d193c2a1d502cf532..5882bb23ea8741fda380b4f262884a3d86621c34 100644 (file)
@@ -80,9 +80,13 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
    res_tmpl.depth0 = 1;
    res_tmpl.array_size = 1;
    res_tmpl.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
-   res_tmpl.usage = PIPE_USAGE_STATIC;
+   res_tmpl.usage = PIPE_USAGE_DEFAULT;
 
    pipe_mutex_lock(dev->mutex);
+
+   if (!CheckSurfaceParams(pipe->screen, &res_tmpl))
+      goto err_unlock;
+
    res = pipe->screen->resource_create(pipe->screen, &res_tmpl);
    if (!res)
       goto err_unlock;
@@ -113,7 +117,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
 err_resource:
    pipe_sampler_view_reference(&vlsurface->sampler_view, NULL);
    pipe_surface_reference(&vlsurface->surface, NULL);
-   pipe_surface_reference(&res, NULL);
+   pipe_resource_reference(&res, NULL);
 err_unlock:
    pipe_mutex_unlock(dev->mutex);
    FREE(vlsurface);
@@ -319,6 +323,9 @@ vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface,
    pipe_mutex_lock(vlsurface->device->mutex);
    vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
 
+   if (!CheckSurfaceParams(context->screen, &res_tmpl))
+      goto error_resource;
+
    res = context->screen->resource_create(context->screen, &res_tmpl);
    if (!res)
       goto error_resource;