Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 75480 Details for
Bug 116661
ksensors 0.7.3 ebuild update suggestion
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to display thermal info provided by ibm_acpi
ksensors-0.7.3-ibm-acpi.patch (text/plain), 6.92 KB, created by
Anton Bolshakov
on 2005-12-24 21:32:43 UTC
(
hide
)
Description:
patch to display thermal info provided by ibm_acpi
Filename:
MIME Type:
Creator:
Anton Bolshakov
Created:
2005-12-24 21:32:43 UTC
Size:
6.92 KB
patch
obsolete
>--- src/i8ksensorslist.cpp.orig 2003-10-27 06:44:40.000000000 +0800 >+++ src/i8ksensorslist.cpp 2005-12-25 11:48:51.000000000 +0800 >@@ -65,7 +65,70 @@ > rightFan->readConfig(); > } > >- if ( (acpiAvail=(AcpiAvailable()==0)) ) >+ if (ibmAcpiAvail=(IbmAcpiAvailable()==0)) >+ { >+ cpuTempAcpiIbm= new Sensor(this); >+ cpuTempAcpiIbm->setType(Sensor::lmTemp); >+ cpuTempAcpiIbm->setName("cputemp"); >+ cpuTempAcpiIbm->setDescription("CPU Temp"); >+ cpuTempAcpiIbm->setValueMax (80 , Sensor::dgCelsius); >+ cpuTempAcpiIbm->setValueMin ( 0 , Sensor::dgCelsius); >+ cpuTempAcpiIbm->setValueIdeal(30 , Sensor::dgCelsius); >+ cpuTempAcpiIbm->setValue ( 0 , Sensor::dgCelsius); >+ cpuTempAcpiIbm->readConfig(); >+ >+ pciTempAcpiIbm= new Sensor(this); >+ pciTempAcpiIbm->setType(Sensor::lmTemp); >+ pciTempAcpiIbm->setName("pictmp"); >+ pciTempAcpiIbm->setDescription("Mini PCI Temp"); >+ pciTempAcpiIbm->setValueMax (55 , Sensor::dgCelsius); >+ pciTempAcpiIbm->setValueMin ( 0 , Sensor::dgCelsius); >+ pciTempAcpiIbm->setValueIdeal(25 , Sensor::dgCelsius); >+ pciTempAcpiIbm->setValue ( 0 , Sensor::dgCelsius); >+ pciTempAcpiIbm->readConfig(); >+ >+ hddTempAcpiIbm= new Sensor(this); >+ hddTempAcpiIbm->setType(Sensor::lmTemp); >+ hddTempAcpiIbm->setName("hddtmp"); >+ hddTempAcpiIbm->setDescription("HDD Temp"); >+ hddTempAcpiIbm->setValueMax (40 , Sensor::dgCelsius); >+ hddTempAcpiIbm->setValueMin ( 0 , Sensor::dgCelsius); >+ hddTempAcpiIbm->setValueIdeal(20 , Sensor::dgCelsius); >+ hddTempAcpiIbm->setValue ( 0 , Sensor::dgCelsius); >+ hddTempAcpiIbm->readConfig(); >+ >+ gpuTempAcpiIbm= new Sensor(this); >+ gpuTempAcpiIbm->setType(Sensor::lmTemp); >+ gpuTempAcpiIbm->setName("gputmp"); >+ gpuTempAcpiIbm->setDescription("GPU Temp"); >+ gpuTempAcpiIbm->setValueMax (60 , Sensor::dgCelsius); >+ gpuTempAcpiIbm->setValueMin ( 0 , Sensor::dgCelsius); >+ gpuTempAcpiIbm->setValueIdeal(25 , Sensor::dgCelsius); >+ gpuTempAcpiIbm->setValue ( 0 , Sensor::dgCelsius); >+ gpuTempAcpiIbm->readConfig(); >+ >+ bat0TempAcpiIbm= new Sensor(this); >+ bat0TempAcpiIbm->setType(Sensor::lmTemp); >+ bat0TempAcpiIbm->setName("bat0tmp"); >+ bat0TempAcpiIbm->setDescription("BAT0 Temp"); >+ bat0TempAcpiIbm->setValueMax (40 , Sensor::dgCelsius); >+ bat0TempAcpiIbm->setValueMin ( 0 , Sensor::dgCelsius); >+ bat0TempAcpiIbm->setValueIdeal(30 , Sensor::dgCelsius); >+ bat0TempAcpiIbm->setValue ( 0 , Sensor::dgCelsius); >+ bat0TempAcpiIbm->readConfig(); >+ >+ bat1TempAcpiIbm= new Sensor(this); >+ bat1TempAcpiIbm->setType(Sensor::lmTemp); >+ bat1TempAcpiIbm->setName("bat1tmp"); >+ bat1TempAcpiIbm->setDescription("BAT1 Temp"); >+ bat1TempAcpiIbm->setValueMax (40 , Sensor::dgCelsius); >+ bat1TempAcpiIbm->setValueMin ( 0 , Sensor::dgCelsius); >+ bat1TempAcpiIbm->setValueIdeal(30 , Sensor::dgCelsius); >+ bat1TempAcpiIbm->setValue ( 0 , Sensor::dgCelsius); >+ bat1TempAcpiIbm->readConfig(); >+ } >+ >+ if ( (!ibmAcpiAvail) && (acpiAvail=(AcpiAvailable()==0)) ) > { > cpuTempAcpi= new Sensor(this); > cpuTempAcpi->setType(Sensor::lmTemp); >@@ -77,35 +140,51 @@ > cpuTempAcpi->setValue (30 , Sensor::dgCelsius); > cpuTempAcpi->readConfig(); > } >- > updateSensors(); > } > > I8KSensorsList::~I8KSensorsList(){ > } > >- > void I8KSensorsList::updateSensors() > { >-double t,f1,f2; >+double t,f1,f2, ct,pt,ht,gt,bt0,na0,bt1,na1; > > if(i8kAvail && !getI8KInfo(&t,&f1,&f2)) { > cpuTemp->setValue(t,Sensor::dgCelsius); > leftFan->setValue(f1); > rightFan->setValue(f2); > } >- if(acpiAvail && !getAcpiTemperature(&t)) { >+ >+ if(ibmAcpiAvail && !getIbmAcpiTemperature(&ct,&pt,&ht,>,&bt0,&na0,&bt1,&na1)) { >+ cpuTempAcpiIbm->setValue(ct,Sensor::dgCelsius); >+ pciTempAcpiIbm->setValue(pt,Sensor::dgCelsius); >+ hddTempAcpiIbm->setValue(ht,Sensor::dgCelsius); >+ gpuTempAcpiIbm->setValue(gt,Sensor::dgCelsius); >+ bat0TempAcpiIbm->setValue(bt0,Sensor::dgCelsius); >+ bat1TempAcpiIbm->setValue(bt1,Sensor::dgCelsius); >+ } >+ >+ if(!ibmAcpiAvail && acpiAvail && !getAcpiTemperature(&t)) { > cpuTempAcpi->setValue(t,Sensor::dgCelsius); > } >-} > >+} > > int I8KSensorsList::AcpiAvailable() > { > double t; >+ > return getAcpiTemperature(&t); > } > >+int I8KSensorsList::IbmAcpiAvailable() >+{ >+ double t0,t1,t2,t3,t4,t5,t6,t7; >+ >+ return getIbmAcpiTemperature(&t0,&t1,&t2,&t3,&t4,&t5,&t6,&t7); >+} >+ > int I8KSensorsList::I8KOnlyAvailable() > { > double d1,d2,d3; >@@ -122,7 +201,7 @@ > case -3: qWarning("I18K Warning: Only format version 1.0 is supported. Inform the author."); break; > } > >- return (result==0 || AcpiAvailable()==0); >+ return (result==0 || AcpiAvailable()==0 || IbmAcpiAvailable()==0); > } > > >--- src/i8ksensorslist.h.orig 2003-10-27 06:29:33.000000000 +0800 >+++ src/i8ksensorslist.h 2005-12-25 10:30:14.000000000 +0800 >@@ -42,13 +42,25 @@ > > bool i8kAvail; > bool acpiAvail; >+ bool ibmAcpiAvail; > > Sensor *cpuTempAcpi; >+ >+ Sensor *cpuTempAcpiIbm; >+ Sensor *pciTempAcpiIbm; >+ Sensor *hddTempAcpiIbm; >+ Sensor *gpuTempAcpiIbm; >+ Sensor *bat0TempAcpiIbm; >+ Sensor *na0TempAcpiIbm; >+ Sensor *bat1TempAcpiIbm; >+ Sensor *na1TempAcpiIbm; >+ > Sensor *cpuTemp; > Sensor *leftFan; > Sensor *rightFan; > > static int AcpiAvailable(); >+ static int IbmAcpiAvailable(); > static int I8KOnlyAvailable(); > }; > >--- src/procinfo.cpp.orig 2003-10-27 06:45:41.000000000 +0800 >+++ src/procinfo.cpp 2005-12-25 12:31:12.000000000 +0800 >@@ -84,7 +84,8 @@ > { > char buf[128]; > >- if(read_file("/proc/acpi/thermal_zone/THRM/temperature", buf, sizeof(buf))<= 0) return -1; >+ if((read_file("/proc/acpi/thermal_zone/THRM/temperature", buf, sizeof(buf))<= 0) && >+ (read_file("/proc/acpi/thermal_zone/THM0/temperature", buf, sizeof(buf))<= 0)) return -1; > > sscanf(buf, "temperature: %lf C", cpuTemp); > >@@ -92,6 +93,23 @@ > } > > >+// ********* IBM Acpi ************************************* >+// cat /proc/acpi/ibm/thermal (ibm_acpi module) if available >+// temperatures: 46 45 34 48 32 -128 29 -128 >+ >+int getIbmAcpiTemperature(double *cpuTemp, double *pciTemp, double *hddTemp, double *gpuTemp, >+ double *bat0Temp, double *na0Temp, double *bat1Temp, double *na1Temp) >+{ >+char buf[128]; >+ >+ if(read_file("/proc/acpi/ibm/thermal", buf, sizeof(buf))<= 0) return -1; >+ >+ sscanf(buf, "temperatures: %lf %lf %lf %lf %lf %lf %lf %lf", cpuTemp, pciTemp, hddTemp, gpuTemp, >+ bat0Temp, na0Temp, bat1Temp, na1Temp); >+ >+ return 0; >+} >+ > int getMemInfo(int *RamTotal,int *RamUsed,int *SwapTotal, int *SwapUsed) > { > char buf[4096]; >@@ -138,7 +156,7 @@ > > if(read_file("/proc/stat", buf, sizeof(buf)) <= 0) return false; > >- sscanf(buf, "cpu %u %u %u %u",user,nice,system,idle); >+ sscanf(buf, "cpu %d %d %d %d",user,nice,system,idle); > > return true; > } > >--- src/procinfo.h.orig 2003-10-27 06:28:46.000000000 +0800 >+++ src/procinfo.h 2005-12-25 10:24:11.000000000 +0800 >@@ -21,3 +21,5 @@ > int getUpTime(); > int getI8KInfo(double *cpuTemp, double *leftFan, double *rightFan); > int getAcpiTemperature(double *cpuTemp); >+int getIbmAcpiTemperature(double *cpuTemp, double *pciTemp, double *hddTemp, double *gpuTemp, >+ double *bat0Temp, double *na0Temp, double *bat1Temp, double *na1Temp);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 116661
: 75480