[waffle] [PATCH] gbm: Don't use a config that mesa's gbm doesn't support

2015-02-11 Thread Tom Stellard
Using GBM_FORMAT_ABGR was causing the B and G components to
be swapped for some piglit tests.
---

I have no idea if this fix is correct, but based on an IRC discussion:
http://people.freedesktop.org/~cbrill/dri-log/?channel=dri-develdate=2015-02-05

Using the wrong format here is the reason that B and G outputs were swapped.
I'm not sure what format we should be using instead.

 src/waffle/gbm/wgbm_config.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/waffle/gbm/wgbm_config.c b/src/waffle/gbm/wgbm_config.c
index 480c2bf..5229210 100644
--- a/src/waffle/gbm/wgbm_config.c
+++ b/src/waffle/gbm/wgbm_config.c
@@ -50,10 +50,8 @@ wgbm_config_get_gbm_format(const struct wcore_config_attrs 
*attrs)
 return 0;
 }
 
-if (attrs-alpha_size = 0)
+if (attrs-alpha_size = 8)
 return GBM_FORMAT_XRGB;
-else if (attrs-alpha_size = 8)
-return GBM_FORMAT_ABGR;
 
 return 0;
 }
-- 
1.8.5.5

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


Re: [waffle] [wflinfo] [RFC] platform-specific info from wflinfo

2015-02-11 Thread Chad Versace
On 02/10/2015 01:20 PM, Frank Henigman wrote:
 On Tue, Feb 10, 2015 at 4:08 PM, Frank Henigman fjhenig...@google.com wrote:

 Looks like Issue #3 is the format of the information.  I thought it
 was given we should duplicate existing glxinfo/eglinfo/etc as closely
 as possible, in order to be a drop-in replacement, but if I follow the
 suggestions Chad made on github
 (https://github.com/fjhenigman/waffle/commit/d0b45bb9850e6ae29ee379a2d3e8ba14afc1b872)
 we'll be diverging.  Improving on existing tools is ok with me - I
 don't have a huge investment in code to parse their output - but I
 wonder if others feel differently.

(+Jordan, +Dylan, questions below)

Oh, when I made those Github comments, I didn't know you were trying to
duplicate glxinfo output verbatim. Now I understand why the GLX lines
look so different from wflinfo's current output.

glxinfo wraps long lines for extension strings and separates extension names 
with commas.
wflinfo intentionally prints extensions strings in their original form: single 
line,
extension names separated by spaces. If I recall correctly, Jordan and Dylan 
wanted
that format so that consumers who parsed wflinfo text output would be 
guaranteed a stable
format.

If wflinfo has mixed line formats (some lines are comma-separated and wrapped, 
some
are space-separated), I fear that may cause problems for already-existing 
consumers.
Dylan, Jordan, do you have an opinion here? Does this really matter?



signature.asc
Description: OpenPGP digital signature
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH] gbm: Don't use a config that mesa's gbm doesn't support

2015-02-11 Thread Chad Versace
On 02/11/2015 09:53 AM, Tom Stellard wrote:
 Using GBM_FORMAT_ABGR was causing the B and G components to
 be swapped for some piglit tests.
 ---
 
 I have no idea if this fix is correct, but based on an IRC discussion:
 http://people.freedesktop.org/~cbrill/dri-log/?channel=dri-develdate=2015-02-05
 
 Using the wrong format here is the reason that B and G outputs were swapped.
 I'm not sure what format we should be using instead.

This might fix the bug you're facing, but it continues the mistake that
caused the bug in the first place: Waffle is guessing, and guessing badly,
which GBM_FORMAT is backing the EGLConfig.

I think the correct fix is to eliminate the guessing. Rewriting
wgbm_config_get_gbm_format() to look like this should do the trick:

uint32_t
wgbm_config_get_gbm_format(struct wegl_config *wegl_config)
{
EGLint gbm_format;

...
ok = plat-eglGetConfigAttrib(..., EGL_NATIVE_VISUAL_ID, gbm_format);
if (!ok) {
   // emit error
   return 0;
}

return gbm_format;
}

Waffle's X11/EGL backend does something very similar when creating during window
creation. See 
[https://github.com/waffle-gl/waffle/blob/master/src/waffle/xegl/xegl_window.c#L79]

 
  src/waffle/gbm/wgbm_config.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/src/waffle/gbm/wgbm_config.c b/src/waffle/gbm/wgbm_config.c
 index 480c2bf..5229210 100644
 --- a/src/waffle/gbm/wgbm_config.c
 +++ b/src/waffle/gbm/wgbm_config.c
 @@ -50,10 +50,8 @@ wgbm_config_get_gbm_format(const struct wcore_config_attrs 
 *attrs)
  return 0;
  }
  
 -if (attrs-alpha_size = 0)
 +if (attrs-alpha_size = 8)
  return GBM_FORMAT_XRGB;
 -else if (attrs-alpha_size = 8)
 -return GBM_FORMAT_ABGR;
  
  return 0;
  }




signature.asc
Description: OpenPGP digital signature
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH v3] nacl: add implementation for waffle_window_swap_buffers

2015-02-11 Thread Chad Versace
On 02/09/2015 06:22 AM, Tapani Pälli wrote:
 Implementation for nacl is somewhat different as for other platforms,
 platform needs to ensure that the previous swap has finished before
 issuing GL commands or more swaps. This is done by introducing a worker
 thread that does buffer swaps from a work queue and uses a semaphore to
 lock main thread until swap is finished.
 
 v2: add error messaging if pp::Graphics3D::SwapBuffers fails
 add semaphore to implement blocking swap()
 remove extra nacl_swapbuffers() c++ function (Chad, Emil)
 
 v3: destroy semaphore when thread dies
 
 Signed-off-by: Tapani Pälli tapani.pa...@intel.com
 ---
  src/waffle/nacl/nacl_container.cpp | 12 +
  src/waffle/nacl/nacl_container.h   |  2 +-
  src/waffle/nacl/nacl_swap_thread.h | 94 
 ++
  src/waffle/nacl/nacl_window.c  |  3 +-
  4 files changed, 109 insertions(+), 2 deletions(-)
  create mode 100644 src/waffle/nacl/nacl_swap_thread.h
 
 diff --git a/src/waffle/nacl/nacl_container.cpp 
 b/src/waffle/nacl/nacl_container.cpp
 index fe907ff..84ab1da 100644
 --- a/src/waffle/nacl/nacl_container.cpp
 +++ b/src/waffle/nacl/nacl_container.cpp
 @@ -28,11 +28,13 @@
  #include ppapi/cpp/module.h
  #include ppapi/c/pp_errors.h
  #include nacl_container.h
 +#include nacl_swap_thread.h
  
  namespace waffle {
  
  struct nacl_container {
  pp::Graphics3D *ctx;
 +NaclSwapThread *swapper;
  
  void *glapi;
  bool (*glInitializePPAPI) (PPB_GetInterface);
 @@ -49,6 +51,7 @@ nacl_container_dtor(waffle::nacl_container *nc)
  if (nc-glapi)
  dlclose(nc-glapi);
  
 +delete nc-swapper;
  delete nc;
  }
  
 @@ -119,6 +122,7 @@ nacl_context_init(waffle::nacl_container *nc, struct 
 nacl_config *cfg)
  return false;
  }
  
 +nc-swapper = new NaclSwapThread(pp_instance, nc-ctx);
  return true;
  }
  
 @@ -194,3 +198,11 @@ nacl_makecurrent(nacl_container *nc, bool release)
  
  return true;
  }
 +
 +extern C bool
 +nacl_swapbuffers(nacl_container *nc)
 +{
 +waffle::nacl_container *cpp_nc =
 +reinterpret_castwaffle::nacl_container*(nc);
 +return cpp_nc-swapper-swap();
 +}
 diff --git a/src/waffle/nacl/nacl_container.h 
 b/src/waffle/nacl/nacl_container.h
 index ca26a1f..579856d 100644
 --- a/src/waffle/nacl/nacl_container.h
 +++ b/src/waffle/nacl/nacl_container.h
 @@ -43,7 +43,7 @@ bool nacl_context_init(struct nacl_container *nc, struct 
 nacl_config *cfg);
  bool nacl_resize(struct nacl_container *nc, int32_t width, int32_t height);
  bool nacl_makecurrent(struct nacl_container *nc, bool release);
  void nacl_context_fini(struct nacl_container *nc);
 -
 +bool nacl_swapbuffers(struct nacl_container *nc);
  #ifdef __cplusplus
  };
  #endif
 diff --git a/src/waffle/nacl/nacl_swap_thread.h 
 b/src/waffle/nacl/nacl_swap_thread.h
 new file mode 100644
 index 000..8e8687b
 --- /dev/null
 +++ b/src/waffle/nacl/nacl_swap_thread.h
 @@ -0,0 +1,94 @@
 +// Copyright 2014 Intel Corporation
 +//
 +// All rights reserved.
 +//
 +// Redistribution and use in source and binary forms, with or without
 +// modification, are permitted provided that the following conditions are 
 met:
 +//
 +// - Redistributions of source code must retain the above copyright notice, 
 this
 +//   list of conditions and the following disclaimer.
 +//
 +// - Redistributions in binary form must reproduce the above copyright 
 notice,
 +//   this list of conditions and the following disclaimer in the 
 documentation
 +//   and/or other materials provided with the distribution.
 +//
 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS 
 IS
 +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
 PURPOSE ARE
 +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
 LIABLE
 +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
 LIABILITY,
 +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
 USE
 +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 +
 +#include ppapi/cpp/graphics_3d.h
 +#include ppapi/cpp/instance.h
 +#include ppapi/utility/completion_callback_factory.h
 +#include ppapi/utility/threading/simple_thread.h
 +#include wcore_error.h
 +#include semaphore.h
 +
 +// Thread takes care that we do not issue another buffer
 +// swap before previous swap has completed.
 +class NaclSwapThread : public pp::SimpleThread
 +{
 +public:
 +explicit NaclSwapThread(const pp::InstanceHandle instance,
 +pp::Graphics3D *_ctx) :
 +pp::SimpleThread(instance),
 +ctx(_ctx),
 +cbf(this)
 +   

[waffle] EGL null platform

2015-02-11 Thread Chad Versace
Frank, I see in your Github repo that you're working on support for
Chrome OS's null platform. I'm looking forward to it, because some
of us in Intel would like to use it too. Do you have an idea when
it will be ready for upstreaming?



signature.asc
Description: OpenPGP digital signature
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [wflinfo] [RFC] platform-specific info from wflinfo

2015-02-11 Thread Jordan Justen
On 2015-02-11 18:01:26, Chad Versace wrote:
 On 02/10/2015 01:20 PM, Frank Henigman wrote:
  On Tue, Feb 10, 2015 at 4:08 PM, Frank Henigman fjhenig...@google.com 
  wrote:
 
  Looks like Issue #3 is the format of the information.  I thought it
  was given we should duplicate existing glxinfo/eglinfo/etc as closely
  as possible, in order to be a drop-in replacement

I don't think this is a goal of wflinfo.

I think a goal of wflinfo would be to provide all the same information
as glxinfo (but, mostly only in verbose mode), but I don't think it is
a goal to match the output format of glxinfo.

  , but if I follow the
  suggestions Chad made on github
  (https://github.com/fjhenigman/waffle/commit/d0b45bb9850e6ae29ee379a2d3e8ba14afc1b872)
  we'll be diverging.  Improving on existing tools is ok with me - I
  don't have a huge investment in code to parse their output - but I
  wonder if others feel differently.
 
 (+Jordan, +Dylan, questions below)
 
 Oh, when I made those Github comments, I didn't know you were trying
 to duplicate glxinfo output verbatim. Now I understand why the GLX
 lines look so different from wflinfo's current output.
 
 glxinfo wraps long lines for extension strings and separates
 extension names with commas. wflinfo intentionally prints extensions
 strings in their original form: single line, extension names
 separated by spaces. If I recall correctly, Jordan and Dylan wanted
 that format so that consumers who parsed wflinfo text output would
 be guaranteed a stable format.
 
 If wflinfo has mixed line formats (some lines are comma-separated
 and wrapped, some are space-separated), I fear that may cause
 problems for already-existing consumers. Dylan, Jordan, do you have
 an opinion here? Does this really matter?

I think you are right, and for consistency we should avoid adding
comma separation to values.

But, I think more importantly we wanted to have each line of output
follow a 'Field: Value' format.

Field obviously can't contain the ':' character, and we decided that
Value should not contain line breaks.

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