Re: [waffle] [PATCH 00/11] Add new public func waffle_window_create2()
On Mon, Dec 22, 2014 at 8:11 PM, Chad Versace chad.vers...@intel.com wrote: On 12/21/2014 01:41 PM, Emil Velikov wrote: On 16 December 2014 at 08:18, Chad Versace chad.vers...@linux.intel.com wrote: Today, waffle_window() has only two parameters: width and height. Frank Henigman wants to extend Waffle's GBM backend with the ability to post window contents to the display. Multiple methods exist for posting content to the screen with the drm API, and that method should be configurable per waffle_window. Therefore, we need to be able to pass additional attributes to waffle_window_create(). It would also be nice to specify at time of creation that the waffle_window should be full screen. Again, we need to pass additional attributes to waffle_window_create(). The new function waffle_window_create2() is conceptually equivalent to the original waffle_window_create() with the addition of an attrib_list parameter. The only supported attributes are currently WAFFLE_WINDOW_WIDTH and WAFFLE_WINDOW_HEIGHT. I tested the new function on GLX, X11/EGL, Wayland, and GBM. I did not even test the build on Windows, Android, and Mac. Before merging this series, I will ensure it doesn't break the build on those platforms. I don't have the ability to actually test on Android or Windows, though. This patch series is available on my personal branch 'waffle_window_create2'. Hi Chad, Overall it looks very good imho. I've managed to spot only a few of trivial bits. Just a small note for future work - popping an attribute at a time, will become noticeable as the attribs list grows. Just as you, I winced when I wrote the code that popped one attribute at a time. I really wanted to write it better, but I repeated to myself the mantra pre-optimization is the root of all evil. The pop-one-at-a-time code is very easy to read in comparison to walk-the-list-once-and-pop-as-we-go code, so I think it's the better choice, at least until the attribute lists grow substantially longer. Also if you're not a fan of adding numbers at the end of function names you might use waffle_window_create_{with,from}_attibs I weighed the two naming conventions. I thought that, if we ever bump the signature for waffle_window_create again, then we might not be able to invent a creatively descriptive but short name for the new function. But good ole #3 is always there for us. Also, I tried typing waffle_window_create_attribs and waffle_window_create2 several times, and I just couldn't bring myself to make people to type a function name so lengthily Java-like. I assume you're not a fan of using 2? Another option is to break compatibility and rename the existing function waffle_window_create(_size,0,_old,_orig) and reuse the nice clean name for the nice new function. It seems an easy enough fix for people updating their waffle version. I'll do the chrome os test code, and piglit seems to have just one call to waffle_window_create. Are there many other users I don't know about? If you buy that, why not also change all the int32_t attribs[] signatures to intptr_t, and not keep around two versions of those functions. Seems like short term pain for long term gain, to me. ___ waffle mailing list waffle@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/waffle
Re: [waffle] [PATCH 00/11] Add new public func waffle_window_create2()
On 16 December 2014 at 08:18, Chad Versace chad.vers...@linux.intel.com wrote: Today, waffle_window() has only two parameters: width and height. Frank Henigman wants to extend Waffle's GBM backend with the ability to post window contents to the display. Multiple methods exist for posting content to the screen with the drm API, and that method should be configurable per waffle_window. Therefore, we need to be able to pass additional attributes to waffle_window_create(). It would also be nice to specify at time of creation that the waffle_window should be full screen. Again, we need to pass additional attributes to waffle_window_create(). The new function waffle_window_create2() is conceptually equivalent to the original waffle_window_create() with the addition of an attrib_list parameter. The only supported attributes are currently WAFFLE_WINDOW_WIDTH and WAFFLE_WINDOW_HEIGHT. I tested the new function on GLX, X11/EGL, Wayland, and GBM. I did not even test the build on Windows, Android, and Mac. Before merging this series, I will ensure it doesn't break the build on those platforms. I don't have the ability to actually test on Android or Windows, though. This patch series is available on my personal branch 'waffle_window_create2'. Hi Chad, Overall it looks very good imho. I've managed to spot only a few of trivial bits. Just a small note for future work - popping an attribute at a time, will become noticeable as the attribs list grows. Also if you're not a fan of adding numbers at the end of function names you might use waffle_window_create_{with,from}_attibs Thanks Emil ___ waffle mailing list waffle@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/waffle
[waffle] [PATCH 00/11] Add new public func waffle_window_create2()
Today, waffle_window() has only two parameters: width and height. Frank Henigman wants to extend Waffle's GBM backend with the ability to post window contents to the display. Multiple methods exist for posting content to the screen with the drm API, and that method should be configurable per waffle_window. Therefore, we need to be able to pass additional attributes to waffle_window_create(). It would also be nice to specify at time of creation that the waffle_window should be full screen. Again, we need to pass additional attributes to waffle_window_create(). The new function waffle_window_create2() is conceptually equivalent to the original waffle_window_create() with the addition of an attrib_list parameter. The only supported attributes are currently WAFFLE_WINDOW_WIDTH and WAFFLE_WINDOW_HEIGHT. I tested the new function on GLX, X11/EGL, Wayland, and GBM. I did not even test the build on Windows, Android, and Mac. Before merging this series, I will ensure it doesn't break the build on those platforms. I don't have the ability to actually test on Android or Windows, though. This patch series is available on my personal branch 'waffle_window_create2'. Chad Versace (11): core: Rename functions s/wcore_attrib_list/wcore_attrib_list32/ core: Define intptr_t variants of wcore_attrib_list functions waffle: Fix mismatch in waffle_window_create prototype waffle: Fix signature of wcore_platform::window::create() core: Add func wcore_error_bad_attribute core: Add attrib_list param to func wcore_platform::window::create core: Add func wcore_attrib_list_copy() core Add func wcore_attrib_list_pop() waffle: Add public func waffle_window_create2() tests/gl_basic: Update to use waffle_window_create2() examples/gl_basic: Update to use waffle_window_create2() examples/gl_basic.c | 10 +- include/waffle/waffle.h | 14 +++ man/waffle_enum.3.xml| 7 ++ man/waffle_window.3.xml | 27 + src/waffle/android/droid_window.c| 9 +- src/waffle/android/droid_window.h| 4 +- src/waffle/api/waffle_attrib_list.c | 8 +- src/waffle/api/waffle_window.c | 76 ++- src/waffle/cgl/cgl_window.h | 5 +- src/waffle/cgl/cgl_window.m | 13 ++- src/waffle/core/wcore_attrib_list.c | 141 ++- src/waffle/core/wcore_attrib_list.h | 40 +++- src/waffle/core/wcore_attrib_list_unittest.c | 112 ++--- src/waffle/core/wcore_config_attrs.c | 10 +- src/waffle/core/wcore_error.c| 8 ++ src/waffle/core/wcore_error.h| 4 + src/waffle/core/wcore_platform.h | 5 +- src/waffle/core/wcore_util.c | 2 + src/waffle/gbm/wgbm_window.c | 11 ++- src/waffle/gbm/wgbm_window.h | 5 +- src/waffle/glx/glx_window.c | 11 ++- src/waffle/glx/glx_window.h | 5 +- src/waffle/wayland/wayland_window.c | 11 ++- src/waffle/wayland/wayland_window.h | 5 +- src/waffle/wgl/wgl_window.c | 14 ++- src/waffle/wgl/wgl_window.h | 9 +- src/waffle/x11/x11_window.c | 4 +- src/waffle/x11/x11_window.h | 4 +- src/waffle/xegl/xegl_window.c| 10 +- src/waffle/xegl/xegl_window.h| 6 +- tests/functional/gl_basic_test.c | 9 +- 31 files changed, 480 insertions(+), 119 deletions(-) -- 2.2.0 ___ waffle mailing list waffle@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/waffle