const char* name, unsigned handle)
{
struct i965_libdrm_buffer *buf = CALLOC_STRUCT(i965_libdrm_buffer);
- uint32_t tile = 0, swizzle = 0;
+ uint32_t swizzle = 0;
if (BRW_DUMP)
debug_printf("%s\n", __FUNCTION__);
if (!buf->bo)
goto err;
- drm_intel_bo_get_tiling(buf->bo, &tile, &swizzle);
- if (tile != 0)
+ drm_intel_bo_get_tiling(buf->bo, &buf->tiling, &swizzle);
+ if (buf->tiling != 0)
buf->map_gtt = TRUE;
return buf;
struct i965_libdrm_buffer *buffer;
if (BRW_DUMP)
- debug_printf("%s\n", __FUNCTION__);
+ debug_printf("%s %s pitch %d handle 0x%x\n", __FUNCTION__,
+ name, pitch, handle);
buffer = i965_libdrm_buffer_from_handle(idws, name, handle);
if (!buffer)
return NULL;
- return brw_texture_blanket_winsys_buffer(screen, template, pitch, &buffer->base);
+ return brw_texture_blanket_winsys_buffer(screen, template, pitch,
+ buffer->tiling,
+ &buffer->base);
}
*handle = buf->flink;
+ if (BRW_DUMP)
+ debug_printf(" -> pitch %d handle 0x%x\n", *pitch, *handle);
+
return TRUE;
}
*handle = i965_libdrm_buffer(buffer)->bo->handle;
+ if (BRW_DUMP)
+ debug_printf(" -> pitch %d handle 0x%x\n", *pitch, *handle);
+
return TRUE;
}
return brw_create_screen(&idws->base, deviceID);
}
-static struct pipe_context *
-i965_libdrm_create_context(struct drm_api *api, struct pipe_screen *screen)
-{
- return brw_create_context(screen);
-}
static void
destroy(struct drm_api *api)
struct drm_api i965_libdrm_api =
{
- .create_context = i965_libdrm_create_context,
+ .name = "i965",
.create_screen = i965_libdrm_create_screen,
.texture_from_shared_handle = i965_libdrm_texture_from_shared_handle,
.shared_handle_from_texture = i965_libdrm_shared_handle_from_texture,