History

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.

Shashank Sharma committed 10 years ago

Commit a68362f1 parent a6e78b32 files · +18 −0Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/drm_modes.c +12 −0
  2. include/uapi/drm/drm_mode.h +6 −0
drivers/gpu/drm/drm_modes.c+12−0
@@ -1509,6 +1509,12 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out, · 1508 unmodified lines
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, · 55 unmodified lines
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+6−0
@@ -81,6 +81,8 @@ extern "C" { · 80 unmodified lines
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" { · 3 unmodified lines
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. */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t