Hmm no answers of course. Ok, so I'll post back my progress:
Gamma mode, also palette mode and pretty sure all other modes except for
normal DO NOT work for video layers. This is not a 100% claim, but I'm at
99.9%. These "special" modes work for normal layers (VIDEO_EN=0) maybe also
YUV layers (not really sure, but unlike video, I had a some feedback from
the screen when in YUV mode).
Not sure if this is a HW bug, or bandwidth to SRAM is too low for video (so
they disabled it), but it's stupid anyway and it's not working. Just so
that someone else doesn't waste so much time on it...
This is also why they made WORK_MODE_SCALER a separate layer - maybe SRAM
functionality is turned off when using DEFE => if someone is willing, I'd
be really interested in what happens when using RGB video instead of YUV,
since then DEFE is not used. Anyway, due to poor documentation and
complexity of the issue, without consulting someone from Allwinner, I guess
we'll never find out what happens here and why.
On Monday, May 5, 2014 8:31:02 PM UTC+2, Ivan Kozic wrote:
>
> 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.