1
0
Fork 0
mutter-performance-source/src/backends
Pekka Paalanen d4bea60e1a renderer/native: use cogl for CPU copy path
Use cogl_framebuffer_read_pixels_into_bitmap () instead of
glReadPixels () for the CPU copy path in multi-GPU support.

The cogl function employs several tricks to make the read-pixels as fast
as possible and does the y-flip as necessary. This should make the copy
more performant over all kinds of hardware.

This is expected to be used on virtual outputs (e.g. DisplayLink USB
docks and monitors) foremost, where the dumb buffer memory is just
regular system memory. If the dumb buffer memory is somehow slow, like
residing in discrete VRAM or having an unexpected caching mode, it may
be possible for the cogl function perform worse because it might do the
y-flip in-place in the dumb buffer. Hopefully that does not happen in
any practical scenario.

Calling meta_renderer_native_gles3_read_pixels () here was conceptually
wrong to begin with because it was done with the Cogl GL context of the
primary GPU, not on the GL ES 3 context of a secondary GPU. However,
due eglBindAPI being a no-op in Mesa and the glReadPixels () arguments
being compatible, it worked.

This patch adds a pixel format conversion table between DRM and Cogl
formats. It contains more formats than absolutely necessary and the
texture components field which is currently unused for completeness. See
Mutter issue #323. Making the table more complete documents better how
the pixel formats actually map so that posterity should be less likely
to be confused. This table could be shared with
shm_buffer_get_cogl_pixel_format () as well, but not with
meta_wayland_dma_buf_buffer_attach ().

On HP ProBook 4520s laptop (Mesa DRI Intel(R) Ironlake Mobile, Mesa
18.0.5), without this patch copy_shared_framebuffer_cpu () for a
DisplayLink output takes 5 seconds with a 1080p frame.  Obviously that
makes Mutter and gnome-shell completely unusable.  With this patch, that
function takes 13-18 ms which makes it usable if not fluent.

On Intel i7-4790 (Mesa DRI Intel(R) Haswell Desktop) machine, this patch
makes no significant difference (the copy takes 4-5 ms).
2018-11-19 22:53:13 +00:00
..
native renderer/native: use cogl for CPU copy path 2018-11-19 22:53:13 +00:00
x11 Make it possible to build without GLX support 2018-11-06 17:17:36 +01:00
edid-parse.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
edid.h edid: Remove unused declarations 2014-09-12 11:55:08 -06:00
gsm-inhibitor-flag.h idle-monitor: Take idle inhibition into account 2018-04-16 13:28:03 +02:00
meta-backend-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-backend-types.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-backend.c backend: Freeze frame clock when headless 2018-11-09 11:16:30 +01:00
meta-barrier-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-barrier.c x11: Require XInput 2.3 at build time 2018-11-06 17:17:36 +01:00
meta-crtc.c backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-crtc.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cursor-renderer.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cursor-renderer.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cursor-sprite-xcursor.c cursor-renderer/native: Let the backend realize cursor sprite itself 2018-06-15 19:09:55 +00:00
meta-cursor-sprite-xcursor.h cursor-renderer: Fetch instead of pass Xcursor image when realizing 2018-06-15 19:09:52 +00:00
meta-cursor-tracker-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cursor-tracker.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cursor.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cursor.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-dbus-session-watcher.c Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-dbus-session-watcher.h Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-display-config-shared.h Remove trailing whitespace 2014-05-02 09:34:48 -04:00
meta-dnd-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-egl-ext.h egl: Add EGL_RESOURCE_BUSY_EXT error 2017-03-04 18:34:17 +08:00
meta-egl.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-egl.h renderer/native: Force EGL config pixel format 2018-03-05 15:42:27 +00:00
meta-gles3-table.h backends: Add OpenGL ES 3 abstraction layer 2017-10-05 18:17:26 -04:00
meta-gles3.c backends: Add OpenGL ES 3 abstraction layer 2017-10-05 18:17:26 -04:00
meta-gles3.h backends: Add OpenGL ES 3 abstraction layer 2017-10-05 18:17:26 -04:00
meta-gpu.c backends: Split out CRTC/output management to MetaGpu 2017-10-05 18:05:20 -04:00
meta-gpu.h gpu: Drop unused declaration 2018-11-19 14:58:48 +00:00
meta-idle-monitor-dbus.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-idle-monitor-dbus.h Start molding out a new src/backends/ dir 2014-03-31 22:11:00 -04:00
meta-idle-monitor-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-idle-monitor.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-input-settings-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-input-settings.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-logical-monitor.c Move monitor management API to MetaDisplay 2018-07-06 19:47:16 +02:00
meta-logical-monitor.h output: Turn winsys_id into a uint64_t 2018-11-19 14:58:48 +00:00
meta-monitor-config-manager.c monitor-manager: use MonitorsConfig to track switch_config 2018-10-08 15:53:45 +08:00
meta-monitor-config-manager.h monitor-manager: use MonitorsConfig to track switch_config 2018-10-08 15:53:45 +08:00
meta-monitor-config-migration.c monitor-config-migration: Discard if configured mode is missing 2017-10-04 09:45:02 -04:00
meta-monitor-config-migration.h Migrate old monitor configuration files to new system 2017-08-21 12:23:51 +08:00
meta-monitor-config-store.c monitor-config: Keep track of disabled monitors for stored configs 2017-10-02 15:34:24 -04:00
meta-monitor-config-store.h Migrate old monitor configuration files to new system 2017-08-21 12:23:51 +08:00
meta-monitor-manager-dummy.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-monitor-manager-dummy.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-monitor-manager-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-monitor-manager.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-monitor.c output: Turn winsys_id into a uint64_t 2018-11-19 14:58:48 +00:00
meta-monitor.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-orientation-manager.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-orientation-manager.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-output.c backends: Add logical monitor -> monitor -> output -> crtc ref chain 2018-06-28 13:42:15 +02:00
meta-output.h output: Turn winsys_id into a uint64_t 2018-11-19 14:58:48 +00:00
meta-pointer-constraint.c Implement support for the wp_pointer_constraints protocol 2016-02-16 19:02:48 +08:00
meta-pointer-constraint.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-remote-access-controller-private.h Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-remote-access-controller.c Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-remote-desktop-session.c remote-desktop: Do not leak the virtual touchscreen 2018-11-19 15:41:43 +00:00
meta-remote-desktop-session.h Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-remote-desktop.c Pass -D_GNU_SOURCE instead of defining it in source 2018-11-06 17:17:36 +01:00
meta-remote-desktop.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-renderer-view.c renderer-view: Add view transform getter 2017-04-07 22:30:49 +08:00
meta-renderer-view.h renderer-view: Add view transform getter 2017-04-07 22:30:49 +08:00
meta-renderer.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-renderer.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-screen-cast-monitor-stream-src.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-screen-cast-monitor-stream-src.h ScreenCast: Pass PipeWire stream node ID directly 2017-08-29 14:39:04 +08:00
meta-screen-cast-monitor-stream.c screen-cast-stream: Add API to transform relative coordinates 2018-02-23 19:33:31 +08:00
meta-screen-cast-monitor-stream.h Add remote desktop and screen cast functionality 2017-08-29 14:39:04 +08:00
meta-screen-cast-session.c Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-screen-cast-session.h Add remote access controller API 2018-07-20 16:49:49 +02:00
meta-screen-cast-stream-src.c Don't cast free function passed to g_clear_pointer 2018-07-31 23:40:01 +02:00
meta-screen-cast-stream-src.h screen-cast-stream-src: Remove malformed include 2017-09-08 17:54:44 +02:00
meta-screen-cast-stream.c screen-cast-stream: Add API to transform relative coordinates 2018-02-23 19:33:31 +08:00
meta-screen-cast-stream.h screen-cast-stream: Add API to transform relative coordinates 2018-02-23 19:33:31 +08:00
meta-screen-cast.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-screen-cast.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-settings-private.h Make screen cast and remote desktop non-experimental 2018-06-07 12:57:51 +00:00
meta-settings.c settings: Remove confused comment 2018-06-07 12:57:52 +00:00
meta-stage-private.h backends/stage: Remove unused function declaration 2018-11-09 11:16:30 +01:00
meta-stage.c backends/stage: Remove MetaStagePrivate 2018-11-09 11:16:30 +01:00