Skip to content

Commit aa5f04d

Browse files
committed
accel/ivpu: Extend get_param ioctl to identify capabilities
Add DRM_IVPU_PARAM_CAPABILITIES parameters to get_param ioctl to query driver capabilities. For now use it for identify metric streamer and new dma memory range features. Currently upstream version of intel_vpu does not have those, they will be added it the future. Reviewed-by: Jacek Lawrynowicz <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 9ab43e9 commit aa5f04d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ void ivpu_file_priv_put(struct ivpu_file_priv **link)
115115
kref_put(&file_priv->ref, file_priv_release);
116116
}
117117

118+
static int ivpu_get_capabilities(struct ivpu_device *vdev, struct drm_ivpu_param *args)
119+
{
120+
switch (args->index) {
121+
case DRM_IVPU_CAP_METRIC_STREAMER:
122+
args->value = 0;
123+
break;
124+
case DRM_IVPU_CAP_DMA_MEMORY_RANGE:
125+
args->value = 0;
126+
break;
127+
default:
128+
return -EINVAL;
129+
}
130+
131+
return 0;
132+
}
133+
118134
static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
119135
{
120136
struct ivpu_file_priv *file_priv = file->driver_priv;
@@ -174,6 +190,9 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f
174190
case DRM_IVPU_PARAM_SKU:
175191
args->value = vdev->hw->sku;
176192
break;
193+
case DRM_IVPU_PARAM_CAPABILITIES:
194+
ret = ivpu_get_capabilities(vdev, args);
195+
break;
177196
default:
178197
ret = -EINVAL;
179198
break;

include/uapi/drm/ivpu_accel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ extern "C" {
6060
#define DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID 10
6161
#define DRM_IVPU_PARAM_TILE_CONFIG 11
6262
#define DRM_IVPU_PARAM_SKU 12
63+
#define DRM_IVPU_PARAM_CAPABILITIES 13
6364

6465
#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
6566

@@ -68,6 +69,9 @@ extern "C" {
6869
#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS 2
6970
#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME 3
7071

72+
#define DRM_IVPU_CAP_METRIC_STREAMER 1
73+
#define DRM_IVPU_CAP_DMA_MEMORY_RANGE 2
74+
7175
/**
7276
* struct drm_ivpu_param - Get/Set VPU parameters
7377
*/

0 commit comments

Comments
 (0)