On Wed, May 6, 2020 at 12:33 PM Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> wrote: > > On Wed, May 06, 2020 at 12:25:00PM +0300, Artem Mygaiev wrote: > > On Wed, May 6, 2020 at 12:18 PM Ville Syrjälä > > <ville.syrjala@xxxxxxxxxxxxxxx> wrote: > > > > > > On Wed, May 06, 2020 at 12:04:22PM +0300, Artem Mygaiev wrote: > > > > Hello Ville > > > > > > > > On Wed, May 6, 2020 at 10:45 AM Ville Syrjälä > > > > <ville.syrjala@xxxxxxxxxxxxxxx> wrote: > > > > > > > > > > On Tue, May 05, 2020 at 01:24:16PM +0300, Artem Mygaiev wrote: > > > > > > Hello all > > > > > > > > > > > > I am currently working on DRM/KMS driver for Fresco Logic FL2000 USB display > > > > > > controller [1]. I have already implemented a POC driver [2] which is working for > > > > > > me, although there are still plenty of things to improve or fix, of course. > > > > > > > > > > > > So far I have one thing that I somehow cannot find in DRM/KMS documentation or > > > > > > existing drivers: how to tell the system that HW expects sRGB (i.e. non-linear) > > > > > > color encoding in framebuffers? This is a HW limitation that I cannot influence > > > > > > by configuration. > > > > > > > > > > Does it do something to process the data that requires linearization > > > > > or why does it care about the gamma applied to the data? In a typical > > > > > use case the data is just passed through unless the user asks otherwise, > > > > > so it doesn't matter much what gamma was used. Though most displays > > > > > probably expect something resembling sRGB gamma by default, so that's > > > > > presumably what most things generate, and images/videos/etc. pretty > > > > > much always have gamma already applied when they are produced. > > > > > > > > > > > > > Unfortunately the HW was designed in a way that when it is configured to 24-bit > > > > RGB888 it expects sRGB and applies degamma automatically. It is not possible to > > > > disable this, I've asked vendor and they confirmed this [1]. > > > > > > So it always does degamma+gamma for no real reason? That shouldn't > > > really matter (apart from potentially losing some precision in those > > > conversions). > > > > > > > It always does only degamma (sRGB -> linear), so if you supply linear RGB it > > will totally corrupt picture colors, e.g. this is how kmscube looks like: > > https://github.com/klogg/fl2000_drm/issues/15 > > That doesn't really make sense to me. You never feed linear data to > actual displays. > I have a display with gamma 1.0 (as populated in EDID) which I assume means linear gamma (am I wrong here?) which is connected to FL2000 dongle, so there is no gamma applied after de-gamma. But after further analysis I noticed that the problem is not the colorspace, HW expects swapped 32-bit dwords in fbuffer. Somehow I completely overlooked this when was working on original implementation. Sorry for causing confusion - this is not the area I understand well enough, I must admit. > > > > > > > > > > The only workaround I could implement now is to switch it to 16-bit RGB565 and > > > > perform framebuffer conversions in driver, similar to what > > > > rm_fb_xrgb8888_to_rgb565() alike helpers do; but it would be still great to > > > > understand whether it is possible to support sRGB. > > > > > > > > [1] https://github.com/FrescoLogic/FL2000/issues/42 > > > > > > > > > > > > > > > > Any pointers are greatly appreciated. > > > > > > > > > > > > [1] www.frescologic.com/product/single/fl2000 > > > > > > [2] https://github.com/klogg/fl2000_drm > > > > > > > > > > > > Best regards, > > > > > > -- Artem > > > > > > _______________________________________________ > > > > > > dri-devel mailing list > > > > > > dri-devel@xxxxxxxxxxxxxxxxxxxxx > > > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > > > > > -- > > > > > Ville Syrjälä > > > > > Intel > > > > > > > > Best regards, > > > > Artem Mygaiev > > > > > > -- > > > Ville Syrjälä > > > Intel > > > > Best regards, > > Artem Mygaiev > > -- > Ville Syrjälä > Intel > _______________________________________________ > dri-devel mailing list > dri-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/dri-devel Best regards, Artem Mygaiev _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel