As I extend the driver to support different V3D revisions, userspace needs to know what version it's targeting. This is most easily detected using the V3D identity registers. v2: Make sure V3D is runtime PM on when reading the registers. v3: Switch to a 64-bit param value (suggested by Rob Clark in review)
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -37,6 +37,7 @@ extern "C" { · 36 unmodified lines | ||
| 37 | 37 | #define DRM_VC4_MMAP_BO 0x04 |
| 38 | 38 | #define DRM_VC4_CREATE_SHADER_BO 0x05 |
| 39 | 39 | #define DRM_VC4_GET_HANG_STATE 0x06 |
| 40 | +#define DRM_VC4_GET_PARAM 0x07 | |
| 40 | 41 | |
| 41 | 42 | #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) |
| 42 | 43 | #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) |
| @@ -45,6 +46,7 @@ extern "C" { · 2 unmodified lines | ||
| 45 | 46 | #define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo) |
| 46 | 47 | #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) |
| 47 | 48 | #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) |
| 49 | +#define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) | |
| 48 | 50 | |
| 49 | 51 | struct drm_vc4_submit_rcl_surface { |
| 50 | 52 | __u32 hindex; /* Handle index, or ~0 if not present. */ |
| @@ -280,6 +282,16 @@ struct drm_vc4_get_hang_state { · 229 unmodified lines | ||
| 280 | 282 | __u32 pad[16]; |
| 281 | 283 | }; |
| 282 | 284 | |
| 285 | +#define DRM_VC4_PARAM_V3D_IDENT0 0 | |
| 286 | +#define DRM_VC4_PARAM_V3D_IDENT1 1 | |
| 287 | +#define DRM_VC4_PARAM_V3D_IDENT2 2 | |
| 288 | + | |
| 289 | +struct drm_vc4_get_param { | |
| 290 | + __u32 param; | |
| 291 | + __u32 pad; | |
| 292 | + __u64 value; | |
| 293 | +}; | |
| 294 | + | |
| 283 | 295 | #if defined(__cplusplus) |
| 284 | 296 | } |
| 285 | 297 | #endif |