From: Tom Stellard Date: Fri, 18 Apr 2014 14:28:41 +0000 (+0200) Subject: clover: Query drivers for max clock frequency X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca848e8bee7683e296e40a7870750d8a156850ca;p=mesa.git clover: Query drivers for max clock frequency Igor Gnatenko: v2: PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY instead of PIPE_COMPUTE_MAX_CLOCK_FREQUENCY Bruno Jiménez: v3: Drivers report clock in Mhz Signed-off-by: Igor Gnatenko Reviewed-by: Francisco Jerez --- diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp index b77a50dafea..1bc2692fa31 100644 --- a/src/gallium/state_trackers/clover/api/device.cpp +++ b/src/gallium/state_trackers/clover/api/device.cpp @@ -153,7 +153,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param, break; case CL_DEVICE_MAX_CLOCK_FREQUENCY: - buf.as_scalar() = 0; + buf.as_scalar() = dev.max_clock_frequency(); break; case CL_DEVICE_ADDRESS_BITS: diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp index 2c5f9b74acc..2f84677b54e 100644 --- a/src/gallium/state_trackers/clover/core/device.cpp +++ b/src/gallium/state_trackers/clover/core/device.cpp @@ -154,6 +154,12 @@ device::max_mem_alloc_size() const { PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE)[0]; } +cl_uint +device::max_clock_frequency() const { + return get_compute_param(pipe, + PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY)[0]; +} + std::vector device::max_block_size() const { auto v = get_compute_param(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE); diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp index 433ac814c21..3662c6be0fe 100644 --- a/src/gallium/state_trackers/clover/core/device.hpp +++ b/src/gallium/state_trackers/clover/core/device.hpp @@ -61,6 +61,7 @@ namespace clover { cl_uint max_const_buffers() const; size_t max_threads_per_block() const; cl_ulong max_mem_alloc_size() const; + cl_uint max_clock_frequency() const; std::vector max_block_size() const; std::string device_name() const;