Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to unset surface which was set by gf_layer_set_surfaces() ?: (23 Items)
   
How to unset surface which was set by gf_layer_set_surfaces() ?  
Is is possible to unset surface which was set by gf_layer_set_surfaces() function ?

I ask this, because if surface was set by gf_layer_set_surfaces() function, and then it passed to gf_3d_target_create() 
function, there is no any OpenGL ES output, just black screen.

If I do not set this surface to layer, all OpenGL ES stuff works fine.
RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Hmm ... was the return code from gf_layer_set_surfaces() is very simple routine, it cannot even fail ... 
 
Did you create the surface with gf_surface_create_layer()?
 
If you pass NULL for the 'surfaces' parameter to gf_3d_target_create() , it uses gf_surface_create_layer() to create at 
least surfaces[0].
 
Regards,
-Derek

 
________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Thu 26/03/2009 4:01 AM
To: advanced-graphics
Subject: How to unset surface which was set by gf_layer_set_surfaces() ?



Is is possible to unset surface which was set by gf_layer_set_surfaces() function ?

I ask this, because if surface was set by gf_layer_set_surfaces() function, and then it passed to gf_3d_target_create() 
function, there is no any OpenGL ES output, just black screen.

If I do not set this surface to layer, all OpenGL ES stuff works fine.


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post25278



Attachment: Text winmail.dat 4.1 KB
Re: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
> Hmm ... was the return code from gf_layer_set_surfaces() is very simple 
> routine, it cannot even fail ... 

Who said that it fails ? It returns void :) But layer_update() did not failed.

> Did you create the surface with gf_surface_create_layer()?

Yes.

> If you pass NULL for the 'surfaces' parameter to gf_3d_target_create() , it 
> uses gf_surface_create_layer() to create at least surfaces[0].

If I call gf_layer_set_surfaces() for main display layer, after this call there is no any output (visible output) 
produced by OpenGL, it doesn't matter if I will pass NULL to gf_3d_target_create() or will pass real surface.
RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
 

[snip]

> Hmm ... was the return code from gf_layer_set_surfaces() is very simple
> routine, it cannot even fail ...

Who said that it fails ? It returns void :) But layer_update() did not failed.
[snip]


I knew this after I looked at the code, but I did not edit my answer enough :)

Attachment: Text winmail.dat 3.19 KB
Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
So is the solution just not to call gf_layer_set_surfaces() if I want just OpenGL ES output without 2D operations ?
RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
short answer is:  yes

________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Thu 26/03/2009 6:38 AM
To: advanced-graphics
Subject: Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?



So is the solution just not to call gf_layer_set_surfaces() if I want just OpenGL ES output without 2D operations ?


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post25296



Attachment: Text winmail.dat 3.48 KB
RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
OK, I do not like this ... gf_layer_set_surfaces() should have a return value and fail if this operation is not 
supported, but it basically just stuffs pointers into a structure.  But since it does not have a return value, I digress
 ...
 
I don't understand the subtleties involved with gf_3d_target_t.  Is there a particular reason you want to call 
gf_layer_set_surfaces() ?
 
The demo applications let all the gf_3d_xxxx() calls handle the surface creations.  Yes, I know those applications are 
not posted yet.   :)   If you require it, I can post the code for gears for reference.
 
I will fwd this message, to get a better response.
 
Regards,
-Derek

________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Thu 26/03/2009 6:12 AM
To: advanced-graphics
Subject: Re: RE: How to unset surface which was set by gf_layer_set_surfaces() ?



> Hmm ... was the return code from gf_layer_set_surfaces() is very simple
> routine, it cannot even fail ...

Who said that it fails ? It returns void :) But layer_update() did not failed.

> Did you create the surface with gf_surface_create_layer()?

Yes.

> If you pass NULL for the 'surfaces' parameter to gf_3d_target_create() , it
> uses gf_surface_create_layer() to create at least surfaces[0].

If I call gf_layer_set_surfaces() for main display layer, after this call there is no any output (visible output) 
produced by OpenGL, it doesn't matter if I will pass NULL to gf_3d_target_create() or will pass real surface.


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post25292



Attachment: Text winmail.dat 4.83 KB
Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
> I don't understand the subtleties involved with gf_3d_target_t.  Is there a 
> particular reason you want to call gf_layer_set_surfaces() ?

Yes, I want to create 2D and 3D targetable surface and draw to it using OpenGL ES and GF. Like demo egl-intermix does.

> The demo applications let all the gf_3d_xxxx() calls handle the surface 
> creations.  Yes, I know those applications are not posted yet.   :)   If you 
> require it, I can post the code for gears for reference.

It would be nice to have egl-intermix demo for my case.
Post Deleted
Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Ah!  egl-intermix kind of "cheats" by using ROPs.  You could accomplish this by using two layers as well.
 
-Derek
Attachment: Text egl-intermix.tgz 6.96 KB
Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
I have found where the problem is, thanks to egl-intermix demo source. My function sequence call is:

1) gf_layer_attach();
2) gf_surface_create_layer();
3) gf_layer_set_surfaces();
4) gl_layer_enable();
------------------------------
5) gf_surface_free()
6) gf_layer_disable()
7) gf_layer_detach()

after this initialization and shutdown I changed video mode using gf_display_set_mode() and then set layer settings 
again:

8) gf_layer_attach();
9) gf_surface_create_layer();
10) gf_layer_set_surfaces();
11) gl_layer_enable();

After this point OpenGL ES initialization gives black screen only. Experimentally I've found that problem line has 
number 3). If I comment out this line everything works properly until next video mode switch.

Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
> Ah!  egl-intermix kind of "cheats" by using ROPs.  You could accomplish this 
> by using two layers as well.
>  
> -Derek

This is modified main.c from egl-intermix test application, which reproduces the problem which described in the 
beginning of this thread.

My code begins with comment:
/******************************************************************/
/* Here is my code, which causes black screen in OpenGL ES render */
/******************************************************************/

After this comment below present one more comment:
/**************************************************************************/
/* Comment out this line to get rid of bug                                */
/**************************************************************************/
	gf_layer_set_surfaces(layer, &gfsurface[0], 1);
/**************************************************************************/
/* End of bug :)                                                          */
/**************************************************************************/

When you comment out the whole gf_layer_set_surfaces() line, egl-intermix application will work as usual.
Attachment: Text main.c 8.49 KB
Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Derek, are you able to reproduce this problem using my patched egl-intermix source ?
RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
I don't have time just yet to try it, but I will ...

________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Fri 27/03/2009 7:10 AM
To: advanced-graphics
Subject: Re: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?



Derek, are you able to reproduce this problem using my patched egl-intermix source ?


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post25435



Attachment: Text winmail.dat 3.49 KB
Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Thanks!
Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
I have an additional information. This bug can't be reproduced on devg-radeon graphics driver, but on devg-extreme2 (on 
82852GM, 82865G, etc) it could be reproduced without any problem.
Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Hi Mike,

Can you please try the attached version with the Intel chipsets, and see if there is any difference?  The the problem 
persists, my best guess is that the Intel drivers are still referencing the free'd surface even though the layer had 
been disabled and detached.

Thanks,
-Derek
Attachment: Text main-intermix.c 8.86 KB
Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
> Hi Mike,
> 
> Can you please try the attached version with the Intel chipsets, and see if 
> there is any difference?  The the problem persists, my best guess is that the 
> Intel drivers are still referencing the free'd surface even though the layer 
> had been disabled and detached.
> 
> Thanks,
> -Derek

I have no hardware to test right now, but I'll test it this evening. Thanks.
Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
> Can you please try the attached version with the Intel chipsets, and see if 
> there is any difference?  The the problem persists, my best guess is that the 
> Intel drivers are still referencing the free'd surface even though the layer 
> had been disabled and detached.

I cannot see any difference in behavior of egl-intermix. Problem still persist.

P.S. This issue is very critical for me, since it stops development.
Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Hi Mike,

I will forward this message to someone else for comment, and decide on a course of action from there.  I used the devg-
vmware.so driver and the test application, and with my modications, ran OK.  It suspect though, that devg-extreme2 may 
still be referencing the released surface memory.

Kind regards,
-Derek
Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Any news ?
RE: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Yes, but not good, appears to be an issue solely with devg-extreme2.so.  I have filed PR67274 on your behalf.  Please 
escalate it with your techsupport/sales rep.

________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Mon 13/04/2009 5:41 AM
To: advanced-graphics
Subject: Re: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?



Any news ?

_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post26735



Attachment: Text winmail.dat 3.57 KB
Re: RE: RE: RE: RE: How to unset surface which was set by gf_layer_set_surfaces() ?  
Thanks, Derek !