Re: [waffle] [PATCH 0/6] wflinfo: Make wflinfo understand OpenGL 3.1 profiles

2014-04-30 Thread Chad Versace
On Mon, Apr 28, 2014 at 11:23:13PM -0700, Jordan Justen wrote:
 On Mon, Apr 28, 2014 at 8:43 PM, Chad Versace
 chad.vers...@linux.intel.com wrote:
  After this series, the following all do what the user wants them to do.
  wflinfo --api=gl --version=3.1
  wflinfo --api=gl --version=3.1 --profile=none
  wflinfo --api=gl --version=3.1 --profile=core
  wflinfo --api=gl --version=3.1 --profile=compat
 
  Likewise, if the user provided a profile but no version, like this...
  wflinfo --api=gl --profile=core
  wflinfo --api=gl --profile=compat
  then wflinfo will also try creating an OpenGL 3.1 context.
 
  DISCLAIMER: I've only tested these patches on Intel Ivybride, which exposes
  only core profile for OpenGL 3.1 and above. Someone really needs to test 
  this
  on a system that exposes an OpenGL 3.1 compatibility context, but I don't 
  have
  access to one. If no one steps up to test that, then we can commit now and
  fix bugs later.
 
 Patches 1-4 Reviewed-by: Jordan Justen jordan.l.jus...@intel.com
 
 These results (on nvidia with GL 4.4) could be better:
 
 $ bin/wflinfo -p glx -a gl -V 3.1 --profile=core
 Waffle error: 0x0 WAFFLE_NO_ERROR
 
 $ bin/wflinfo -p glx -a gl -V 3.1 --profile=compat
 Waffle error: 0x0 WAFFLE_NO_ERROR
 
 Removing -V works as expected though.
 
 origin/master gives:
 
 $ bin/wflinfo -p glx -a gl -V 3.1 --profile=core
 Waffle error: 0x8 WAFFLE_ERROR_BAD_ATTRIBUTE: for OpenGL  3.2,
 WAFFLE_CONTEXT_PROFILE must be WAFFLE_NONE
 
 $ bin/wflinfo -p glx -a gl -V 3.1 --profile=compat
 Waffle error: 0x8 WAFFLE_ERROR_BAD_ATTRIBUTE: for OpenGL  3.2,
 WAFFLE_CONTEXT_PROFILE must be WAFFLE_NONE

Ivybridge looks good.Here's my output.

$ bin/wflinfo -p gbm -a gl -V 3.1 --profile=core
Wflinfo: Creation of an OpenGL = 3.1 context succeeded, but it
  had the wrong profile.  Fallback to requesting an OpenGL = 3.2
  context, which is guaranteed to have the correct profile if
  context creation succeeds.
Waffle platform: gbm
Waffle api: gl
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL version string: 3.3 (Core Profile) Mesa 10.2.0-devel (git-410d7ae)
OpenGL context flags: 0x0

$ bin/wflinfo -p gbm -a gl -V 3.1 --profile=compat
Wflinfo: Creation of an OpenGL = 3.1 context succeeded, but it
  had the wrong profile.  Fallback to requesting an OpenGL = 3.2
  context, which is guaranteed to have the correct profile if
  context creation succeeds.
Wflinfo error: Failed to create an OpenGL 3.1 or later context with requested 
profile

I'm looking at the code now trying to understand why NVidia fails.
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 0/6] wflinfo: Make wflinfo understand OpenGL 3.1 profiles

2014-04-30 Thread Chad Versace
On Wed, Apr 30, 2014 at 07:25:39PM -0700, Chad Versace wrote:
 On Mon, Apr 28, 2014 at 11:23:13PM -0700, Jordan Justen wrote:

  These results (on nvidia with GL 4.4) could be better:
  
  $ bin/wflinfo -p glx -a gl -V 3.1 --profile=core
  Waffle error: 0x0 WAFFLE_NO_ERROR
  
  $ bin/wflinfo -p glx -a gl -V 3.1 --profile=compat
  Waffle error: 0x0 WAFFLE_NO_ERROR
  
  Removing -V works as expected though.


My best guess is that waffle_make_current() fails here.

// The user cares about the profile. We must bind the context to inspect
// its profile.
//
// Skip window creation. No window is needed when binding an OpenGL = 3.0
// context.
ok = waffle_make_current(dpy, NULL, ctx);
if (!ok) {
error_waffle();
}

On GLX, that doesn't set waffle_error because this code in glx_platform.c is 
stupid:

static inline Bool
wrapped_glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
{
X11_SAVE_ERROR_HANDLER
Bool ok = glXMakeCurrent(dpy, drawable, ctx);
X11_RESTORE_ERROR_HANDLER
return ok;
}

Can you confirm if my guess is correct? Maybe by dropping this into the GLX 
function:

  if (!ok) {
  wcore_errorf(WAFFLE_ERROR_UNKNOWN,
  Chad forgot to catch GLX errors);
  }

Well... I may have forgot to catch GLX errors, but it used to be worse. Xlib's
default error handler would kill the process on GLX error.
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 0/6] wflinfo: Make wflinfo understand OpenGL 3.1 profiles

2014-04-30 Thread Jordan Justen
On Wed, Apr 30, 2014 at 7:36 PM, Chad Versace
chad.vers...@linux.intel.com wrote:
 On Wed, Apr 30, 2014 at 07:25:39PM -0700, Chad Versace wrote:
 On Mon, Apr 28, 2014 at 11:23:13PM -0700, Jordan Justen wrote:

  These results (on nvidia with GL 4.4) could be better:
 
  $ bin/wflinfo -p glx -a gl -V 3.1 --profile=core
  Waffle error: 0x0 WAFFLE_NO_ERROR
 
  $ bin/wflinfo -p glx -a gl -V 3.1 --profile=compat
  Waffle error: 0x0 WAFFLE_NO_ERROR
 
  Removing -V works as expected though.


 My best guess is that waffle_make_current() fails here.

 // The user cares about the profile. We must bind the context to inspect
 // its profile.
 //
 // Skip window creation. No window is needed when binding an OpenGL = 3.0
 // context.
 ok = waffle_make_current(dpy, NULL, ctx);
 if (!ok) {
 error_waffle();
 }

 On GLX, that doesn't set waffle_error because this code in glx_platform.c is 
 stupid:

 static inline Bool
 wrapped_glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
 {
 X11_SAVE_ERROR_HANDLER
 Bool ok = glXMakeCurrent(dpy, drawable, ctx);
 X11_RESTORE_ERROR_HANDLER
 return ok;
 }

 Can you confirm if my guess is correct? Maybe by dropping this into the GLX 
 function:

   if (!ok) {
   wcore_errorf(WAFFLE_ERROR_UNKNOWN,
   Chad forgot to catch GLX errors);
   }

Yep, adding this into wrapped_glXMakeCurrent makes it print that error.

-Jordan


 Well... I may have forgot to catch GLX errors, but it used to be worse. Xlib's
 default error handler would kill the process on GLX error.
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 0/6] wflinfo: Make wflinfo understand OpenGL 3.1 profiles

2014-04-29 Thread Jordan Justen
On Mon, Apr 28, 2014 at 8:43 PM, Chad Versace
chad.vers...@linux.intel.com wrote:
 After this series, the following all do what the user wants them to do.
 wflinfo --api=gl --version=3.1
 wflinfo --api=gl --version=3.1 --profile=none
 wflinfo --api=gl --version=3.1 --profile=core
 wflinfo --api=gl --version=3.1 --profile=compat

 Likewise, if the user provided a profile but no version, like this...
 wflinfo --api=gl --profile=core
 wflinfo --api=gl --profile=compat
 then wflinfo will also try creating an OpenGL 3.1 context.

 DISCLAIMER: I've only tested these patches on Intel Ivybride, which exposes
 only core profile for OpenGL 3.1 and above. Someone really needs to test this
 on a system that exposes an OpenGL 3.1 compatibility context, but I don't have
 access to one. If no one steps up to test that, then we can commit now and
 fix bugs later.

Patches 1-4 Reviewed-by: Jordan Justen jordan.l.jus...@intel.com

These results (on nvidia with GL 4.4) could be better:

$ bin/wflinfo -p glx -a gl -V 3.1 --profile=core
Waffle error: 0x0 WAFFLE_NO_ERROR

$ bin/wflinfo -p glx -a gl -V 3.1 --profile=compat
Waffle error: 0x0 WAFFLE_NO_ERROR

Removing -V works as expected though.

origin/master gives:

$ bin/wflinfo -p glx -a gl -V 3.1 --profile=core
Waffle error: 0x8 WAFFLE_ERROR_BAD_ATTRIBUTE: for OpenGL  3.2,
WAFFLE_CONTEXT_PROFILE must be WAFFLE_NONE

$ bin/wflinfo -p glx -a gl -V 3.1 --profile=compat
Waffle error: 0x8 WAFFLE_ERROR_BAD_ATTRIBUTE: for OpenGL  3.2,
WAFFLE_CONTEXT_PROFILE must be WAFFLE_NONE

-Jordan

 This series lives on my wflinfo-3.1-v04 branch at
 https://github.com/chadversary/waffle/tree/wflinfo-3.1-v04

 I believe this is final feature needed for waffle-1.4.

 So, after this series lands and the few remaining 1.4 blocker issues on
 https://github.com/waffle-gl/waffle/issues?milestone=1state=open get 
 resolved,
 I'll send out a wafle-1.4 release candidate announcement.

 Chad Versace (6):
   wflinfo: Don't modify struct options after initialization
   wflinfo: Cleanup signature of wflinfo_try_create_context()
   wflinfo: Cleanup signature of wflinfo_create_context()
   wflinfo: Replace s/-1/WAFFLE_DONT_CARE/ when relevant
   wflinfo: Distinguish between cmdline options and func options
   wflinfo: Make wflinfo understand OpenGL 3.1 profiles

  src/utils/wflinfo.c | 355 
 +---
  1 file changed, 307 insertions(+), 48 deletions(-)

 --
 1.9.0

 ___
 waffle mailing list
 waffle@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/waffle
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


[waffle] [PATCH 0/6] wflinfo: Make wflinfo understand OpenGL 3.1 profiles

2014-04-28 Thread Chad Versace
After this series, the following all do what the user wants them to do.
wflinfo --api=gl --version=3.1
wflinfo --api=gl --version=3.1 --profile=none
wflinfo --api=gl --version=3.1 --profile=core
wflinfo --api=gl --version=3.1 --profile=compat

Likewise, if the user provided a profile but no version, like this...
wflinfo --api=gl --profile=core
wflinfo --api=gl --profile=compat
then wflinfo will also try creating an OpenGL 3.1 context.

DISCLAIMER: I've only tested these patches on Intel Ivybride, which exposes
only core profile for OpenGL 3.1 and above. Someone really needs to test this
on a system that exposes an OpenGL 3.1 compatibility context, but I don't have
access to one. If no one steps up to test that, then we can commit now and
fix bugs later.

This series lives on my wflinfo-3.1-v04 branch at
https://github.com/chadversary/waffle/tree/wflinfo-3.1-v04

I believe this is final feature needed for waffle-1.4.

So, after this series lands and the few remaining 1.4 blocker issues on
https://github.com/waffle-gl/waffle/issues?milestone=1state=open get resolved,
I'll send out a wafle-1.4 release candidate announcement.

Chad Versace (6):
  wflinfo: Don't modify struct options after initialization
  wflinfo: Cleanup signature of wflinfo_try_create_context()
  wflinfo: Cleanup signature of wflinfo_create_context()
  wflinfo: Replace s/-1/WAFFLE_DONT_CARE/ when relevant
  wflinfo: Distinguish between cmdline options and func options
  wflinfo: Make wflinfo understand OpenGL 3.1 profiles

 src/utils/wflinfo.c | 355 +---
 1 file changed, 307 insertions(+), 48 deletions(-)

-- 
1.9.0

___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle