Hi all,

Has anyone successfully used SRAM gamma table? I know it's not supported in 
kernel (it's only mentioned in sunxi_display_ioctls.h as 
DISP_LAYER_WORK_MODE_GAMMA), but I've just added the support for it and it 
doesn't seem to be working at all. I'm referring to the table mentioned on 
pages 581-582 of the A20 user manual. I would like to apply this gamma 
table to the video, but I only get black screen.
What I have done:

Since the layering is completely off with this sunxi stuff, I had to use 
some tricks to enable gamma tables. I have used similar functions to the 
palette table setup and implemented some new display ioctls in dev_disp.c. 
The end result is that both registers and SRAM get set to the correct gamma 
values, BUT after the layer has been initialized and BEFORE the video 
stream is started. I also tried to do it before the layer is initialized, 
but due to the architecture of disp driver, this is either impossible, or 
requires A LOT of code changing to really work (and I wouldn't really 
change too much code just to test a corner case).

The real problem is that User Manual is not really in sync with the drivers 
- in display driver, we have 5 layer modes:

typedef enum {
    DISP_LAYER_WORK_MODE_NORMAL = 0, /* normal work mode */
    DISP_LAYER_WORK_MODE_PALETTE = 1, /* palette work mode */
    /* internal frame buffer work mode */
    DISP_LAYER_WORK_MODE_INTER_BUF = 2,
    DISP_LAYER_WORK_MODE_GAMMA = 3, /* gamma correction work mode */
    DISP_LAYER_WORK_MODE_SCALER = 4, /* scaler work mode */
} __disp_layer_work_mode_t;

Problem is that only the first four have physical meaning. Scaler is a part 
of DEFE not DEBE and therefore is an artificial layer. As DEBE sees it, YUV 
video for instance works in normal mode. However, due to the needed CSC, it 
needs a DEFE, sometimes even without scaler. BUT Allwinner people decided 
to call DEFE DISP_LAYER_WORK_MODE_SCALER, so that actually when looking at 
the driver, DEBE and DEFE are sort of glued together. I have no idea why 
they did this. Especially because I for one need gamma lookup tables to do 
some color ops on the video and this is not possible or is possible with a 
lot of work and code rewrite... This is also why video will not work in 
DISP_LAYER_WORK_MODE_NORMAL (unless it's RGB, which is really not likely), 
even though for DEBE it's initialized as such (video is always init as 
normal in DEBE registers).

Anyway, I have made some shortcuts and gamma is active, but I don't get any 
colors on the screen. If anyone has done anything with SRAM gamma tables, I 
would really appreciate the help.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to