Skip to content

Commit b246271

Browse files
kwachowsjlawryno
authored andcommitted
accel/ivpu: Deprecate DRM_IVPU_PARAM_CONTEXT_PRIORITY param
DRM_IVPU_PARAM_CONTEXT_PRIORITY has been deprecated because it has been replaced with DRM_IVPU_JOB_PRIORITY levels set with submit IOCTL and was unused anyway. Signed-off-by: Wachowski, Karol <[email protected]> Signed-off-by: Jacek Lawrynowicz <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 37dee2a commit b246271

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f
177177
case DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS:
178178
args->value = vdev->hw->ranges.user.start;
179179
break;
180-
case DRM_IVPU_PARAM_CONTEXT_PRIORITY:
181-
args->value = file_priv->priority;
182-
break;
183180
case DRM_IVPU_PARAM_CONTEXT_ID:
184181
args->value = file_priv->ctx.id;
185182
break;
@@ -219,17 +216,10 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f
219216

220217
static int ivpu_set_param_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
221218
{
222-
struct ivpu_file_priv *file_priv = file->driver_priv;
223219
struct drm_ivpu_param *args = data;
224220
int ret = 0;
225221

226222
switch (args->param) {
227-
case DRM_IVPU_PARAM_CONTEXT_PRIORITY:
228-
if (args->value <= DRM_IVPU_CONTEXT_PRIORITY_REALTIME)
229-
file_priv->priority = args->value;
230-
else
231-
ret = -EINVAL;
232-
break;
233223
default:
234224
ret = -EINVAL;
235225
}
@@ -258,7 +248,6 @@ static int ivpu_open(struct drm_device *dev, struct drm_file *file)
258248
}
259249

260250
file_priv->vdev = vdev;
261-
file_priv->priority = DRM_IVPU_CONTEXT_PRIORITY_NORMAL;
262251
kref_init(&file_priv->ref);
263252
mutex_init(&file_priv->lock);
264253

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ struct ivpu_file_priv {
146146
struct mutex lock; /* Protects cmdq */
147147
struct ivpu_cmdq *cmdq[IVPU_NUM_ENGINES];
148148
struct ivpu_mmu_context ctx;
149-
u32 priority;
150149
bool has_mmu_faults;
151150
};
152151

drivers/accel/ivpu/ivpu_job.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ int ivpu_submit_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
488488
if (params->engine > DRM_IVPU_ENGINE_COPY)
489489
return -EINVAL;
490490

491+
if (params->priority > DRM_IVPU_JOB_PRIORITY_REALTIME)
492+
return -EINVAL;
493+
491494
if (params->buffer_count == 0 || params->buffer_count > JOB_MAX_BUFFER_COUNT)
492495
return -EINVAL;
493496

include/uapi/drm/ivpu_accel.h

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extern "C" {
5353
#define DRM_IVPU_PARAM_CORE_CLOCK_RATE 3
5454
#define DRM_IVPU_PARAM_NUM_CONTEXTS 4
5555
#define DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS 5
56-
#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6
56+
#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6 /* Deprecated */
5757
#define DRM_IVPU_PARAM_CONTEXT_ID 7
5858
#define DRM_IVPU_PARAM_FW_API_VERSION 8
5959
#define DRM_IVPU_PARAM_ENGINE_HEARTBEAT 9
@@ -64,11 +64,18 @@ extern "C" {
6464

6565
#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
6666

67+
/* Deprecated, use DRM_IVPU_JOB_PRIORITY */
6768
#define DRM_IVPU_CONTEXT_PRIORITY_IDLE 0
6869
#define DRM_IVPU_CONTEXT_PRIORITY_NORMAL 1
6970
#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS 2
7071
#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME 3
7172

73+
#define DRM_IVPU_JOB_PRIORITY_DEFAULT 0
74+
#define DRM_IVPU_JOB_PRIORITY_IDLE 1
75+
#define DRM_IVPU_JOB_PRIORITY_NORMAL 2
76+
#define DRM_IVPU_JOB_PRIORITY_FOCUS 3
77+
#define DRM_IVPU_JOB_PRIORITY_REALTIME 4
78+
7279
/**
7380
* DRM_IVPU_CAP_METRIC_STREAMER
7481
*
@@ -112,10 +119,6 @@ struct drm_ivpu_param {
112119
* %DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS:
113120
* Lowest VPU virtual address available in the current context (read-only)
114121
*
115-
* %DRM_IVPU_PARAM_CONTEXT_PRIORITY:
116-
* Value of current context scheduling priority (read-write).
117-
* See DRM_IVPU_CONTEXT_PRIORITY_* for possible values.
118-
*
119122
* %DRM_IVPU_PARAM_CONTEXT_ID:
120123
* Current context ID, always greater than 0 (read-only)
121124
*
@@ -286,6 +289,18 @@ struct drm_ivpu_submit {
286289
* to be executed. The offset has to be 8-byte aligned.
287290
*/
288291
__u32 commands_offset;
292+
293+
/**
294+
* @priority:
295+
*
296+
* Priority to be set for related job command queue, can be one of the following:
297+
* %DRM_IVPU_JOB_PRIORITY_DEFAULT
298+
* %DRM_IVPU_JOB_PRIORITY_IDLE
299+
* %DRM_IVPU_JOB_PRIORITY_NORMAL
300+
* %DRM_IVPU_JOB_PRIORITY_FOCUS
301+
* %DRM_IVPU_JOB_PRIORITY_REALTIME
302+
*/
303+
__u32 priority;
289304
};
290305

291306
/* drm_ivpu_bo_wait job status codes */

0 commit comments

Comments
 (0)