On Thu, Jun 15, 2017 at 12:15:58PM +0200, Boris Brezillon wrote: > On Thu, 15 Jun 2017 11:54:29 +0200 > Peter Rosin <peda@xxxxxxxxxx> wrote: > > > On 2017-06-13 17:30, Boris Brezillon wrote: > > > Hi Peter, > > > > > > On Tue, 13 Jun 2017 16:34:25 +0200 > > > Peter Rosin <peda@xxxxxxxxxx> wrote: > > > > > >> Hi! > > >> > > >> I need color lookup support for the atmel-hlcdc driver, and had a peek > > >> at the code. I also looked at the drivers/gpu/drm/stm driver and came > > >> up with the below diff. It compiles, but I have not booted it for the > > >> simple reason that I can't imagine it will work. > > >> > > >> Sure, the code fills the clut registers in the .load_lut helper function > > >> and I think it might even do the right thing when setting up the mode. > > >> I'm less sure DMA will work correctly? It might, but I haven't looked at > > >> it for many seconds... > > >> > > >> The big question is how the color info gets into the new clut array > > >> I created in atmel_hlcdc_crtc? When I look at the stm driver, which does > > >> it just like this AFAICT I just don't see it. So, what I'm I missing? > > > > > > You should look at drm_atomic_helper_legacy_gamma_set() and its users. > > > > Ok, thanks. I had a long look and could not get it to work at all. > > Probably because you're trying to set this up through the emulated > fbdev interface. The solution I proposed is supposed to be accessed > through DRM ioctls. Yup, no one typed the fbdev emulation support to use the new&fancy color manager stuff if available. That needs to be done if you want that. Also note that even the existing legacy lut support for fbdev is in imo rather bad shape, and I really don't want to see it's usage spread (it has its own special functions which use neither the old nor new kms interfaces, forcing drivers to duplicate stuff for no gain at all). > > So, > > I did as below instead. However, there are a few glaring problems... > > Well, I doubt this will be accepted. The fbdev emulation layer is > supposed to be rather dumb, partly because DRM people want developers > to switch to the DRM interface. > > Also note that I won't accept a solution that supports setting the LUT > table only through the fbdev interface, so please try to make it work > the DRM way before you even consider modifying the fbdev emulation > layer. Correct :-) Bunch more details: fbdev emulation in drm_fb_helper.c uses ->gamma_set and ->load_lut, that needs to be replaced by the proper kms interfaces (and using the color manager properties for atomic drivers directly, if available). Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel