Skip to contentSkip to conversation

Add aspect ratio parsing

PATCH In review Shashank Sharma 5 participants 11 messages Mar 24, 2016 – Mar 29, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Add aspect ratio parsing

Currently DRM framework doesn't parse aspect ratio of a videomode while converting it from a umode->kmode or viceversa. This causes modeset of CEA modes with incorrect aspect ratio.

While running HDMI complaince, tests (like 7-27) expect the DUT to apply the mode as per the VIC, but as driver does not consider the aspect ratio part while searching a mode from modedb, we end up setting mode with a wrong VIC, causing the test to fail.

What this patch set does:
Patch 1-2
- Adds aspect ratio flags in the DRM layer, in form of flags.
- Adds parsing of aspect ratio, during conversion of a umode->kmode and viceversa.
- Adds aspect ratio check while finding a mode, during modeset.

Patch 3-5
- Adds some new aspect ratio defined in CEA-861-F specs to support HDMI 2.0 displays, in DRM and I915 layer.

V2: needed a rebase

Shashank Sharma (5):
drm: add picture aspect ratio flags
drm: Add aspect ratio parsing in DRM layer
video: Add new aspect ratios for HDMI 2.0
drm: Add flags for new aspect ratios
drm/i915: Add support for new aspect ratios

 drivers/gpu/drm/drm_modes.c       | 46 +++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_hdmi.c |  6 +++++
 drivers/gpu/drm/i915/intel_sdvo.c |  6 +++++
 drivers/video/hdmi.c              |  4 ++++
 include/linux/hdmi.h              |  2 ++
 include/uapi/drm/drm_mode.h       | 24 +++++++++++++++-----
 6 files changed, 83 insertions(+), 5 deletions(-)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v2 1/5 drm: add picture aspect ratio flags

This patch adds drm flag bits for aspect ratio information

Currently drm flag bits don't have field for mode's picture aspect ratio. This field will help the driver to pick mode with right aspect ratio, and help in setting right VIC field in avi infoframes.

---
 include/uapi/drm/drm_mode.h | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
include/uapi/drm/drm_mode.h +13 -5
index 50adb46..3389bd1 100644
@@ -73,6 +73,19 @@
 #define  DRM_MODE_FLAG_3D_TOP_AND_BOTTOM	(7<<14)
 #define  DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF	(8<<14)
 
+/* Picture aspect ratio options */
+#define DRM_MODE_PICTURE_ASPECT_NONE		0
+#define DRM_MODE_PICTURE_ASPECT_4_3		1
+#define DRM_MODE_PICTURE_ASPECT_16_9		2
+
+/* Aspect ratio flag bitmask (4 bits 21:19) */
+#define	 DRM_MODE_FLAG_PARMASK		(0x0F<<19)
+#define  DRM_MODE_FLAG_PARNONE \
+		(DRM_MODE_PICTURE_ASPECT_NONE << 19)
+#define  DRM_MODE_FLAG_PAR4_3 \
+		(DRM_MODE_PICTURE_ASPECT_4_3 << 19)
+#define  DRM_MODE_FLAG_PAR16_9 \
+		(DRM_MODE_PICTURE_ASPECT_16_9 << 19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
@@ -88,11 +101,6 @@
 #define DRM_MODE_SCALE_CENTER		2 /* Centered, no scaling */
 #define DRM_MODE_SCALE_ASPECT		3 /* Full screen, preserve aspect */
 
-/* Picture aspect ratio options */
-#define DRM_MODE_PICTURE_ASPECT_NONE	0
-#define DRM_MODE_PICTURE_ASPECT_4_3	1
-#define DRM_MODE_PICTURE_ASPECT_16_9	2
-
 /* Dithering mode options */
 #define DRM_MODE_DITHERING_OFF	0
 #define DRM_MODE_DITHERING_ON	1
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#2 lore raw

Re: [PATCH v2 1/5] drm: add picture aspect ratio flags

Quoted 10 lines · Shashank Sharma

This patch adds drm flag bits for aspect ratio information

Currently drm flag bits don't have field for mode's picture aspect ratio. This field will help the driver to pick mode with right aspect ratio, and help in setting right VIC field in avi infoframes.

---
 include/uapi/drm/drm_mode.h | 18 +++++++++++++-----

Please use scripts/get_maintainer.pl on the patch to figure out who it should be sent to. This file is not maintained by us, so we can't just merge it.

For example:

$ scripts/get_maintainer.pl 0001-drm-add-picture-aspect-ratio-flags.patch 
David Airlie <[email protected]> (maintainer:DRM DRIVERS)
[email protected] (open list:DRM DRIVERS)
[email protected] (open list)

Of course, since you ultimately aim for a change in drm/i915, you should also Cc: intel-gfx.

BR,
Jani.

Quoted 38 lines
 1 file changed, 13 insertions(+), 5 deletions(-)
include/uapi/drm/drm_mode.h +13 -5
index 50adb46..3389bd1 100644
@@ -73,6 +73,19 @@
 #define  DRM_MODE_FLAG_3D_TOP_AND_BOTTOM	(7<<14)
 #define  DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF	(8<<14)
 
+/* Picture aspect ratio options */
+#define DRM_MODE_PICTURE_ASPECT_NONE		0
+#define DRM_MODE_PICTURE_ASPECT_4_3		1
+#define DRM_MODE_PICTURE_ASPECT_16_9		2
+
+/* Aspect ratio flag bitmask (4 bits 21:19) */
+#define	 DRM_MODE_FLAG_PARMASK		(0x0F<<19)
+#define  DRM_MODE_FLAG_PARNONE \
+		(DRM_MODE_PICTURE_ASPECT_NONE << 19)
+#define  DRM_MODE_FLAG_PAR4_3 \
+		(DRM_MODE_PICTURE_ASPECT_4_3 << 19)
+#define  DRM_MODE_FLAG_PAR16_9 \
+		(DRM_MODE_PICTURE_ASPECT_16_9 << 19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
@@ -88,11 +101,6 @@
 #define DRM_MODE_SCALE_CENTER		2 /* Centered, no scaling */
 #define DRM_MODE_SCALE_ASPECT		3 /* Full screen, preserve aspect */
 
-/* Picture aspect ratio options */
-#define DRM_MODE_PICTURE_ASPECT_NONE	0
-#define DRM_MODE_PICTURE_ASPECT_4_3	1
-#define DRM_MODE_PICTURE_ASPECT_16_9	2
-
 /* Dithering mode options */
 #define DRM_MODE_DITHERING_OFF	0
 #define DRM_MODE_DITHERING_ON	1
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH v2 1/5] drm: add picture aspect ratio flags

Ok, will do it for other patches too.

Regards
Shashank
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Thursday, March 24, 2016 6:26 PM
To: Sharma, Shashank; Vivi, Rodrigo
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v2 1/5] drm: add picture aspect ratio flags

Quoted 9 lines · Shashank Sharma

This patch adds drm flag bits for aspect ratio information

Currently drm flag bits don't have field for mode's picture aspect ratio. This field will help the driver to pick mode with right aspect ratio, and help in setting right VIC field in avi infoframes.

---
 include/uapi/drm/drm_mode.h | 18 +++++++++++++-----

Please use scripts/get_maintainer.pl on the patch to figure out who it should be sent to. This file is not maintained by us, so we can't just merge it.

For example:

$ scripts/get_maintainer.pl 0001-drm-add-picture-aspect-ratio-flags.patch
David Airlie <[email protected]> (maintainer:DRM DRIVERS) [email protected] (open list:DRM DRIVERS) [email protected] (open list)

Of course, since you ultimately aim for a change in drm/i915, you should also Cc: intel-gfx.

BR,
Jani.

Quoted 29 lines
 1 file changed, 13 insertions(+), 5 deletions(-)
include/uapi/drm/drm_mode.h +13 -0
index 50adb46..3389bd1 100644
@@ -73,6 +73,19 @@
 #define  DRM_MODE_FLAG_3D_TOP_AND_BOTTOM	(7<<14)
 #define  DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF	(8<<14)
 
+/* Picture aspect ratio options */
+#define DRM_MODE_PICTURE_ASPECT_NONE		0
+#define DRM_MODE_PICTURE_ASPECT_4_3		1
+#define DRM_MODE_PICTURE_ASPECT_16_9		2
+
+/* Aspect ratio flag bitmask (4 bits 21:19) */
+#define	 DRM_MODE_FLAG_PARMASK		(0x0F<<19)
+#define  DRM_MODE_FLAG_PARNONE \
+		(DRM_MODE_PICTURE_ASPECT_NONE << 19) #define  DRM_MODE_FLAG_PAR4_3 
+\
+		(DRM_MODE_PICTURE_ASPECT_4_3 << 19) #define  DRM_MODE_FLAG_PAR16_9 
+\
+		(DRM_MODE_PICTURE_ASPECT_16_9 << 19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */ @@ -88,11 +101,6 @@

#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */

include/uapi/drm/drm_mode.h line 106

Quoted 8 lines
include/uapi/drm/drm_mode.h +0 -5
-/* Picture aspect ratio options */
-#define DRM_MODE_PICTURE_ASPECT_NONE	0
-#define DRM_MODE_PICTURE_ASPECT_4_3	1
-#define DRM_MODE_PICTURE_ASPECT_16_9	2
-
 /* Dithering mode options */
 #define DRM_MODE_DITHERING_OFF	0
 #define DRM_MODE_DITHERING_ON	1

--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#4 lore raw

Re: [PATCH v2 1/5] drm: add picture aspect ratio flags

Thanks Shashank.

When they get merged and propagated to nightly I merge the last one in internal.

Quoted 79 lines · Shashank

Ok, will do it for other patches too.

Regards
Shashank
-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Thursday, March 24, 2016 6:26 PM
To: Sharma, Shashank; Vivi, Rodrigo
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v2 1/5] drm: add picture aspect ratio flags

Quoted 10 lines · Shashank Sharma

This patch adds drm flag bits for aspect ratio information

Currently drm flag bits don't have field for mode's picture aspect ratio. This field will help the driver to pick mode with right aspect
ratio, and help in setting right VIC field in avi infoframes.

---
 include/uapi/drm/drm_mode.h | 18 +++++++++++++-----

Please use scripts/get_maintainer.pl on the patch to figure out who it should be sent to. This file is not maintained by us, so we can't just merge it.

For example:

$ scripts/get_maintainer.pl 0001-drm-add-picture-aspect-ratio
-flags.patch
David Airlie <[email protected]> (maintainer:DRM DRIVERS) 
[email protected] (open list:DRM DRIVERS) 
[email protected] (open list)

Of course, since you ultimately aim for a change in drm/i915, you should also Cc: intel-gfx.

BR,
Jani.

Quoted 35 lines
 1 file changed, 13 insertions(+), 5 deletions(-)
include/uapi/drm/drm_mode.h +13 -0
index 50adb46..3389bd1 100644
@@ -73,6 +73,19 @@
 #define  DRM_MODE_FLAG_3D_TOP_AND_BOTTOM	(7<<14)
 #define  DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF	(8<<14)
 
+/* Picture aspect ratio options */
+#define DRM_MODE_PICTURE_ASPECT_NONE		0
+#define DRM_MODE_PICTURE_ASPECT_4_3		1
+#define DRM_MODE_PICTURE_ASPECT_16_9		2
+
+/* Aspect ratio flag bitmask (4 bits 21:19) */
+#define	 DRM_MODE_FLAG_PARMASK		(0x0F<<19)
+#define  DRM_MODE_FLAG_PARNONE \
+		(DRM_MODE_PICTURE_ASPECT_NONE << 19) #define 
 DRM_MODE_FLAG_PAR4_3 
+\
+		(DRM_MODE_PICTURE_ASPECT_4_3 << 19) #define 
 DRM_MODE_FLAG_PAR16_9 
+\
+		(DRM_MODE_PICTURE_ASPECT_16_9 << 19)
 

/* DPMS flags */
/* bit compatible with the xorg definitions. */ @@ -88,11 +101,6
@@
#define DRM_MODE_SCALE_CENTER 2 /* Centered, no
scaling */
#define DRM_MODE_SCALE_ASPECT 3 /* Full screen,
preserve aspect */

Quoted 11 lines

include/uapi/drm/drm_mode.h line 106

Quoted 8 lines
include/uapi/drm/drm_mode.h +0 -5
-/* Picture aspect ratio options */
-#define DRM_MODE_PICTURE_ASPECT_NONE	0
-#define DRM_MODE_PICTURE_ASPECT_4_3	1
-#define DRM_MODE_PICTURE_ASPECT_16_9	2
-
 /* Dithering mode options */
 #define DRM_MODE_DITHERING_OFF	0
 #define DRM_MODE_DITHERING_ON	1

--
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

PATCH v2 2/5 drm: Add aspect ratio parsing in DRM layer

In reply to Shashank Sharma

Current DRM layer functions dont parse aspect ratio information while converting a user mode->kernel mode or viceversa. This causes modeset to pick mode with wrong aspect ratio, eventually cauing failures in HDMI compliance test cases, due to wrong VIC.

This patch adds aspect ratio information in DRM's mode conversion and mode comparision functions, to make sure kernel picks mode with right aspect ratio (as per the VIC).

---
 drivers/gpu/drm/drm_modes.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
drivers/gpu/drm/drm_modes.c +34 -0
index 20775c0..7824a63 100644
@@ -939,6 +939,9 @@ bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct
 	    (mode2->flags & DRM_MODE_FLAG_3D_MASK))
 		return false;
 
+	if (mode1->picture_aspect_ratio != mode2->picture_aspect_ratio)
+		return false;
+
 	return drm_mode_equal_no_clocks_no_stereo(mode1, mode2);
 }
 EXPORT_SYMBOL(drm_mode_equal_no_clocks);
@@ -967,6 +970,7 @@ bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1,
 	    mode1->vsync_end == mode2->vsync_end &&
 	    mode1->vtotal == mode2->vtotal &&
 	    mode1->vscan == mode2->vscan &&
+	    mode1->picture_aspect_ratio == mode2->picture_aspect_ratio &&
 	    (mode1->flags & ~DRM_MODE_FLAG_3D_MASK) ==
 	     (mode2->flags & ~DRM_MODE_FLAG_3D_MASK))
 		return true;
@@ -1470,6 +1474,22 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
 	out->vrefresh = in->vrefresh;
 	out->flags = in->flags;
 	out->type = in->type;
+	out->flags &= ~DRM_MODE_FLAG_PARMASK;
+
+	switch (in->picture_aspect_ratio) {
+	case HDMI_PICTURE_ASPECT_4_3:
+		out->flags |= DRM_MODE_FLAG_PAR4_3;
+		break;
+	case HDMI_PICTURE_ASPECT_16_9:
+		out->flags |= DRM_MODE_FLAG_PAR16_9;
+		break;
+	case HDMI_PICTURE_ASPECT_NONE:
+	case HDMI_PICTURE_ASPECT_RESERVED:
+	default:
+		out->flags |= DRM_MODE_FLAG_PARNONE;
+		break;
+	}
+
 	strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
 	out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
 }
@@ -1515,6 +1535,20 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
 	strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
 	out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
 
+	/* Clearing picture aspect ratio bits from out flags */
+	out->flags &= ~DRM_MODE_FLAG_PARMASK;
+
+	switch (in->flags & DRM_MODE_FLAG_PARMASK) {
+	case DRM_MODE_FLAG_PAR4_3:
+		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_4_3;
+		break;
+	case DRM_MODE_FLAG_PAR16_9:
+		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
+		break;
+	default:
+		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
+	}
+
 	out->status = drm_mode_validate_basic(out);
 	if (out->status != MODE_OK)
 		goto out;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH v2 3/5 video: Add new aspect ratios for HDMI 2.0

In reply to Shashank Sharma

HDMI 2.0/CEA-861-F introduces two new aspect ratios:
- 64:27
- 256:135

This patch adds enumeration for the new aspect ratios in the existing aspect ratio list.

---
 drivers/video/hdmi.c | 4 ++++
 include/linux/hdmi.h | 2 ++
 2 files changed, 6 insertions(+)
drivers/video/hdmi.c +4 -0
index 1626892..1cf907e 100644
@@ -533,6 +533,10 @@ hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect)
 		return "4:3";
 	case HDMI_PICTURE_ASPECT_16_9:
 		return "16:9";
+	case HDMI_PICTURE_ASPECT_64_27:
+		return "64:27";
+	case HDMI_PICTURE_ASPECT_256_135:
+		return "256:135";
 	case HDMI_PICTURE_ASPECT_RESERVED:
 		return "Reserved";
 	}
include/linux/hdmi.h +2 -0
index e974420..edbb4fc 100644
@@ -78,6 +78,8 @@ enum hdmi_picture_aspect {
 	HDMI_PICTURE_ASPECT_NONE,
 	HDMI_PICTURE_ASPECT_4_3,
 	HDMI_PICTURE_ASPECT_16_9,
+	HDMI_PICTURE_ASPECT_64_27,
+	HDMI_PICTURE_ASPECT_256_135,
 	HDMI_PICTURE_ASPECT_RESERVED,
 };
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH v2 4/5 drm: Add flags for new aspect ratios

In reply to Shashank Sharma

HDMI 2.0/CEA-861-F introduces two new aspect ratios:
- 64:27
- 256:135

This patch adds DRM flags for the new aspect ratios in the existing aspect ratio flags.

---
 include/uapi/drm/drm_mode.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/uapi/drm/drm_mode.h +6 -0
index 3389bd1..b482d73 100644
@@ -77,6 +77,8 @@
 #define DRM_MODE_PICTURE_ASPECT_NONE		0
 #define DRM_MODE_PICTURE_ASPECT_4_3		1
 #define DRM_MODE_PICTURE_ASPECT_16_9		2
+#define DRM_MODE_PICTURE_ASPECT_64_27		3
+#define DRM_MODE_PICTURE_ASPECT_256_135	4
 
 /* Aspect ratio flag bitmask (4 bits 21:19) */
 #define	 DRM_MODE_FLAG_PARMASK		(0x0F<<19)
@@ -86,6 +88,10 @@
 		(DRM_MODE_PICTURE_ASPECT_4_3 << 19)
 #define  DRM_MODE_FLAG_PAR16_9 \
 		(DRM_MODE_PICTURE_ASPECT_16_9 << 19)
+#define  DRM_MODE_FLAG_PAR64_27 \
+		(DRM_MODE_PICTURE_ASPECT_64_27 << 19)
+#define  DRM_MODE_FLAG_PAR256_135 \
+		(DRM_MODE_PICTURE_ASPECT_256_135 << 19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH v2 5/5 drm/i915: Add support for new aspect ratios

In reply to Shashank Sharma

HDMI 2.0/CEA-861-F introduces two new aspect ratios:
- 64:27
- 256:135

This patch adds support for these aspect ratios in I915 driver, at various places.

---
 drivers/gpu/drm/drm_modes.c       | 12 ++++++++++++
 drivers/gpu/drm/i915/intel_hdmi.c |  6 ++++++
 drivers/gpu/drm/i915/intel_sdvo.c |  6 ++++++
 3 files changed, 24 insertions(+)
drivers/gpu/drm/drm_modes.c +12 -0
index 7824a63..7e27854 100644
@@ -1483,6 +1483,12 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
 	case HDMI_PICTURE_ASPECT_16_9:
 		out->flags |= DRM_MODE_FLAG_PAR16_9;
 		break;
+	case HDMI_PICTURE_ASPECT_64_27:
+		out->flags |= DRM_MODE_FLAG_PAR64_27;
+		break;
+	case DRM_MODE_PICTURE_ASPECT_256_135:
+		out->flags |= DRM_MODE_FLAG_PAR256_135;
+		break;
 	case HDMI_PICTURE_ASPECT_NONE:
 	case HDMI_PICTURE_ASPECT_RESERVED:
 	default:
@@ -1545,6 +1551,12 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
 	case DRM_MODE_FLAG_PAR16_9:
 		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
 		break;
+	case DRM_MODE_FLAG_PAR64_27:
+		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
+		break;
+	case DRM_MODE_FLAG_PAR256_135:
+		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
+		break;
 	default:
 		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 	}
drivers/gpu/drm/i915/intel_hdmi.c +6 -0
index 6825543..6d5c3ad 100644
@@ -1533,6 +1533,12 @@ intel_hdmi_set_property(struct drm_connector *connector,
 		case DRM_MODE_PICTURE_ASPECT_16_9:
 			intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_16_9;
 			break;
+		case DRM_MODE_PICTURE_ASPECT_64_27:
+			intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_64_27;
+			break;
+		case DRM_MODE_PICTURE_ASPECT_256_135:
+			intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_256_135;
+			break;
 		default:
 			return -EINVAL;
 		}
drivers/gpu/drm/i915/intel_sdvo.c +6 -0
index 2e1da06..83f30d6 100644
@@ -2069,6 +2069,12 @@ intel_sdvo_set_property(struct drm_connector *connector,
 		case DRM_MODE_PICTURE_ASPECT_16_9:
 			intel_sdvo->aspect_ratio = HDMI_PICTURE_ASPECT_16_9;
 			break;
+		case DRM_MODE_PICTURE_ASPECT_64_27:
+			intel_sdvo->aspect_ratio = HDMI_PICTURE_ASPECT_64_27;
+			break;
+		case DRM_MODE_PICTURE_ASPECT_256_135:
+			intel_sdvo->aspect_ratio = HDMI_PICTURE_ASPECT_256_135;
+			break;
 		default:
 			return -EINVAL;
 		}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH v2 5/5] drm/i915: Add support for new aspect ratios

Quoted 8 lines · Shashank Sharma

HDMI 2.0/CEA-861-F introduces two new aspect ratios:
- 64:27
- 256:135

This patch adds support for these aspect ratios in I915 driver, at various places.

Given that we have the exact same switch lookup code 4 times in i915 alone I think it's time for some helpers to convert between the two. -Daniel

Quoted 77 lines
---
 drivers/gpu/drm/drm_modes.c       | 12 ++++++++++++
 drivers/gpu/drm/i915/intel_hdmi.c |  6 ++++++
 drivers/gpu/drm/i915/intel_sdvo.c |  6 ++++++
 3 files changed, 24 insertions(+)
drivers/gpu/drm/drm_modes.c +12 -0
index 7824a63..7e27854 100644
@@ -1483,6 +1483,12 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
 	case HDMI_PICTURE_ASPECT_16_9:
 		out->flags |= DRM_MODE_FLAG_PAR16_9;
 		break;
+	case HDMI_PICTURE_ASPECT_64_27:
+		out->flags |= DRM_MODE_FLAG_PAR64_27;
+		break;
+	case DRM_MODE_PICTURE_ASPECT_256_135:
+		out->flags |= DRM_MODE_FLAG_PAR256_135;
+		break;
 	case HDMI_PICTURE_ASPECT_NONE:
 	case HDMI_PICTURE_ASPECT_RESERVED:
 	default:
@@ -1545,6 +1551,12 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
 	case DRM_MODE_FLAG_PAR16_9:
 		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
 		break;
+	case DRM_MODE_FLAG_PAR64_27:
+		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
+		break;
+	case DRM_MODE_FLAG_PAR256_135:
+		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
+		break;
 	default:
 		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 	}
drivers/gpu/drm/i915/intel_hdmi.c +6 -0
index 6825543..6d5c3ad 100644
@@ -1533,6 +1533,12 @@ intel_hdmi_set_property(struct drm_connector *connector,
 		case DRM_MODE_PICTURE_ASPECT_16_9:
 			intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_16_9;
 			break;
+		case DRM_MODE_PICTURE_ASPECT_64_27:
+			intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_64_27;
+			break;
+		case DRM_MODE_PICTURE_ASPECT_256_135:
+			intel_hdmi->aspect_ratio = HDMI_PICTURE_ASPECT_256_135;
+			break;
 		default:
 			return -EINVAL;
 		}
drivers/gpu/drm/i915/intel_sdvo.c +6 -0
index 2e1da06..83f30d6 100644
@@ -2069,6 +2069,12 @@ intel_sdvo_set_property(struct drm_connector *connector,
 		case DRM_MODE_PICTURE_ASPECT_16_9:
 			intel_sdvo->aspect_ratio = HDMI_PICTURE_ASPECT_16_9;
 			break;
+		case DRM_MODE_PICTURE_ASPECT_64_27:
+			intel_sdvo->aspect_ratio = HDMI_PICTURE_ASPECT_64_27;
+			break;
+		case DRM_MODE_PICTURE_ASPECT_256_135:
+			intel_sdvo->aspect_ratio = HDMI_PICTURE_ASPECT_256_135;
+			break;
 		default:
 			return -EINVAL;
 		}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

✗ Fi.CI.BAT: failure for Add aspect ratio parsing (rev2)

In reply to Shashank Sharma
== Series Details ==

== Series Details ==

Series: Add aspect ratio parsing (rev2)
URL : https://patchwork.freedesktop.org/series/1915/
State : failure

== Summary ==

Series 1915v2 Add aspect ratio parsing
http://patchwork.freedesktop.org/api/1.0/series/1915/revisions/2/mbox/

Test gem_exec_suspend:

        Subgroup basic-s3:
                dmesg-warn -> PASS       (bsw-nuc-2)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (skl-nuci5)
        Subgroup suspend-read-crc-pipe-c:
                incomplete -> PASS       (hsw-gt2)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                dmesg-warn -> PASS       (byt-nuc)
        Subgroup basic-rte:
                pass       -> DMESG-WARN (bsw-nuc-2)
bdw-nuci7        total:192  pass:180  dwarn:0   dfail:0   fail:0   skip:12 
bdw-ultra        total:192  pass:171  dwarn:0   dfail:0   fail:0   skip:21 
bsw-nuc-2        total:192  pass:154  dwarn:1   dfail:0   fail:0   skip:37 
byt-nuc          total:192  pass:157  dwarn:0   dfail:0   fail:0   skip:35 
hsw-brixbox      total:192  pass:170  dwarn:0   dfail:0   fail:0   skip:22 
hsw-gt2          total:192  pass:175  dwarn:0   dfail:0   fail:0   skip:17 
ivb-t430s        total:192  pass:167  dwarn:0   dfail:0   fail:0   skip:25 
skl-i7k-2        total:192  pass:169  dwarn:0   dfail:0   fail:0   skip:23 
skl-nuci5        total:7    pass:6    dwarn:0   dfail:0   fail:0   skip:0  
snb-dellxps      total:192  pass:158  dwarn:0   dfail:0   fail:0   skip:34 
snb-x220t        total:192  pass:158  dwarn:0   dfail:0   fail:1   skip:33 

Results at /archive/results/CI_IGT_test/Patchwork_1705/

79ee42317266a82b932a39e9567244ed91dd27d6 drm-intel-nightly: 2016y-03m-24d-10h-26m-54s UTC integration manifest a60eb2345fd88921efd726b87c3fcdb37ac4e354 drm/i915: Add support for new aspect ratios 88cc86a1fac6487e28c7fa417907b3cdeaf42c51 drm: Add flags for new aspect ratios 78ae236a5577f16e09246bf380d759a4ef519a58 video: Add new aspect ratios for HDMI 2.0 fa5c2406d9b48b353b1e11480610fe388fe89381 drm: Add aspect ratio parsing in DRM layer b969d1257347df863347dbe71ffe517f9ca8e263 drm: add picture aspect ratio flags

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx