struct iris_bo *
iris_bo_import_dmabuf(struct iris_bufmgr *bufmgr, int prime_fd,
- int tiling, uint32_t stride)
+ int tiling)
{
uint32_t handle;
struct iris_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 (!bufmgr->has_tiling_uapi)
- get_tiling.tiling_mode = I915_TILING_NONE;
- else if (gen_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling))
- goto err;
-
- if (tiling == -1) {
- bo->tiling_mode = get_tiling.tiling_mode;
- /* XXX stride is unknown */
- } else {
+ if (tiling != -1) {
/* Modifiers path */
- if (get_tiling.tiling_mode == tiling || !bufmgr->has_tiling_uapi) {
- bo->tiling_mode = tiling;
- bo->stride = stride;
- } else if (bo_set_tiling_internal(bo, tiling, stride)) {
+ bo->tiling_mode = tiling;
+ } else if (bufmgr->has_tiling_uapi) {
+ struct drm_i915_gem_get_tiling get_tiling = { .handle = bo->gem_handle };
+ if (gen_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling))
goto err;
- }
+ bo->tiling_mode = get_tiling.tiling_mode;
+ } else {
+ bo->tiling_mode = I915_TILING_NONE;
}
out:
int iris_bo_export_dmabuf(struct iris_bo *bo, int *prime_fd);
struct iris_bo *iris_bo_import_dmabuf(struct iris_bufmgr *bufmgr, int prime_fd,
- int tiling, uint32_t stride);
+ int tiling);
/**
* Exports a bo as a GEM handle into a given DRM file descriptor
else
tiling = -1;
res->bo = iris_bo_import_dmabuf(bufmgr, whandle->handle,
- tiling, whandle->stride);
+ tiling);
break;
case WINSYS_HANDLE_TYPE_SHARED:
res->bo = iris_bo_gem_create_from_name(bufmgr, "winsys image",