diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h index 21bece8d..975fa268 100644 --- a/libweston/backend-drm/drm-internal.h +++ b/libweston/backend-drm/drm-internal.h @@ -114,15 +114,6 @@ #define MAX_CLONED_CONNECTORS 4 -/** - * aspect ratio info taken from the drmModeModeInfo flag bits 19-22, - * which should be used to fill the aspect ratio field in weston_mode. - */ -#define DRM_MODE_FLAG_PIC_AR_BITS_POS 19 -#ifndef DRM_MODE_FLAG_PIC_AR_MASK -#define DRM_MODE_FLAG_PIC_AR_MASK (0xF << DRM_MODE_FLAG_PIC_AR_BITS_POS) -#endif - /** * Represents the values of an enum-type KMS property */ diff --git a/libweston/backend-drm/modes.c b/libweston/backend-drm/modes.c index 12514cfe..7c45e50a 100644 --- a/libweston/backend-drm/modes.c +++ b/libweston/backend-drm/modes.c @@ -52,8 +52,19 @@ static const char *const aspect_ratio_as_string[] = { static enum weston_mode_aspect_ratio drm_to_weston_mode_aspect_ratio(uint32_t drm_mode_flags) { - return (drm_mode_flags & DRM_MODE_FLAG_PIC_AR_MASK) >> - DRM_MODE_FLAG_PIC_AR_BITS_POS; + switch (drm_mode_flags & DRM_MODE_FLAG_PIC_AR_MASK) { + case DRM_MODE_FLAG_PIC_AR_4_3: + return WESTON_MODE_PIC_AR_4_3; + case DRM_MODE_FLAG_PIC_AR_16_9: + return WESTON_MODE_PIC_AR_16_9; + case DRM_MODE_FLAG_PIC_AR_64_27: + return WESTON_MODE_PIC_AR_64_27; + case DRM_MODE_FLAG_PIC_AR_256_135: + return WESTON_MODE_PIC_AR_256_135; + case DRM_MODE_FLAG_PIC_AR_NONE: + default: + return WESTON_MODE_PIC_AR_NONE; + } } static const char * diff --git a/meson.build b/meson.build index 764a1960..f1fa6ba6 100644 --- a/meson.build +++ b/meson.build @@ -139,7 +139,7 @@ dep_libinput = dependency('libinput', version: '>= 0.8.0') dep_libevdev = dependency('libevdev') dep_libm = cc.find_library('m') dep_libdl = cc.find_library('dl') -dep_libdrm = dependency('libdrm', version: '>= 2.4.83') +dep_libdrm = dependency('libdrm', version: '>= 2.4.86') dep_libdrm_headers = dep_libdrm.partial_dependency(compile_args: true) dep_threads = dependency('threads')