mirror of https://gitlab.freedesktop.org/mesa/mesa
rusticl: advertise conformance on 12th Intel iGPUs
Submission can be found here: https://www.khronos.org/conformance/adopters/conformant-products/opencl#submission_405 Signed-off-by: Karol Herbst <kherbst@redhat.com> Hard-reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19699>
This commit is contained in:
parent
507a86e131
commit
fa99fc3491
|
@ -143,6 +143,19 @@ iris_get_name(struct pipe_screen *pscreen)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static const char *
|
||||
iris_get_cl_cts_version(struct pipe_screen *pscreen)
|
||||
{
|
||||
struct iris_screen *screen = (struct iris_screen *)pscreen;
|
||||
const struct intel_device_info *devinfo = &screen->devinfo;
|
||||
|
||||
/* https://www.khronos.org/conformance/adopters/conformant-products/opencl#submission_405 */
|
||||
if (devinfo->verx10 == 120)
|
||||
return "v2022-04-22-00";
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
iris_get_video_memory(struct iris_screen *screen)
|
||||
{
|
||||
|
@ -867,6 +880,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
|
|||
pscreen->get_name = iris_get_name;
|
||||
pscreen->get_vendor = iris_get_vendor;
|
||||
pscreen->get_device_vendor = iris_get_device_vendor;
|
||||
pscreen->get_cl_cts_version = iris_get_cl_cts_version;
|
||||
pscreen->get_param = iris_get_param;
|
||||
pscreen->get_shader_param = iris_get_shader_param;
|
||||
pscreen->get_compute_param = iris_get_compute_param;
|
||||
|
|
|
@ -89,7 +89,9 @@ impl CLInfo<cl_device_info> for cl_device_id {
|
|||
CL_DEVICE_IMAGE3D_MAX_HEIGHT => cl_prop::<usize>(dev.image_3d_size()),
|
||||
CL_DEVICE_IMAGE3D_MAX_WIDTH => cl_prop::<usize>(dev.image_3d_size()),
|
||||
CL_DEVICE_IMAGE3D_MAX_DEPTH => cl_prop::<usize>(dev.image_3d_size()),
|
||||
CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED => cl_prop::<&str>("v0000-01-01-00"),
|
||||
CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED => {
|
||||
cl_prop::<&CStr>(dev.screen().cl_cts_version())
|
||||
}
|
||||
CL_DEVICE_LINKER_AVAILABLE => cl_prop::<bool>(true),
|
||||
CL_DEVICE_LOCAL_MEM_SIZE => cl_prop::<cl_ulong>(dev.local_mem_size()),
|
||||
// TODO add query for CL_LOCAL vs CL_GLOBAL
|
||||
|
|
|
@ -8,6 +8,7 @@ use mesa_rust_gen::*;
|
|||
use mesa_rust_util::string::*;
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::ffi::CStr;
|
||||
use std::mem::size_of;
|
||||
use std::os::raw::c_void;
|
||||
use std::ptr;
|
||||
|
@ -238,6 +239,24 @@ impl PipeScreen {
|
|||
unsafe { *self.ldev.ldev }.type_
|
||||
}
|
||||
|
||||
pub fn cl_cts_version(&self) -> &CStr {
|
||||
unsafe {
|
||||
let s = *self.screen;
|
||||
|
||||
let ptr = s
|
||||
.get_cl_cts_version
|
||||
.map_or(ptr::null(), |get_cl_cts_version| {
|
||||
get_cl_cts_version(self.screen)
|
||||
});
|
||||
if ptr.is_null() {
|
||||
// this string is good enough to pass the CTS
|
||||
CStr::from_bytes_with_nul(b"v0000-01-01-00\0").unwrap()
|
||||
} else {
|
||||
CStr::from_ptr(ptr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_format_supported(
|
||||
&self,
|
||||
format: pipe_format,
|
||||
|
|
|
@ -112,6 +112,13 @@ struct pipe_screen {
|
|||
*/
|
||||
const char *(*get_device_vendor)(struct pipe_screen *);
|
||||
|
||||
/**
|
||||
* Returns the latest OpenCL CTS version passed
|
||||
*
|
||||
* The returned value should be the git tag used when passing conformance.
|
||||
*/
|
||||
const char *(*get_cl_cts_version)(struct pipe_screen *);
|
||||
|
||||
/**
|
||||
* Query an integer-valued capability/parameter/limit
|
||||
* \param param one of PIPE_CAP_x
|
||||
|
|
Loading…
Reference in New Issue