diff --git a/libweston/backend-drm/fb.c b/libweston/backend-drm/fb.c index 328d1f85..202c4818 100644 --- a/libweston/backend-drm/fb.c +++ b/libweston/backend-drm/fb.c @@ -98,7 +98,7 @@ drm_fb_addfb(struct drm_backend *b, struct drm_fb *fb) /* Legacy AddFB can't always infer the format from depth/bpp alone, so * check if our format is one of the lucky ones. */ - if (!fb->format->depth || !fb->format->bpp) + if (!fb->format->addfb_legacy_depth || !fb->format->bpp) return ret; /* Cannot fall back to AddFB for multi-planar formats either. */ @@ -106,7 +106,7 @@ drm_fb_addfb(struct drm_backend *b, struct drm_fb *fb) return ret; ret = drmModeAddFB(fb->fd, fb->width, fb->height, - fb->format->depth, fb->format->bpp, + fb->format->addfb_legacy_depth, fb->format->bpp, fb->strides[0], fb->handles[0], &fb->fb_id); return ret; } @@ -134,7 +134,7 @@ drm_fb_create_dumb(struct drm_backend *b, int width, int height, goto err_fb; } - if (!fb->format->depth || !fb->format->bpp) { + if (!fb->format->addfb_legacy_depth || !fb->format->bpp) { weston_log("format 0x%lx is not compatible with dumb buffers\n", (unsigned long) format); goto err_fb; diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c index 2373add6..1e155ee6 100644 --- a/libweston/pixel-formats.c +++ b/libweston/pixel-formats.c @@ -129,7 +129,7 @@ static const struct pixel_format_info pixel_format_table[] = { { DRM_FORMAT(XRGB1555), BITS_RGBA_FIXED(5, 5, 5, 0), - .depth = 15, + .addfb_legacy_depth = 15, .bpp = 16, }, { @@ -175,7 +175,7 @@ static const struct pixel_format_info pixel_format_table[] = { { DRM_FORMAT(RGB565), BITS_RGBA_FIXED(5, 6, 5, 0), - .depth = 16, + .addfb_legacy_depth = 16, .bpp = 16, # if __BYTE_ORDER == __LITTLE_ENDIAN GL_FORMAT(GL_RGB), @@ -200,7 +200,7 @@ static const struct pixel_format_info pixel_format_table[] = { { DRM_FORMAT(XRGB8888), BITS_RGBA_FIXED(8, 8, 8, 0), - .depth = 24, + .addfb_legacy_depth = 24, .bpp = 32, GL_FORMAT(GL_BGRA_EXT), GL_TYPE(GL_UNSIGNED_BYTE), @@ -214,7 +214,7 @@ static const struct pixel_format_info pixel_format_table[] = { DRM_FORMAT(ARGB8888), BITS_RGBA_FIXED(8, 8, 8, 8), .opaque_substitute = DRM_FORMAT_XRGB8888, - .depth = 32, + .addfb_legacy_depth = 32, .bpp = 32, GL_FORMAT(GL_BGRA_EXT), GL_TYPE(GL_UNSIGNED_BYTE), @@ -288,7 +288,7 @@ static const struct pixel_format_info pixel_format_table[] = { { DRM_FORMAT(XRGB2101010), BITS_RGBA_FIXED(10, 10, 10, 0), - .depth = 30, + .addfb_legacy_depth = 30, .bpp = 32, #if __BYTE_ORDER == __LITTLE_ENDIAN PIXMAN_FMT(x2r10g10b10), diff --git a/libweston/pixel-formats.h b/libweston/pixel-formats.h index 0b1a5f58..f1204a9f 100644 --- a/libweston/pixel-formats.h +++ b/libweston/pixel-formats.h @@ -76,7 +76,7 @@ struct pixel_format_info { /** If set, this format can be used with the legacy drmModeAddFB() * function (not AddFB2), using this and the bpp member. */ - int depth; + int addfb_legacy_depth; /** See 'depth' member above. */ int bpp;