Skip to content

Commit 2054d38

Browse files
committed
drm/xe: Use q->xef for accessing xe file
No need to traverse through the vm object as each exec queue maintains a reference to xe_file. Also improve/simplify the comment on why xef is checked. Reviewed-by: Umesh Nerlige Ramappa <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 4ca1fd4 commit 2054d38

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -770,25 +770,21 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
770770
void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
771771
{
772772
struct xe_device *xe = gt_to_xe(q->gt);
773-
struct xe_file *xef;
774773
struct xe_lrc *lrc;
775774
u32 old_ts, new_ts;
776775
int idx;
777776

778777
/*
779-
* Jobs that are run during driver load may use an exec_queue, but are
780-
* not associated with a user xe file, so avoid accumulating busyness
781-
* for kernel specific work.
778+
* Jobs that are executed by kernel doesn't have a corresponding xe_file
779+
* and thus are not accounted.
782780
*/
783-
if (!q->vm || !q->vm->xef)
781+
if (!q->xef)
784782
return;
785783

786784
/* Synchronize with unbind while holding the xe file open */
787785
if (!drm_dev_enter(&xe->drm, &idx))
788786
return;
789787

790-
xef = q->vm->xef;
791-
792788
/*
793789
* Only sample the first LRC. For parallel submission, all of them are
794790
* scheduled together and we compensate that below by multiplying by
@@ -799,7 +795,7 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
799795
*/
800796
lrc = q->lrc[0];
801797
new_ts = xe_lrc_update_timestamp(lrc, &old_ts);
802-
xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;
798+
q->xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;
803799

804800
drm_dev_exit(idx);
805801
}

0 commit comments

Comments
 (0)