"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gallium/drivers/iris/iris_bufmgr.c" between
mesa-21.2.0-rc1.tar.xz and mesa-21.2.0-rc2.tar.xz

About: Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics (main library code). Release candidate.

iris_bufmgr.c  (mesa-21.2.0-rc1.tar.xz):iris_bufmgr.c  (mesa-21.2.0-rc2.tar.xz)
skipping to change at line 1677 skipping to change at line 1677
{ {
int v = -1; /* No param uses (yet) the sign bit, reserve it for errors */ int v = -1; /* No param uses (yet) the sign bit, reserve it for errors */
struct drm_i915_getparam gp = { .param = name, .value = &v }; struct drm_i915_getparam gp = { .param = name, .value = &v };
if (intel_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) if (intel_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
return -1; return -1;
return v; return v;
} }
static void static bool
iris_bufmgr_update_meminfo(struct iris_bufmgr *bufmgr, iris_bufmgr_query_meminfo(struct iris_bufmgr *bufmgr)
const struct drm_i915_query_memory_regions *meminfo)
{ {
struct drm_i915_query_memory_regions *meminfo =
intel_i915_query_alloc(bufmgr->fd, DRM_I915_QUERY_MEMORY_REGIONS);
if (meminfo == NULL)
return false;
for (int i = 0; i < meminfo->num_regions; i++) { for (int i = 0; i < meminfo->num_regions; i++) {
const struct drm_i915_memory_region_info *mem = &meminfo->regions[i]; const struct drm_i915_memory_region_info *mem = &meminfo->regions[i];
switch (mem->region.memory_class) { switch (mem->region.memory_class) {
case I915_MEMORY_CLASS_SYSTEM: case I915_MEMORY_CLASS_SYSTEM:
bufmgr->sys.region = mem->region; bufmgr->sys.region = mem->region;
bufmgr->sys.size = mem->probed_size; bufmgr->sys.size = mem->probed_size;
break; break;
case I915_MEMORY_CLASS_DEVICE: case I915_MEMORY_CLASS_DEVICE:
bufmgr->vram.region = mem->region; bufmgr->vram.region = mem->region;
bufmgr->vram.size = mem->probed_size; bufmgr->vram.size = mem->probed_size;
break; break;
default: default:
break; break;
} }
};
}
static bool
iris_bufmgr_query_meminfo(struct iris_bufmgr *bufmgr)
{
struct drm_i915_query_item item = {
.query_id = DRM_I915_QUERY_MEMORY_REGIONS,
};
struct drm_i915_query query = {
.num_items = 1,
.items_ptr = (uintptr_t) &item,
};
if (drmIoctl(bufmgr->fd, DRM_IOCTL_I915_QUERY, &query))
return false;
struct drm_i915_query_memory_regions *meminfo = calloc(1, item.length);
item.data_ptr = (uintptr_t)meminfo;
if (drmIoctl(bufmgr->fd, DRM_IOCTL_I915_QUERY, &query) ||
item.length <= 0) {
free(meminfo);
return false;
} }
iris_bufmgr_update_meminfo(bufmgr, meminfo);
free(meminfo); free(meminfo);
return true; return true;
} }
/** /**
* Initializes the GEM buffer manager, which uses the kernel to allocate, map, * Initializes the GEM buffer manager, which uses the kernel to allocate, map,
* and manage map buffer objections. * and manage map buffer objections.
* *
* \param fd File descriptor of the opened DRM device. * \param fd File descriptor of the opened DRM device.
 End of changes. 4 change blocks. 
30 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)