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

Author: Rob Clark <[email protected]>
Date:   Mon Aug  8 12:01:37 2022 -0700

freedreno/drm: Add FD_VA_SIZE param

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17947>

---

 src/freedreno/drm/freedreno_drmif.h    | 2 ++
 src/freedreno/drm/msm/msm_pipe.c       | 2 ++
 src/freedreno/drm/virtio/virtio_pipe.c | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/src/freedreno/drm/freedreno_drmif.h 
b/src/freedreno/drm/freedreno_drmif.h
index 83e52e9d100..2583e671cd6 100644
--- a/src/freedreno/drm/freedreno_drmif.h
+++ b/src/freedreno/drm/freedreno_drmif.h
@@ -62,6 +62,7 @@ enum fd_param_id {
    FD_GLOBAL_FAULTS, /* # of global (all context) faults */
    FD_SUSPEND_COUNT, /* # of times the GPU has suspended, and potentially lost 
state */
    FD_SYSPROF,       /* Settable (for CAP_SYS_ADMIN) param for system 
profiling */
+   FD_VA_SIZE,       /* GPU virtual address size */
 };
 
 /**
@@ -139,6 +140,7 @@ enum fd_version {
    FD_VERSION_MEMORY_FD = 2,           /* supports shared memory objects */
    FD_VERSION_SUSPENDS = 7,            /* Adds MSM_PARAM_SUSPENDS to detect 
device suspend */
    FD_VERSION_CACHED_COHERENT = 8,     /* Adds cached-coherent support (a6xx+) 
*/
+   FD_VERSION_VA_SIZE = 9,
 };
 enum fd_version fd_device_version(struct fd_device *dev);
 
diff --git a/src/freedreno/drm/msm/msm_pipe.c b/src/freedreno/drm/msm/msm_pipe.c
index dd4073aac52..fd7d9b6d0d2 100644
--- a/src/freedreno/drm/msm/msm_pipe.c
+++ b/src/freedreno/drm/msm/msm_pipe.c
@@ -100,6 +100,8 @@ msm_pipe_get_param(struct fd_pipe *pipe, enum fd_param_id 
param,
       return query_param(pipe, MSM_PARAM_FAULTS, value);
    case FD_SUSPEND_COUNT:
       return query_param(pipe, MSM_PARAM_SUSPENDS, value);
+   case FD_VA_SIZE:
+      return query_param(pipe, MSM_PARAM_VA_SIZE, value);
    default:
       ERROR_MSG("invalid param id: %d", param);
       return -1;
diff --git a/src/freedreno/drm/virtio/virtio_pipe.c 
b/src/freedreno/drm/virtio/virtio_pipe.c
index 9b001c937a9..76c4dedc519 100644
--- a/src/freedreno/drm/virtio/virtio_pipe.c
+++ b/src/freedreno/drm/virtio/virtio_pipe.c
@@ -106,6 +106,9 @@ virtio_pipe_get_param(struct fd_pipe *pipe, enum 
fd_param_id param,
       return query_param(pipe, MSM_PARAM_FAULTS, value);
    case FD_SUSPEND_COUNT:
       return query_param(pipe, MSM_PARAM_SUSPENDS, value);
+   case FD_VA_SIZE:
+      *value = virtio_dev->caps.u.msm.va_size;
+      return 0;
    default:
       ERROR_MSG("invalid param id: %d", param);
       return -1;

Reply via email to