nouveau: Fix build after msaa merge
[mesa.git] / src / gallium / winsys / nouveau / drm / nouveau_drm_api.c
index 716d4bacd3bfa1b6931a4714a68b6788730b515a..c0047859b18b1b01eb5813d6c93692df4aa56837 100644 (file)
@@ -19,12 +19,14 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen,
                         unsigned width, unsigned height, unsigned pitch)
 {
        struct pipe_surface *ps = NULL;
-       struct pipe_texture *pt = NULL;
-       struct pipe_texture tmpl;
+       struct pipe_resource *pt = NULL;
+       struct pipe_resource tmpl;
        struct winsys_handle whandle;
+       unsigned bind = (PIPE_BIND_SCANOUT |
+                        PIPE_BIND_RENDER_TARGET);
 
        memset(&tmpl, 0, sizeof(tmpl));
-       tmpl.tex_usage = PIPE_TEXTURE_USAGE_SCANOUT;
+       tmpl.bind = bind;
        tmpl.target = PIPE_TEXTURE_2D;
        tmpl.last_level = 0;
        tmpl.depth0 = 1;
@@ -36,16 +38,14 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen,
        whandle.stride = pitch;
        whandle.handle = handle;
 
-       pt = pscreen->texture_from_handle(pscreen, &tmpl, &whandle);
+       pt = pscreen->resource_from_handle(pscreen, &tmpl, &whandle);
        if (!pt)
                return NULL;
 
-       ps = pscreen->get_tex_surface(pscreen, pt, 0, 0, 0,
-                                     PIPE_BUFFER_USAGE_GPU_READ |
-                                     PIPE_BUFFER_USAGE_GPU_WRITE);
+       ps = pscreen->get_tex_surface(pscreen, pt, 0, 0, 0, bind);
 
        /* we don't need the texture from this point on */
-       pipe_texture_reference(&pt, NULL);
+       pipe_resource_reference(&pt, NULL);
        return ps;
 }
 
@@ -144,14 +144,15 @@ nouveau_drm_create_screen(struct drm_api *api, int fd,
        return nvws->pscreen;
 }
 
-struct drm_api drm_api_hooks = {
+static struct drm_api nouveau_drm_api_hooks = {
        .name = "nouveau",
        .driver_name = "nouveau",
        .create_screen = nouveau_drm_create_screen,
+       .destroy = NULL,
 };
 
 struct drm_api *
 drm_api_create() {
-       return &drm_api_hooks;
+       return &nouveau_drm_api_hooks;
 }