1. 11 Oct, 2019 7 commits
  2. 09 Oct, 2019 1 commit
  3. 04 Oct, 2019 22 commits
    • Pekka Paalanen's avatar
      xwm: no need for compositor/weston.h · 7b679772
      Pekka Paalanen authored
      The xwayland plugin (XWM) is a libweston plugin, so it has no business using
      Weston things. Luckily its not, this was just a left-over include. Remove it to
      reduce confusion.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      7b679772
    • Pekka Paalanen's avatar
      build: simplify include_directories · 4f5e3601
      Pekka Paalanen authored
      Define common_inc which includes both public_inc and the project root directory.
      The project root directory will allow access to config.h and all the shared/
      headers.
      
      Replacing all custom '.', '..', '../..', '../shared' etc. include paths with
      common_inc reduces clutter in the target definitions and enforces the common
       #include directive style, as e.g. including shared/ headers without the
      subdirectory name no longer works.
      
      Unfortunately this does not prevent one from using private libweston headers
      with the usual include pattern for public headers.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      4f5e3601
    • Pekka Paalanen's avatar
      Unify the include style of shared/ headers · c232f8d9
      Pekka Paalanen authored
      When all shared/ headers are included in the same way, we can drop unnecessary
      include seach paths from the compiler.
      
      This include style was chosen because it is prevalent in the code base. Doing
      anything different would have been a bigger patch.
      
      This also means that we need to keep the project root directory in the include
      search path, which means that one could accidentally include private headers
      with
      
      	#include "libweston/dbus.h"
      
      or even
      
      	#include <libweston/dbus.h>
      
      IMO such problem is smaller than the churn caused by any of the alternatives,
      and we should be able to catch those in review. We might even be able to catch
      those with grep in CI if necessary.
      
      The "bad" include style was found with:
      $ for h in shared/*.h; do git grep -F $(basename $h); done | grep -vF '"shared/'
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      c232f8d9
    • Pekka Paalanen's avatar
      xwm: dnd does not need cairo-util.h · acf84fd2
      Pekka Paalanen authored
      Turns out dnd.c does not actually need cairo-util.h. This was found when
      unifying the include directives of all shared/ headers. Removing this makes one
      less place to fix.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      acf84fd2
    • Pekka Paalanen's avatar
      build: use dependency for matrix.c · b6c7a302
      Pekka Paalanen authored
      matrix.c needs to be built differently for a test program vs. everything else,
      so it cannot be in a helper lib. Instead, make a dependency object for it for
      easy use which always gets all the paths correct automatically.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      b6c7a302
    • Pekka Paalanen's avatar
      build: shells do not need matrix.c · 03eacfa6
      Pekka Paalanen authored
      Do not build matrix.c into the shell plugins. The matrix functions are exported
      by libweston.so and the shell plugins links to it.
      
      Found by inspection.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      03eacfa6
    • Pekka Paalanen's avatar
      gl-renderer: use EGLConfig printer for window outputs · 2f83c02e
      Pekka Paalanen authored
      Replace the old config printer with the new fancy one: less duplicate code,
      more details logged.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      2f83c02e
    • Pekka Paalanen's avatar
      gl-renderer: print detailed EGLConfig list · f2aa6408
      Pekka Paalanen authored
      Print details of all available EGLConfigs in case none match what we are
      looking for. This helps debugging.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      f2aa6408
    • Pekka Paalanen's avatar
      gl-renderer: improve get_egl_config errors · 6aadac71
      Pekka Paalanen authored
      Listing exactly what we were looking for but did not find should help debugging
      failures.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      6aadac71
    • Pekka Paalanen's avatar
      gl-renderer: prefer the base EGLConfig · 7ba4c515
      Pekka Paalanen authored
      If configless_context is not supported, we pick one EGLConfig as the "base
      config" because we have just one GL context and different configs between the
      context and EGLSurfaces might not work. Until now, we did not actually make
      sure to pick the base config.
      
      If the base config matches the requirements, prefer it. Only if it doesn't
      match, go looking for another config.
      
      This should give better chances of success on systems where configless_context
      is not supported by relying less on eglChooseConfig().
      
      Cc: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      7ba4c515
    • Pekka Paalanen's avatar
      gl-renderer: pbuffer config for non-surfaceless · 88e5fcb5
      Pekka Paalanen authored
      If we don't have the surfaceless_context extension, we create a pbuffer as a
      dummy surface to work with. If we also don't have configless_context, then it
      is possible the config used for creating the context does not support pbuffers.
      Therefore, if both conditions apply, we need to pick a config that supports
      both window and pbuffer surfaces.
      
      This makes the "base" config compatible, but it does not yet guarantee that we
      actually pick it again when creating the pbuffer surface. Fixing that is
      another patch.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      88e5fcb5
    • Pekka Paalanen's avatar
      gl-renderer: configs for pbuffers too · 5d6d2b10
      Pekka Paalanen authored
      Fold more code into the common config choosing, the pbuffer path this time.
      Simplifies code and allows gl_renderer_get_egl_config() to grow smarter in the
      future to guarantee config compatility in the absence of configless_context
      extension.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      5d6d2b10
    • Pekka Paalanen's avatar
      gl-renderer: remove EGLConfig attributes from API · 7cb7a678
      Pekka Paalanen authored
      Now that all backends pass in a list of acceptable DRM formats, that is used to
      determine if the EGLConfig has an alpha channel or not. Therefore the
      opaque_attribs and alpha_attribs are now useless, and we can remove the whole
      config_attribs argument from the API.
      
      gl_renderer_get_egl_config() uses an internal attrib list that matches at least
      the union of the opaque_attribs and alpha_attribs matches.
      
      Overall, behaviour should remain unchanged.
      
      The new attribute array becomes variable in the future, so it is left
      non-const.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      7cb7a678
    • Pekka Paalanen's avatar
      backend-x11: use DRM formats for EGLConfig · 9ddb3bc3
      Pekka Paalanen authored
      Define a specific DRM format for the GL-renderer to render in. It goes through
      fuzzy matching in egl-glue.c which ensures we get exactly the number of bits
      for each channel, but does not require an exact format match.
      
      This ensures we get the bit depth we expect instead of the first arbitrary
      EGLConfig.
      
      This should not change the current behaviour, because Mesa EGL takes care to
      order the configs as apps expect.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      9ddb3bc3
    • Pekka Paalanen's avatar
      backend-wayland: use DRM formats for EGLConfig · ed20b4d9
      Pekka Paalanen authored
      Define a specific DRM format for the GL-renderer to render in. It goes through
      fuzzy matching in egl-glue.c which ensures we get exactly the number of bits
      for each channel, but does not require an exact format match.
      
      This ensures we get the bit depth we expect instead of the first arbitrary
      EGLConfig.
      
      This should not change the current behaviour, because Mesa EGL takes care to
      order the configs as apps expect.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      ed20b4d9
    • Pekka Paalanen's avatar
      gl-renderer: fuzzy EGLConfig matching for non-GBM · 7cbafec8
      Pekka Paalanen authored
      Implement fuzzy EGLConfig pixel format matching, where we ensure that R, G, B
      and A channels have the expected number of bits exactly. This is used on EGL
      platforms where the EGLConfig native visual ID is not a DRM format code. On EGL
      GBM platform, the old exact matching of native visual ID is kept.
      
      As only the DRM backend uses a DRM format list for picking a config, this patch
      should not change any behaviour.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      7cbafec8
    • Pekka Paalanen's avatar
      gl-renderer: use pixel_format_info internally for EGL · c01ba92e
      Pekka Paalanen authored
      Using arrays of pixel_format_info instead of just DRM format codes is useful
      for fuzzy matching of formats with EGLConfigs in the future. The immediate
      benefit is that we can easily print format names in log messages.
      
      We should never deal with formats we don't have in our database, so discarding
      unknown formats should be ok. Using unknown formats would become hard later,
      too.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      c01ba92e
    • Pekka Paalanen's avatar
      pixel-formats: add RGBA bits and type fields · abd3f3c3
      Pekka Paalanen authored
      These fields are necessary when looking for an EGLConfig matching a pixel
      format, but the configs do not expose a native visual id. Such happens on the
      EGL surfaceless platform where one does not actually care about the exact pixel
      format, one just cares it has the right number of bits for each channel and the
      right component type.
      
      FP16 formats are coming, so this paves way for them too, allowing them to be
      described.
      
      The FIXED/FLOAT terminology comes from EGL_EXT_pixel_format_float.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      abd3f3c3
    • Pekka Paalanen's avatar
      gl-renderer: do not even pick a config with configless_context · ad8c7448
      Pekka Paalanen authored
      If configless context is supported, we can skip choosing the "base" config
      completely as it will never be used.
      
      This simplifies the code a little bit.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      ad8c7448
    • Pekka Paalanen's avatar
      gl-renderer: use gl_renderer_get_egl_config() for display_create · d8e85189
      Pekka Paalanen authored
      Replace a direct call to egl_choose_config() with a higher level function
      gl_renderer_get_egl_config(). This will make follow-up work easier when
      attribute lists will be generated inside gl_renderer_get_egl_config() instead
      of passed in as is.
      
      We explicitly replace visual_id with drm_formats, because that is what they
      really are. Only the DRM backend passes in other than NULL/0, and if other
      backends start caring about the actual pixel format, drm_format is the lingua
      franca.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      d8e85189
    • Pekka Paalanen's avatar
      gl_renderer: introduce gl_renderer_get_egl_config() · 8e42af02
      Pekka Paalanen authored
      In an attempt to pull more of EGLConfig choosing into one place, refactor code
      into the new gl_renderer_get_egl_config(). The purpose of this function is to
      find an EGL config that not only satisfies the requested attributes and the
      pixel formats if given but also makes sure the config is generally compatible
      with the single GL context we have.
      
      All this was already checked in gl_renderer_create_window_surface(), but
      gl_renderer_create_pbuffer_surface() is still missing it. This patch is
      preparation for fixing the pbuffer path.
      
      We explicitly replace visual_id with drm_formats, because that is what they
      really are. Only the DRM backend passes in other than NULL/0, and if other
      backends start caring about the actual pixel format, drm_format is the lingua
      franca.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      8e42af02
    • Pekka Paalanen's avatar
      gl-renderer: move into egl-glue.c · 5aaf8dc4
      Pekka Paalanen authored
      Start a new source file for EGL glue stuff, for the EGL platform Weston runs
      on. gl-renderer.c is getting too long, and I want to add even more boring code
      (config pretty-printing etc.).
      
      This pure code move, no changes.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      5aaf8dc4
  4. 02 Oct, 2019 1 commit
  5. 01 Oct, 2019 9 commits