Module: Mesa
Branch: main
Commit: 979f47a04d72d10fceebc1f2c92848f39ae566e8
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=979f47a04d72d10fceebc1f2c92848f39ae566e8

Author: norablackcat <[email protected]>
Date:   Sat Jun 17 14:52:21 2023 -0600

r600/pipe: add PIPE_CAP_TIMER_RESOLUTION

Reviewed by Marek Olšák

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23703>

---

 src/gallium/drivers/r600/r600_pipe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index 02bc47d01d0..d327a5ddd61 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -496,6 +496,10 @@ static int r600_get_param(struct pipe_screen* pscreen, 
enum pipe_cap param)
        case PIPE_CAP_QUERY_TIMESTAMP:
                return rscreen->b.info.clock_crystal_freq != 0;
 
+       case PIPE_CAP_TIMER_RESOLUTION:
+               /* Conversion to nanos from cycles per millisecond */
+               return DIV_ROUND_UP(1000000, 
rscreen->b.info.clock_crystal_freq);
+
        case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MIN_TEXEL_OFFSET:
                return -8;

Reply via email to