mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
freedreno/drm: update for robustness
Update UABI header and add FD_PP_PGTABLE and FD_NR_FAULTS params. Robustness can be supported by a kernel which provides the new ABI if it also indicates that per-process pagetables are in use. Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
parent
77d091d0c5
commit
6503918689
3 changed files with 44 additions and 0 deletions
|
|
@ -52,6 +52,9 @@ enum fd_param_id {
|
|||
FD_MAX_FREQ,
|
||||
FD_TIMESTAMP,
|
||||
FD_NR_RINGS, /* # of rings == # of distinct priority levels */
|
||||
FD_PP_PGTABLE, /* are per-process pagetables used for the pipe/ctx */
|
||||
FD_CTX_FAULTS, /* # of per context faults */
|
||||
FD_GLOBAL_FAULTS, /* # of global (all context) faults */
|
||||
};
|
||||
|
||||
/* bo flags: */
|
||||
|
|
@ -88,6 +91,7 @@ enum fd_version {
|
|||
FD_VERSION_SUBMIT_QUEUES = 3, /* submit queues and multiple priority levels */
|
||||
FD_VERSION_BO_IOVA = 3, /* supports fd_bo_get/put_iova() */
|
||||
FD_VERSION_SOFTPIN = 4, /* adds softpin, bo name, and dump flag */
|
||||
FD_VERSION_ROBUSTNESS = 5, /* adds FD_NR_FAULTS and FD_PP_PGTABLE */
|
||||
};
|
||||
enum fd_version fd_device_version(struct fd_device *dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ struct drm_msm_timespec {
|
|||
#define MSM_PARAM_TIMESTAMP 0x05
|
||||
#define MSM_PARAM_GMEM_BASE 0x06
|
||||
#define MSM_PARAM_NR_RINGS 0x07
|
||||
#define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */
|
||||
#define MSM_PARAM_FAULTS 0x09
|
||||
|
||||
struct drm_msm_param {
|
||||
__u32 pipe; /* in, MSM_PIPE_x */
|
||||
|
|
@ -286,6 +288,16 @@ struct drm_msm_submitqueue {
|
|||
__u32 id; /* out, identifier */
|
||||
};
|
||||
|
||||
#define MSM_SUBMITQUEUE_PARAM_FAULTS 0
|
||||
|
||||
struct drm_msm_submitqueue_query {
|
||||
__u64 data;
|
||||
__u32 id;
|
||||
__u32 param;
|
||||
__u32 len;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
#define DRM_MSM_GET_PARAM 0x00
|
||||
/* placeholder:
|
||||
#define DRM_MSM_SET_PARAM 0x01
|
||||
|
|
@ -302,6 +314,7 @@ struct drm_msm_submitqueue {
|
|||
*/
|
||||
#define DRM_MSM_SUBMITQUEUE_NEW 0x0A
|
||||
#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B
|
||||
#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C
|
||||
|
||||
#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
|
||||
#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
|
||||
|
|
@ -313,6 +326,7 @@ struct drm_msm_submitqueue {
|
|||
#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
|
||||
#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
|
||||
#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
|
||||
#define DRM_IOCTL_MSM_SUBMITQUEUE_QUERY DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_QUERY, struct drm_msm_submitqueue_query)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,26 @@ static int query_param(struct fd_pipe *pipe, uint32_t param,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int query_queue_param(struct fd_pipe *pipe, uint32_t param,
|
||||
uint64_t *value)
|
||||
{
|
||||
struct msm_pipe *msm_pipe = to_msm_pipe(pipe);
|
||||
struct drm_msm_submitqueue_query req = {
|
||||
.data = value,
|
||||
.id = msm_pipe->queue_id,
|
||||
.param = param,
|
||||
.len = sizeof(*value),
|
||||
};
|
||||
int ret;
|
||||
|
||||
ret = drmCommandWriteRead(pipe->dev->fd, DRM_MSM_SUBMITQUEUE_QUERY,
|
||||
&req, sizeof(req));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_pipe_get_param(struct fd_pipe *pipe,
|
||||
enum fd_param_id param, uint64_t *value)
|
||||
{
|
||||
|
|
@ -69,6 +89,12 @@ static int msm_pipe_get_param(struct fd_pipe *pipe,
|
|||
return query_param(pipe, MSM_PARAM_TIMESTAMP, value);
|
||||
case FD_NR_RINGS:
|
||||
return query_param(pipe, MSM_PARAM_NR_RINGS, value);
|
||||
case FD_PP_PGTABLE:
|
||||
return query_param(pipe, MSM_PARAM_PP_PGTABLE, value);
|
||||
case FD_CTX_FAULTS:
|
||||
return query_queue_param(pipe, MSM_SUBMITQUEUE_PARAM_FAULTS, value);
|
||||
case FD_GLOBAL_FAULTS:
|
||||
return query_param(pipe, MSM_PARAM_FAULTS, value);
|
||||
default:
|
||||
ERROR_MSG("invalid param id: %d", param);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue