@@ -238,25 +238,34 @@ static struct xe_gt_sriov_config *pf_pick_vf_config(struct xe_gt *gt, unsigned i
238
238
}
239
239
240
240
/* Return: number of configuration dwords written */
241
- static u32 encode_config_ggtt (u32 * cfg , const struct xe_gt_sriov_config * config , bool details )
241
+ static u32 encode_ggtt (u32 * cfg , u64 start , u64 size , bool details )
242
242
{
243
243
u32 n = 0 ;
244
244
245
- if (xe_ggtt_node_allocated (config -> ggtt_region )) {
246
- if (details ) {
247
- cfg [n ++ ] = PREP_GUC_KLV_TAG (VF_CFG_GGTT_START );
248
- cfg [n ++ ] = lower_32_bits (config -> ggtt_region -> base .start );
249
- cfg [n ++ ] = upper_32_bits (config -> ggtt_region -> base .start );
250
- }
251
-
252
- cfg [n ++ ] = PREP_GUC_KLV_TAG (VF_CFG_GGTT_SIZE );
253
- cfg [n ++ ] = lower_32_bits (config -> ggtt_region -> base .size );
254
- cfg [n ++ ] = upper_32_bits (config -> ggtt_region -> base .size );
245
+ if (details ) {
246
+ cfg [n ++ ] = PREP_GUC_KLV_TAG (VF_CFG_GGTT_START );
247
+ cfg [n ++ ] = lower_32_bits (start );
248
+ cfg [n ++ ] = upper_32_bits (start );
255
249
}
256
250
251
+ cfg [n ++ ] = PREP_GUC_KLV_TAG (VF_CFG_GGTT_SIZE );
252
+ cfg [n ++ ] = lower_32_bits (size );
253
+ cfg [n ++ ] = upper_32_bits (size );
254
+
257
255
return n ;
258
256
}
259
257
258
+ /* Return: number of configuration dwords written */
259
+ static u32 encode_config_ggtt (u32 * cfg , const struct xe_gt_sriov_config * config , bool details )
260
+ {
261
+ struct xe_ggtt_node * node = config -> ggtt_region ;
262
+
263
+ if (!xe_ggtt_node_allocated (node ))
264
+ return 0 ;
265
+
266
+ return encode_ggtt (cfg , node -> base .start , node -> base .size , details );
267
+ }
268
+
260
269
/* Return: number of configuration dwords written */
261
270
static u32 encode_config (u32 * cfg , const struct xe_gt_sriov_config * config , bool details )
262
271
{
0 commit comments