st/egl: Fix KMS build error after winsys handle change.
authorChia-I Wu <olv@lunarg.com>
Tue, 9 Mar 2010 03:32:17 +0000 (11:32 +0800)
committerChia-I Wu <olv@lunarg.com>
Tue, 9 Mar 2010 03:34:37 +0000 (11:34 +0800)
src/gallium/state_trackers/egl/kms/native_kms.c

index 418461089add8cac94d5d1fdab788b21779a2d49..73222408565cb752a4a79237542ad95160ed26b2 100644 (file)
@@ -55,7 +55,7 @@ kms_surface_validate(struct native_surface *nsurf, uint attachment_mask,
       templ.format = ksurf->color_format;
       templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET;
       if (ksurf->type == KMS_SURFACE_TYPE_SCANOUT)
-         templ.tex_usage |= PIPE_TEXTURE_SCANOUT;
+         templ.tex_usage |= PIPE_TEXTURE_USAGE_SCANOUT;
    }
 
    /* create textures */
@@ -100,7 +100,7 @@ kms_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back)
    for (i = 0; i < num_framebuffers; i++) {
       struct kms_framebuffer *fb;
       enum native_attachment natt;
-      unsigned int handle, stride;
+      struct winsys_handle whandle;
       uint block_bits;
 
       if (i == 0) {
@@ -128,13 +128,17 @@ kms_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back)
       /* TODO detect the real value */
       fb->is_passive = TRUE;
 
-      if (!kdpy->api->local_handle_from_texture(kdpy->api,
-               kdpy->base.screen, fb->texture, &stride, &handle))
+      memset(&whandle, 0, sizeof(whandle));
+      whandle.type = DRM_API_HANDLE_TYPE_KMS;
+
+      if (!kdpy->base.screen->texture_get_handle(kdpy->base.screen,
+               fb->texture, &whandle))
          return FALSE;
 
       block_bits = util_format_get_blocksizebits(ksurf->color_format);
       err = drmModeAddFB(kdpy->fd, ksurf->width, ksurf->height,
-            block_bits, block_bits, stride, handle, &fb->buffer_id);
+            block_bits, block_bits, whandle.stride, whandle.handle,
+            &fb->buffer_id);
       if (err) {
          fb->buffer_id = 0;
          return FALSE;