drm-backend: Drop support libgbm older than 21.1.1

Since drm-backend requires libgbm 21.1.1 or later, there is no need to
support the old libgbm which does not support modifiers or fd import.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
This commit is contained in:
Tomohito Esaki 2023-08-03 17:19:46 +09:00 committed by Marius Vlad
parent d31ab9163d
commit 1e781d9f88
3 changed files with 2 additions and 27 deletions

View File

@ -198,7 +198,6 @@ create_gbm_surface(struct gbm_device *gbm, struct drm_output *output)
return;
}
#ifdef HAVE_GBM_MODIFIERS
if (!weston_drm_format_has_modifier(fmt, DRM_FORMAT_MOD_INVALID)) {
modifiers = weston_drm_format_get_modifiers(fmt, &num_modifiers);
output->gbm_surface =
@ -207,7 +206,6 @@ create_gbm_surface(struct gbm_device *gbm, struct drm_output *output)
output->format->format,
modifiers, num_modifiers);
}
#endif
/*
* If we cannot use modifiers to allocate the GBM surface and the GBM
@ -220,9 +218,8 @@ create_gbm_surface(struct gbm_device *gbm, struct drm_output *output)
/* We may allocate with no modifiers in the following situations:
*
* 1. old GBM version, so HAVE_GBM_MODIFIERS is false;
* 2. the KMS driver does not support modifiers;
* 3. if allocating with modifiers failed, what can happen when the KMS
* 1. the KMS driver does not support modifiers;
* 2. if allocating with modifiers failed, what can happen when the KMS
* display device supports modifiers but the GBM driver does not,
* e.g. the old i915 Mesa driver.
*/

View File

@ -376,12 +376,6 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf,
struct drm_device *device, bool is_opaque,
uint32_t *try_view_on_plane_failure_reasons)
{
#ifndef HAVE_GBM_FD_IMPORT
/* Importing a buffer to KMS requires explicit modifiers, so
* we can't continue with the legacy GBM_BO_IMPORT_FD instead
* of GBM_BO_IMPORT_FD_MODIFIER. */
return NULL;
#else
struct drm_backend *backend = device->backend;
struct drm_fb *fb;
int i;
@ -492,7 +486,6 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf,
err_free:
drm_fb_destroy_dmabuf(fb);
return NULL;
#endif
}
struct drm_fb *
@ -500,9 +493,7 @@ drm_fb_get_from_bo(struct gbm_bo *bo, struct drm_device *device,
bool is_opaque, enum drm_fb_type type)
{
struct drm_fb *fb = gbm_bo_get_user_data(bo);
#ifdef HAVE_GBM_MODIFIERS
int i;
#endif
if (fb) {
assert(fb->type == type);
@ -524,7 +515,6 @@ drm_fb_get_from_bo(struct gbm_bo *bo, struct drm_device *device,
fb->format = pixel_format_get_info(gbm_bo_get_format(bo));
fb->size = 0;
#ifdef HAVE_GBM_MODIFIERS
fb->modifier = gbm_bo_get_modifier(bo);
fb->num_planes = gbm_bo_get_plane_count(bo);
for (i = 0; i < fb->num_planes; i++) {
@ -532,12 +522,6 @@ drm_fb_get_from_bo(struct gbm_bo *bo, struct drm_device *device,
fb->handles[i] = gbm_bo_get_handle_for_plane(bo, i).u32;
fb->offsets[i] = gbm_bo_get_offset(bo, i);
}
#else
fb->num_planes = 1;
fb->strides[0] = gbm_bo_get_stride(bo);
fb->handles[0] = gbm_bo_get_handle(bo).u32;
fb->modifier = DRM_FORMAT_MOD_INVALID;
#endif
if (!fb->format) {
weston_log("couldn't look up format 0x%lx\n",

View File

@ -62,12 +62,6 @@ if get_option('renderer-gl')
if not dep_gbm.found()
error('drm-backend with GL renderer requires gbm which was not found. Or, you can use \'-Drenderer-gl=false\'.')
endif
if dep_gbm.version().version_compare('>= 17.1')
config_h.set('HAVE_GBM_MODIFIERS', '1')
endif
if dep_gbm.version().version_compare('>= 17.2')
config_h.set('HAVE_GBM_FD_IMPORT', '1')
endif
deps_drm += dep_gbm
srcs_drm += 'drm-gbm.c'
config_h.set('BUILD_DRM_GBM', '1')