canonical / mir

The Mir compositor
GNU General Public License v2.0
637 stars 102 forks source link

Allow setting maximum bits-per-colour (`max bpc`) value #3391

Open ryanjmulder opened 6 months ago

ryanjmulder commented 6 months ago

I'm using a display with ubuntu-frame (on ubuntu core) whose picture looks terrible. It also looks terrible in ubuntu desktop, but in desktop I can set max bpc to 8 (with xrandr) and it makes the picture correct.

How can I set max bpc with ubuntu-frame?

Here's the output from ubuntu-frame, if it's interesting:

+ [ /snap/ubuntu-frame/9120/bin/run-frame = --help ]
+ mkdir -p /root/snap/ubuntu-frame/9120/.config/
+ grep -vE (^vt=|^console-provider=vt) /var/snap/ubuntu-frame/9120/frame.config
+ rm -f /root/snap/ubuntu-frame/9120/.config/frame.display
+ cp /var/snap/ubuntu-frame/9120/frame.display /root/snap/ubuntu-frame/9120/.config/
+ exec /snap/ubuntu-frame/9120/bin/run-frame /snap/ubuntu-frame/9120/bin/graphics-core22-wrapper /snap/ubuntu-frame/9120/usr/local/bin/frame
+ [ /snap/ubuntu-frame/9120/bin/graphics-core22-wrapper = --help ]
+ dirname /run/user/0/snap.ubuntu-frame
+ XDG_RUNTIME_DIR=/run/user/0
+ export XDG_RUNTIME_DIR
+ mkdir -p /run/user/0 -m 700
+ [ -n  ]
+ exec /snap/ubuntu-frame/9120/bin/graphics-core22-wrapper /snap/ubuntu-frame/9120/usr/local/bin/frame
< - debug - > miral: Loaded display configuration file: /root/snap/ubuntu-frame/9120/.config/frame.display
<information> mirserver: Starting
< - debug - > mirserver: Not using logind for session management: Failed to find active session
< - debug - > mirserver: Using Linux VT subsystem for session management
<information> mircommon: Loading modules from: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
<information> mirserver: Found display driver: mir:eglstream-kms (version 2.16.4)
< - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_EXT_device_drm EGL_EXT_device_drm_render_node
< -warning- > eglstream: Failed to create EGL context: no EGL_STREAM_BIT_KHR configs supported
< - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_MESA_device_software EGL_EXT_device_drm_render_node
<information> eglstream: Failed to query DRM node for EGLDevice: Failed to determine DRM device node path from EGLDevice: EGL_BAD_PARAMETER (0x300c)
<information> mirserver: Driver supports:
<information> mirserver:    /devices/pci0000:00/0000:00:02.0/drm/card0 (priority 0)
<information> mirserver: Found display driver: mir:gbm-kms (version 2.16.4)
< - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver i915
< - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
< - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
<information> mirserver: Driver supports:
<information> mirserver:    /devices/pci0000:00/0000:00:02.0/drm/card0 (priority 256)
<information> mirserver: Found display driver: mir:egl-generic (version 2.16.4)
<information> mirserver: Found display driver: mir:x11 (version 2.16.4)
<information> mirserver: (Unsupported by system environment)
<information> mirserver: Selected display driver: mir:gbm-kms (version 2.16.4) for device ((null): /dev/dri/card0)
<information> mircommon: Loading modules from: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
<information> mirserver: Found rendering driver: mir:eglstream-kms (version 2.16.4)
<information> eglstream: EGLDevice found but unsuitable. Missing extension EGL_KHR_stream_consumer_gltexture
<information> eglstream: EGLDevice found but unsuitable. Missing extension EGL_NV_stream_attrib
< - debug - > eglstream: Failed to find kernel device for EGLDevice: Failed to determine DRM device node path from EGLDevice: EGL_BAD_PARAMETER (0x300c)
< - debug - > eglstream: EGLDeviceEXTs found, but none are suitable for Mir
<information> mirserver: Driver supports:
<information> mirserver:    /devices/pci0000:00/0000:00:02.0/drm/card0 (priority 0)
<information> mirserver: Found rendering driver: mir:gbm-kms (version 2.16.4)
< - debug - > gbm-kms: GBM-capable display found
< - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver i915
< - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
< - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
< - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/renderD128, driver i915
<information> mirserver: Driver supports:
<information> mirserver:    /devices/pci0000:00/0000:00:02.0/drm/renderD128 (priority 256)
<information> mirserver: Found rendering driver: mir:egl-generic (version 2.16.4)
<information> mirserver: Driver supports:
<information> mirserver:    System (priority 128)
<information> mirserver: Found rendering driver: mir:x11 (version 2.16.4)
<information> mirserver: Selected rendering driver: mir:gbm-kms (version 2.16.4) for device ((null): /dev/dri/renderD128)
< - debug - > gbm-kms: Checking whether /dev/dri/renderD128 is the same device as (/dev/dri/card0, /dev/dri/renderD128)...
< - debug - > gbm-kms:  ...yup.
<information> mirserver: Selected rendering driver: mir:egl-generic (version 2.16.4) for platform
< -warning- > gbm-kms: Unable to determine the current display mode.
<information> gbm-kms: DRM device details:
<information> gbm-kms: /dev/dri/card0: using driver i915 [Intel Graphics] (version: 1.6.0 driver date: 20201103)
<information> gbm-kms:  Output: DisplayPort-1 (disconnected)
<information> gbm-kms:  Output: HDMI-A-1 (connected)
<information> gbm-kms:      Mode: 1024×600@59.90
<information> gbm-kms:      Mode: 1920×1080@60.00
<information> gbm-kms:      Mode: 1920×1080@59.94
<information> gbm-kms:      Mode: 1920×1080@30.00
<information> gbm-kms:      Mode: 1920×1080@29.97
<information> gbm-kms:      Mode: 1920×1080@50.00
<information> gbm-kms:      Mode: 1920×1080@25.00
<information> gbm-kms:      Mode: 1920×1080@24.00
<information> gbm-kms:      Mode: 1920×1080@23.97
<information> gbm-kms:      Mode: 1280×720@60.00
<information> gbm-kms:      Mode: 1280×720@59.94
<information> gbm-kms:      Mode: 1280×720@50.00
<information> gbm-kms:      Mode: 1024×768@60.00
<information> gbm-kms:      Mode: 800×600@60.31
<information> gbm-kms:      Mode: 720×576@50.00
<information> gbm-kms:      Mode: 720×576@25.00
<information> gbm-kms:      Mode: 720×480@60.00
<information> gbm-kms:      Mode: 720×480@59.94
<information> gbm-kms:      Mode: 720×480@30.00
<information> gbm-kms:      Mode: 720×480@29.97
<information> gbm-kms:      Mode: 640×480@60.00
<information> gbm-kms:      Mode: 640×480@59.94
< - debug - > miral: Display config using layout: 'default'
<information> miral: Display config:
8>< ---------------------------------------------------
layouts:
  default:                         # the current layout
    cards:
    # a list of cards (currently matched by card-id)

    - card-id: 0
      DisplayPort-1:
        # (disconnected)

      HDMI-A-1:
        # This output supports the following modes: 1024x600@59.9, 1920x1080@60.0,
        # 1920x1080@59.9, 1920x1080@30.0, 1920x1080@30.0, 1920x1080@50.0, 1920x1080@25.0,
        # 1920x1080@24.0, 1920x1080@24.0, 1280x720@60.0, 1280x720@59.9, 1280x720@50.0,
        # 1024x768@60.0, 800x600@60.3, 720x576@50.0, 720x576@25.0, 720x480@60.0,
        # 720x480@59.9, 720x480@30.0, 720x480@30.0, 640x480@60.0, 640x480@59.9
        #
        # Uncomment the following to enforce the selected configuration.
        # Or amend as desired.
        #
        state: enabled  # {enabled, disabled}, defaults to enabled
        mode: 1024x600@59.9 # Defaults to preferred mode
        position: [0, 0]    # Defaults to [0, 0]
        orientation: normal # {normal, left, right, inverted}, defaults to normal
        scale: 1
        group: 0    # Outputs with the same non-zero value are treated as a single display
8>< ---------------------------------------------------
< -warning- > gbm-kms: Ignoring attempt to set zero length gamma
< - debug - > miral: Display config using layout: 'default'
<information> miral: Display config:
8>< ---------------------------------------------------
layouts:
  default:                         # the current layout
    cards:
    # a list of cards (currently matched by card-id)

    - card-id: 0
      DisplayPort-1:
        # (disconnected)

      HDMI-A-1:
        # This output supports the following modes: 1024x600@59.9, 1920x1080@60.0,
        # 1920x1080@59.9, 1920x1080@30.0, 1920x1080@30.0, 1920x1080@50.0, 1920x1080@25.0,
        # 1920x1080@24.0, 1920x1080@24.0, 1280x720@60.0, 1280x720@59.9, 1280x720@50.0,
        # 1024x768@60.0, 800x600@60.3, 720x576@50.0, 720x576@25.0, 720x480@60.0,
        # 720x480@59.9, 720x480@30.0, 720x480@30.0, 640x480@60.0, 640x480@59.9
        #
        # Uncomment the following to enforce the selected configuration.
        # Or amend as desired.
        #
        state: enabled  # {enabled, disabled}, defaults to enabled
        mode: 1024x600@59.9 # Defaults to preferred mode
        position: [0, 0]    # Defaults to [0, 0]
        orientation: normal # {normal, left, right, inverted}, defaults to normal
        scale: 1
        group: 0    # Outputs with the same non-zero value are treated as a single display
8>< ---------------------------------------------------
xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF-8" (mapped to "en_US.UTF-8")
<information> mirserver: Cursor disabled
<information> gbm-kms-buffer-allocator: Enabled linux-dmabuf import support
<information> mircommon: Loading modules from: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.21
<information> mircommon: Loading module: /snap/ubuntu-frame/9120/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
<information> mirserver: Selected input driver: mir:evdev-input (version: 2.16.4)
<information> mirserver: Mir version 2.16.4
<information> GLRenderer: EGL vendor: Mesa Project
<information> GLRenderer: EGL version: 1.5
<information> GLRenderer: EGL client APIs: OpenGL OpenGL_ES 
<information> GLRenderer: EGL extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_IMG_context_priority EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display 
<information> GLRenderer: GL vendor: Intel
<information> GLRenderer: GL renderer: Mesa Intel(R) HD Graphics 500 (APL 2)
<information> GLRenderer: GL version: OpenGL ES 3.2 Mesa 23.2.1-1ubuntu3.1~22.04.2
<information> GLRenderer: GLSL version: OpenGL ES GLSL ES 3.20
<information> GLRenderer: GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_draw_instanced GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_conditional_render GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_NV_pack_subimage GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_OES_viewport_array GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean GL_EXT_robustness GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_NV_generate_mipmap_sRGB GL_NV_pixel_buffer_object GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_debug_label GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_INTEL_conservative_rasterization GL_INTEL_performance_query GL_ANDROID_extension_pack_es31a GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_gpu_shader5 GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box GL_EXT_render_snorm GL_EXT_shader_io_blocks GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_cube_map_array GL_EXT_texture_norm16 GL_EXT_texture_view GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_image_formats GL_NV_shader_noperspective_interpolation GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_gpu_shader5 GL_OES_primitive_bounding_box GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_EXT_blend_func_extended GL_EXT_buffer_storage GL_EXT_float_blend GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_shader_samples_identical GL_EXT_texture_sRGB_R8 GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_NV_fragment_shader_interlock GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_shader_image_atomic GL_EXT_clear_texture GL_EXT_clip_cull_distance GL_EXT_disjoint_timer_query GL_EXT_texture_compression_s3tc_srgb GL_MESA_shader_integer_functions GL_EXT_clip_control GL_EXT_color_buffer_half_float GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_texture_compression_bptc GL_EXT_texture_mirror_clamp_to_edge GL_KHR_parallel_shader_compile GL_NV_alpha_to_coverage_dither_control GL_EXT_EGL_image_storage GL_EXT_shader_framebuffer_fetch_non_coherent GL_EXT_texture_shadow_lod GL_INTEL_blackhole_render GL_MESA_framebuffer_flip_y GL_NV_compute_shader_derivatives GL_EXT_demote_to_helper_invocation GL_EXT_depth_clamp GL_EXT_texture_query_lod GL_MESA_bgra 
<information> GLRenderer: GL max texture size = 16384
<information> GLRenderer: GL framebuffer bits: RGBA=8880, depth=0, stencil=0
<information> mirserver: Initial display configuration:
<information> mirserver: * Output 1: DisplayPort disconnected
<information> mirserver: * Output 2: HDMI-A connected, used
<information> mirserver: . |_ EDID monitor name: HDMI1024600HH
<information> mirserver: . |_ EDID manufacturer: RTK
<information> mirserver: . |_ EDID product code: 10811
<information> mirserver: . |_ Physical size 24.0" 520x320mm
<information> mirserver: . |_ Power is on
<information> mirserver: . |_ Current mode 1024x600 59.90Hz
<information> mirserver: . |_ Preferred mode 1024x600 59.90Hz
<information> mirserver: . |_ Orientation normal
<information> mirserver: . |_ Logical size 1024x600
<information> mirserver: . |_ Logical position +0+0
<information> mirserver: . |_ Scaling factor: 1.00
<information> frame: New surface for snap="monitoringpanelhmi" with title="Monitoring Panel HMI"
< -warning- > mirserver: Ignoring layer shell protocol violation: wl_surface destroyed before associated zwlr_layer_surface_v1@28
< - debug - > mirserver: Handling Interrupt from pid=0
< -warning- > mirserver: wl_surface@12 destroyed before associated role
Saviq commented 5 months ago

Hi @ryanjmulder, sorry for the late reply, we've been busy planning our next cycle.

There isn't a way today to limit bits per colour with Mir, I'll move this issue there. It sounds to me like this should be an extra per-output configuration option.