Re: Performance hit while working with screen depth 16

2009-07-13 Thread shivaprasad javali
I changed the screen depth while installing my activity. I couldn't install
my activity using only the .xo file because other things such as the OSS
sound module needed to be setup before running the activity. So I provided a
script to install the activity. I ran the commands from the script from
their as sudo.

On Tue, Jul 14, 2009 at 4:53 AM, Martin Langhoff
wrote:

> On Tue, Jul 14, 2009 at 7:28 AM, Benjamin M.
> Schwartz wrote:
> > On the other hand, if this is for private deployment under your control,
> > then it's perfectly acceptable.
>
> U...
>
>  - Restarting X kills the session, which means that it'll kill all the
> other open activities. So no, I don't think any user will consider
> this reasonable -- _unless this activity is the only one in the
> system_ or a ridiculously important one.
>
>  - As Quozl points out, editing config files _must_ be atomic, and
> there better be a way to restore it back to normal.
>
>  - Does the activity have root access? Can it bypass rainbow? How does
> it manage to rewrite xorg.conf and restart X?
>
> It's a real shame that xrandr dropped the "switch colour depth" goal
> midstream. Otherwise it'd be the recommended course of action. I'm of
> course intrigued by Tomeu's link re Maemo.
>
> Given the above notes... If a deployment considers your activity _so_
> important, then persuade them to ship with 24bpp in xorg.conf
>
> cheers,
>
>
>
> m
> --
>  martin.langh...@gmail.com
>  mar...@laptop.org -- School Server Architect
>  - ask interesting questions
>  - don't get distracted with shiny stuff  - working code first
>  - http://wiki.laptop.org/go/User:Martinlanghoff
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread S Page
On Mon, Jul 13, 2009 at 2:40 AM, Tomeu Vizoso wrote:

> Btw, the issue of depth transformations have been known in the Geode
> for quite some time. We didn't switched to 24bpp because of the amount
> of memory available.

Right, and in 8.2.1 xdpyinfo indicates my default screen visual is
still RGB 565.

> AFAIR the problem was that Cairo has no 16bit surfaces on which we
> could work,

The most recent discussion of the issue in the Cairo graphics library
is in the threads

and 
where Cairo expert Behdad says
"Most of the situations where RGB16_565 may be needed,
[cairo_surface_create_similar]() does a better job."
If you use this function to create a surface matching your eventual
Xlib target window that is  16bpp, Cairo will internally use a 16bpp
drawing surface.  This technique was discussed on the sugarlabs list
in 
and again in December 2008.

However many graphics libraries use cairo_image_surface_create() to
create a bitmap for rendering independent of the eventual target
window .  These graphics libraries are willing to provide you a 565
bitmap (saving memory and improving performance) but the explicit
CAIRO_FORMAT_RGB16_565 format is still deprecated, despite patches
that fix this (see below).

> so we use 32 (or is it 24?)
I dunno, what does GTK on OLPC do?  I don't know enough pycairo to
check what's going on.

> and those need to be converted
> by the X server. I have heard a rumour about someone (OpenMoko?
> Maemo?) having invested resources in adding 16bit surfaces to Qt so it
> ran properly on their hardware.

Cairo is unrelated to Qt.  However, the Maemo project has cairo paches
for 565 support, see

and also Mozilla is pushing for a Firefox that works in 16bpp and has
similar cairo patches, see
https://bugzilla.mozilla.org/show_bug.cgi?id=491357

Staying 16bpp all the way should be a win for memory and performance,
it's just a matter of getting all the layers lined up.

Prepend "AIUI" in front of every paragraph I wrote  8-)
--
=S Page
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread Martin Langhoff
On Tue, Jul 14, 2009 at 7:28 AM, Benjamin M.
Schwartz wrote:
> On the other hand, if this is for private deployment under your control,
> then it's perfectly acceptable.

U...

 - Restarting X kills the session, which means that it'll kill all the
other open activities. So no, I don't think any user will consider
this reasonable -- _unless this activity is the only one in the
system_ or a ridiculously important one.

 - As Quozl points out, editing config files _must_ be atomic, and
there better be a way to restore it back to normal.

 - Does the activity have root access? Can it bypass rainbow? How does
it manage to rewrite xorg.conf and restart X?

It's a real shame that xrandr dropped the "switch colour depth" goal
midstream. Otherwise it'd be the recommended course of action. I'm of
course intrigued by Tomeu's link re Maemo.

Given the above notes... If a deployment considers your activity _so_
important, then persuade them to ship with 24bpp in xorg.conf

cheers,



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread Benjamin M. Schwartz
shivaprasad javali wrote:
> My original question still remains unanswered. Is it acceptable for my
> activity to change the screen depth to increase its performance?

Acceptable to whom?

It's probably not acceptable to the hundreds of thousands of children who
currently have XOs running Sugar, because the Rainbow system will prevent
your activity from editing xorg.conf.  In fact, because the users in
Uruguay have been denied root access, they cannot change the screen depth
at all.

On the other hand, if this is for private deployment under your control,
then it's perfectly acceptable.

--Ben



signature.asc
Description: OpenPGP digital signature
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread James Cameron
Consider what might happen if power is removed while the xorg.conf file
is either (a) edited to your satisfaction, or (b) half completed.

In the former case, the unit will persist in behaving in the manner that
you have adjusted it to.  The impact will be unknown.

In the latter case, the unit may not start the X server, because of an
incomplete xorg.conf file, and may require reinstallation.  I've tested
this, and the result is text console output:

(EE) Error parsing the config file

Fatal server error:
No screens found

I've also just tested several activities at depth 24, and they seem
slower, by a second or so, to start up.  I used two laptops side by
side, one in 24 bit depth, one in 16 bit depth.  In particular Measure,
Moon and Browse.  Once started there didn't seem to be much difference.

I suggest at a minimum you should make the configuration file change
atomic.  You should also prepare code that will undo the change on
reboot.

-- 
James Cameronmailto:qu...@us.netrek.org http://quozl.netrek.org/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread James Cameron
On Mon, Jul 13, 2009 at 03:59:40PM +0530, shivaprasad javali wrote:
> My original question still remains unanswered. Is it acceptable for my 
> activity
> to change the screen depth to increase its performance?

Doing so will increase memory consumption ... and like any change in
footprint you have to decide whether the increase in that cost is worth
it ... what does the user lose by giving away that memory?

Otherwise, like others, I'm a bit confused as whom you mean it would be
unacceptable to.  It's not like we can have any direct input into an
activity we cannot see.

> Which would be really painful for me to do:( )

Think of the risks ... after setting the X server into this mode, will
everything else work normally, and how are you testing that?  The last
thing you'd want is for your activity to be either (a) unable to share
resources with other activities, or (b) cause other activities to fail
because you have changed the environment.

I looked at the script, but the build I'm using doesn't have an
/etc/X11/xorg.conf file, so I don't think it can work ... the mv would
fail.  What operating system build are you using?

-- 
James Cameronmailto:qu...@us.netrek.org http://quozl.netrek.org/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread Daniel Drake
On Mon, 2009-07-13 at 15:59 +0530, shivaprasad javali wrote:
> My original question still remains unanswered. Is it acceptable for my
> activity to change the screen depth to increase its performance?

Perhaps you should ask this question to the users of your activity. That
doesn't appear to be us, since you seem unwilling to share it :(

Daniel


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread shivaprasad javali
My original question still remains unanswered. Is it acceptable for my
activity to change the screen depth to increase its performance? Or do I
have to look at improving my code itself to get it to work better with 16
bit screen depth?( Which would be really painful for me to do:( )

On Mon, Jul 13, 2009 at 3:48 PM, Tomeu Vizoso  wrote:

> On Mon, Jul 13, 2009 at 11:56, shivaprasad javali wrote:
> > @ James
> > I have attached my script to change the screen depth.
> >
> > @Tomeu
> > Is there any possiblity of Sugar changing its default depth to 24  in the
> > feature? By what you say it seems like this is a problem with sugar. So
> is
> > it acceptable for my Activity to change the screen depth so that it runs
> > faster?
>
> It has nothing to do with Sugar but rather with how the system where
> Sugar runs is configured. If you run GNOME on the XO with the server
> at 16bits, you will notice the same effect.
>
> Regards,
>
> Tomeu
>
> > On Mon, Jul 13, 2009 at 3:10 PM, Tomeu Vizoso 
> wrote:
> >>
> >> On Mon, Jul 13, 2009 at 11:24, James Cameron wrote:
> >> > On Mon, Jul 13, 2009 at 02:08:13PM +0530, shivaprasad javali wrote:
> >> >> Sorry, I didn't understand the question. If you are talking about
> where
> >> >> my
> >> >> activity is for you to download, I am sorry I cannot provide you the
> >> >> activity
> >> >> itself.
> >> >
> >> > No, I wasn't asking about the activity.
> >> >
> >> >> If you are asking which file I changed to get the screen depth of the
> >> >> XO to be
> >> >> 24, it is the xorg.conf file present at /etc/X11.
> >> >
> >> > Yes, I was asking about your small script.  Can you provide your small
> >> > script that changes teh screen depth and restarts X?
> >>
> >> Btw, the issue of depth transformations have been known in the Geode
> >> for quite some time. We didn't switched to 24bpp because of the amount
> >> of memory available.
> >>
> >> AFAIR the problem was that Cairo has no 16bit surfaces on which we
> >> could work, so we use 32 (or is it 24?) and those need to be converted
> >> by the X server. I have heard a rumour about someone (OpenMoko?
> >> Maemo?) having invested resources in adding 16bit surfaces to Qt so it
> >> ran properly on their hardware.
> >>
> >> Just found this after some googling:
> >>
> >> http://ariya.blogspot.com/2008/08/qt-44-and-maemo.html
> >>
> >> Regards,
> >>
> >> Tomeu
> >>
> >> > --
> >> > James Cameronmailto:qu...@us.netrek.org
> http://quozl.netrek.org/
> >> > ___
> >> > Devel mailing list
> >> > Devel@lists.laptop.org
> >> > http://lists.laptop.org/listinfo/devel
> >> >
> >> ___
> >> Devel mailing list
> >> Devel@lists.laptop.org
> >> http://lists.laptop.org/listinfo/devel
> >
> >
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread Tomeu Vizoso
On Mon, Jul 13, 2009 at 11:56, shivaprasad javali wrote:
> @ James
> I have attached my script to change the screen depth.
>
> @Tomeu
> Is there any possiblity of Sugar changing its default depth to 24  in the
> feature? By what you say it seems like this is a problem with sugar. So is
> it acceptable for my Activity to change the screen depth so that it runs
> faster?

It has nothing to do with Sugar but rather with how the system where
Sugar runs is configured. If you run GNOME on the XO with the server
at 16bits, you will notice the same effect.

Regards,

Tomeu

> On Mon, Jul 13, 2009 at 3:10 PM, Tomeu Vizoso  wrote:
>>
>> On Mon, Jul 13, 2009 at 11:24, James Cameron wrote:
>> > On Mon, Jul 13, 2009 at 02:08:13PM +0530, shivaprasad javali wrote:
>> >> Sorry, I didn't understand the question. If you are talking about where
>> >> my
>> >> activity is for you to download, I am sorry I cannot provide you the
>> >> activity
>> >> itself.
>> >
>> > No, I wasn't asking about the activity.
>> >
>> >> If you are asking which file I changed to get the screen depth of the
>> >> XO to be
>> >> 24, it is the xorg.conf file present at /etc/X11.
>> >
>> > Yes, I was asking about your small script.  Can you provide your small
>> > script that changes teh screen depth and restarts X?
>>
>> Btw, the issue of depth transformations have been known in the Geode
>> for quite some time. We didn't switched to 24bpp because of the amount
>> of memory available.
>>
>> AFAIR the problem was that Cairo has no 16bit surfaces on which we
>> could work, so we use 32 (or is it 24?) and those need to be converted
>> by the X server. I have heard a rumour about someone (OpenMoko?
>> Maemo?) having invested resources in adding 16bit surfaces to Qt so it
>> ran properly on their hardware.
>>
>> Just found this after some googling:
>>
>> http://ariya.blogspot.com/2008/08/qt-44-and-maemo.html
>>
>> Regards,
>>
>> Tomeu
>>
>> > --
>> > James Cameron    mailto:qu...@us.netrek.org     http://quozl.netrek.org/
>> > ___
>> > Devel mailing list
>> > Devel@lists.laptop.org
>> > http://lists.laptop.org/listinfo/devel
>> >
>> ___
>> Devel mailing list
>> Devel@lists.laptop.org
>> http://lists.laptop.org/listinfo/devel
>
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread shivaprasad javali
@ James
I have attached my script to change the screen depth.

@Tomeu
Is there any possiblity of Sugar changing its default depth to 24  in the
feature? By what you say it seems like this is a problem with sugar. So is
it acceptable for my Activity to change the screen depth so that it runs
faster?

On Mon, Jul 13, 2009 at 3:10 PM, Tomeu Vizoso  wrote:

> On Mon, Jul 13, 2009 at 11:24, James Cameron wrote:
> > On Mon, Jul 13, 2009 at 02:08:13PM +0530, shivaprasad javali wrote:
> >> Sorry, I didn't understand the question. If you are talking about where
> my
> >> activity is for you to download, I am sorry I cannot provide you the
> activity
> >> itself.
> >
> > No, I wasn't asking about the activity.
> >
> >> If you are asking which file I changed to get the screen depth of the XO
> to be
> >> 24, it is the xorg.conf file present at /etc/X11.
> >
> > Yes, I was asking about your small script.  Can you provide your small
> > script that changes teh screen depth and restarts X?
>
> Btw, the issue of depth transformations have been known in the Geode
> for quite some time. We didn't switched to 24bpp because of the amount
> of memory available.
>
> AFAIR the problem was that Cairo has no 16bit surfaces on which we
> could work, so we use 32 (or is it 24?) and those need to be converted
> by the X server. I have heard a rumour about someone (OpenMoko?
> Maemo?) having invested resources in adding 16bit surfaces to Qt so it
> ran properly on their hardware.
>
> Just found this after some googling:
>
> http://ariya.blogspot.com/2008/08/qt-44-and-maemo.html
>
> Regards,
>
> Tomeu
>
> > --
> > James Cameronmailto:qu...@us.netrek.org http://quozl.netrek.org/
> > ___
> > Devel mailing list
> > Devel@lists.laptop.org
> > http://lists.laptop.org/listinfo/devel
> >
> ___
> Devel mailing list
> Devel@lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>


Setxoconfiguration.sh
Description: Bourne shell script
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread Tomeu Vizoso
On Mon, Jul 13, 2009 at 11:24, James Cameron wrote:
> On Mon, Jul 13, 2009 at 02:08:13PM +0530, shivaprasad javali wrote:
>> Sorry, I didn't understand the question. If you are talking about where my
>> activity is for you to download, I am sorry I cannot provide you the activity
>> itself.
>
> No, I wasn't asking about the activity.
>
>> If you are asking which file I changed to get the screen depth of the XO to 
>> be
>> 24, it is the xorg.conf file present at /etc/X11.
>
> Yes, I was asking about your small script.  Can you provide your small
> script that changes teh screen depth and restarts X?

Btw, the issue of depth transformations have been known in the Geode
for quite some time. We didn't switched to 24bpp because of the amount
of memory available.

AFAIR the problem was that Cairo has no 16bit surfaces on which we
could work, so we use 32 (or is it 24?) and those need to be converted
by the X server. I have heard a rumour about someone (OpenMoko?
Maemo?) having invested resources in adding 16bit surfaces to Qt so it
ran properly on their hardware.

Just found this after some googling:

http://ariya.blogspot.com/2008/08/qt-44-and-maemo.html

Regards,

Tomeu

> --
> James Cameron    mailto:qu...@us.netrek.org     http://quozl.netrek.org/
> ___
> Devel mailing list
> Devel@lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread James Cameron
On Mon, Jul 13, 2009 at 02:08:13PM +0530, shivaprasad javali wrote:
> Sorry, I didn't understand the question. If you are talking about where my
> activity is for you to download, I am sorry I cannot provide you the activity
> itself.

No, I wasn't asking about the activity.

> If you are asking which file I changed to get the screen depth of the XO to be
> 24, it is the xorg.conf file present at /etc/X11.

Yes, I was asking about your small script.  Can you provide your small
script that changes teh screen depth and restarts X?

-- 
James Cameronmailto:qu...@us.netrek.org http://quozl.netrek.org/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread shivaprasad javali
Sorry, I didn't understand the question. If you are talking about where my
activity is for you to download, I am sorry I cannot provide you the
activity itself.

If you are asking which file I changed to get the screen depth of the XO to
be 24, it is the xorg.conf file present at /etc/X11.

Thanks
Shivaprasad

On Mon, Jul 13, 2009 at 1:58 PM, James Cameron  wrote:

> On Mon, Jul 13, 2009 at 12:28:37PM +0530, shivaprasad javali wrote:
> > To improve the performance on the XO I wrote a small script to be used
> > along with my activity. This script changed the screen depth of the XO
> > to 24 and restarted X.
>
> Where is it?
>
> --
> James Cameronmailto:qu...@us.netrek.org http://quozl.netrek.org/
> ___
> Devel mailing list
> Devel@lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Performance hit while working with screen depth 16

2009-07-13 Thread James Cameron
On Mon, Jul 13, 2009 at 12:28:37PM +0530, shivaprasad javali wrote:
> To improve the performance on the XO I wrote a small script to be used
> along with my activity. This script changed the screen depth of the XO
> to 24 and restarted X.

Where is it?

-- 
James Cameronmailto:qu...@us.netrek.org http://quozl.netrek.org/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Performance hit while working with screen depth 16

2009-07-12 Thread shivaprasad javali
Hi All,

I have an activity for the XO, written in LabVIEW. I tried out
the activity on the XO and it turned out that the performance of the
activity was really bad, the drawing was too slow to be usable. I did some
investigation and found that the main bottleneck for performance was that
the screen depth of the XO was 16 and my application assumed everything was
in 32 bit. So it constantly converted pixels from 16 bit to 32 bit to do
alpha blending and then back to 16 for drawing the image on screen.

   To improve the performance on the XO I wrote a small script to be
used along with my activity. This script changed the screen depth of the XO
to 24 and restarted X. I wanted to know how appropriate is it for my
activity to do this( change the configuration of teh XO to improve
performance). Do you think doing this would adversely affect other
activities on the XO?

Thanks
Shivaprasad
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel