summaryrefslogtreecommitdiff
path: root/lib/igt_color_encoding.c
AgeCommit message (Collapse)Author
2019-03-29lib/igt_fb: Add support for Y410/Y416 formats, v5.Maarten Lankhorst
Y410 is packed with compressed a channel and only 32 bpp, like 10 bits RGB formats. Y416 is a packed 16 bits per component format. Changes since v1: - Rebase on top of upstream YUV changes. Changes since v2: - Discard alpha channel, not used upstream. Changes since v3: - Handle the XVYU formats and Y41x formats correctly. Changes since v4: - Fix YUV conversion routines. (Ville) - Use memset64 to clear initial fb. (Ville) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Add missing ULL (Ville) Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-29lib/igt_fb: Add support for Y21x formats as well, v3.Maarten Lankhorst
Those formats are packed like YUYV, but only 16 bits per component. Changes since v1: - Rebase on top of upstream YUV changes. Changes since v2: - Use drm_fourcc.h from upstream. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-02-13lib/igt_fb: Add support for P01x formats, v5.Maarten Lankhorst
The P01x formats are planar 16 bits per component, with the unused lower bits set to 0. This means they can all be converted the same way. Only the range is slightly different, and this is handled in the color_encoding implementation. This requires cairo 1.17.2 and pixman 0.36. This works but doesn't give extra precision. For more than 8 bits precision a few more patches are required to pixman, pending review: https://lists.freedesktop.org/archives/pixman/2019-January/004815.html https://lists.freedesktop.org/archives/pixman/2019-January/004809.html Once those are merged, we will require the next pixman release for better precision. Changes since v1: - Add fallback color definitions when compiling on cairo version < 1.17.2. - Skip when FB creation fails on HDR formats, instead of failing. Changes since v2: - Complain slightly harder when pixman/cairo are out of date. - Create a fb with alpha when converting to pixman formats with alpha. - Oops, s/pixman_format_code_t/cairo_format_t/ Changes since v3: - Rebase on top of upstream YUV changes. Changes since v4: - Rebase again. - Use drm_fourcc.h from drm-misc-next. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> #v4
2019-02-13lib/color_encoding: Prepare support for HDR modes, v2.Maarten Lankhorst
We're starting to add support for 10, 12 and 16-bits formats that all have different values for the Y offset and range. Some 10 bits formats go from [0...1023], others go to [0...1023] shifted left by 6. To accomodate all formats add a struct definition for all various formats, this can be extended further when we add new formats. Changes since v1: - Rebase on top of added yuv changes. - Add commit description (swatish) - Add missing newline. (swatish) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> #v1
2018-08-30lib/kms: Remove special enum handling and replace with call to ↵Maarten Lankhorst
igt_plane_set_prop_enum, v2. We now have infrastructure for generic enum handling. This will make it easier to write new tests without defining all enum constants beforehand. Changes since v1: - Fix compile error, sent old version by accident. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-06-07lib/igt_color_encoding: Appease c90Ville Syrjälä
Apparently we stil build in c90 mode or something with autotools. It doesn't like mixed code and declarations. v2: Do it the sane way (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-06-07lib/igt_color_encoding: Use the m(row,col) macro to address the matrix cellsVille Syrjälä
Sinec the m(row,col) macro is now in igt_matrix.h let's use it when constructing the ycbcr<->rgb matrices. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-23lib: Add igt_color_encodingVille Syrjälä
Add some helpers for generating rgb<->ycbcr conversion matrices. v2: Add enums for color_encoding/color_range Fix full range handling (lacked +-0.5<->+-1.0 scaling) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>