amdgpu_fan 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/amdgpu_fan/cli.rb +1 -1
- data/lib/amdgpu_fan/connector.rb +18 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab8784cb1b68ab424942a5c7f2b4c11d9b15ef664529d8029b3c1cc03d4c4ffe
|
4
|
+
data.tar.gz: c2be64896c2d981b6462e4df7ff4e060a78663d55b51ff270f0c6089ec26a855
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db7e5229ca97968edf84e563d0a626777e053922969e3f03a0e801b30ed5108971bc0679fdecc582c9d9920f52ac35e24af9800fd10cf9755a51f3ca222daa9e
|
7
|
+
data.tar.gz: 963a1876d6ef7b00f3693035bc181d245268c9d528344e4cb1eec1af45c8d85305a6c292d93cc3340b68facc2d85d30df452ee81df882e062c7adbfcdef4b5e0
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# amdgpu_fan
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/amdgpu_fan)
|
3
4
|
[](https://travis-ci.org/HarlemSquirrel/amdgpu-fan-rb) [](https://codeclimate.com/github/HarlemSquirrel/amdgpu-fan-rb/maintainability)
|
4
5
|
|
5
6
|
A Ruby CLI to read and set fan speed, power profiles, and more for AMD Radeon graphics cards running on the AMDGPU Linux driver.
|
data/lib/amdgpu_fan/cli.rb
CHANGED
@@ -54,7 +54,7 @@ module AmdgpuFan
|
|
54
54
|
puts radeon_logo if option == '--logo'
|
55
55
|
puts "👾 #{'GPU:'.ljust(9)} #{amdgpu_service.name}",
|
56
56
|
"📄 #{'vBIOS:'.ljust(9)} #{amdgpu_service.vbios_version}",
|
57
|
-
"📺 Displays: #{amdgpu_service.connectors.map(&:display_name).compact.join(',')}",
|
57
|
+
"📺 Displays: #{amdgpu_service.connectors.map(&:display_name).compact.join(', ')}",
|
58
58
|
"⏰ #{'Clocks:'.ljust(9)} #{clock_status}",
|
59
59
|
"💾 #{'Memory:'.ljust(9)} #{mem_total_mibibyes}",
|
60
60
|
"🌀 #{'Fan:'.ljust(9)} #{fan_status}",
|
data/lib/amdgpu_fan/connector.rb
CHANGED
@@ -6,7 +6,8 @@ module AmdgpuFan
|
|
6
6
|
# A model class for a GPU connector
|
7
7
|
class Connector
|
8
8
|
EDID_DESCRIPTORS_CONF = {
|
9
|
-
|
9
|
+
display_name_leading_bytes: String.new('\x00\xFC\x00', encoding: 'ascii-8bit'),
|
10
|
+
unspecified_text_leading_bytes: String.new('\x00\xFE\x00', encoding: 'ascii-8bit'),
|
10
11
|
index_range: (54..125)
|
11
12
|
}.freeze
|
12
13
|
|
@@ -22,7 +23,7 @@ module AmdgpuFan
|
|
22
23
|
Connector.new card_num: card_num,
|
23
24
|
dir_path: dir_path,
|
24
25
|
index: dir_path[-1],
|
25
|
-
type: dir_path.slice(/(?<=card#{card_num}-)[A-
|
26
|
+
type: dir_path.slice(/(?<=card#{card_num}-)[A-z]+/)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
@@ -41,10 +42,7 @@ module AmdgpuFan
|
|
41
42
|
def display_name
|
42
43
|
return if edid.to_s.empty?
|
43
44
|
|
44
|
-
|
45
|
-
.scan(/(?<=#{EDID_DESCRIPTORS_CONF[:display_descriptor_leading_bytes]}).{1,13}/)
|
46
|
-
.first
|
47
|
-
.strip
|
45
|
+
(display_name_text + unspecified_text).join(' ').strip
|
48
46
|
end
|
49
47
|
|
50
48
|
def status
|
@@ -53,8 +51,22 @@ module AmdgpuFan
|
|
53
51
|
|
54
52
|
private
|
55
53
|
|
54
|
+
def display_descriptors_raw
|
55
|
+
edid.slice EDID_DESCRIPTORS_CONF[:index_range]
|
56
|
+
end
|
57
|
+
|
58
|
+
def display_name_text
|
59
|
+
display_descriptors_raw
|
60
|
+
.scan(/(?<=#{EDID_DESCRIPTORS_CONF[:display_name_leading_bytes]}).{1,13}/)
|
61
|
+
end
|
62
|
+
|
56
63
|
def edid
|
57
64
|
File.read("#{dir_path}/edid", encoding: 'ascii-8bit')
|
58
65
|
end
|
66
|
+
|
67
|
+
def unspecified_text
|
68
|
+
display_descriptors_raw
|
69
|
+
.scan(/(?<=#{EDID_DESCRIPTORS_CONF[:unspecified_text_leading_bytes]}).{1,13}/)
|
70
|
+
end
|
59
71
|
end
|
60
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amdgpu_fan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin McCormack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A CLI for interacting with the amdgpu Linux driver
|
14
14
|
email: harlemsquirrel@gmail.com
|