util_range_init(&rsc->valid_buffer_range);
- rsc->bo = fd_screen_bo_from_handle(pscreen, handle, &slice->pitch);
+ rsc->bo = fd_screen_bo_from_handle(pscreen, handle);
if (!rsc->bo)
goto fail;
rsc->base.vtbl = &fd_resource_vtbl;
rsc->cpp = util_format_get_blocksize(tmpl->format);
- slice->pitch /= rsc->cpp;
+ slice->pitch = handle->stride / rsc->cpp;
slice->offset = handle->offset;
+ if ((slice->pitch < align(prsc->width0, 32)) || (slice->pitch % 32))
+ goto fail;
+
assert(rsc->cpp);
return prsc;
struct fd_bo *
fd_screen_bo_from_handle(struct pipe_screen *pscreen,
- struct winsys_handle *whandle,
- unsigned *out_stride)
+ struct winsys_handle *whandle)
{
struct fd_screen *screen = fd_screen(pscreen);
struct fd_bo *bo;
return NULL;
}
- *out_stride = whandle->stride;
-
return bo;
}
unsigned stride,
struct winsys_handle *whandle);
struct fd_bo * fd_screen_bo_from_handle(struct pipe_screen *pscreen,
- struct winsys_handle *whandle,
- unsigned *out_stride);
+ struct winsys_handle *whandle);
struct pipe_screen * fd_screen_create(struct fd_device *dev);