• Tomi Valkeinen's avatar
    drm/omap: cleanup color space conversion · 4cba7071
    Tomi Valkeinen authored
    The setup code for color space conversion is a bit messy. This patch
    cleans it up.
    
    For some reason the TRM uses values in YCrCb order, which is also used
    in the current driver, whereas everywhere else it's YCbCr (which also
    matches YUV order). This patch changes the tables to use the common
    order to avoid confusion.
    
    The tables are split into separate lines, and comments added for
    clarity.
    
    WB color conversion registers are similar but different than non-WB, but
    the same function was used to write both. It worked fine because the
    coef table was adjusted accordingly, but that was rather confusing. This
    patch adds a separate function to write the WB values so that the coef
    table can be written in an understandable way.
    
    Recalculation also showed that 'bcb' value in yuv-to-rgb conversion had
    been rounded wrongly, and it should be 516 instead of 517.
    Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
    Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    4cba7071
dispc.c 129 KB