summaryrefslogtreecommitdiff
path: root/lib/igt_fb.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-11-01 22:26:47 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2018-11-05 18:09:17 +0200
commite5eb140b67497ad74e058959e876376a83bdc09b (patch)
tree597b2149801fcf55e140450633211a675e266576 /lib/igt_fb.c
parent15dff9353621d0746b80fae534c20621e03a9f01 (diff)
lib/igt_fb: Fix the pixman converter
Cairo doesn't do RGB888. The shadow buffer must be in XRGB888 (which is what our YUV converters also assume). We did calculate the shadow stride/size with four bytes per pixel, but we just put the wrong format in the fb metadata. Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r--lib/igt_fb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index fe0c99b9..ac43f158 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1464,7 +1464,7 @@ static void *igt_fb_create_cairo_shadow_buffer(int fd,
igt_assert(shadow);
fb_init(shadow, fd, width, height,
- DRM_FORMAT_RGB888, LOCAL_DRM_FORMAT_MOD_NONE,
+ DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
IGT_COLOR_YCBCR_BT709, IGT_COLOR_YCBCR_LIMITED_RANGE);
shadow->strides[0] = ALIGN(width * 4, 16);
@@ -1899,7 +1899,7 @@ static void fb_convert(struct fb_convert *cvt)
(drm_format_to_pixman(cvt->dst.fb->drm_format) != PIXMAN_invalid)) {
convert_pixman(cvt);
return;
- } else if (cvt->dst.fb->drm_format == DRM_FORMAT_RGB888) {
+ } else if (cvt->dst.fb->drm_format == DRM_FORMAT_XRGB8888) {
switch (cvt->src.fb->drm_format) {
case DRM_FORMAT_NV12:
convert_nv12_to_rgb24(cvt);
@@ -1911,7 +1911,7 @@ static void fb_convert(struct fb_convert *cvt)
convert_yuyv_to_rgb24(cvt);
return;
}
- } else if (cvt->src.fb->drm_format == DRM_FORMAT_RGB888) {
+ } else if (cvt->src.fb->drm_format == DRM_FORMAT_XRGB8888) {
switch (cvt->dst.fb->drm_format) {
case DRM_FORMAT_NV12:
convert_rgb24_to_nv12(cvt);