intel: Store the aperture size in devinfo.
We will later use the devinfo from iris_bufmgr, where we don't have access to the screen pointer. And since we are moving it, we can reuse it in Anv and i965. v2: return error code and check for it on Anv (Lionel). v3: Remove anv_gem_get_aperture() from anv_private.h and stubs (Lionel). Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5043>
This commit is contained in:
committed by
Marge Bot
parent
a887ad7c84
commit
bb3545a6ee
@@ -1396,6 +1396,18 @@ query_topology(struct gen_device_info *devinfo, int fd)
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
gen_get_aperture_size(int fd, uint64_t *size)
|
||||
{
|
||||
struct drm_i915_gem_get_aperture aperture = { 0 };
|
||||
|
||||
int ret = gen_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
|
||||
if (ret == 0 && size)
|
||||
*size = aperture.aper_size;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
gen_get_device_info_from_fd(int fd, struct gen_device_info *devinfo)
|
||||
{
|
||||
@@ -1463,5 +1475,7 @@ gen_get_device_info_from_fd(int fd, struct gen_device_info *devinfo)
|
||||
getparam_topology(devinfo, fd);
|
||||
}
|
||||
|
||||
gen_get_aperture_size(fd, &devinfo->aperture_bytes);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -252,6 +252,8 @@ struct gen_device_info
|
||||
*/
|
||||
uint64_t timestamp_frequency;
|
||||
|
||||
uint64_t aperture_bytes;
|
||||
|
||||
/**
|
||||
* ID to put into the .aub files.
|
||||
*/
|
||||
@@ -293,6 +295,7 @@ gen_device_info_timebase_scale(const struct gen_device_info *devinfo,
|
||||
bool gen_get_device_info_from_fd(int fh, struct gen_device_info *devinfo);
|
||||
bool gen_get_device_info_from_pci_id(int pci_id,
|
||||
struct gen_device_info *devinfo);
|
||||
int gen_get_aperture_size(int fd, uint64_t *size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user