Re: [gentoo-dev] RFC: mesa.eselect

2010-11-01 Thread Chí-Thanh Christopher Nguyễn

Pacho Ramos schrieb:

Is there any kind of information (doc page, news item...) planned for
explaining when it's better to switch to gallium3d and when not? For
example, one of the systems I administrate has a r300 device, but I
haven't followed at all gallium progress and, I guess, you cannot asume
most of the people know about all this. Then, I think that, for example,
a news item would be useful to know what drivers should we use.
   


I am not aware of official Mesa documentation which explains when 
Gallium3D should be used rather than classic. Mostly, such information 
spreads as word of mouth and sometimes as news articles on websites like 
phoronix.com.


There will be a default set for new eselect-mesa installations, so if 
you upgrade to mesa-7.9 today you will get the r300 gallium driver and 
the r600 classic driver. When we set a new default, then a news item to 
inform users about the change is certainly a good idea.



Best regards,
Chí-Thanh Christopher Nguyễn




Re: [gentoo-dev] RFC: mesa.eselect

2010-11-01 Thread Ondřej Súkup
>> Best regards,
>> Chí-Thanh Christopher Nguyễn
>>
>
> Is there any kind of information (doc page, news item...) planned for
> explaining when it's better to switch to gallium3d and when not? For
> example, one of the systems I administrate has a r300 device, but I
> haven't followed at all gallium progress and, I guess, you cannot asume
> most of the people know about all this. Then, I think that, for example,
> a news item would be useful to know what drivers should we use.
>
> Thanks a lot
>

r300g is in good state, fully supported:)



Re: [gentoo-dev] RFC: mesa.eselect

2010-11-01 Thread Pacho Ramos
El dom, 31-10-2010 a las 23:30 +0100, Chí-Thanh Christopher Nguyễn
escribió:
> Hi,
> 
> media-libs/mesa-7.9 has been sitting in the X11 overlay for some time 
> and the X11 team are planning to move it to portage soon.
> The new release brings a number of improvements, including much better 
> Gallium3D support. One feature that we would like to add to Mesa in 
> Gentoo is the ability to switch between "classic" and "gallium" drivers 
> via an eselect module.
> 
> Attached you will find the eselect module which we used in the X11 
> overlay, and the configuration file from mesa. There are still some 
> things on the TODO list but I consider them not blockers for addition to 
> the tree. As this is the first eselect module I have written, I would 
> welcome your comments and pointers.
> 
> TODO:
>   * Add support for switching emul-linux-x86-opengl on amd64 multilib
>   * Accept numbers as do_set() arguments
>   * Make the code a bit more compact
> Untested:
>   * Prefix support
> 
> 
> Best regards,
> Chí-Thanh Christopher Nguyễn
> 

Is there any kind of information (doc page, news item...) planned for
explaining when it's better to switch to gallium3d and when not? For
example, one of the systems I administrate has a r300 device, but I
haven't followed at all gallium progress and, I guess, you cannot asume
most of the people know about all this. Then, I think that, for example,
a news item would be useful to know what drivers should we use.

Thanks a lot


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] RFC: mesa.eselect

2010-11-01 Thread Ulrich Mueller
> On Sun, 31 Oct 2010, Chí-Thanh Christopher Nguyễn wrote:

> Attached you will find the eselect module which we used in the X11 
> overlay, and the configuration file from mesa.

Is there a specific reason why the "list" action doesn't output a
numbered list? Also the "set" action should accept a number argument.

Ulrich



[gentoo-dev] RFC: mesa.eselect

2010-10-31 Thread Chí-Thanh Christopher Nguyễn

Hi,

media-libs/mesa-7.9 has been sitting in the X11 overlay for some time 
and the X11 team are planning to move it to portage soon.
The new release brings a number of improvements, including much better 
Gallium3D support. One feature that we would like to add to Mesa in 
Gentoo is the ability to switch between "classic" and "gallium" drivers 
via an eselect module.


Attached you will find the eselect module which we used in the X11 
overlay, and the configuration file from mesa. There are still some 
things on the TODO list but I consider them not blockers for addition to 
the tree. As this is the first eselect module I have written, I would 
welcome your comments and pointers.


TODO:
 * Add support for switching emul-linux-x86-opengl on amd64 multilib
 * Accept numbers as do_set() arguments
 * Make the code a bit more compact
Untested:
 * Prefix support


Best regards,
Chí-Thanh Christopher Nguyễn

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: $  

DESCRIPTION="Manage the OpenGL driver architecture used by media-libs/mesa"
MAINTAINER="x...@gentoo.org"
SVN_DATE='$Date: $'
VERSION=$(svn_date_to_version "${SVN_DATE}" )
EBUILD_VERSION="0.0.7"

CONFIG_DIR="${EROOT}/usr/share/mesa"
MESA_DIR="${EROOT}/usr/lib/mesa"
DRI_DIR="${EROOT}/usr/lib/dri"

source "${CONFIG_DIR}"/eselect-mesa.conf || die "Failed to source config"

# receives a filename of the driver as argument, outputs the architecture 
(classic or gallium)
drivername_to_architecture() {
local drivername=$1
local x
local y
local z
for x in ${MESA_IMPLEMENTATIONS}; do
for y in classic gallium; do
z=$(get_drivername ${x} ${y})
if [[ ${drivername} == ${z} ]]; then
echo ${y}
exit 0
fi
done
done
}

# receives chipset family and driver architecture as argument, outputs the 
driver's filename
get_drivername() {
local family=$1
local architecture=$2
echo ${MESA_DRIVERS[${family},${architecture}driver]}
}

# receives the chipset family as argument, outputs the currently selected 
architecture for that family
get_current_implementation() {
local family=$1
local y
local z
local current=$(get_drivername ${family} classic)

if [[ -L ${DRI_DIR}/${current} ]]; then
for y in classic gallium; do
z=$(get_drivername ${family} ${y})
if [[ $(readlink ${DRI_DIR}/${current}) == 
"../mesa/${z}" && -f "${MESA_DIR}/${z}" ]]; then
echo $(drivername_to_architecture ${z})
fi
done
elif [[ -f ${DRI_DIR}/${current} ]]; then
echo "classic"
fi
}

# receives a family as argument, outputs all installed driver filenames
get_implementations() {
local ret
local family=$1
local y
local z
for y in classic gallium; do
z=$(get_drivername ${family} ${y})
[ -f ${MESA_DIR}/${z} -o -L ${MESA_DIR}/${z} ] && ret+="${y} "
done
echo ${ret}
}

### show action ###
describe_show() {
echo "Print the current OpenGL driver."
}

do_show() {
local current
local x
local y
for x in ${MESA_IMPLEMENTATIONS}; do
current=$(get_current_implementation ${x})
if [[ -n ${current} ]]; then
echo -n "${x} "
echo ${current}
fi
done
return 0
}

### list action ###
describe_list() {
echo "List the available OpenGL drivers."
}

do_list() {
local x
local y
local z
local available

for x in ${MESA_IMPLEMENTATIONS}; do
write_list_start ${MESA_DRIVERS[${x},description]}
available=( $(get_implementations ${x}) )
for (( i = 0 ; i < ${#availab...@]} ; i = i + 1 )); do
if [[ ${available[${i}]} == 
$(get_current_implementation ${x}) ]]; then
available[${i}]=$(highlight_marker 
"${available[${i}]}")
fi
write_kv_list_entry "${available[${i}]}"
done
done
}

### set action ###
describe_set() {
echo "Select the OpenGL driver."
}

describe_set_parameters() {
echo "[--auto| ]"
}

describe_set_options() {
echo "--auto : Sets all drivers which are not already set"
echo " : The chipset family, or sw for software renderer"
echo " : The driver architecture"
}

do_set() {
if [[ "$1" == --auto ]]; then
local x
for x in ${MESA_IMPLEMENTATIONS}; do