region->refcount = 1;
region->bo = buffer;
region->tiling = tiling;
- region->screen = screen;
_DBG("%s <-- %p\n", __FUNCTION__, region);
return region;
if (region->name == 0) {
if (drm_intel_bo_flink(region->bo, ®ion->name))
return false;
-
- _mesa_HashInsert(region->screen->named_regions,
- region->name, region);
}
*name = region->name;
GLuint width, GLuint height, GLuint pitch,
GLuint handle, const char *name)
{
- struct intel_region *region, *dummy;
+ struct intel_region *region;
drm_intel_bo *buffer;
int ret;
uint32_t bit_6_swizzle, tiling;
- region = _mesa_HashLookup(screen->named_regions, handle);
- if (region != NULL) {
- dummy = NULL;
- if (region->width != width || region->height != height ||
- region->cpp != cpp || region->pitch != pitch) {
- fprintf(stderr,
- "Region for name %d already exists but is not compatible\n",
- handle);
- return NULL;
- }
- intel_region_reference(&dummy, region);
- return dummy;
- }
-
buffer = intel_bo_gem_create_from_name(screen->bufmgr, name, handle);
if (buffer == NULL)
return NULL;
}
region->name = handle;
- _mesa_HashInsert(screen->named_regions, handle, region);
return region;
}
drm_intel_bo_unreference(region->bo);
- if (region->name > 0)
- _mesa_HashRemove(region->screen->named_regions, region->name);
-
free(region);
}
*region_handle = NULL;
#endif
struct intel_context;
+struct intel_screen;
struct intel_buffer_object;
/**
uint32_t tiling; /**< Which tiling mode the region is in */
uint32_t name; /**< Global name for the bo */
- struct intel_screen *screen;
};
image->region->bo = parent->region->bo;
drm_intel_bo_reference(image->region->bo);
image->region->tiling = parent->region->tiling;
- image->region->screen = parent->region->screen;
image->offset = offset;
intel_setup_image_from_dimensions(image);
return intel_get_param(psp, param, &value) && value;
}
-static void
-nop_callback(GLuint key, void *data, void *userData)
-{
-}
-
static void
intelDestroyScreen(__DRIscreen * sPriv)
{
dri_bufmgr_destroy(intelScreen->bufmgr);
driDestroyOptionInfo(&intelScreen->optionCache);
- /* Some regions may still have references to them at this point, so
- * flush the hash table to prevent _mesa_DeleteHashTable() from
- * complaining about the hash not being empty; */
- _mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL);
- _mesa_DeleteHashTable(intelScreen->named_regions);
-
free(intelScreen);
sPriv->driverPrivate = NULL;
}
drm_intel_bufmgr_gem_enable_fenced_relocs(intelScreen->bufmgr);
- intelScreen->named_regions = _mesa_NewHashTable();
-
intelScreen->relaxed_relocations = 0;
intelScreen->relaxed_relocations |=
intel_get_boolean(spriv, I915_PARAM_HAS_RELAXED_DELTA) << 0;
bool no_vbo;
dri_bufmgr *bufmgr;
- struct _mesa_HashTable *named_regions;
/**
* A unique ID for shader programs.