|
XenevaOS
|
#include <i915_drm.h>

Public Attributes | |
| __u32 | num_regions |
| __u32 | rsvd [3] |
| struct drm_i915_memory_region_info | regions [] |
struct drm_i915_query_memory_regions
The region info query enumerates all regions known to the driver by filling in an array of struct drm_i915_memory_region_info structures.
Example for getting the list of supported regions:
.. code-block:: C
struct drm_i915_query_memory_regions *info; 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, }; int err, i;
// First query the size of the blob we need, this needs to be large // enough to hold our array of regions. The kernel will fill out the // item.length for us, which is the number of bytes we need. err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query); if (err) ...
info = calloc(1, item.length); // Now that we allocated the required number of bytes, we call the ioctl // again, this time with the data_ptr pointing to our newly allocated // blob, which the kernel can then populate with the all the region info. item.data_ptr = (uintptr_t)&info,
err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query); if (err) ...
// We can now access each region in the array for (i = 0; i < info->num_regions; i++) { struct drm_i915_memory_region_info mr = info->regions[i]; u16 class = mr.region.class; u16 instance = mr.region.instance;
.... }
| __u32 drm_i915_query_memory_regions::num_regions |
@num_regions: Number of supported regions
| struct drm_i915_memory_region_info drm_i915_query_memory_regions::regions[] |
@regions: Info about each supported region
| __u32 drm_i915_query_memory_regions::rsvd[3] |
@rsvd: MBZ