}
static inline void
-nvc0_set_global_handle(uint64_t *phandle, struct pipe_resource *res)
+nvc0_set_global_handle(uint32_t *phandle, struct pipe_resource *res)
{
struct nv04_resource *buf = nv04_resource(res);
if (buf) {
- *phandle = buf->address;
+ uint64_t limit = (buf->address + buf->base.width0) - 1;
+ if (limit < (1ULL << 32)) {
+ *phandle = (uint32_t)buf->address;
+ } else {
+ NOUVEAU_ERR("Cannot map into TGSI_RESOURCE_GLOBAL: "
+ "resource not contained within 32-bit address space !\n");
+ *phandle = 0;
+ }
} else {
*phandle = 0;
}
nvc0_set_global_bindings(struct pipe_context *pipe,
unsigned start, unsigned nr,
struct pipe_resource **resources,
- uint64_t **handles)
+ uint32_t **handles)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct pipe_resource **ptr;