@@ -191,11 +191,9 @@ static int guc_ring_doorbell(struct i915_guc_client *gc)
191
191
struct guc_process_desc * desc ;
192
192
union guc_doorbell_qw db_cmp , db_exc , db_ret ;
193
193
union guc_doorbell_qw * db ;
194
- void * base ;
195
194
int attempt = 2 , ret = - EAGAIN ;
196
195
197
- base = kmap_atomic (i915_gem_object_get_page (gc -> client_obj , 0 ));
198
- desc = base + gc -> proc_desc_offset ;
196
+ desc = gc -> client_base + gc -> proc_desc_offset ;
199
197
200
198
/* Update the tail so it is visible to GuC */
201
199
desc -> tail = gc -> wq_tail ;
@@ -211,7 +209,7 @@ static int guc_ring_doorbell(struct i915_guc_client *gc)
211
209
db_exc .cookie = 1 ;
212
210
213
211
/* pointer of current doorbell cacheline */
214
- db = base + gc -> doorbell_offset ;
212
+ db = gc -> client_base + gc -> doorbell_offset ;
215
213
216
214
while (attempt -- ) {
217
215
/* lets ring the doorbell */
@@ -243,7 +241,6 @@ static int guc_ring_doorbell(struct i915_guc_client *gc)
243
241
/* Finally, update the cached copy of the GuC's WQ head */
244
242
gc -> wq_head = desc -> head ;
245
243
246
- kunmap_atomic (base );
247
244
return ret ;
248
245
}
249
246
@@ -462,7 +459,6 @@ static void guc_fini_ctx_desc(struct intel_guc *guc,
462
459
int i915_guc_wq_check_space (struct i915_guc_client * gc )
463
460
{
464
461
struct guc_process_desc * desc ;
465
- void * base ;
466
462
u32 size = sizeof (struct guc_wq_item );
467
463
int ret = - ETIMEDOUT , timeout_counter = 200 ;
468
464
@@ -474,8 +470,7 @@ int i915_guc_wq_check_space(struct i915_guc_client *gc)
474
470
if (CIRC_SPACE (gc -> wq_tail , gc -> wq_head , gc -> wq_size ) >= size )
475
471
return 0 ;
476
472
477
- base = kmap_atomic (i915_gem_object_get_page (gc -> client_obj , 0 ));
478
- desc = base + gc -> proc_desc_offset ;
473
+ desc = gc -> client_base + gc -> proc_desc_offset ;
479
474
480
475
while (timeout_counter -- > 0 ) {
481
476
gc -> wq_head = desc -> head ;
@@ -489,16 +484,13 @@ int i915_guc_wq_check_space(struct i915_guc_client *gc)
489
484
usleep_range (1000 , 2000 );
490
485
};
491
486
492
- kunmap_atomic (base );
493
-
494
487
return ret ;
495
488
}
496
489
497
490
static int guc_add_workqueue_item (struct i915_guc_client * gc ,
498
491
struct drm_i915_gem_request * rq )
499
492
{
500
493
struct guc_wq_item * wqi ;
501
- void * base ;
502
494
u32 tail , wq_len , wq_off , space ;
503
495
504
496
space = CIRC_SPACE (gc -> wq_tail , gc -> wq_head , gc -> wq_size );
@@ -521,10 +513,7 @@ static int guc_add_workqueue_item(struct i915_guc_client *gc,
521
513
WARN_ON (wq_off & 3 );
522
514
523
515
/* wq starts from the page after doorbell / process_desc */
524
- base = kmap_atomic (i915_gem_object_get_page (gc -> client_obj ,
525
- (wq_off + GUC_DB_SIZE ) >> PAGE_SHIFT ));
526
- wq_off &= PAGE_SIZE - 1 ;
527
- wqi = (struct guc_wq_item * )((char * )base + wq_off );
516
+ wqi = gc -> client_base + GUC_DB_SIZE + wq_off ;
528
517
529
518
/* len does not include the header */
530
519
wq_len = sizeof (struct guc_wq_item ) / sizeof (u32 ) - 1 ;
@@ -542,8 +531,6 @@ static int guc_add_workqueue_item(struct i915_guc_client *gc,
542
531
wqi -> ring_tail = tail << WQ_RING_TAIL_SHIFT ;
543
532
wqi -> fence_id = 0 ; /*XXX: what fence to be here */
544
533
545
- kunmap_atomic (base );
546
-
547
534
return 0 ;
548
535
}
549
536
0 commit comments