个人工具

“UbuntuHelp:BinaryDriverHowto/Fglrx lowpower”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第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}}
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.
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
This works for me, but YMMV. Use at your own risk. Interested to hear any/all feedback.  
+
<html>
The following was written for Ubuntu 6.06 (Dapper Drake).
+
<head>
* First install the fglrx driver  by installing the xorg-driver-fglrx package from the Restricted Repository & make sure you can run 'aticonfig --lsp'
+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
* In /etc/default/fglrx, uncomment/set:
+
<meta name="robots" content="index,nofollow">
<pre><nowiki>FGLRX_ACPI_SWITCH_POWERSTATES=true
+
<title>BinaryDriverHowto/Fglrx - Community Ubuntu Documentation</title>
</nowiki></pre>
+
<script type="text/javascript">
* In /etc/default/acpi-support, uncomment/set:
+
<!--// common functions
<pre><nowiki>ENABLE_LAPTOP_MODE=true
+
// We keep here the state of the search box
</nowiki></pre>
+
searchIsDisabled = false;
* Then we need a modified version of /etc/acpi/fglrx-powermode.sh
+
function searchChange(e) {
(if the script doesn't exist, it means you haven't got the fglrx driver installed)
+
// Update search buttons status according to search box content.
<pre><nowiki>
+
// Ignore empty or whitespace search term.
mkdir ~/bin
+
var value = e.value.replace(/\s+/, '');
cat /etc/acpi/fglrx-powermode.sh | sed 's/su \$user -c \"\(.*\)\"/\1/' > ~/bin/fglrx-powermode.sh
+
if (value == '' || searchIsDisabled) {
chmod +x ~/bin/fglrx-powermode.sh
+
searchSetDisabled(true);
</nowiki></pre>
+
} else {
* Next, edit/create ~/.gnomerc to call the new script (eg):
+
searchSetDisabled(false);
sample ~/.gnomerc
+
}
<pre><nowiki>
+
}
#!/bin/bash
+
function searchSetDisabled(flag) {
~/bin/fglrx-powermode.sh
+
// Enable or disable search
</nowiki></pre>
+
document.getElementById('fullsearch').disabled = flag;
* Set execute permissions on script
+
document.getElementById('titlesearch').disabled = flag;
<pre><nowiki>chmod +x ~/bin/fglrx-powermode.sh
+
}
</nowiki></pre>
+
function searchFocus(e) {
* Now if you boot while on battery, ati-config --lsp should indicate the vid card as in low power mode.
+
// Update search input content on focus
<pre><nowiki>aticonfig --lsp
+
if (e.value == 'Search') {
core/mem [flags]
+
e.value = '';
-----------------
+
e.style.color = 'black';
* 1: 111/111 MHz [low voltage]
+
searchIsDisabled = false;
2: 392/209 MHz [default state]
+
}
</nowiki></pre>
+
}
=== Comments ===
+
function searchBlur(e) {
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>):
+
// Update search input content on blur
<pre><nowiki>
+
if (e.value == '') {
cd /etc/acpi/battery.sh
+
e.value = 'Search';
sudo ln -s ../fglrx_powermode.sh
+
e.style.color = 'gray';
cd ../ac.d
+
searchIsDisabled = true;
sudo ln -s ../fglrx_powermode.sh
+
}
</nowiki></pre>
+
}
I consider this a better solution than making a script for gnome to run.
+
function actionsMenuInit(title) {
-- JPKotta
+
// Initiliaze action menu
I don't think this will set low power mode at boot up.
+
for (i = 0; i < document.forms.length; i++) {
-- fz
+
var form = document.forms[i];
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.
+
if (form.className == 'actionsmenu') {
<pre><nowiki>
+
// Check if this form needs update
. /usr/share/acpi-support/power-funcs
+
var div = form.getElementsByTagName('div')[0];
new_state=1
+
var label = div.getElementsByTagName('label')[0];
if [ -x /usr/bin/aticonfig ]; then
+
if (label) {
for x in /tmp/.X11-unix/*; do
+
// This is the first time: remove label and do buton.
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
+
div.removeChild(label);
getXuser;
+
var dobutton = div.getElementsByTagName('input')[0];
if [ x"$XAUTHORITY" != x"" ]; then     
+
div.removeChild(dobutton);
export DISPLAY=":$displaynum"
+
// and add menu title
/usr/bin/aticonfig --set-powerstate=$new_state
+
var select = div.getElementsByTagName('select')[0];
fi
+
var item = document.createElement('option');
done
+
item.appendChild(document.createTextNode(title));
fi
+
item.value = 'show';
</nowiki></pre>
+
select.insertBefore(item, select.options[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).
+
select.selectedIndex = 0;
--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年11月30日 (五) 22:37的版本

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> BinaryDriverHowto/Fglrx - Community Ubuntu Documentation