intel: Add and use intel_gem_get_context_param()
authorJosé Roberto de Souza <jose.souza@intel.com>
Wed, 5 Oct 2022 16:41:10 +0000 (09:41 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Nov 2022 21:01:30 +0000 (21:01 +0000)
commitfd14fcb9f995efcd08fddfd00101fe626f9bbe4b
tree9bee3dfbd70e656a9134763d56b25b05fb94b98a
parent39486661e9c24e39a21bc8e9e8fdc8ccf45216ad
intel: Add and use intel_gem_get_context_param()

Again sharing the same function across all Intel drivers.

There is still two additional DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM
calls, one in intel/dev and other in perf.
The first one can't call intel_gem_get_context_param() because of the
build order of libs and the second one because it sets the size
parameter.

Will revisit those calls in future but this is already an improvement.

v2:
- using intel_gem_get_context_param() for the recently added query for
I915_CONTEXT_PARAM_PROTECTED_CONTENT

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>
src/gallium/drivers/crocus/crocus_bufmgr.c
src/gallium/drivers/iris/iris_bufmgr.c
src/intel/common/intel_gem.c
src/intel/common/intel_gem.h