@@ -20,9 +20,6 @@ pub struct Table {
2020 pub current_sclk_range : Range ,
2121 /// The current core clock offset (RDNA4+)
2222 pub sclk_offset : Option < i32 > ,
23- /// Workaround for the original buggy SCLK offset range format on RDNA4
24- /// TODO: drop this when the new format is widely used (should be kernel 6.15+)
25- pub rdna4_sclk_offset_workaround : bool ,
2623 /// The current memory clock range. Empty on iGPUs.
2724 pub current_mclk_range : Range ,
2825 /// The current voltage curve. May be empty if the GPU does not support it.
@@ -42,7 +39,7 @@ impl ClocksTable for Table {
4239 writer : & mut W ,
4340 previous_table : & ClocksTableGen ,
4441 ) -> Result < ( ) > {
45- let ClocksTableGen :: Vega20 ( previous_table) = previous_table else {
42+ let ClocksTableGen :: Rdna ( previous_table) = previous_table else {
4643 return Err ( Error :: not_allowed (
4744 "Mismatched clocks table format" . to_owned ( ) ,
4845 ) ) ;
@@ -81,17 +78,10 @@ impl ClocksTable for Table {
8178 ] ) ;
8279
8380 if let Some ( sclk_offset) = self . sclk_offset {
84- if self . rdna4_sclk_offset_workaround {
85- let line = format ! ( "s 1 {sclk_offset}\n " ) ;
86- writer
87- . write_all ( line. as_bytes ( ) )
88- . context ( "Could not write sclk offset" ) ?;
89- } else {
90- let line = format ! ( "s {sclk_offset}\n " ) ;
91- writer
92- . write_all ( line. as_bytes ( ) )
93- . context ( "Could not write sclk offset" ) ?;
94- }
81+ let line = format ! ( "s {sclk_offset}\n " ) ;
82+ writer
83+ . write_all ( line. as_bytes ( ) )
84+ . context ( "Could not write sclk offset" ) ?;
9585 }
9686
9787 for ( maybe_clockspeed, symbol, index) in clocks_commands {
@@ -242,7 +232,6 @@ impl FromStr for Table {
242232 let mut current_section = None ;
243233
244234 let mut current_sclk_range = None ;
245- let mut current_sclk_offset_range = None ;
246235 let mut current_mclk_range = None ;
247236 let mut allowed_sclk_range = None ;
248237 let mut allowed_sclk_offset_range = None ;
@@ -306,20 +295,12 @@ impl FromStr for Table {
306295 }
307296 Some ( Section :: Sclk ) => parse_min_max_line ( line, i, & mut current_sclk_range) ?,
308297 Some ( Section :: SclkOffset ) => {
309- if line
310- . split_ascii_whitespace ( )
311- . next ( )
312- . is_some_and ( |start| start == "0:" || start == "1:" )
313- {
314- parse_min_max_line ( line, i, & mut current_sclk_offset_range) ?
315- } else {
316- let line = line. to_ascii_lowercase ( ) ;
317- let raw_value = line. trim_end_matches ( "mhz" ) ;
318- let value = raw_value
319- . parse ( )
320- . context ( "Could not parse sclk offset value" ) ?;
321- sclk_offset = Some ( value) ;
322- }
298+ let line = line. to_ascii_lowercase ( ) ;
299+ let raw_value = line. trim_end_matches ( "mhz" ) ;
300+ let value = raw_value
301+ . parse ( )
302+ . context ( "Could not parse sclk offset value" ) ?;
303+ sclk_offset = Some ( value) ;
323304 }
324305 Some ( Section :: Mclk ) => parse_min_max_line ( line, i, & mut current_mclk_range) ?,
325306 Some ( Section :: VddcCurve ) => {
@@ -350,13 +331,9 @@ impl FromStr for Table {
350331 voltage_offset : voltage_offset_range,
351332 } ;
352333
353- let sclk_offset =
354- sclk_offset. or_else ( || current_sclk_offset_range. and_then ( |range| range. max ) ) ;
355-
356334 Ok ( Self {
357335 current_sclk_range : current_sclk_range. unwrap_or_default ( ) ,
358336 sclk_offset,
359- rdna4_sclk_offset_workaround : current_sclk_offset_range. is_some ( ) ,
360337 current_mclk_range : current_mclk_range. unwrap_or_default ( ) ,
361338 vddc_curve,
362339 od_range,
@@ -510,7 +487,6 @@ mod tests {
510487 const TABLE_7900XT : & str = include_table ! ( "rx7900xt" ) ;
511488 const TABLE_7800XT : & str = include_table ! ( "rx7800xt" ) ;
512489 const TABLE_9070XT : & str = include_table ! ( "rx9070xt" ) ;
513- const TABLE_9070XT_NEW : & str = include_test_data ! ( "rx9070xt/pp_od_clk_voltage_new" ) ;
514490 const TABLE_VANGOGH : & str = include_table ! ( "vangogh" ) ;
515491
516492 #[ test]
@@ -640,7 +616,6 @@ mod tests {
640616 current_sclk_range : Range :: empty ( ) ,
641617 current_mclk_range : Range :: full ( 500 , 1000 ) ,
642618 sclk_offset : None ,
643- rdna4_sclk_offset_workaround : false ,
644619 vddc_curve : vec ! [ ClocksLevel :: new( 300 , 600 ) , ClocksLevel :: new( 1000 , 1000 ) ] ,
645620 voltage_offset : None ,
646621 od_range : OdRange {
@@ -794,12 +769,6 @@ mod tests {
794769 assert_yaml_snapshot ! ( table) ;
795770 }
796771
797- #[ test]
798- fn parse_9070xt_new_full ( ) {
799- let table = Table :: from_str ( TABLE_9070XT_NEW ) . unwrap ( ) ;
800- assert_yaml_snapshot ! ( table) ;
801- }
802-
803772 #[ test]
804773 fn set_clock_offset_9070xt ( ) {
805774 let mut table = Table :: from_str ( TABLE_9070XT ) . unwrap ( ) ;
@@ -809,15 +778,6 @@ mod tests {
809778 assert_yaml_snapshot ! ( table. get_commands( & table. clone( ) . into( ) ) . unwrap( ) ) ;
810779 }
811780
812- #[ test]
813- fn set_clock_offset_9070xt_new ( ) {
814- let mut table = Table :: from_str ( TABLE_9070XT_NEW ) . unwrap ( ) ;
815- table. clear ( ) ;
816- table. sclk_offset = Some ( 200 ) ;
817- table. voltage_offset = Some ( -50 ) ;
818- assert_yaml_snapshot ! ( table. get_commands( & table. clone( ) . into( ) ) . unwrap( ) ) ;
819- }
820-
821781 #[ test]
822782 fn set_7800xt_voltage ( ) {
823783 let mut table = Table :: from_str ( TABLE_7800XT ) . unwrap ( ) ;
0 commit comments