Hacker News new | ask | show | jobs
by newnewpdro 3038 days ago
It's unclear to me why there's no color palette/correction table exposed in libdrm/KMS at the kernel. It should just be part of the video mode, maybe with a bit to indicate when the driver/hardware doesn't support changing it. But always be able to read it out, make it linear nonsense when the support isn't there - that won't be worse than what we have now.

Then the layers up the stack like Wayland/X/GNOME/KDE are just messengers to/from the bottom @ drm.

We also need floating point frame buffers to be first-class citizens at the KMS level. I don't want to be forced into OpenGL/Vulkan just to be able to have the hardware apply gamma correction on a software-rendered frame buffer, and if I have the hardware do color correction, it kind of needs the HDR of floats - not uchars, which I don't think libdrm supports with dumb buffers of today. If not floats, at least more bits than 8 per color component.

Programs like Plymouth or other embedded style applications running directly on libdrm should be able to have color-corrected output without needing bespoke software implementations and their own calibration tables. I should be able to tell the kernel the correction table, maybe compile it in, or another payload on the boot parameters cmdline.

Hell there are fairly well-known simple algorithms for generating approximate color tables from a single gamma value. If I only want to make things look "better" in my linux kiosk, and care not about absolute color correctness, let me stick a drm.gamma=.55 field on the kernel commandline to generate the correction table in lieu of a full calibrated table.

1 comments

Have you created it, cause if not then that might explain why what you want in detail doesn't exist.
Is your point that I should get off my ass and do it instead of complaining?

Or is your point that it's substantially more complicated than it appears, and I'd know that if I tried doing it myself?

Yeah... I think both are applicable, but if you really want something done then you do it yourself or pay someone to help do it, especially for open source. It sounds like have a descent idea of where to start. I'd go find some kernel developers working on the underlying components, and offer to pay them or see if they have recommendations of people to get the work done.
In doing some searches on the subject this [1] came up. So there seems to already be movement on this front, and it's possible my knowledge of the current situation is stale.

[1] https://lists.freedesktop.org/archives/intel-gfx/2015-Septem...

There's definitely some level of gamma/color correction funtionality at the DRM level already in the kernel [1]. So my desires may already be largely fulfilled, and maybe userspace just needs to get its act together.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

Both points are likely applicable. :)

However I think complaining about open source software has its place. Sometimes the developer has never thought of adding the feature that the end user can't get along without.

No one has time to implement all the ideas they throw out in a casual discussion. That doesn't mean those ideas shouldn't be heard. If you have an actual argument, let's hear it, but your comment here is damaging and provides no value.