Skip to content

Commit a68362f

Browse files
contactshashanksharmadanvet
authored andcommitted
drm: Add and handle new aspect ratios in DRM layer
HDMI 2.0/CEA-861-F introduces two new aspect ratios: - 64:27 - 256:135 This patch: - Adds new DRM flags for to represent these new aspect ratios. - Adds new cases to handle these aspect ratios while converting from user->kernel mode or vise versa. V2: Rebase V3: Align macro for DRM_MODE_PICTURE_ASPECT_256_135 (Jim Bride) V4: Added r-b from Jose. Signed-off-by: Shashank Sharma <[email protected]> Reviewed-by: Sean Paul <[email protected]> Reviewed-by: Jose Abreu <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Emil Velikov <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a6e78b3 commit a68362f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/gpu/drm/drm_modes.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,12 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
15091509
case HDMI_PICTURE_ASPECT_16_9:
15101510
out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
15111511
break;
1512+
case HDMI_PICTURE_ASPECT_64_27:
1513+
out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
1514+
break;
1515+
case DRM_MODE_PICTURE_ASPECT_256_135:
1516+
out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
1517+
break;
15121518
case HDMI_PICTURE_ASPECT_RESERVED:
15131519
default:
15141520
out->flags |= DRM_MODE_FLAG_PIC_AR_NONE;
@@ -1570,6 +1576,12 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
15701576
case DRM_MODE_FLAG_PIC_AR_16_9:
15711577
out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
15721578
break;
1579+
case DRM_MODE_FLAG_PIC_AR_64_27:
1580+
out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
1581+
break;
1582+
case DRM_MODE_FLAG_PIC_AR_256_135:
1583+
out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
1584+
break;
15731585
default:
15741586
out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
15751587
break;

include/uapi/drm/drm_mode.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ extern "C" {
8181
#define DRM_MODE_PICTURE_ASPECT_NONE 0
8282
#define DRM_MODE_PICTURE_ASPECT_4_3 1
8383
#define DRM_MODE_PICTURE_ASPECT_16_9 2
84+
#define DRM_MODE_PICTURE_ASPECT_64_27 3
85+
#define DRM_MODE_PICTURE_ASPECT_256_135 4
8486

8587
/* Aspect ratio flag bitmask (4 bits 22:19) */
8688
#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19)
@@ -90,6 +92,10 @@ extern "C" {
9092
(DRM_MODE_PICTURE_ASPECT_4_3<<19)
9193
#define DRM_MODE_FLAG_PIC_AR_16_9 \
9294
(DRM_MODE_PICTURE_ASPECT_16_9<<19)
95+
#define DRM_MODE_FLAG_PIC_AR_64_27 \
96+
(DRM_MODE_PICTURE_ASPECT_64_27<<19)
97+
#define DRM_MODE_FLAG_PIC_AR_256_135 \
98+
(DRM_MODE_PICTURE_ASPECT_256_135<<19)
9399

94100
/* DPMS flags */
95101
/* bit compatible with the xorg definitions. */

0 commit comments

Comments
 (0)