assert(screen);
- buffer = iws->buffer_from_handle(iws, whandle, &tiling, &stride);
+ buffer = iws->buffer_from_handle(iws, whandle, template->height0, &tiling, &stride);
/* Only supports one type */
if ((template->target != PIPE_TEXTURE_2D &&
return screen;
}
+static const struct drm_conf_ret throttle_ret = {
+ .type = DRM_CONF_INT,
+ .val.val_int = 2,
+};
+
+static const struct drm_conf_ret share_fd_ret = {
+ .type = DRM_CONF_BOOL,
+ .val.val_int = true,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+ switch (conf) {
+ case DRM_CONF_THROTTLE:
+ return &throttle_ret;
+ case DRM_CONF_SHARE_FD:
+ return &share_fd_ret;
+ default:
+ break;
+ }
+ return NULL;
+}
+
PUBLIC
-DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen, NULL)
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen, drm_configuration)
-
#include "state_tracker/drm_driver.h"
#include "i915_drm_winsys.h"
#include "util/u_memory.h"
buf->bo = drm_intel_bo_alloc_tiled(idws->gem_manager,
i915_drm_type_to_name(type),
- *stride, height, 1,
+ *stride, height, 1,
&tiling_mode, &pitch, 0);
if (!buf->bo)
static struct i915_winsys_buffer *
i915_drm_buffer_from_handle(struct i915_winsys *iws,
struct winsys_handle *whandle,
+ unsigned height,
enum i915_winsys_buffer_tile *tiling,
unsigned *stride)
{
struct i915_drm_buffer *buf;
uint32_t tile = 0, swizzle = 0;
- if (whandle->type != DRM_API_HANDLE_TYPE_SHARED)
+ if ((whandle->type != DRM_API_HANDLE_TYPE_SHARED) && (whandle->type != DRM_API_HANDLE_TYPE_FD))
return NULL;
buf = CALLOC_STRUCT(i915_drm_buffer);
return NULL;
buf->magic = 0xDEAD1337;
- buf->bo = drm_intel_bo_gem_create_from_name(idws->gem_manager, "gallium3d_from_handle", whandle->handle);
+
+ if (whandle->type == DRM_API_HANDLE_TYPE_SHARED)
+ buf->bo = drm_intel_bo_gem_create_from_name(idws->gem_manager, "gallium3d_from_handle", whandle->handle);
+ else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ int fd = (int) whandle->handle;
+ buf->bo = drm_intel_bo_gem_create_from_prime(idws->gem_manager, fd, height * whandle->stride);
+ }
+
buf->flinked = TRUE;
buf->flink = whandle->handle;