wlroots icon indicating copy to clipboard operation
wlroots copied to clipboard

Support 10bit color

Open maletor opened this issue 7 years ago • 4 comments

Discussed previously in the past. 10 bit color should work if configured (or detected?) properly.

https://github.com/swaywm/sway/issues/1348#issuecomment-328394287 https://github.com/swaywm/wlroots/issues/54#issuecomment-321395585


https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_shm-enum-format


wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1378

maletor avatar Nov 19 '18 23:11 maletor

Can we composite in 10-bit? (See GL_EXT_color_buffer_float)

emersion avatar Nov 19 '18 23:11 emersion

Wayland/Weston has now started work on HDR support with a proposed design here: https://lists.freedesktop.org/archives/wayland-devel/2019-January/039808.html

AntiSC2 avatar Jan 13 '19 02:01 AntiSC2

Any update on this perhaps? Would be up for testing this if needed.

AndreasBackx avatar Dec 14 '19 21:12 AndreasBackx

I was able to get wlroots working with 10-bit output:

diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 60f8ecaa..fb0602f3 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -109,10 +109,11 @@ static bool add_plane(struct wlr_drm_backend *drm,
 	for (size_t j = 0; j < drm_plane->count_formats; ++j) {
 		uint32_t fmt = drm_plane->formats[j];
 
-		if (fmt == DRM_FORMAT_ARGB8888) {
-			// Prefer formats with alpha channel
+		if (fmt == DRM_FORMAT_XRGB2101010) {
 			rgb_format = fmt;
 			break;
+		} else if (fmt == DRM_FORMAT_ARGB8888) {
+			rgb_format = fmt;
 		} else if (fmt == DRM_FORMAT_XRGB8888) {
 			rgb_format = fmt;
 		}
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c
index 25101a4b..7ff0f023 100644
--- a/backend/drm/renderer.c
+++ b/backend/drm/renderer.c
@@ -32,7 +32,7 @@ bool init_drm_renderer(struct wlr_drm_backend *drm,
 		EGL_NONE,
 	};
 
-	renderer->gbm_format = GBM_FORMAT_ARGB8888;
+	renderer->gbm_format = GBM_FORMAT_ARGB2101010;
 	renderer->wlr_rend = create_renderer_func(&renderer->egl,
 		EGL_PLATFORM_GBM_MESA, renderer->gbm,
 		config_attribs, renderer->gbm_format);

Tested it with glpaper with a shader with particularly bad banding on 8-bit, seems to work fine. Not sure if this is the only place wher changes are needed (other than wl_shm formats).

tadeokondrak avatar Dec 30 '19 23:12 tadeokondrak