[PATCH] drm/xe: Remove unused 'create' parameter from queue property logic
Nirmoy Das
nirmoy.das at intel.com
Fri Feb 23 14:44:50 UTC 2024
On 2/23/2024 3:12 PM, Rodrigo Vivi wrote:
> On Fri, Feb 23, 2024 at 01:23:11PM +0100, Nirmoy Das wrote:
>> The 'create' parameter in exec_queue_user_extensions was always true.
>> This commit removes the dead parameter and all the relevant dead code.
> I'm afraid that you need to rebase now that I just push the removal
> of some of these functions.
>
> But with that rebased you can already resend it using
>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
Resent, thanks!
Nirmoy
>
>
>> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_exec_queue.c | 56 +++++++++---------------------
>> 1 file changed, 16 insertions(+), 40 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
>> index 4bb8f897bf15..969c82d20e79 100644
>> --- a/drivers/gpu/drm/xe/xe_exec_queue.c
>> +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
>> @@ -31,7 +31,7 @@ enum xe_exec_queue_sched_prop {
>> };
>>
>> static int exec_queue_user_extensions(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 extensions, int ext_number, bool create);
>> + u64 extensions, int ext_number);
>>
>> static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
>> struct xe_vm *vm,
>> @@ -79,7 +79,7 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
>> * may set q->usm, must come before xe_lrc_init(),
>> * may overwrite q->sched_props, must come before q->ops->init()
>> */
>> - err = exec_queue_user_extensions(xe, q, extensions, 0, true);
>> + err = exec_queue_user_extensions(xe, q, extensions, 0);
>> if (err) {
>> kfree(q);
>> return ERR_PTR(err);
>> @@ -268,7 +268,7 @@ xe_exec_queue_device_get_max_priority(struct xe_device *xe)
>> }
>>
>> static int exec_queue_set_priority(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 value, bool create)
>> + u64 value)
>> {
>> if (XE_IOCTL_DBG(xe, value > XE_EXEC_QUEUE_PRIORITY_HIGH))
>> return -EINVAL;
>> @@ -276,9 +276,6 @@ static int exec_queue_set_priority(struct xe_device *xe, struct xe_exec_queue *q
>> if (XE_IOCTL_DBG(xe, value > xe_exec_queue_device_get_max_priority(xe)))
>> return -EPERM;
>>
>> - if (!create)
>> - return q->ops->set_priority(q, value);
>> -
>> q->sched_props.priority = value;
>> return 0;
>> }
>> @@ -336,7 +333,7 @@ xe_exec_queue_get_prop_minmax(struct xe_hw_engine_class_intf *eclass,
>> }
>>
>> static int exec_queue_set_timeslice(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 value, bool create)
>> + u64 value)
>> {
>> u32 min = 0, max = 0;
>>
>> @@ -347,16 +344,12 @@ static int exec_queue_set_timeslice(struct xe_device *xe, struct xe_exec_queue *
>> !xe_hw_engine_timeout_in_range(value, min, max))
>> return -EINVAL;
>>
>> - if (!create)
>> - return q->ops->set_timeslice(q, value);
>> -
>> q->sched_props.timeslice_us = value;
>> return 0;
>> }
>>
>> static int exec_queue_set_preemption_timeout(struct xe_device *xe,
>> - struct xe_exec_queue *q, u64 value,
>> - bool create)
>> + struct xe_exec_queue *q, u64 value)
>> {
>> u32 min = 0, max = 0;
>>
>> @@ -367,21 +360,15 @@ static int exec_queue_set_preemption_timeout(struct xe_device *xe,
>> !xe_hw_engine_timeout_in_range(value, min, max))
>> return -EINVAL;
>>
>> - if (!create)
>> - return q->ops->set_preempt_timeout(q, value);
>> -
>> q->sched_props.preempt_timeout_us = value;
>> return 0;
>> }
>>
>> static int exec_queue_set_job_timeout(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 value, bool create)
>> + u64 value)
>> {
>> u32 min = 0, max = 0;
>>
>> - if (XE_IOCTL_DBG(xe, !create))
>> - return -EINVAL;
>> -
>> xe_exec_queue_get_prop_minmax(q->hwe->eclass,
>> XE_EXEC_QUEUE_JOB_TIMEOUT, &min, &max);
>>
>> @@ -395,11 +382,8 @@ static int exec_queue_set_job_timeout(struct xe_device *xe, struct xe_exec_queue
>> }
>>
>> static int exec_queue_set_acc_trigger(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 value, bool create)
>> + u64 value)
>> {
>> - if (XE_IOCTL_DBG(xe, !create))
>> - return -EINVAL;
>> -
>> if (XE_IOCTL_DBG(xe, !xe->info.has_usm))
>> return -EINVAL;
>>
>> @@ -409,11 +393,8 @@ static int exec_queue_set_acc_trigger(struct xe_device *xe, struct xe_exec_queue
>> }
>>
>> static int exec_queue_set_acc_notify(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 value, bool create)
>> + u64 value)
>> {
>> - if (XE_IOCTL_DBG(xe, !create))
>> - return -EINVAL;
>> -
>> if (XE_IOCTL_DBG(xe, !xe->info.has_usm))
>> return -EINVAL;
>>
>> @@ -423,11 +404,8 @@ static int exec_queue_set_acc_notify(struct xe_device *xe, struct xe_exec_queue
>> }
>>
>> static int exec_queue_set_acc_granularity(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 value, bool create)
>> + u64 value)
>> {
>> - if (XE_IOCTL_DBG(xe, !create))
>> - return -EINVAL;
>> -
>> if (XE_IOCTL_DBG(xe, !xe->info.has_usm))
>> return -EINVAL;
>>
>> @@ -441,7 +419,7 @@ static int exec_queue_set_acc_granularity(struct xe_device *xe, struct xe_exec_q
>>
>> typedef int (*xe_exec_queue_set_property_fn)(struct xe_device *xe,
>> struct xe_exec_queue *q,
>> - u64 value, bool create);
>> + u64 value);
>>
>> static const xe_exec_queue_set_property_fn exec_queue_set_property_funcs[] = {
>> [DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY] = exec_queue_set_priority,
>> @@ -455,8 +433,7 @@ static const xe_exec_queue_set_property_fn exec_queue_set_property_funcs[] = {
>>
>> static int exec_queue_user_ext_set_property(struct xe_device *xe,
>> struct xe_exec_queue *q,
>> - u64 extension,
>> - bool create)
>> + u64 extension)
>> {
>> u64 __user *address = u64_to_user_ptr(extension);
>> struct drm_xe_ext_set_property ext;
>> @@ -476,13 +453,12 @@ static int exec_queue_user_ext_set_property(struct xe_device *xe,
>> if (!exec_queue_set_property_funcs[idx])
>> return -EINVAL;
>>
>> - return exec_queue_set_property_funcs[idx](xe, q, ext.value, create);
>> + return exec_queue_set_property_funcs[idx](xe, q, ext.value);
>> }
>>
>> typedef int (*xe_exec_queue_user_extension_fn)(struct xe_device *xe,
>> struct xe_exec_queue *q,
>> - u64 extension,
>> - bool create);
>> + u64 extension);
>>
>> static const xe_exec_queue_set_property_fn exec_queue_user_extension_funcs[] = {
>> [DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY] = exec_queue_user_ext_set_property,
>> @@ -490,7 +466,7 @@ static const xe_exec_queue_set_property_fn exec_queue_user_extension_funcs[] = {
>>
>> #define MAX_USER_EXTENSIONS 16
>> static int exec_queue_user_extensions(struct xe_device *xe, struct xe_exec_queue *q,
>> - u64 extensions, int ext_number, bool create)
>> + u64 extensions, int ext_number)
>> {
>> u64 __user *address = u64_to_user_ptr(extensions);
>> struct drm_xe_user_extension ext;
>> @@ -511,13 +487,13 @@ static int exec_queue_user_extensions(struct xe_device *xe, struct xe_exec_queue
>>
>> idx = array_index_nospec(ext.name,
>> ARRAY_SIZE(exec_queue_user_extension_funcs));
>> - err = exec_queue_user_extension_funcs[idx](xe, q, extensions, create);
>> + err = exec_queue_user_extension_funcs[idx](xe, q, extensions);
>> if (XE_IOCTL_DBG(xe, err))
>> return err;
>>
>> if (ext.next_extension)
>> return exec_queue_user_extensions(xe, q, ext.next_extension,
>> - ++ext_number, create);
>> + ++ext_number);
>>
>> return 0;
>> }
>> --
>> 2.42.0
>>
More information about the Intel-xe
mailing list