aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/renderer.c
AgeCommit message (Collapse)Author
2020-05-20render/egl: unset current context after swapping buffersSimon Ser
After swapping buffers, it doesn't make sense to perform more rendering operations. Unset the context to reflect this. This commit makes it so the context is always only current between wlr_egl_make_current and wlr_egl_swap_buffers. This is an alternative to [1]. [1]: https://github.com/swaywm/wlroots/pull/2212
2020-05-19backend/drm: add missing wlr_egl_unset_currentSimon Ser
2020-05-19backend/drm: fix current EGL context on multi-GPUSimon Ser
get_tex_for_bo changes the current EGL context. Rendering operations must immediately follow drm_surface_make_current. Closes: https://github.com/swaywm/wlroots/issues/2209
2020-04-29backend/drm: strip alpha channel if necessarySimon Ser
Some primary planes don't support ARGB8888, they only support XRGB8888 (for instance on older Intel hardware). The DRM backend would fail to initialize. When that's the case, try to allocate buffers without an alpha channel.
2020-04-28backend/drm: introduce wlr_drm_fbScott Anderson
This is a type which manages gbm_surfaces and imported dmabufs in the same place, and makes the lifetime management between the two shared. It should lead to easier to understand code, and fewer special cases. This also contains a fair bit of refactoring to start using this new type. Co-authored-by: Simon Ser <contact@emersion.fr>
2020-04-09backend: set EGL_RENDERABLE_TYPE and EGL_SURFACE_TYPESimon Ser
Ensure these are set to the correct value.
2019-12-20Refactor EGL/GL API loadingSimon Ser
Remove glapi.sh code generation, replace it with hand-written loading code that checks extension strings before calling eglGetProcAddress. The GLES2 renderer still uses global state because of: - {PUSH,POP}_GLES2_DEBUG macros - wlr_gles2_texture_from_* taking a wlr_egl instead of the renderer
2019-12-05backend/drm: fix segfault in init_drm_surfaceSimon Ser
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: https://github.com/swaywm/wlroots/issues/1868 Closes: https://github.com/swaywm/wlroots/issues/1874 Closes: https://github.com/swaywm/sway/issues/4785 Closes: https://github.com/swaywm/sway/issues/4717 Closes: https://github.com/swaywm/sway/issues/4730 Fixes: 2bdd1d0896cc ("backend/drm: use modifiers for our GBM buffers")
2019-10-23backend/drm: retry without modifiers for the primary planeSimon Ser
On some Intel cards using modifiers can fill the FIFO and prevent hotplugged outputs from being properly enabled. Add a fallback without modifiers. Fixes: 2bdd1d0896cc ("backend/drm: use modifiers for our GBM buffers") References: https://github.com/swaywm/wlroots/issues/1840 Closes: https://github.com/swaywm/wlroots/issues/1852
2019-10-11backend/drm: use modifiers for our GBM buffersSimon Ser
2019-09-26drm: use IMPORT_FD for INVALID modifierIvan Molodetskikh
GBM_BO_IMPORT_FD_MODIFIER doesn't accept the INVALID modifier.
2019-06-07backend/drm: add basic support for direct scan-outemersion
2019-04-22Fix missing headers when building without X11Alyssa Ross
The deleted includes are redundant, because other headers will include the necessary files. Additionally, they cause build failures, because including EGL/egl.h or EGL/eglext.h directly, instead of through wlr/render/egl.h or wlr/render/interface.h, will mean that MESA_EGL_NO_X11_HEADERS will not have been defined, and so the EGL headers will attempt to pull in unnecessary X11 headers that may not exist on the system. For the headers produced by glgen.sh, the includes couldn't simply be deleted, because no other header would include the EGL headers. Neither wlr/render/egl.h or wlr/render/interface.h felt appropriate to include, so I opted instead to copy the MESA_EGL_NO_X11_HEADERS definition before the EGL includes.
2019-02-14Copy cursor surface to secondary gpu if necessaryVincent Vanlaer
2019-01-29Require libdrm >= 2.4.95emersion
2019-01-29backend/drm: fix GBM format mismatchemersion
We create the EGL config with GBM_FORMAT_ARGB8888, but then initialize GBM BOs with GBM_FORMAT_XRGB8888. This mismatch confuses Mesa. Instead, we can always use GBM_FORMAT_ARGB8888, and use DRM_FORMAT_XRGB8888 when calling drmModeAddFB2. Fixes https://github.com/swaywm/wlroots/issues/1438
2018-11-04backend/drm: specify minimum config attributesemersion
Since the format used by DRM is GBM_FORMAT_ARGB8888, we need at least a R, G, B and A channel.
2018-08-04Remove unused data from gbm_bo userdataScott Anderson
These aren't used anymore and crashes when the gbm_bo tries to get destroyed (e.g. on hotplug).
2018-08-03multi-gpu: do not flip screens on secondary GPUMariusz Bialonczyk
All screens on secondary GPU in multiple GPU configurations was flipped 180. The flipped screens was always on secondary card (the primary card was always correct). Tested on nouveau with: WLR_DRM_DEVICES=/dev/dri/card1:/dev/dri/card2 WLR_DRM_DEVICES=/dev/dri/card2:/dev/dri/card1 The commit is fixing this problem. Now all screens are "normal".
2018-07-09util: add wlr_ prefix to log symbolsemersion
2018-05-31Merge branch 'master' into screencontentemersion
2018-05-30Only allow one modifier per DMA-BUF, split attributes struct in render/emersion
2018-05-29backend/drm: support multi-planar DMA-BUFs when exportingemersion
2018-05-29output, backend/drm: add wlr_output_export_dmabufemersion
2018-05-25backends: implement custom EGL and renderer initializationIlia Bozhinov
Compositors now have more control over how the backend creates its renderer. Currently all backends create an EGL/GLES2 renderer, so the necessary attributes for creating the context are passed to a user-provided callback function. It is responsible for initializing provided wlr_egl and to return a renderer. On fail, return 0. Fixes #987
2018-04-25Make sure we don't use others' prefixesemersion
2018-04-25Remove wlr_ prefix from local symbolsemersion
2018-04-25render/egl: allow passing NULL to surface and image destructorsemersion
2018-04-24render/egl: add wlr_egl_destroy_surfaceemersion
2018-03-31Untie wlr_backend from wlr_rendereremersion
2018-03-26Use DRM_FORMAT_MOD_LINEAR instead of a hardcoded constantemersion
2018-03-24Redesign wlr_textureemersion
- Textures are now immutable (apart from those created from raw pixels), no more invalid textures - Move all wl_drm stuff in wlr_renderer - Most of wlr_texture fields are now private - Remove some duplicated DMA-BUF code in the DRM backend - Add more assertions - Stride is now always given as bytes rather than pixels - Drop wl_shm functions Fun fact: this patch has been written 10,000 meters up in the air.
2018-03-23Merge branch 'master' into gles2-renderer-redesignemersion
2018-03-21render/egl: use EGL_KHR_debugemersion
2018-03-21render/gles2: make wlr_renderer_begin take viewport sizeemersion
This allows raw GL calls outside wlr_renderer to be removed.
2018-03-19render: split render.h into wlr_renderer.h and wlr_texture.hemersion
2018-03-18backend/drm: don't hardcode matrixemersion
2018-03-15matrix: use 2D matricesemersion
2018-03-15matrix: unify API, don't use array pointersemersion
2018-03-15matrix: move to types/emersion
2018-02-25Add alpha to wlr_render_with_matrixGuido Günther
so we can use the alpha channel to e.g. blend in textures
2018-02-12Reformat all #include directivesemersion
2018-02-09Swap buffers with damageemersion
2018-02-03Merge remote-tracking branch 'upstream/master' into output-damageemersion
2018-01-29Clean up the gbm/egl as wellMarkus Ongyerth
2018-01-29relases gbm buffers on initMarkus Ongyerth
The wlr_drm_surface_init function is called (upon others) when the drm mode is changed. When the surface was used previously this replaced the gbm_surface, but did not replace the gbm buffers (front/back). With this, wlr_drm_surface_get_from never set up the new buffers with the new glViewport because surf->front existed. This frees the buffers to get new buffers on the new surface with the new viewport.
2018-01-21output: add damage tracking via buffer ageemersion
2017-12-17Refactor wlr_egl_init to accept config_attribsemersion
2017-12-08Listen to display destroy in xwayland, rename wlr_egl_freeemersion
2017-11-30Use correct include path for glapi.hScott Anderson