Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Photon and GF default video mode settings: (8 Items)
   
Photon and GF default video mode settings  
During experiments I've found that GF during initialization uses photon current video mode settings and setting photon's
 last video mode. It is not comfortable to wait while one mode is set and then another video mode which is set by 
application.

Another problem, If I switch video mode using GF's function gf_display_set_mode() it reconfigures photon to use last 
video mode, which was set by gf_display_set_mode(). So GF application needs to set original mode which was before.
RE: Photon and GF default video mode settings  
Hello Mike,

This is the expected behaviour, but I can understand your concern.  The
only application that actually writes to /etc/system/config/display.conf
is the Photon application 'phgrafx', or if you write to it using an
editor.

Since Photon and GF as 'converged', it is rather difficult to address
this behaviour.  Photon cannot really determine if another GF
application is running, but I have a suggestion for the GF application.

In the GF application, you can use the access() or stat() function to
check for /dev/photon.  If it exists, you can have your GF application
not call gf_display_set_mode().

Kind Regards,
-Derek

-----Original Message-----
From: Mike Gorchak [mailto:community-noreply@qnx.com] 
Sent: Wednesday, March 11, 2009 7:56 AM
To: advanced-graphics
Subject: Photon and GF default video mode settings

During experiments I've found that GF during initialization uses photon
current video mode settings and setting photon's last video mode. It is
not comfortable to wait while one mode is set and then another video
mode which is set by application.

Another problem, If I switch video mode using GF's function
gf_display_set_mode() it reconfigures photon to use last video mode,
which was set by gf_display_set_mode(). So GF application needs to set
original mode which was before.


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post24108
Re: RE: Photon and GF default video mode settings  
No, Photon and GF do not working simultaneously in my case. I meant when I call gf_display_set_mode() it writes to the /
etc/system/config/display.conf file, which is not suitable.
Re: RE: Photon and GF default video mode settings  
Hi Mike,

I followed the entire code path, and cannot isolate the behaviour you describe.  I am not disputing that you are 
encountering an issue, please post a sample GF application, and the steps necessary to recreate this situation so we can
 triage the issue.

Regards,
-Derek
Re: RE: Photon and GF default video mode settings  
Ok, I'll write codesample tomorrow.
Re: RE: Photon and GF default video mode settings  
Please run Photon and set videomode to any resolution and refresh rate excluding 640x480 resoloution. Shutdown photon.

Run testcase which is attached to this post. It will try to set 640x480@60Hz with RGBA8888 pixel format and then exit.

And then run Photon again - it will use 640x480@60Hz 32bpp video mode and discards previous video mode settings.

I tested this case on devg-tnt and devg-radeon. There is no any change in behavior.
Attachment: Text gf_test11.tar.gz 2.84 KB
Re: RE: Photon and GF default video mode settings  
Hi Mike,

I finally understand the situation you are requiring.  You observations are quite correct.

1)  Photon's io-graphics process does not cause a mode switch at all, it just relies on io-display's settings.
2)  io-display reads the configuration file when first started, and stores that value.
3)  If your GF application changes the display mode, io-display will stay at those settings until changed further.

The reason #3 is a valid behaviour, is because applications making GF API calls must be run as a root process, and 
therefore any API calls they make are premitted, and trusted.  Of course, one could argue about this particular 
behaviour either way, but it is consistent with the initial design requirements.

In short, gf_display_set_mode() does not write to the configuration file, but io-display retains the setting.

My suggestions is for your GF application to query the display for the settings at the beginning, and when the GF 
application terminates, it can reset the display settings.

Kind Regards,
-Derek
Re: RE: Photon and GF default video mode settings  
Ok then. I did video mode restoring while application exiting, this is not so elegant solution as could be, but it is 
solution :)