File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,12 +245,18 @@ impl File {
245245
246246 result_render_size : core:: mem:: size_of :: < uapi:: drm_asahi_result_render > ( ) as u32 ,
247247 result_compute_size : core:: mem:: size_of :: < uapi:: drm_asahi_result_compute > ( ) as u32 ,
248+
249+ firmware_version : [ 0 ; 4 ] ,
248250 } ;
249251
250252 for ( i, mask) in gpu. get_dyncfg ( ) . id . core_masks . iter ( ) . enumerate ( ) {
251253 * ( params. core_masks . get_mut ( i) . ok_or ( EIO ) ?) = ( * mask) . try_into ( ) ?;
252254 }
253255
256+ for i in 0 ..3 {
257+ params. firmware_version [ i] = * gpu. get_dyncfg ( ) . firmware_version . get ( i) . unwrap_or ( & 0 ) ;
258+ }
259+
254260 let size = core:: mem:: size_of :: < uapi:: drm_asahi_params_global > ( ) . min ( data. size . try_into ( ) ?) ;
255261
256262 // SAFETY: We only write to this userptr once, so there are no TOCTOU issues.
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ use core::time::Duration;
1818use kernel:: {
1919 c_str,
2020 delay:: coarse_sleep,
21+ device:: RawDevice ,
2122 error:: code:: * ,
2223 macros:: versions,
2324 prelude:: * ,
@@ -780,10 +781,13 @@ impl GpuManager::ver {
780781 return Err ( EIO ) ;
781782 }
782783
784+ let node = dev. of_node ( ) . ok_or ( EIO ) ?;
785+
783786 Ok ( Box :: try_new ( hw:: DynConfig {
784787 pwr : pwr_cfg,
785788 uat_ttb_base : uat. ttb_base ( ) ,
786789 id : gpu_id,
790+ firmware_version : node. get_property ( c_str ! ( "apple,firmware-version" ) ) ?,
787791 } ) ?)
788792 }
789793
Original file line number Diff line number Diff line change @@ -321,6 +321,8 @@ pub(crate) struct DynConfig {
321321 pub ( crate ) id : GpuIdConfig ,
322322 /// Power calibration configuration for this specific chip/device.
323323 pub ( crate ) pwr : PwrConfig ,
324+ /// Firmware version.
325+ pub ( crate ) firmware_version : Vec < u32 > ,
324326}
325327
326328/// Specific GPU ID configuration fetched from SGX MMIO registers.
You can’t perform that action at this time.
0 commit comments