struct crocus_bo *
crocus_bo_import_dmabuf(struct crocus_bufmgr *bufmgr, int prime_fd,
- uint32_t tiling, uint32_t stride)
+ uint32_t tiling)
{
uint32_t handle;
struct crocus_bo *bo;
bo->gem_handle = handle;
_mesa_hash_table_insert(bufmgr->handle_table, &bo->gem_handle, bo);
- struct drm_i915_gem_get_tiling get_tiling = { .handle = bo->gem_handle };
- if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling))
- goto err;
+ if (tiling != -1) {
+ /* Modifiers path */
+ bo->tiling_mode = tiling;
+ } else if (bufmgr->has_tiling_uapi) {
+ struct drm_i915_gem_get_tiling get_tiling = { .handle = bo->gem_handle };
+ if (intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling))
+ goto err;
- if (get_tiling.tiling_mode == tiling || tiling > I915_TILING_LAST) {
bo->tiling_mode = get_tiling.tiling_mode;
- bo->swizzle_mode = get_tiling.swizzle_mode;
- /* XXX stride is unknown */
} else {
- if (bo_set_tiling_internal(bo, tiling, stride)) {
- goto err;
- }
+ bo->tiling_mode = I915_TILING_NONE;
}
out:
int crocus_bo_export_dmabuf(struct crocus_bo *bo, int *prime_fd);
struct crocus_bo *crocus_bo_import_dmabuf(struct crocus_bufmgr *bufmgr,
- int prime_fd, uint32_t tiling,
- uint32_t stride);
+ int prime_fd, uint32_t tiling);
/**
* Exports a bo as a GEM handle into a given DRM file descriptor
else
tiling = I915_TILING_LAST + 1;
res->bo = crocus_bo_import_dmabuf(bufmgr, whandle->handle,
- tiling, whandle->stride);
+ tiling);
break;
case WINSYS_HANDLE_TYPE_SHARED:
res->bo = crocus_bo_gem_create_from_name(bufmgr, "winsys image",