Commit Graph

2076 Commits

Author SHA1 Message Date
Dominique Martinet e86cd4dc33 wlr_pointer: fix potential null deref
if pointer is null here we'd access pointer->events... anyway
2018-03-22 21:27:49 +01:00
Dominique Martinet d5e14ab247 wayland backend: fix use-after free on output destroy
==12021==ERROR: AddressSanitizer: heap-use-after-free on address 0x617000015698 at pc 0x7f1a9abe1c09 bp 0x7ffe9068f6b0 sp 0x7ffe9068f6a0
WRITE of size 4 at 0x617000015698 thread T0
    #0 0x7f1a9abe1c08 in pointer_handle_leave ../backend/wayland/wl_seat.c:40
    #1 0x7f1a96ae7d1d in ffi_call_unix64 (/lib64/libffi.so.6+0x5d1d)
    #2 0x7f1a96ae768e in ffi_call (/lib64/libffi.so.6+0x568e)
    #3 0x7f1a988e0d8a  (/lib64/libwayland-client.so.0+0x8d8a)
    #4 0x7f1a988dd927  (/lib64/libwayland-client.so.0+0x5927)
    #5 0x7f1a988debe3 in wl_display_dispatch_queue_pending (/lib64/libwayland-client.so.0+0x6be3)
    #6 0x7f1a9abdd6d6 in dispatch_events ../backend/wayland/backend.c:28
    #7 0x7f1a9a968c11 in wl_event_loop_dispatch (/lib64/libwayland-server.so.0+0x9c11)
    #8 0x7f1a9a967449 in wl_display_run (/lib64/libwayland-server.so.0+0x8449)
    #9 0x418dff in main ../rootston/main.c:81
    #10 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #11 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9)

0x617000015698 is located 664 bytes inside of 696-byte region [0x617000015400,0x6170000156b8)
freed by thread T0 here:
    #0 0x7f1a9af754b8 in __interceptor_free (/lib64/libasan.so.4+0xde4b8)
    #1 0x7f1a9abe01ee in wlr_wl_output_destroy ../backend/wayland/output.c:194
    #2 0x7f1a9ac12918 in wlr_output_destroy ../types/wlr_output.c:299
    #3 0x7f1a9abe061b in xdg_toplevel_handle_close ../backend/wayland/output.c:255
    #4 0x7f1a96ae7d1d in ffi_call_unix64 (/lib64/libffi.so.6+0x5d1d)
    #5 0x7f1a96ae768e in ffi_call (/lib64/libffi.so.6+0x568e)
    #6 0x7f1a988e0d8a  (/lib64/libwayland-client.so.0+0x8d8a)
    #7 0x7f1a988dd927  (/lib64/libwayland-client.so.0+0x5927)
    #8 0x7f1a988debe3 in wl_display_dispatch_queue_pending (/lib64/libwayland-client.so.0+0x6be3)
    #9 0x7f1a9abdd6d6 in dispatch_events ../backend/wayland/backend.c:28
    #10 0x7f1a9a968c11 in wl_event_loop_dispatch (/lib64/libwayland-server.so.0+0x9c11)
    #11 0x7f1a9a967449 in wl_display_run (/lib64/libwayland-server.so.0+0x8449)
    #12 0x418dff in main ../rootston/main.c:81
    #13 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #14 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9)

previously allocated by thread T0 here:
    #0 0x7f1a9af75a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
    #1 0x7f1a9abe0703 in wlr_wl_output_create ../backend/wayland/output.c:272
    #2 0x7f1a9abdd8eb in wlr_wl_backend_start ../backend/wayland/backend.c:55
    #3 0x7f1a9abbeb49 in wlr_backend_start ../backend/backend.c:28
    #4 0x7f1a9abd8ce1 in multi_backend_start ../backend/multi/backend.c:24
    #5 0x7f1a9abbeb49 in wlr_backend_start ../backend/backend.c:28
    #6 0x418c32 in main ../rootston/main.c:58
    #7 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #8 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9)
2018-03-22 21:27:49 +01:00
Dominique Martinet b0c2bbebd1 x11 backend: fix various leaks
- xcb_query_pointer_reply return value needs to be freed
 - call XCloseDisplay
 - remove wl event_source
2018-03-22 21:25:41 +01:00
Dominique Martinet d9a3c66942 rootston/output: fix leak in damage_from_surface 2018-03-22 21:25:41 +01:00
Dominique Martinet de955a0f63 xdg_popup_grab: add listener on seat destroy 2018-03-22 21:25:41 +01:00
Drew DeVault ff2e08aa74
Merge pull request #736 from agx/gles2-tex-target
Gles2 tex target
2018-03-20 13:16:30 -04:00
Guido Günther 2d01663b25 gles2: Honor alpha in fragment_src_external
By using the same vertex shader and adding alpha to the fragment shader
for external textures we can:

  - use alpha blending
  - have wlr_gles2_render_texture_with_matrix work with
    the GL_TEXTURE_EXTERNAL_OES. So far this failed
    since we passed in alpha which was unknown by fragment_src_external
2018-03-20 14:30:30 +01:00
Guido Günther 13e4ba4867 gles2_texture_bind: use texture's target type
Hardcoding GL_TEXTURE_2D leads to rendering errors when using
GL_TEXTURE_EXTERNAL_OES textures.
2018-03-20 14:30:30 +01:00
Guido Günther b3cb5a36c7 gles2: allow to specify texture target type
Allow to set the texture target type when generating/binding the
texture.  This allows us to attach the texture type to the texture so we
don't have to keep the logic elsewhere.
2018-03-20 14:30:30 +01:00
Drew DeVault 453516a621
Merge pull request #735 from emersion/split-render-h
render: split render.h into wlr_renderer.h and wlr_texture.h
2018-03-19 18:21:41 -04:00
emersion c41de2d1be
render: split render.h into wlr_renderer.h and wlr_texture.h 2018-03-19 23:16:29 +01:00
Drew DeVault a76cef475b
Merge pull request #733 from emersion/fix-matrix-transpose
Don't use OpenGL matrix transposition
2018-03-19 16:36:17 -04:00
Drew DeVault 8d490fdb34 Write some more docs 2018-03-19 15:46:28 -04:00
emersion 6ecb0eefcb
render/gles2: transpose matrices before binding them
Setting glUniformMatrix3fv's transpose parameter to GL_TRUE is
not allowed for OpenGL ES 2.

This adds a wlr_matrix_transpose function.
2018-03-19 20:21:02 +01:00
emersion 6227da96b1
backend/drm: don't hardcode matrix 2018-03-18 11:34:23 +01:00
emersion bfc9b13dcd
Merge pull request #730 from martinetd/matrix_rotate
Rootston: fix rotation heading (was: wlr_matrix: fix matrix_rotate)
2018-03-18 09:25:33 +01:00
Dominique Martinet a491f780b8 rootston rotation: change view->rotation sign
The convetion with wlr_matrix changed and it's a good time to remove
all these pesky minus signs
2018-03-18 09:19:09 +01:00
Drew DeVault 1956d3cedb
Merge pull request #722 from emersion/matrix-redesign
Matrix redesign
2018-03-17 15:22:00 -04:00
Tony Crisci 09413aa7f1
Merge pull request #711 from emersion/map-unmap
Add map/unmap to xdg-shell
2018-03-17 10:00:54 -04:00
emersion 9cc875429b
Merge pull request #726 from agx/egl-print-dmabuf-formats
egl: print supported dmabuf formats
2018-03-16 09:52:27 +01:00
Guido Günther 7fd7dff26f egl: print supported dmabuf formats
Useful for debugging dmabuf related problems e.g. when a client requests
a certain and we fail to support it.
2018-03-16 09:47:21 +01:00
emersion 303883ce49
rootston: properly emit view unmap event 2018-03-15 21:47:20 +01:00
Tony Crisci 8ad0c5376c
Merge pull request #721 from emersion/simplify-screenshot-client
examples: simplify screenshot client
2018-03-15 16:42:10 -04:00
emersion f1cbbac636
render/gles2: remove matrix transposition in shaders 2018-03-15 21:30:31 +01:00
emersion 7894fca224
matrix: rename wlr_matrix_texture to wlr_matrix_projection 2018-03-15 21:26:45 +01:00
emersion e607d0f7ee
xdg-shell: add map/unmap support 2018-03-15 20:15:09 +01:00
emersion 42cc575266
xdg-shell-v6: fix wl_list_remove called twice 2018-03-15 20:14:47 +01:00
emersion 361d7c857e
xdg-shell-v6: don't leak wlr_xdg_surface_v6_configure.toplevel_state 2018-03-15 19:40:57 +01:00
emersion 876f07e9f1
renderer: replace wlr_texture_get_matrix by wlr_render_texture 2018-03-15 19:31:02 +01:00
emersion 1914a1aa2b
surface: drop wlr_surface_get_matrix 2018-03-15 18:35:22 +01:00
Drew DeVault 7d3c4c2450
Merge pull request #723 from emersion/fix-xwayland-inverted-y
Fix y-inverted rendering for xwayland surfaces
2018-03-15 10:59:28 -04:00
emersion 0e253e0615
render/gles2: don't set inverted_y when EGL_WAYLAND_Y_INVERTED_WL is unsupported 2018-03-15 15:51:15 +01:00
emersion 8b58e1a3ad
Merge branch 'master' into matrix-redesign 2018-03-15 15:48:09 +01:00
emersion 824a95ad19
matrix: use 2D matrices 2018-03-15 15:33:58 +01:00
emersion de0e40d621
Merge pull request #698 from agx/linux-dmabuf
Add initial linux_dmabuf protocol support
2018-03-15 12:45:07 +01:00
Guido Günther 653bc282a7 Indent GLSL by two spaces
since this is the most established indentation
2018-03-15 12:40:18 +01:00
Guido Günther eb4337b5ee Wire up linux_dmabuf in rootston 2018-03-15 12:40:18 +01:00
Guido Günther 14cdb6153f Add initial linux_dmabuf protocol support
Tested with

    ./weston-simple-dmabuf-drm
    ./weston-simple-dmabuf-drm --import-immediate=1
    ./weston-simple-dmabuf-drm --y-inverted=1
    (and combinations)

Supports only single plane XRGB dmabufs for now.
2018-03-15 12:40:18 +01:00
emersion d26b67cb06
matrix: unify API, don't use array pointers 2018-03-15 11:10:56 +01:00
emersion b6a3f240c7
matrix: move to types/ 2018-03-15 09:11:27 +01:00
emersion 3bd1d876ae
examples: simplify screenshot client 2018-03-14 19:21:36 +01:00
Drew DeVault 85da9df807
Merge pull request #719 from acrisci/xdg-toplevel-role
differentiate xdg-toplevel roles
2018-03-13 19:18:47 -04:00
Tony Crisci b2926a6c62 differentiate xdg-toplevel roles 2018-03-13 19:11:02 -04:00
emersion dd8a7a29e1
rootston: don't center view if maximized 2018-03-14 00:01:28 +01:00
emersion ace738dbca
xdg-shell-v6: next_geometry and geometry fields are not longer pointers in wlr_xdg_surface_v6 2018-03-13 22:17:25 +01:00
emersion 149209b72e
xdg-shell-v6: rename toplevel and popup fields in wlr_xdg_surface_v6 for consistency 2018-03-13 22:09:44 +01:00
emersion 657e5c8c0d
xdg-shell-v6: changed wlr_xdg_surface_v6_configure.toplevel_state to be NULL if surface isn't a toplevel 2018-03-13 22:05:35 +01:00
emersion e74ddaaf10
xdg-shell-v6: redesign the configure/ack_configure workflow 2018-03-13 19:57:21 +01:00
emersion 125138f1a0
rootston: unmap view after emitting destroy signal in view_destroy 2018-03-13 12:34:29 +01:00
emersion c1c88bfe5d
rootston: destroy seat view on unmap 2018-03-13 12:31:45 +01:00