特殊:Badtitle/NS100:BinaryDriverHowto/Fglrx lowpower:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
第1行: 第1行:
{{From|https://help.ubuntu.com/community/BinaryDriverHowto/Fglrx lowpower}}
{{From|https://help.ubuntu.com/community/BinaryDriverHowto/Fglrx_lowpower}}
{{Languages|UbuntuHelp:BinaryDriverHowto/Fglrx lowpower}}
{{Languages|UbuntuHelp:BinaryDriverHowto/Fglrx_lowpower}}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
This is an ugly hack to get a Radeon video card to run on low power when running off batteries. It saves quite a bit of power, but it's known that enabling low power mode on the fglrx driver can cause "mysterious hangs", so be aware of that. However, when it works, battery life is considerably improved.
<html>
This works for me, but YMMV. Use at your own risk. Interested to hear any/all feedback.  
<head>
The following was written for Ubuntu 6.06 (Dapper Drake).
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
* First install the fglrx driver  by installing the xorg-driver-fglrx package from the Restricted Repository & make sure you can run 'aticonfig --lsp'
<meta name="robots" content="index,nofollow">
* In /etc/default/fglrx, uncomment/set:
<title>BinaryDriverHowto/Fglrx - Community Ubuntu Documentation</title>
<pre><nowiki>FGLRX_ACPI_SWITCH_POWERSTATES=true
<script type="text/javascript">
</nowiki></pre>
<!--// common functions
* In /etc/default/acpi-support, uncomment/set:
// We keep here the state of the search box
<pre><nowiki>ENABLE_LAPTOP_MODE=true
searchIsDisabled = false;
</nowiki></pre>
function searchChange(e) {
* Then we need a modified version of /etc/acpi/fglrx-powermode.sh
// Update search buttons status according to search box content.
(if the script doesn't exist, it means you haven't got the fglrx driver installed)
// Ignore empty or whitespace search term.
<pre><nowiki>
var value = e.value.replace(/\s+/, '');
mkdir ~/bin
if (value == '' || searchIsDisabled) {
cat /etc/acpi/fglrx-powermode.sh | sed 's/su \$user -c \"\(.*\)\"/\1/' > ~/bin/fglrx-powermode.sh
searchSetDisabled(true);
chmod +x ~/bin/fglrx-powermode.sh
} else {
</nowiki></pre>
searchSetDisabled(false);
* Next, edit/create ~/.gnomerc to call the new script (eg):
}
sample ~/.gnomerc
}
<pre><nowiki>
function searchSetDisabled(flag) {
#!/bin/bash
// Enable or disable search
~/bin/fglrx-powermode.sh
document.getElementById('fullsearch').disabled = flag;
</nowiki></pre>
document.getElementById('titlesearch').disabled = flag;
* Set execute permissions on script
}
<pre><nowiki>chmod +x ~/bin/fglrx-powermode.sh
function searchFocus(e) {
</nowiki></pre>
// Update search input content on focus
* Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
if (e.value == 'Search') {
<pre><nowiki>aticonfig --lsp
e.value = '';
core/mem [flags]
e.style.color = 'black';
-----------------
searchIsDisabled = false;
* 1: 111/111 MHz [low voltage]
}
2: 392/209 MHz [default state]
}
</nowiki></pre>
function searchBlur(e) {
=== Comments ===
// Update search input content on blur
Worked for me on my Dell D610. On dapper, <code><nowiki>/etc/acpi</nowiki></code> has <code><nowiki>battery.d</nowiki></code> and <code><nowiki>ac.d</nowiki></code> directories.  The scripts in here are sourced (not executed) by the <code><nowiki>power.sh</nowiki></code> script on switching of power modes.  In most cases, there is no difference between sourcing and executing.  I just linked the fglrx script into the two directories (after editing the files in <code><nowiki>/etc/default</nowiki></code>):
if (e.value == '') {
<pre><nowiki>
e.value = 'Search';
cd /etc/acpi/battery.sh
e.style.color = 'gray';
sudo ln -s ../fglrx_powermode.sh
searchIsDisabled = true;
cd ../ac.d
}
sudo ln -s ../fglrx_powermode.sh
}
</nowiki></pre>
function actionsMenuInit(title) {
I consider this a better solution than making a script for gnome to run.
// Initiliaze action menu
-- JPKotta
for (i = 0; i < document.forms.length; i++) {
I don't think this will set low power mode at boot up.
var form = document.forms[i];
-- fz
if (form.className == 'actionsmenu') {
I somehow lost the fglrx_powermode.sh script.  So I reinvented the wheel and came up with this script which I put directly in <code><nowiki>/etc/acpi/{battery.d,ac.d}/ati.sh</nowiki></code>.  The 'new_state=' line is obviously different in the ac.d vs. battery.d scripts.
// Check if this form needs update
<pre><nowiki>
var div = form.getElementsByTagName('div')[0];
. /usr/share/acpi-support/power-funcs
var label = div.getElementsByTagName('label')[0];
new_state=1
if (label) {
if [ -x /usr/bin/aticonfig ]; then
// This is the first time: remove label and do buton.
for x in /tmp/.X11-unix/*; do
div.removeChild(label);
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
var dobutton = div.getElementsByTagName('input')[0];
getXuser;
div.removeChild(dobutton);
if [ x"$XAUTHORITY" != x"" ]; then     
// and add menu title
export DISPLAY=":$displaynum"
var select = div.getElementsByTagName('select')[0];
/usr/bin/aticonfig --set-powerstate=$new_state
var item = document.createElement('option');
fi
item.appendChild(document.createTextNode(title));
done
item.value = 'show';
fi
select.insertBefore(item, select.options[0]);
</nowiki></pre>
select.selectedIndex = 0;
If you want to run it at boot time, put a symlink to <code><nowiki>/etc/acpi/power.sh</nowiki></code> named something like <code><nowiki>/etc/rc2.d/S99powerstate</nowiki></code> (I have not tested this).
}
--jpkotta
}
}
}
//-->
</script>
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/htdocs/ubuntu/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="/htdocs/ubuntu/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" href="/htdocs/ubuntu/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="projection" href="/htdocs/ubuntu/css/projection.css">
<link rel="Start" href="/community/UserDocumentation">
<link rel="Alternate" title="Wiki Markup" href="/community/BinaryDriverHowto/Fglrx?action=raw">
<link rel="Alternate" media="print" title="Print View" href="/community/BinaryDriverHowto/Fglrx?action=print">
<link rel="Up" href="/community/BinaryDriverHowto">
<link rel="Search" href="/community/FindPage">
<link rel="Index" href="/community/TitleIndex">
<link rel="Glossary" href="/community/WordIndex">
<link rel="Help" href="/community/HelpOnFormatting">
</head>
<body  lang="en" dir="ltr">
<script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
<script xmlns="" type="text/javascript"><![CDATA[
_uacct = "UA-1018242-8";
urchinTracker();
]]></script>
<div id="header">
<div id="mastwrap"><div id="masthead">
<div id="logo"><a href="/community/UserDocumentation">Community Ubuntu Documentation</a></div>
<form id="searchform" method="get" action="">
<div>
<input type="hidden" name="action" value="fullsearch">
<input type="hidden" name="context" value="180">
<label for="searchinput">Search:</label>
<input id="searchinput" type="text" name="value" value="" size="20"
onfocus="searchFocus(this)" onblur="searchBlur(this)"
onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search">
<input id="titlesearch" name="titlesearch" type="submit"
value="Titles" alt="Search Titles">
<input id="fullsearch" name="fullsearch" type="submit"
value="Text" alt="Search Full Text">
</div>
</form>
<script type="text/javascript">
<!--// Initialize search form
var f = document.getElementById('searchform');
f.getElementsByTagName('label')[0].style.display = 'none';
var e = document.getElementById('searchinput');
searchChange(e);
searchBlur(e);
//-->
</script>
<div id="sisternav">
<ul>
<li id="plain">
<a href="https://help.ubuntu.com/6.06"
accesskey="t">6.06 LTS</a>
</li>
<li id="plain">
<a href="https://help.ubuntu.com/6.10"
accesskey="t">6.10</a>
</li>
<li id="plain">
<a href="https://help.ubuntu.com/7.04"
accesskey="t">7.04</a>
</li>
<li id="plain">
<a href="https://help.ubuntu.com/7.10"
accesskey="t">7.10</a>
</li>
<li id="current">
<a href="https://help.ubuntu.com/community"
accesskey="t">Community Docs</a>
</li>
</ul>
</div>
</div></div>
<ul class="extranav">
<li><a href="/community/UserDocumentation">User Documentation</a></li>
</ul>
</div>
<div id="page" lang="en" dir="ltr"><!-- start page -->
<h1 id="title"><a title="Click to do a full-text search for this title" href="/community/BinaryDriverHowto/Fglrx?action=fullsearch&amp;value=linkto%3A%22BinaryDriverHowto%2FFglrx%22&amp;context=180">BinaryDriverHowto/Fglrx</a></h1>
<div lang="en" id="content" dir="ltr">
<a id="top"></a>
<div lang="en" id="content" dir="ltr">
<a id="top"></a>
<p><strong>This page does not exist yet. You can create a new empty page, or use one of the page templates. Before creating the page, please check if a similar page already exists.</strong> </p>
<a href="/community/BinaryDriverHowto/Fglrx?action=edit">Create new empty page</a><p> </p>
<div>
<table>
<tr>
<td>
<p> <strong>Page templates:</strong> </p>
</td>
<td>
<p> <strong>Existing pages with similar names:</strong> </p>
</td>
</tr>
<tr>
<td style="vertical-align: top;">
<p> <ul>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=AideTemplate">AideTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=[[category:CategoryTemplate">CategoryTemplate</a></li>]]
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=DocumentationTemplate">DocumentationTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=HelpTemplate">HelpTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=HilfeTemplate">HilfeTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=HomepageTemplate">HomepageTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=PagePersonnelleTemplate">PagePersonnelleTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=Pr%c3%a9sentationTemplate">PrésentationTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SlideShowHandOutTemplate">SlideShowHandOutTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SlideShowTemplate">SlideShowTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SlideTemplate">SlideTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=SupportPapierD'UnePr%c3%a9sentationTemplate">SupportPapierD'UnePrésentationTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=ThuisbladTemplate">ThuisbladTemplate</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx?action=edit&amp;template=TransparentTemplate">TransparentTemplate</a></li>
</ul>
</p>
</td>
<td style="vertical-align: top;">
<p> <ul>
<li><a href="/community/BIND9ServerHowto">BIND9ServerHowto</a></li>
</ul>
<ul>
<li><a href="/community/BinaryDriverHowto">BinaryDriverHowto</a></li>
<li><a href="/community/BinaryDriverHowto/ATI">BinaryDriverHowto/ATI</a></li>
<li><a href="/community/BinaryDriverHowto/EiconDiva">BinaryDriverHowto/EiconDiva</a></li>
<li><a href="/community/BinaryDriverHowto/Fglrx_lowpower">BinaryDriverHowto/Fglrx lowpower</a></li>
<li><a href="/community/BinaryDriverHowto/KeyspanDriver">BinaryDriverHowto/KeyspanDriver</a></li>
<li><a href="/community/BinaryDriverHowto/MatroxParhelia">BinaryDriverHowto/MatroxParhelia</a></li>
<li><a href="/community/BinaryDriverHowto/Nvidia">BinaryDriverHowto/Nvidia</a></li>
<li><a href="/community/BinaryDriverHowto/ati">BinaryDriverHowto/ati</a></li>
</ul>
</p>
</td>
</tr>
</table>
</div>
<a id="bottom"></a>
</div>
<a id="bottom"></a>
</div>
</div> <!-- end page -->
<div id="footer">
<div id="ubuntulinks">
&copy; 2007 <a href="http://www.canonical.com">Canonical Ltd</a>. Ubuntu, Kubuntu, Edubuntu and Canonical are registered trademarks of Canonical Ltd.<br />
<a href="https://help.ubuntu.com/community/WikiGuide">Feedback</a> &mdash;
<a href="https://help.ubuntu.com/community/License">Legal</a> &mdash;
<a href="https://help.ubuntu.com/community/Credits">Credits</a>
<br />
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
<img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png" />
</a>
</div>
</div>
</body>
</html>


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2007年12月3日 (一) 12:28的版本

{{#ifexist: :BinaryDriverHowto/Fglrx lowpower/zh | | {{#ifexist: BinaryDriverHowto/Fglrx lowpower/zh | | {{#ifeq: {{#titleparts:BinaryDriverHowto/Fglrx lowpower|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:BinaryDriverHowto/Fglrx lowpower|1|-1|}} | zh | | }}

This is an ugly hack to get a Radeon video card to run on low power when running off batteries. It saves quite a bit of power, but it's known that enabling low power mode on the fglrx driver can cause "mysterious hangs", so be aware of that. However, when it works, battery life is considerably improved. This works for me, but YMMV. Use at your own risk. Interested to hear any/all feedback. The following was written for Ubuntu 6.06 (Dapper Drake).

  • First install the fglrx driver by installing the xorg-driver-fglrx package from the Restricted Repository & make sure you can run 'aticonfig --lsp'
  • In /etc/default/fglrx, uncomment/set:
FGLRX_ACPI_SWITCH_POWERSTATES=true
  • In /etc/default/acpi-support, uncomment/set:
ENABLE_LAPTOP_MODE=true
  • Then we need a modified version of /etc/acpi/fglrx-powermode.sh

(if the script doesn't exist, it means you haven't got the fglrx driver installed)

mkdir ~/bin
cat /etc/acpi/fglrx-powermode.sh | sed 's/su \$user -c \"\(.*\)\"/\1/' > ~/bin/fglrx-powermode.sh
chmod +x ~/bin/fglrx-powermode.sh
  • Next, edit/create ~/.gnomerc to call the new script (eg):

sample ~/.gnomerc

#!/bin/bash
~/bin/fglrx-powermode.sh
  • Set execute permissions on script
chmod +x ~/bin/fglrx-powermode.sh
  • Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
aticonfig --lsp
core/mem [flags]
-----------------
* 1: 111/111 MHz [low voltage]
2: 392/209 MHz [default state]

Comments

Worked for me on my Dell D610. On dapper, /etc/acpi has battery.d and ac.d directories. The scripts in here are sourced (not executed) by the power.sh script on switching of power modes. In most cases, there is no difference between sourcing and executing. I just linked the fglrx script into the two directories (after editing the files in /etc/default):

cd /etc/acpi/battery.sh
sudo ln -s ../fglrx_powermode.sh
cd ../ac.d
sudo ln -s ../fglrx_powermode.sh

I consider this a better solution than making a script for gnome to run. -- JPKotta I don't think this will set low power mode at boot up. -- fz I somehow lost the fglrx_powermode.sh script. So I reinvented the wheel and came up with this script which I put directly in /etc/acpi/{battery.d,ac.d}/ati.sh. The 'new_state=' line is obviously different in the ac.d vs. battery.d scripts.

. /usr/share/acpi-support/power-funcs
new_state=1
if [ -x /usr/bin/aticonfig ]; then 
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then      
export DISPLAY=":$displaynum"
/usr/bin/aticonfig --set-powerstate=$new_state
fi
done
fi

If you want to run it at boot time, put a symlink to /etc/acpi/power.sh named something like /etc/rc2.d/S99powerstate (I have not tested this). --jpkotta