Skip to contentSkip to conversation

Revert "drm: Add and handle new aspect ratios in DRM layer"

PATCH In review [email protected] 7 participants 44 messages Nov 3, 2016 – Nov 15, 2016 3 messages not in the archive

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

PATCH 1/2 Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_modes.c | 12 ------------
 include/uapi/drm/drm_mode.h |  6 ------
 2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -12
index f64ac86deb84..725faa6409aa 100644
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
 	case HDMI_PICTURE_ASPECT_16_9:
 		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
 		break;
-	case HDMI_PICTURE_ASPECT_64_27:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-		break;
-	case DRM_MODE_PICTURE_ASPECT_256_135:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-		break;
 	case HDMI_PICTURE_ASPECT_RESERVED:
 	default:
 		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE;
@@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
 	case DRM_MODE_FLAG_PIC_AR_16_9:
 		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
 		break;
-	case DRM_MODE_FLAG_PIC_AR_64_27:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_256_135:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-		break;
 	default:
 		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 		break;
include/uapi/drm/drm_mode.h +0 -6
index 084b50a02dc5..5c142b1387ac 100644
@@ -81,8 +81,6 @@ extern "C" {
 #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 22:19) */
 #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
 			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
 #define  DRM_MODE_FLAG_PIC_AR_16_9 \
 			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
Signature · 6 lines
2.7.4

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

PATCH 2/2 Revert "drm: Add aspect ratio parsing in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit 6dffd431e2296cda08e7e4f0242e02df1d1698cd.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

This also broke things so that we would always send out VIC==0 in the AVI infoframe unless the user specified an aspect ratio via the mode flags. And the automagic RGB full vs. limited range handling was similartly broken as the user mode would never match any CEA mode.

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_modes.c | 31 -------------------------------
 1 file changed, 31 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -31
index 725faa6409aa..18442b5bb34c 100644
@@ -1001,7 +1001,6 @@ 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;
@@ -1504,21 +1503,6 @@ 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_PIC_AR_MASK;
-
-	switch (in->picture_aspect_ratio) {
-	case HDMI_PICTURE_ASPECT_4_3:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_4_3;
-		break;
-	case HDMI_PICTURE_ASPECT_16_9:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
-		break;
-	case HDMI_PICTURE_ASPECT_RESERVED:
-	default:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE;
-		break;
-	}
-
 	strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
 	out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
 }
@@ -1564,21 +1548,6 @@ 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_PIC_AR_MASK;
-
-	switch (in->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
-	case DRM_MODE_FLAG_PIC_AR_4_3:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_4_3;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_16_9:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
-		break;
-	default:
-		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
-		break;
-	}
-
 	out->status = drm_mode_validate_basic(out);
 	if (out->status != MODE_OK)
 		goto out;
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

RE: [PATCH 2/2] Revert "drm: Add aspect ratio parsing in DRM layer"

NACK until we get to the right reason.

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 2/2] Revert "drm: Add aspect ratio parsing in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit 6dffd431e2296cda08e7e4f0242e02df1d1698cd.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

This also broke things so that we would always send out VIC==0 in the AVI infoframe unless the user specified an aspect ratio via the mode flags. And the automagic RGB full vs. limited range handling was similartly broken as the user mode would never match any CEA mode.

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_modes.c | 31 -------------------------------
 1 file changed, 31 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -16
@@ -1001,7 +1001,6 @@ 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;
@@ -1504,21 +1503,6 @@ 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_PIC_AR_MASK;
-
-	switch (in->picture_aspect_ratio) {
-	case HDMI_PICTURE_ASPECT_4_3:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_4_3;
-		break;
-	case HDMI_PICTURE_ASPECT_16_9:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
-		break;
-	case HDMI_PICTURE_ASPECT_RESERVED:
-	default:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE;
-		break;
-	}
-
 	strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
 	out->name[DRM_DISPLAY_MODE_LEN-1] = 0;  } @@ -1564,21 +1548,6 @@ 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_PIC_AR_MASK;
-
- switch (in->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
- case DRM_MODE_FLAG_PIC_AR_4_3:
- out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_4_3;
- break;
- case DRM_MODE_FLAG_PIC_AR_16_9:
- out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
- break;
- default:
- out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
- break;
- }
-
out->status = drm_mode_validate_basic(out); if (out->status != MODE_OK)
goto out;
--
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): FF3DDC77922A8A4BB08A3BC48A1EA8CB411AE158@BGSMSX101.gar.corp.intel.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 6 lines · Ville Syrjälä
Quoted 3 lines · Shashank

Hi Ville,
(-dri-devel)
I would appreciate an internal discussion before going to dri-devel. a

Added back. Private discussions are pointless.

Now added for reals.

Quoted 108 lines
Quoted 3 lines

What did this patch break ?

Intel ddx. It will reject any mode with flags it doesn't know about. Other ddxen like -ati or -modesetting will also suffer, but potentially in a different way since they don't even check the flags and instead just directly stuff them into the randr mode flags, which will result in an out of spec mode as far randr is concerned.

Quoted 1 line

This is exposed in the same way, as the 3D flags.

Not it isn't. We have a client cap for 3D flags.

Quoted 1 line

The information is already available in form of flags, all you have to do in userspace is read and print that. Its already being done in Android.

Please stop relying on Android for testing upstream patches. Test with actual userspace people are using.

Quoted 85 lines

NACK until we get to the right reason.

Regards
Shashank
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_modes.c | 12 ------------  include/uapi/drm/drm_mode.h |  6 ------
 2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -6
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
 	case HDMI_PICTURE_ASPECT_16_9:
 		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
 		break;
-	case HDMI_PICTURE_ASPECT_64_27:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-		break;
-	case DRM_MODE_PICTURE_ASPECT_256_135:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-		break;
 	case HDMI_PICTURE_ASPECT_RESERVED:
 	default:
 		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; @@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
drivers/gpu/drm/drm_modes.c +0 -6
 	case DRM_MODE_FLAG_PIC_AR_16_9:
 		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
 		break;
-	case DRM_MODE_FLAG_PIC_AR_64_27:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_256_135:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-		break;
 	default:
 		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 		break;
include/uapi/drm/drm_mode.h +0 -7
@@ -81,8 +81,6 @@ extern "C" {
 #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 22:19) */
 #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
 			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
 #define  DRM_MODE_FLAG_PIC_AR_16_9 \
 			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
--

2.7.4

Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
Quoted 19 lines · Ville Syrjälä
Quoted 6 lines · Ville Syrjälä
Quoted 3 lines · Shashank

Hi Ville,
(-dri-devel)
I would appreciate an internal discussion before going to dri-devel. a

Added back. Private discussions are pointless.

Now added for reals.

Quoted 9 lines
Quoted 3 lines

What did this patch break ?

Intel ddx. It will reject any mode with flags it doesn't know about. Other ddxen like -ati or -modesetting will also suffer, but potentially in a different way since they don't even check the flags and instead just directly stuff them into the randr mode flags, which will result in an out of spec mode as far randr is concerned.

BTW outside of the userspace issues there were some issues with the way the mode matching was being done. Before I realized the userspace breakage I had cooked up a few additonal patch to adjust the mode matching a bit. I pushed those to [1] in case anyone wants to take a look, but obviously they need to be put on hold a bit until we sort out the userspace part.

[1] git://github.com/vsyrjala/linux.git cea_f_vics

Quoted 107 lines
Quoted 99 lines
Quoted 2 lines

This is exposed in the same way, as the 3D flags.

Not it isn't. We have a client cap for 3D flags.

Quoted 1 line

The information is already available in form of flags, all you have to do in userspace is read and print that. Its already being done in Android.

Please stop relying on Android for testing upstream patches. Test with actual userspace people are using.

Quoted 85 lines

NACK until we get to the right reason.

Regards
Shashank
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_modes.c | 12 ------------  include/uapi/drm/drm_mode.h |  6 ------
 2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -6
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
 	case HDMI_PICTURE_ASPECT_16_9:
 		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
 		break;
-	case HDMI_PICTURE_ASPECT_64_27:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-		break;
-	case DRM_MODE_PICTURE_ASPECT_256_135:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-		break;
 	case HDMI_PICTURE_ASPECT_RESERVED:
 	default:
 		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; @@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
drivers/gpu/drm/drm_modes.c +0 -6
 	case DRM_MODE_FLAG_PIC_AR_16_9:
 		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
 		break;
-	case DRM_MODE_FLAG_PIC_AR_64_27:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_256_135:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-		break;
 	default:
 		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 		break;
include/uapi/drm/drm_mode.h +0 -7
@@ -81,8 +81,6 @@ extern "C" {
 #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 22:19) */
 #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
 			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
 #define  DRM_MODE_FLAG_PIC_AR_16_9 \
 			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
--

2.7.4

Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

Regards

Shashank

Quoted 8 lines · Ville Syrjälä
Quoted 7 lines · Ville Syrjälä
Quoted 5 lines · Ville Syrjälä
Quoted 3 lines · Shashank

Hi Ville,
(-dri-devel)
I would appreciate an internal discussion before going to dri-devel. a

Added back. Private discussions are pointless.

Now added for reals.

Noted for future.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

What did this patch break ?

Intel ddx. It will reject any mode with flags it doesn't know about. Other ddxen like -ati or -modesetting will also suffer, but potentially in a different way since they don't even check the flags and instead just directly stuff them into the randr mode flags, which will result in an out of spec mode as far randr is concerned.

We are adding new flags to indicate aspect ratios, so its obvious that the implementation should be modified to accept new flags. I dont see why you should revert patch for it. This is instead option to extend the support.

Quoted 2 lines

BTW outside of the userspace issues there were some issues with the way the mode matching was being done. Before I realized the userspace breakage

Again, this is not a break, we need to extend the test-setup for new flags.

Quoted 5 lines

I had cooked up a few additonal patch to adjust the mode matching a bit. I pushed those to [1] in case anyone wants to take a look, but obviously they need to be put on hold a bit until we sort out the userspace part.

[1] git://github.com/vsyrjala/linux.git cea_f_vics

I think we had several rounds of code reviews on this, since months. So I don't really see why are we discussing this now.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

This is exposed in the same way, as the 3D flags.

Not it isn't. We have a client cap for 3D flags.

Quoted 1 line

The information is already available in form of flags, all you have to do in userspace is read and print that. Its already being done in Android.

Please stop relying on Android for testing upstream patches. Test with actual userspace people are using.

Please note that android goes through HDMI compliance certification, and several commercial test infrastructures, so that's one of the best infrastructure to test. And when we have common branch for all of Linux flavors, we should consider all. I dont really think how breaking / blocking Android implementation is going to help others.
Also, the breaks what you are reporting are with the test tools / infrastructures, which is specific to one setup.

Honestly, thats one of the setup which uses aspect ratio in practical use cases, so I dont find a reason why not.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

NACK until we get to the right reason.

My nack continues.

Quoted 86 lines
Quoted 86 lines
Quoted 86 lines
Quoted 83 lines

Regards
Shashank
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
  drivers/gpu/drm/drm_modes.c | 12 ------------  include/uapi/drm/drm_mode.h |  6 ------
  2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -6
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
  	case HDMI_PICTURE_ASPECT_16_9:
  		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
  		break;
-	case HDMI_PICTURE_ASPECT_64_27:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-		break;
-	case DRM_MODE_PICTURE_ASPECT_256_135:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-		break;
  	case HDMI_PICTURE_ASPECT_RESERVED:
  	default:
  		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; @@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
  	case DRM_MODE_FLAG_PIC_AR_16_9:
  		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
  		break;
drivers/gpu/drm/drm_modes.c +0 -6
-	case DRM_MODE_FLAG_PIC_AR_64_27:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_256_135:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-		break;
  	default:
  		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
  		break;
include/uapi/drm/drm_mode.h +0 -7
@@ -81,8 +81,6 @@ extern "C" {
  #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 22:19) */
  #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
  			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
  #define  DRM_MODE_FLAG_PIC_AR_16_9 \
  			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
  /* DPMS flags */
  /* bit compatible with the xorg definitions. */
--

2.7.4

Signature · 2 lines
Ville Syrjälä
Intel OTC
Quoted 7 lines
Quoted 7 lines
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 18 lines · Shashank

Regards

Shashank

Quoted 5 lines · Ville Syrjälä
Quoted 3 lines · Shashank

Hi Ville,
(-dri-devel)
I would appreciate an internal discussion before going to dri-devel. a

Added back. Private discussions are pointless.

Noted.

Quoted 6 lines
Quoted 1 line

What did this patch break ?

Intel ddx. It will reject any mode with flags it doesn't know about. Other ddxen like -ati or -modesetting will also suffer, but potentially in a different way since they don't even check the flags and instead just directly stuff them into the randr mode flags, which will result in an out of spec mode as far randr is concerned.

Quoted 4 lines

Then its a fault of intel-ddx design. We are adding new flags to indicate aspect ratios, so its obvious that the implementation should be modified to accept new flags.
I dont see why you should revert patch for it.

Rule 1 of kernel development: You simply don't break existing userspace

Quoted 10 lines
Quoted 6 lines
Quoted 1 line

This is exposed in the same way, as the 3D flags.

Not it isn't. We have a client cap for 3D flags.

Quoted 1 line

The information is already available in form of flags, all you have to do in userspace is read and print that. Its already being done in Android.

Please stop relying on Android for testing upstream patches. Test with actual userspace people are using.

Please note that android goes through HDMI compliance certification, and several commercial test infrastructures, so
that's one of the best infrastructure to test. And when we have common branch for all of Linux flavors, we should consider all.

You can test with Android as much as you like. That probably won't catch ABI breaks and whatnot though since you don't generally just plop a new kernel onto an existing Android device.

So you really must test with normal userspace as well. That has a long history and so any ABI/behaviour change is actually a big deal.

Quoted 85 lines
Quoted 85 lines
Quoted 85 lines

NACK until we get to the right reason.

Regards
Shashank
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
  drivers/gpu/drm/drm_modes.c | 12 ------------  include/uapi/drm/drm_mode.h |  6 ------
  2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -6
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
  	case HDMI_PICTURE_ASPECT_16_9:
  		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
  		break;
-	case HDMI_PICTURE_ASPECT_64_27:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-		break;
-	case DRM_MODE_PICTURE_ASPECT_256_135:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-		break;
  	case HDMI_PICTURE_ASPECT_RESERVED:
  	default:
  		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; @@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
  	case DRM_MODE_FLAG_PIC_AR_16_9:
  		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
  		break;
drivers/gpu/drm/drm_modes.c +0 -6
-	case DRM_MODE_FLAG_PIC_AR_64_27:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_256_135:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-		break;
  	default:
  		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
  		break;
include/uapi/drm/drm_mode.h +0 -7
@@ -81,8 +81,6 @@ extern "C" {
  #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 22:19) */
  #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
  			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
  #define  DRM_MODE_FLAG_PIC_AR_16_9 \
  			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
  /* DPMS flags */
  /* bit compatible with the xorg definitions. */
--

2.7.4

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw

Regards

Shashank

Quoted 19 lines · Ville Syrjälä
Quoted 18 lines · Shashank

Regards

Shashank

Quoted 5 lines · Ville Syrjälä
Quoted 3 lines · Shashank

Hi Ville,
(-dri-devel)
I would appreciate an internal discussion before going to dri-devel. a

Added back. Private discussions are pointless.

Noted.

Quoted 6 lines
Quoted 1 line

What did this patch break ?

Intel ddx. It will reject any mode with flags it doesn't know about. Other ddxen like -ati or -modesetting will also suffer, but potentially in a different way since they don't even check the flags and instead just directly stuff them into the randr mode flags, which will result in an out of spec mode as far randr is concerned.

Quoted 5 lines
Quoted 4 lines

Then its a fault of intel-ddx design. We are adding new flags to indicate aspect ratios, so its obvious that the implementation should be modified to accept new flags.
I dont see why you should revert patch for it.

Rule 1 of kernel development: You simply don't break existing userspace

Again, we are adding something new, for which userspace should be modified.
If the userspace in written in such a way that it wont accept changes, its not saleable design.

Even in this case, we should go and extend the userspace (which I am ready to do) instead of reverting the patch. If you still think you should send this revert, I am removing my NACK. Pls Go ahead.

Quoted 97 lines
Quoted 10 lines
Quoted 6 lines
Quoted 1 line

This is exposed in the same way, as the 3D flags.

Not it isn't. We have a client cap for 3D flags.

Quoted 1 line

The information is already available in form of flags, all you have to do in userspace is read and print that. Its already being done in Android.

Please stop relying on Android for testing upstream patches. Test with actual userspace people are using.

Please note that android goes through HDMI compliance certification, and several commercial test infrastructures, so
that's one of the best infrastructure to test. And when we have common branch for all of Linux flavors, we should consider all.

You can test with Android as much as you like. That probably won't catch ABI breaks and whatnot though since you don't generally just plop a new kernel onto an existing Android device.

So you really must test with normal userspace as well. That has a long history and so any ABI/behaviour change is actually a big deal.

Quoted 80 lines
Quoted 80 lines
Quoted 80 lines

NACK until we get to the right reason.

Regards
Shashank
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
   drivers/gpu/drm/drm_modes.c | 12 ------------  include/uapi/drm/drm_mode.h |  6 ------
   2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -6
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
   	case HDMI_PICTURE_ASPECT_16_9:
   		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
   		break;
-	case HDMI_PICTURE_ASPECT_64_27:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-		break;
-	case DRM_MODE_PICTURE_ASPECT_256_135:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-		break;
   	case HDMI_PICTURE_ASPECT_RESERVED:
   	default:
   		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; @@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
   	case DRM_MODE_FLAG_PIC_AR_16_9:
   		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
   		break;
drivers/gpu/drm/drm_modes.c +0 -6
-	case DRM_MODE_FLAG_PIC_AR_64_27:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_256_135:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-		break;
   	default:
   		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
   		break;
include/uapi/drm/drm_mode.h +0 -6
@@ -81,8 +81,6 @@ extern "C" {
   #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 22:19) */
   #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
   			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
   #define  DRM_MODE_FLAG_PIC_AR_16_9 \
   			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
include/uapi/drm/drm_mode.h +0 -1
   /* DPMS flags */
   /* bit compatible with the xorg definitions. */
--

2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
Quoted 25 lines · Shashank

Regards

Shashank

Quoted 19 lines · Ville Syrjälä
Quoted 18 lines · Shashank

Regards

Shashank

Quoted 5 lines · Ville Syrjälä
Quoted 3 lines · Shashank

Hi Ville,
(-dri-devel)
I would appreciate an internal discussion before going to dri-devel. a

Added back. Private discussions are pointless.

Noted.

Quoted 6 lines
Quoted 1 line

What did this patch break ?

Intel ddx. It will reject any mode with flags it doesn't know about. Other ddxen like -ati or -modesetting will also suffer, but potentially in a different way since they don't even check the flags and instead just directly stuff them into the randr mode flags, which will result in an out of spec mode as far randr is concerned.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

Then its a fault of intel-ddx design. We are adding new flags to indicate aspect ratios, so its obvious that the implementation should be modified to accept new flags.
I dont see why you should revert patch for it.

Rule 1 of kernel development: You simply don't break existing userspace

Again, we are adding something new, for which userspace should be modified. If the userspace in written in such a way that it wont accept changes, its not saleable design.

Whether the design is good or not is besides the point. It already exists, so we have to live with it.

Quoted 3 lines

Even in this case, we should go and extend the userspace (which I am ready to do) instead of reverting the patch.

We can't retroactively fix the binaries on everyone's machine.

Quoted 2 lines

If you still think you should send this revert, I am removing my NACK. Pls Go ahead.

The other option is to not revert and instead slap a fix on top. But that would have to be done reasonably quickly so that the thing is ready in time for 4.10. We're closing in on 4.9-rc4 now so I guess we should still have a few weeks to fix things up. Whether that's enough I don't know. If not, then we should revert.

Quoted 102 lines
Quoted 102 lines
Quoted 10 lines
Quoted 6 lines
Quoted 1 line

This is exposed in the same way, as the 3D flags.

Not it isn't. We have a client cap for 3D flags.

Quoted 1 line

The information is already available in form of flags, all you have to do in userspace is read and print that. Its already being done in Android.

Please stop relying on Android for testing upstream patches. Test with actual userspace people are using.

Please note that android goes through HDMI compliance certification, and several commercial test infrastructures, so
that's one of the best infrastructure to test. And when we have common branch for all of Linux flavors, we should consider all.

You can test with Android as much as you like. That probably won't catch ABI breaks and whatnot though since you don't generally just plop a new kernel onto an existing Android device.

So you really must test with normal userspace as well. That has a long history and so any ABI/behaviour change is actually a big deal.

Quoted 85 lines
Quoted 85 lines
Quoted 85 lines

NACK until we get to the right reason.

Regards
Shashank
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
   drivers/gpu/drm/drm_modes.c | 12 ------------  include/uapi/drm/drm_mode.h |  6 ------
   2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -6
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
   	case HDMI_PICTURE_ASPECT_16_9:
   		out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
   		break;
-	case HDMI_PICTURE_ASPECT_64_27:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-		break;
-	case DRM_MODE_PICTURE_ASPECT_256_135:
-		out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-		break;
   	case HDMI_PICTURE_ASPECT_RESERVED:
   	default:
   		out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; @@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
   	case DRM_MODE_FLAG_PIC_AR_16_9:
   		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
   		break;
drivers/gpu/drm/drm_modes.c +0 -6
-	case DRM_MODE_FLAG_PIC_AR_64_27:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-		break;
-	case DRM_MODE_FLAG_PIC_AR_256_135:
-		out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-		break;
   	default:
   		out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
   		break;
include/uapi/drm/drm_mode.h +0 -7
@@ -81,8 +81,6 @@ extern "C" {
   #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 22:19) */
   #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
   			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
   #define  DRM_MODE_FLAG_PIC_AR_16_9 \
   			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
   /* DPMS flags */
   /* bit compatible with the xorg definitions. */
--

2.7.4

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw
Quoted 8 lines · Ville Syrjälä
Quoted 2 lines

If you still think you should send this revert, I am removing my NACK. Pls Go ahead.

The other option is to not revert and instead slap a fix on top. But that would have to be done reasonably quickly so that the thing is ready in time for 4.10. We're closing in on 4.9-rc4 now so I guess we should still have a few weeks to fix things up. Whether that's enough I don't know. If not, then we should revert.

1 week and then revert is the guideline. Please don't bend the rules for regressions all the time, it makes things painful for everyone else.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw
Quoted 9 lines · Daniel Vetter
Quoted 7 lines · Ville Syrjälä
Quoted 2 lines

If you still think you should send this revert, I am removing my NACK. Pls Go ahead.

The other option is to not revert and instead slap a fix on top. But that would have to be done reasonably quickly so that the thing is ready in time for 4.10. We're closing in on 4.9-rc4 now so I guess we should still have a few weeks to fix things up. Whether that's enough I don't know. If not, then we should revert.

Quoted 4 lines

1 week and then revert is the guideline. Please don't bend the rules for regressions all the time, it makes things painful for everyone else.
-Daniel

I don't remember breaking it for first time itself.
As I mentioned in the other thread, please add the regression details. After that, revert it if you want (I saw you have already given maintainers-ack)

Regards
Shashank

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw

If I was not very clear for the first time, every time we send a patch to drm-intel/dri-devel, we do basic testing on Gnome-desktop too (Not only Android).

So even these aspect ratio patches were tested with full gnome-desktop, and it worked well.

Regards
Shashank

Quoted 16 lines · Shashank
Quoted 9 lines · Daniel Vetter
Quoted 7 lines · Ville Syrjälä
Quoted 2 lines

If you still think you should send this revert, I am removing my NACK. Pls Go ahead.

The other option is to not revert and instead slap a fix on top. But that would have to be done reasonably quickly so that the thing is ready in time for 4.10. We're closing in on 4.9-rc4 now so I guess we should still have a few weeks to fix things up. Whether that's enough I don't know. If not, then we should revert.

Quoted 4 lines

1 week and then revert is the guideline. Please don't bend the rules for regressions all the time, it makes things painful for everyone else.
-Daniel

Quoted 7 lines

I don't remember breaking it for first time itself.
As I mentioned in the other thread, please add the regression details. After that, revert it if you want (I saw you have already given maintainers-ack)

Regards
Shashank

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw
Quoted 8 lines · Shashank

If I was not very clear for the first time, every time we send a patch to drm-intel/dri-devel, we do basic testing on Gnome-desktop too (Not only Android).

So even these aspect ratio patches were tested with full gnome-desktop, and it worked well.

I guess the part that's not so obvious is that Linux desktop/distributions provide a very wide permutation of components and configs used. While on a local (test) setup only a small/limited set is available. Esp. on Android where things are _very_ tightly coupled.

Obviously nobody likes when we have to carry kernel patches which workaround "broken" userspace, but it's a kernel policy and we all have to live with it. That's the main reason people are so careful/pedantic when it comes to UABI. And as you can see even then there are bits that we miss :'-(

Regards,
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#16 lore raw

Regards

Shashank

Quoted 9 lines · Emil Velikov
Quoted 8 lines · Shashank

If I was not very clear for the first time, every time we send a patch to drm-intel/dri-devel, we do basic testing on Gnome-desktop too (Not only Android).

So even these aspect ratio patches were tested with full gnome-desktop, and it worked well.

Quoted 5 lines

I guess the part that's not so obvious is that Linux desktop/distributions provide a very wide permutation of components and configs used. While on a local (test) setup only a small/limited set is available. Esp. on Android where things are _very_ tightly coupled.

I agree, Emil.
I was only mentioning my testing with Gnome, to confirm that intel-ddx is not broken with Gnome desktop. And I was testing on both Android as well as X.

Quoted 5 lines

Obviously nobody likes when we have to carry kernel patches which workaround "broken" userspace, but it's a kernel policy and we all have to live with it. That's the main reason people are so careful/pedantic when it comes to UABI. And as you can see even then there are bits that we miss :'-(

I agree, again. But I was thinking if reverting the patch was the best way, else it would be impossible to add something new in the kernel. I hope experts like you and others can suggest the right way.

Quoted 3 lines

Regards,
Emil

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#17 lore raw
Quoted 36 lines · Shashank

Regards

Shashank

Quoted 13 lines · Emil Velikov
Quoted 10 lines · Shashank

If I was not very clear for the first time, every time we send a patch to drm-intel/dri-devel, we do basic testing on Gnome-desktop too (Not only Android).

So even these aspect ratio patches were tested with full gnome-desktop, and
it worked well.

Quoted 5 lines

I guess the part that's not so obvious is that Linux desktop/distributions provide a very wide permutation of components and configs used. While on a local (test) setup only a small/limited set is available. Esp. on Android where things are _very_ tightly coupled.

I agree, Emil.
I was only mentioning my testing with Gnome, to confirm that intel-ddx is not broken with Gnome desktop.
And I was testing on both Android as well as X.

Quoted 6 lines

Obviously nobody likes when we have to carry kernel patches which workaround "broken" userspace, but it's a kernel policy and we all have to live with it. That's the main reason people are so careful/pedantic when it comes to UABI. And as you can see even then there are bits that we miss :'-(

Quoted 4 lines

I agree, again. But I was thinking if reverting the patch was the best way, else it would be impossible to
add something new in the kernel. I hope experts like you and others can suggest the right way.

Afaict, Daniel Vetter and Ville mentioned the best route - "1 week and then revert is the guideline" and "... with a new client cap ..." (grep for DRM_CAP_) respectively.

It the former is missing from the documentation, so feel free to point out where you'd expect it to be. Or even better send a patch describing it based on your experience. Things explained form your POV would read better (and be easier to find) for people unfamiliar with the topic.

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#18 lore raw
In reply to a message not in the archive
Quoted 3 lines · Shashank

Hi Ville,
(-dri-devel)
I would appreciate an internal discussion before going to dri-devel.

Nack on internal discssion. We do development in the open.

Quoted 3 lines

What did this patch break ?
This is exposed in the same way, as the 3D flags.
The information is already available in form of flags, all you have to do in userspace is read and print that. Its already being done in Android.

Yeah, the patch is missing details on the bug report and how it falls apart, but if that's added revert might be the appropriate thing to do here. Maintainer-ack on the revert if that crucial information is added.
-Daniel

Quoted 84 lines

NACK until we get to the right reason.

Regards
Shashank
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 3, 2016 6:02 PM
To: [email protected]
Cc: Sharma, Shashank <[email protected]>; Lin; Jia, Lin A <[email protected]>; Sharma, Akashdeep <[email protected]>; Jim Bride <[email protected]>; Jose Abreu <[email protected]>; Daniel Vetter <[email protected]>; Emil Velikov <[email protected]>
Subject: [PATCH 1/2] Revert "drm: Add and handle new aspect ratios in DRM layer"

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

Cc Shashank Sharma <[email protected]>
Cc Lin, Jia <[email protected]>
Cc Akashdeep Sharma <[email protected]>
Cc Jim Bride <[email protected]>
Cc Jose Abreu <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_modes.c | 12 ------------  include/uapi/drm/drm_mode.h |  6 ------
 2 files changed, 18 deletions(-)
drivers/gpu/drm/drm_modes.c +0 -6
@@ -1513,12 +1513,6 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
        case HDMI_PICTURE_ASPECT_16_9:
                out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
                break;
-       case HDMI_PICTURE_ASPECT_64_27:
-               out->flags |= DRM_MODE_FLAG_PIC_AR_64_27;
-               break;
-       case DRM_MODE_PICTURE_ASPECT_256_135:
-               out->flags |= DRM_MODE_FLAG_PIC_AR_256_135;
-               break;
        case HDMI_PICTURE_ASPECT_RESERVED:
        default:
                out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; @@ -1580,12 +1574,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
        case DRM_MODE_FLAG_PIC_AR_16_9:
                out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
                break;
drivers/gpu/drm/drm_modes.c +0 -6
-       case DRM_MODE_FLAG_PIC_AR_64_27:
-               out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_64_27;
-               break;
-       case DRM_MODE_FLAG_PIC_AR_256_135:
-               out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_256_135;
-               break;
        default:
                out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
                break;
include/uapi/drm/drm_mode.h +0 -7
@@ -81,8 +81,6 @@ extern "C" {
 #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 22:19) */
 #define DRM_MODE_FLAG_PIC_AR_MASK              (0x0F<<19)
@@ -92,10 +90,6 @@ extern "C" {
                        (DRM_MODE_PICTURE_ASPECT_4_3<<19)
 #define  DRM_MODE_FLAG_PIC_AR_16_9 \
                        (DRM_MODE_PICTURE_ASPECT_16_9<<19)
-#define  DRM_MODE_FLAG_PIC_AR_64_27 \
-                       (DRM_MODE_PICTURE_ASPECT_64_27<<19)
-#define  DRM_MODE_FLAG_PIC_AR_256_135 \
-                       (DRM_MODE_PICTURE_ASPECT_256_135<<19)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
--

2.7.4

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#19 lore raw
In reply to [email protected]
Quoted 8 lines · On Thu, Nov 03, 2016 at 02:31:43PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

As a demonstration here's the change in the xrandr mode list after doing the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00  
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98  
+   1920x1080i    60.00    50.00    59.94  
    1600x1200     60.00  
    1680x1050     59.88  
    1280x1024     75.02    60.02  
@@ -13,30 +13,29 @@
    1360x768      60.02  
    1280x800      59.91  
    1152x864      75.00  
-   1280x720      60.00    50.00  
+   1280x720      60.00    50.00    59.94  
    1024x768      75.03    70.07    60.00  
    832x624       74.55  
    800x600       72.19    75.00    60.32  
-   640x480       75.00    72.81    66.67    59.94  
+   720x576       50.00  
+   720x480       60.00    59.94  
+   640x480       75.00    72.81    66.67    60.00    59.94  
    720x400       70.08  

This was with sna, which does this:
#define KNOWN_MODE_FLAGS ((1<<14)-1)
if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
mode->status = MODE_BAD; /* unknown flags => unhandled */
so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:
mode->Flags = kmode->flags; //& FLAG_BITS;
I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#20 lore raw
Quoted 48 lines · Ville Syrjälä
Quoted 8 lines · On Thu, Nov 03, 2016 at 02:31:43PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

As a demonstration here's the change in the xrandr mode list after doing the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

(quoted diff) +6 -4
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00  
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98  
+   1920x1080i    60.00    50.00    59.94  
    1600x1200     60.00  
    1680x1050     59.88  
    1280x1024     75.02    60.02  
@@ -13,30 +13,29 @@
    1360x768      60.02  
    1280x800      59.91  
    1152x864      75.00  
-   1280x720      60.00    50.00  
+   1280x720      60.00    50.00    59.94  
    1024x768      75.03    70.07    60.00  
    832x624       74.55  
    800x600       72.19    75.00    60.32  
-   640x480       75.00    72.81    66.67    59.94  
+   720x576       50.00  
+   720x480       60.00    59.94  
+   640x480       75.00    72.81    66.67    60.00    59.94  
    720x400       70.08  
 

This was with sna, which does this:
#define KNOWN_MODE_FLAGS ((1<<14)-1)
if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
mode->status = MODE_BAD; /* unknown flags => unhandled */
so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:
mode->Flags = kmode->flags; //& FLAG_BITS;
I've not checked what damage it can actually cause.

Quoted 6 lines

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Oh and I guess this is also the reason most people didn't notice anything wrong. The preferred mode usually (or maybe always?) comes from some other source than edid_cea_modes[] and hence doesn't tend to go AWOL.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#21 lore raw
In reply to Ville Syrjälä
Quoted 39 lines · Ville Syrjälä
Quoted 8 lines · On Thu, Nov 03, 2016 at 02:31:43PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

As a demonstration here's the change in the xrandr mode list after doing the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

(quoted diff) +6 -4
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
    1600x1200     60.00
    1680x1050     59.88
    1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
    1360x768      60.02
    1280x800      59.91
    1152x864      75.00
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
    1024x768      75.03    70.07    60.00
    832x624       74.55
    800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
    720x400       70.08
 

This was with sna, which does this:
#define KNOWN_MODE_FLAGS ((1<<14)-1)
if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)

Quoted 7 lines
        mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:
mode->Flags = kmode->flags; //& FLAG_BITS;
I've not checked what damage it can actually cause.

What problems could this cause? Presumably the kernel driver has validated the modes already or they wouldn't showing up in the first place. Or is your concern that something in the xserver itself may barf on the new flags?

Alex
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#22 lore raw
Quoted 11 lines · Alex Deucher
Quoted 10 lines

This was with sna, which does this:
#define KNOWN_MODE_FLAGS ((1<<14)-1)
if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)

        mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:
mode->Flags = kmode->flags; //& FLAG_BITS;
I've not checked what damage it can actually cause.

Quoted 4 lines

What problems could this cause? Presumably the kernel driver has validated the modes already or they wouldn't showing up in the first place. Or is your concern that something in the xserver itself may barf on the new flags?

See above snipped from sna, we now lost a bunch of modes. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#23 lore raw
In reply to Alex Deucher
Quoted 44 lines · Alex Deucher
Quoted 42 lines · Ville Syrjälä
Quoted 8 lines · On Thu, Nov 03, 2016 at 02:31:43PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

This reverts commit a68362fe3e84fcbedd49939aa200519aa5410135.

Adding new mode flags willy nilly breaks existing userspace. We need to coordinate this better, potentially with a new client cap that only exposes the aspect ratio flags when userspace is prepared for them (similar to what we do with stereo 3D modes).

As a demonstration here's the change in the xrandr mode list after doing the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

(quoted diff) +6 -4
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
    1600x1200     60.00
    1680x1050     59.88
    1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
    1360x768      60.02
    1280x800      59.91
    1152x864      75.00
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
    1024x768      75.03    70.07    60.00
    832x624       74.55
    800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
    720x400       70.08
 

This was with sna, which does this:
#define KNOWN_MODE_FLAGS ((1<<14)-1)
if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)

        mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

Quoted 6 lines
Quoted 4 lines

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:
mode->Flags = kmode->flags; //& FLAG_BITS;
I've not checked what damage it can actually cause.

What problems could this cause?

As I wrote, I haven't analyzed the potential damage from this. Either something in the server might go wonky, or maybe we even leak that stuff over the protocol all the way to the clients? Not sure.

Quoted 6 lines

Presumably the kernel driver has
validated the modes already or they wouldn't showing up in the first place. Or is your concern that something in the xserver itself may barf on the new flags?

Alex

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#24 lore raw
In reply to Ville Syrjälä

Regards
Shashank

Quoted 14 lines

the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

(quoted diff) +2 -2
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
     1600x1200     60.00
     1680x1050     59.88
     1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
     1360x768      60.02
     1280x800      59.91
     1152x864      75.00

Review line 23

Quoted 10 lines
(quoted diff) +4 -2
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
     1024x768      75.03    70.07    60.00
     832x624       74.55
     800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
     720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F These are the existing modes, and should be independent of reverted patches.

Quoted 12 lines

This was with sna, which does this:
#define KNOWN_MODE_FLAGS ((1<<14)-1)
if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
mode->status = MODE_BAD; /* unknown flags => unhandled */
so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:
mode->Flags = kmode->flags; //& FLAG_BITS;
I've not checked what damage it can actually cause.

Quoted 6 lines

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar
- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

I dont think kernel needs to bother about it.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#25 lore raw
Quoted 22 lines · Shashank

Regards
Shashank

Quoted 20 lines

the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

(quoted diff) +3 -4
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
     1600x1200     60.00
     1680x1050     59.88
     1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
     1360x768      60.02
     1280x800      59.91
     1152x864      75.00
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
     1024x768      75.03    70.07    60.00
     832x624       74.55
     800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
Quoted 8 lines

Review line 23

Quoted 4 lines
(quoted diff) +3 -0
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
     720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

They're affected because your patches changed them by adding the aspect ratio flags to them.

Quoted 18 lines
Quoted 12 lines

This was with sna, which does this:
#define KNOWN_MODE_FLAGS ((1<<14)-1)
if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
mode->status = MODE_BAD; /* unknown flags => unhandled */
so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:
mode->Flags = kmode->flags; //& FLAG_BITS;
I've not checked what damage it can actually cause.

Quoted 6 lines

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Quoted 13 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 2 lines

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#26 lore raw

Regards

Shashank

Quoted 31 lines · Ville Syrjälä
Quoted 22 lines · Shashank

Regards
Shashank

Quoted 20 lines

the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

(quoted diff) +3 -4
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
      1600x1200     60.00
      1680x1050     59.88
      1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
      1360x768      60.02
      1280x800      59.91
      1152x864      75.00
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
      1024x768      75.03    70.07    60.00
      832x624       74.55
      800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
Quoted 8 lines

Review line 23

Quoted 4 lines
(quoted diff) +3 -0
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
      720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

Quoted 2 lines

They're affected because your patches changed them by adding the aspect ratio flags to them.

Yes, But they are independent of reverted patch, which adds aspect ratio for HDMI 2.0 ratios (64:27 and 256:135)

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

This was with sna, which does this:

   #define KNOWN_MODE_FLAGS ((1<<14)-1)
   if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
   	mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:

   mode->Flags = kmode->flags; //& FLAG_BITS;

I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 7 lines
Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Makes sense, in this way we can even revert the aspect_ratio property for HDMI connector, as discussed during the code review sessions of this patch series. In this way, when kernel will expose the aspect ratios, it will either do the aspect ratios as per EDID, or wont.

Quoted 21 lines
Quoted 14 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Quoted 8 lines

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 1 line

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

IMHO, making policies for UI is not a part of kernel design, a UI manager (Hardware composed, X or Wayland) should take care of it, as they have access to much information (Like previously applied mode, user preference etc). When it comes to sorting of modes, the only general rule across drivers like FB, V4L2, I have seen is the first mode in the list should be preferred mode, which we are still keeping. And after that our probed_modes were anyways not sorted now, so it doesn't matter further.

If X server doesn't know what to do with aspect ratio flags, it can chose not to set the cap, and if HWC knows, it can chose to set. This is the same situation as 2D stereo modes which are existing already.

Regards
Shashank
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#27 lore raw
Quoted 37 lines · Shashank

Regards

Shashank

Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Shashank

Regards
Shashank

Quoted 14 lines

the revert:

HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm

(quoted diff) +2 -2
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
      1600x1200     60.00
      1680x1050     59.88
      1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
      1360x768      60.02
      1280x800      59.91
      1152x864      75.00

Review line 23

Quoted 10 lines
(quoted diff) +4 -2
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
      1024x768      75.03    70.07    60.00
      832x624       74.55
      800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
      720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

Quoted 4 lines
Quoted 2 lines

They're affected because your patches changed them by adding the aspect ratio flags to them.

Yes, But they are independent of reverted patch, which adds aspect ratio for HDMI 2.0 ratios (64:27 and 256:135)

The second patch had to be reverted so that the first patch would revert cleanly.

Quoted 59 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

This was with sna, which does this:

   #define KNOWN_MODE_FLAGS ((1<<14)-1)
   if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
   	mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:

   mode->Flags = kmode->flags; //& FLAG_BITS;

I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 7 lines
Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Makes sense, in this way we can even revert the aspect_ratio property for HDMI connector, as discussed during
the code review sessions of this patch series. In this way, when kernel will expose the aspect ratios, it will either
do the aspect ratios as per EDID, or wont.

Quoted 21 lines
Quoted 14 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Quoted 8 lines

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 1 line

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

Quoted 8 lines

IMHO, making policies for UI is not a part of kernel design, a UI manager (Hardware composed, X or Wayland) should take care of it, as they have access to much information (Like previously applied mode, user preference etc). When it comes to sorting of modes, the only general rule across drivers like FB, V4L2, I have seen is the first mode in the list should be preferred mode, which we are still keeping. And after that our probed_modes were
anyways not sorted now, so it doesn't matter further.

Having userspace be responsible for sorting the aspect ratios would perhaps require that userspace parses the EDID, which is pretty crazy. I guess it could try to deduce something from the physical aspect ratio of the display, but I'm not sure that's quite what we want either.

Also we already sort the modes in the kernel anyway, so it's not like we'd be doing something new by also considering the aspect ratios. I would at the very least want to avoid a totally random order between modes that differ only by the aspect ratio.

Quoted 8 lines

If X server doesn't know what to do with aspect ratio flags, it can chose not to set the cap, and if HWC knows, it can chose to set. This is the same situation as 2D stereo modes
which are existing already.

Regards
Shashank

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#28 lore raw

Regards

Shashank

Quoted 111 lines · Ville Syrjälä
Quoted 37 lines · Shashank

Regards

Shashank

Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Shashank

Regards
Shashank

Quoted 14 lines

the revert:

    HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
(quoted diff) +2 -2
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
       1600x1200     60.00
       1680x1050     59.88
       1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
       1360x768      60.02
       1280x800      59.91
       1152x864      75.00

Review line 23

Quoted 10 lines
(quoted diff) +4 -2
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
       1024x768      75.03    70.07    60.00
       832x624       74.55
       800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
       720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

Quoted 4 lines
Quoted 2 lines

They're affected because your patches changed them by adding the aspect ratio flags to them.

Yes, But they are independent of reverted patch, which adds aspect ratio for HDMI 2.0 ratios (64:27 and 256:135)

The second patch had to be reverted so that the first patch would revert cleanly.

Quoted 58 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

This was with sna, which does this:

    #define KNOWN_MODE_FLAGS ((1<<14)-1)
    if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
    	mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:

    mode->Flags = kmode->flags; //& FLAG_BITS;

I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 7 lines
Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Makes sense, in this way we can even revert the aspect_ratio property for HDMI connector, as discussed during
the code review sessions of this patch series. In this way, when kernel will expose the aspect ratios, it will either
do the aspect ratios as per EDID, or wont.

Quoted 20 lines
Quoted 13 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Quoted 8 lines

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 1 line

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

Quoted 8 lines

IMHO, making policies for UI is not a part of kernel design, a UI manager (Hardware composed, X or Wayland) should take care of it, as they have access to much information (Like previously applied mode, user preference etc). When it comes to sorting of modes, the only general rule across drivers like FB, V4L2, I have seen is the first mode in the list should be preferred mode, which we are still keeping. And after that our probed_modes were
anyways not sorted now, so it doesn't matter further.

Quoted 2 lines

Having userspace be responsible for sorting the aspect ratios would perhaps require that userspace parses the EDID, which is pretty crazy.

Why ?
userspace has to just set cap for aspect ratio, and kernel can read EDID, parse the CEA block, populate the aspect ratios flags and add the modes (Just what this patch was doing, except the cap part)
Once userspace has the getResources/getConnector call filled, it can access all the modes (with and without aspect) and do the sorting in any way it wants.

Quoted 7 lines

I guess it could try to deduce something from the physical aspect ratio of the display, but I'm not sure that's quite what we want either.

Also we already sort the modes in the kernel anyway, so it's not like we'd be doing something new by also considering the aspect ratios. I would at the very least want to avoid a totally random order between modes that differ only by the aspect ratio.

Path: get_connector -> probe_single_connector_mode -> drm_add_edid_modes
Again, IMHO, we don't sort the modes in kernel, we populate modes in a particular order, which is:
(From drm_edid.c::drm_add_edid_modes)
##############################################################
/*
* EDID spec says modes should be preferred in this order:
* - preferred detailed mode
* - other detailed modes from base block
* - detailed modes from extension blocks
* - CVT 3-byte code modes
* - standard timing codes
* - established timing codes
* - modes inferred from GTF or CVT range information
*
* We get this pretty much right.
*
* XXX order for additional mode types in extension blocks?
*/
num_modes += add_detailed_modes(connector, edid, quirks);
num_modes += add_cvt_modes(connector, edid);
num_modes += add_standard_modes(connector, edid);
num_modes += add_established_modes(connector, edid);
num_modes += add_cea_modes(connector, edid);
num_modes += add_alternate_cea_modes(connector, edid);
num_modes += add_displayid_detailed_modes(connector, edid);
###############################################################

Here the modes are added in the connector, in the same order they are arranged into their respective blocks in EDID. But the order to read the block is a preferred order (no sorting).

Now, in this patch series, we are adding aspect ratio information in edid_cea_modes db, which is going to affect only add_cea/alternate_cea_modes() call, and the modes accordingly. Please let me know if I misunderstood something here.

Regards
Shashank

Quoted 7 lines
Quoted 7 lines

If X server doesn't know what to do with aspect ratio flags, it can chose not to set the cap, and if HWC knows, it can chose to set. This is the same situation as 2D stereo modes
which are existing already.

Regards
Shashank

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#29 lore raw
Quoted 161 lines · Shashank

Regards

Shashank

Quoted 111 lines · Ville Syrjälä
Quoted 37 lines · Shashank

Regards

Shashank

Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Shashank

Regards
Shashank

Quoted 14 lines

the revert:

    HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
(quoted diff) +2 -2
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
       1600x1200     60.00
       1680x1050     59.88
       1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
       1360x768      60.02
       1280x800      59.91
       1152x864      75.00

Review line 23

Quoted 10 lines
(quoted diff) +4 -2
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
       1024x768      75.03    70.07    60.00
       832x624       74.55
       800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
       720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

Quoted 4 lines
Quoted 2 lines

They're affected because your patches changed them by adding the aspect ratio flags to them.

Yes, But they are independent of reverted patch, which adds aspect ratio for HDMI 2.0 ratios (64:27 and 256:135)

The second patch had to be reverted so that the first patch would revert cleanly.

Quoted 58 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

This was with sna, which does this:

    #define KNOWN_MODE_FLAGS ((1<<14)-1)
    if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
    	mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:

    mode->Flags = kmode->flags; //& FLAG_BITS;

I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 7 lines
Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Makes sense, in this way we can even revert the aspect_ratio property for HDMI connector, as discussed during
the code review sessions of this patch series. In this way, when kernel will expose the aspect ratios, it will either
do the aspect ratios as per EDID, or wont.

Quoted 20 lines
Quoted 13 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Quoted 8 lines

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 1 line

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

Quoted 8 lines

IMHO, making policies for UI is not a part of kernel design, a UI manager (Hardware composed, X or Wayland) should take care of it, as they have access to much information (Like previously applied mode, user preference etc). When it comes to sorting of modes, the only general rule across drivers like FB, V4L2, I have seen is the first mode in the list should be preferred mode, which we are still keeping. And after that our probed_modes were
anyways not sorted now, so it doesn't matter further.

Quoted 2 lines

Having userspace be responsible for sorting the aspect ratios would perhaps require that userspace parses the EDID, which is pretty crazy.

Why ?
userspace has to just set cap for aspect ratio, and kernel can read EDID, parse the CEA block, populate the aspect ratios flags and add the modes (Just what this patch was doing, except the cap part) Once userspace has the getResources/getConnector call filled, it can access all the modes (with and without aspect) and do the sorting in any way it wants.

Quoted 7 lines

I guess it could try to deduce something from the physical aspect ratio of the display, but I'm not sure that's quite what we want either.

Also we already sort the modes in the kernel anyway, so it's not like we'd be doing something new by also considering the aspect ratios. I would at the very least want to avoid a totally random order between modes that differ only by the aspect ratio.

Path: get_connector -> probe_single_connector_mode -> drm_add_edid_modes Again, IMHO, we don't sort the modes in kernel, we populate modes in a particular order, which is:
(From drm_edid.c::drm_add_edid_modes)
##############################################################
/*
* EDID spec says modes should be preferred in this order:
* - preferred detailed mode
* - other detailed modes from base block
* - detailed modes from extension blocks
* - CVT 3-byte code modes
* - standard timing codes
* - established timing codes
* - modes inferred from GTF or CVT range information
*
* We get this pretty much right.
*
* XXX order for additional mode types in extension blocks? */
num_modes += add_detailed_modes(connector, edid, quirks); num_modes += add_cvt_modes(connector, edid);
num_modes += add_standard_modes(connector, edid); num_modes += add_established_modes(connector, edid); num_modes += add_cea_modes(connector, edid);
num_modes += add_alternate_cea_modes(connector, edid); num_modes += add_displayid_detailed_modes(connector, edid);
###############################################################

Quoted 8 lines

Here the modes are added in the connector, in the same order they are arranged into their respective blocks in EDID.
But the order to read the block is a preferred order (no sorting).

Now, in this patch series, we are adding aspect ratio information in edid_cea_modes db, which is going to affect only add_cea/alternate_cea_modes() call, and the modes accordingly. Please let me know if I misunderstood something here.

We explicitly sort the modes after this.

Quoted 10 lines

Regards
Shashank

Quoted 7 lines
Quoted 7 lines

If X server doesn't know what to do with aspect ratio flags, it can chose not to set the cap, and if HWC knows, it can chose to set. This is the same situation as 2D stereo modes
which are existing already.

Regards
Shashank

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#30 lore raw
Quoted 166 lines · Ville Syrjälä
Quoted 165 lines · Shashank

Regards

Shashank

Quoted 111 lines · Ville Syrjälä
Quoted 37 lines · Shashank

Regards

Shashank

Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Shashank

Regards
Shashank

Quoted 14 lines

the revert:

     HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
(quoted diff) +2 -2
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
        1600x1200     60.00
        1680x1050     59.88
        1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
        1360x768      60.02
        1280x800      59.91
        1152x864      75.00

Review line 23

Quoted 10 lines
(quoted diff) +4 -2
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
        1024x768      75.03    70.07    60.00
        832x624       74.55
        800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
        720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

Quoted 4 lines
Quoted 2 lines

They're affected because your patches changed them by adding the aspect ratio flags to them.

Yes, But they are independent of reverted patch, which adds aspect ratio for HDMI 2.0 ratios (64:27 and 256:135)

The second patch had to be reverted so that the first patch would revert cleanly.

Quoted 58 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

This was with sna, which does this:

     #define KNOWN_MODE_FLAGS ((1<<14)-1)
     if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
     	mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:

     mode->Flags = kmode->flags; //& FLAG_BITS;

I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 7 lines
Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Makes sense, in this way we can even revert the aspect_ratio property for HDMI connector, as discussed during
the code review sessions of this patch series. In this way, when kernel will expose the aspect ratios, it will either
do the aspect ratios as per EDID, or wont.

Quoted 20 lines
Quoted 13 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Quoted 8 lines

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 1 line

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

Quoted 8 lines

IMHO, making policies for UI is not a part of kernel design, a UI manager (Hardware composed, X or Wayland) should take care of it, as they have access to much information (Like previously applied mode, user preference etc). When it comes to sorting of modes, the only general rule across drivers like FB, V4L2, I have seen is the first mode in the list should be preferred mode, which we are still keeping. And after that our probed_modes were
anyways not sorted now, so it doesn't matter further.

Quoted 2 lines

Having userspace be responsible for sorting the aspect ratios would perhaps require that userspace parses the EDID, which is pretty crazy.

Why ?
userspace has to just set cap for aspect ratio, and kernel can read EDID, parse the CEA block, populate the aspect ratios flags and add the modes (Just what this patch was doing, except the cap part) Once userspace has the getResources/getConnector call filled, it can access all the modes (with and without aspect) and do the sorting in any way it wants.

Quoted 7 lines

I guess it could try to deduce something from the physical aspect ratio of the display, but I'm not sure that's quite what we want either.

Also we already sort the modes in the kernel anyway, so it's not like we'd be doing something new by also considering the aspect ratios. I would at the very least want to avoid a totally random order between modes that differ only by the aspect ratio.

Path: get_connector -> probe_single_connector_mode -> drm_add_edid_modes Again, IMHO, we don't sort the modes in kernel, we populate modes in a particular order, which is:
(From drm_edid.c::drm_add_edid_modes)
##############################################################
/*
* EDID spec says modes should be preferred in this order:
* - preferred detailed mode
* - other detailed modes from base block
* - detailed modes from extension blocks
* - CVT 3-byte code modes
* - standard timing codes
* - established timing codes
* - modes inferred from GTF or CVT range information *
* We get this pretty much right.
*
* XXX order for additional mode types in extension blocks? */
num_modes += add_detailed_modes(connector, edid, quirks); num_modes += add_cvt_modes(connector, edid);
num_modes += add_standard_modes(connector, edid); num_modes += add_established_modes(connector, edid); num_modes += add_cea_modes(connector, edid);
num_modes += add_alternate_cea_modes(connector, edid); num_modes += add_displayid_detailed_modes(connector, edid);
###############################################################

Here the modes are added in the connector, in the same order they are arranged into their respective blocks in EDID.
But the order to read the block is a preferred order (no sorting).

Quoted 6 lines
Quoted 4 lines

Now, in this patch series, we are adding aspect ratio information in edid_cea_modes db, which is going to affect only add_cea/alternate_cea_modes() call, and the modes accordingly. Please let me know if I misunderstood something here.

We explicitly sort the modes after this.

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Regards

Shashank

Quoted 9 lines
Quoted 9 lines

Regards
Shashank

Quoted 7 lines
Quoted 7 lines

If X server doesn't know what to do with aspect ratio flags, it can chose not to set the cap, and if HWC knows, it can chose to set. This is the same situation as 2D stereo modes
which are existing already.

Regards
Shashank

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#31 lore raw
Quoted 171 lines · Shashank
Quoted 170 lines · Ville Syrjälä
Quoted 169 lines · Shashank

Regards

Shashank

Quoted 111 lines · Ville Syrjälä
Quoted 37 lines · Shashank

Regards

Shashank

Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Shashank

Regards
Shashank

Quoted 14 lines

the revert:

     HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
(quoted diff) +2 -2
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
        1600x1200     60.00
        1680x1050     59.88
        1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
        1360x768      60.02
        1280x800      59.91
        1152x864      75.00

Review line 23

Quoted 10 lines
(quoted diff) +4 -2
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
        1024x768      75.03    70.07    60.00
        832x624       74.55
        800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
        720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

Quoted 4 lines
Quoted 2 lines

They're affected because your patches changed them by adding the aspect ratio flags to them.

Yes, But they are independent of reverted patch, which adds aspect ratio for HDMI 2.0 ratios (64:27 and 256:135)

The second patch had to be reverted so that the first patch would revert cleanly.

Quoted 58 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

This was with sna, which does this:

     #define KNOWN_MODE_FLAGS ((1<<14)-1)
     if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
     	mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:

     mode->Flags = kmode->flags; //& FLAG_BITS;

I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 7 lines
Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Makes sense, in this way we can even revert the aspect_ratio property for HDMI connector, as discussed during
the code review sessions of this patch series. In this way, when kernel will expose the aspect ratios, it will either
do the aspect ratios as per EDID, or wont.

Quoted 20 lines
Quoted 13 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Quoted 8 lines

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 1 line

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

Quoted 8 lines

IMHO, making policies for UI is not a part of kernel design, a UI manager (Hardware composed, X or Wayland) should take care of it, as they have access to much information (Like previously applied mode, user preference etc). When it comes to sorting of modes, the only general rule across drivers like FB, V4L2, I have seen is the first mode in the list should be preferred mode, which we are still keeping. And after that our probed_modes were
anyways not sorted now, so it doesn't matter further.

Quoted 2 lines

Having userspace be responsible for sorting the aspect ratios would perhaps require that userspace parses the EDID, which is pretty crazy.

Why ?
userspace has to just set cap for aspect ratio, and kernel can read EDID, parse the CEA block, populate the aspect ratios flags and add the modes (Just what this patch was doing, except the cap part) Once userspace has the getResources/getConnector call filled, it can access all the modes (with and without aspect) and do the sorting in any way it wants.

Quoted 7 lines

I guess it could try to deduce something from the physical aspect ratio of the display, but I'm not sure that's quite what we want either.

Also we already sort the modes in the kernel anyway, so it's not like we'd be doing something new by also considering the aspect ratios. I would at the very least want to avoid a totally random order between modes that differ only by the aspect ratio.

Path: get_connector -> probe_single_connector_mode -> drm_add_edid_modes Again, IMHO, we don't sort the modes in kernel, we populate modes in a particular order, which is:
(From drm_edid.c::drm_add_edid_modes)
##############################################################
/*
* EDID spec says modes should be preferred in this order:
* - preferred detailed mode
* - other detailed modes from base block
* - detailed modes from extension blocks
* - CVT 3-byte code modes
* - standard timing codes
* - established timing codes
* - modes inferred from GTF or CVT range information *
* We get this pretty much right.
*
* XXX order for additional mode types in extension blocks? */
num_modes += add_detailed_modes(connector, edid, quirks); num_modes += add_cvt_modes(connector, edid);
num_modes += add_standard_modes(connector, edid); num_modes += add_established_modes(connector, edid); num_modes += add_cea_modes(connector, edid);
num_modes += add_alternate_cea_modes(connector, edid); num_modes += add_displayid_detailed_modes(connector, edid);
###############################################################

Here the modes are added in the connector, in the same order they are arranged into their respective blocks in EDID.
But the order to read the block is a preferred order (no sorting).

Now, in this patch series, we are adding aspect ratio information in edid_cea_modes db, which is going to affect only add_cea/alternate_cea_modes() call, and the modes accordingly. Please let me know if I misunderstood something here.

Quoted 7 lines
Quoted 1 line

We explicitly sort the modes after this.

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 16 lines

Regards

Shashank

Quoted 9 lines
Quoted 9 lines

Regards
Shashank

Quoted 7 lines
Quoted 7 lines

If X server doesn't know what to do with aspect ratio flags, it can chose not to set the cap, and if HWC knows, it can chose to set. This is the same situation as 2D stereo modes
which are existing already.

Regards
Shashank

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

Regards

Shashank

Quoted 172 lines · Daniel Vetter
Quoted 171 lines · Shashank
Quoted 170 lines · Ville Syrjälä
Quoted 169 lines · Shashank

Regards

Shashank

Quoted 111 lines · Ville Syrjälä
Quoted 37 lines · Shashank

Regards

Shashank

Quoted 31 lines · Ville Syrjälä
Quoted 30 lines · Shashank

Regards
Shashank

Quoted 14 lines

the revert:

      HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
(quoted diff) +2 -2
-   1920x1080     60.00*+
-   1920x1080i    60.00    50.00
+   1920x1080     60.00*+  50.00    59.94    30.00    25.00    24.00    29.97    23.98
+   1920x1080i    60.00    50.00    59.94
         1600x1200     60.00
         1680x1050     59.88
         1280x1024     75.02    60.02
@@ -13,30 +13,29 @@
         1360x768      60.02
         1280x800      59.91
         1152x864      75.00

Review line 23

Quoted 10 lines
(quoted diff) +4 -2
-   1280x720      60.00    50.00
+   1280x720      60.00    50.00    59.94
         1024x768      75.03    70.07    60.00
         832x624       74.55
         800x600       72.19    75.00    60.32
-   640x480       75.00    72.81    66.67    59.94
+   720x576       50.00
+   720x480       60.00    59.94
+   640x480       75.00    72.81    66.67    60.00    59.94
         720x400       70.08

None of these aspect ratios are new modes / new aspect ratios from HDMI 2.0/CEA-861-F
These are the existing modes, and should be independent of reverted patches.

Quoted 4 lines
Quoted 2 lines

They're affected because your patches changed them by adding the aspect ratio flags to them.

Yes, But they are independent of reverted patch, which adds aspect ratio for HDMI 2.0 ratios (64:27 and 256:135)

The second patch had to be reverted so that the first patch would revert cleanly.

Quoted 58 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

This was with sna, which does this:

      #define KNOWN_MODE_FLAGS ((1<<14)-1)
      if (mode->status == MODE_OK && kmode->flags & ~KNOWN_MODE_FLAGS)
      	mode->status = MODE_BAD; /* unknown flags => unhandled */

so all the modes with an aspect ratio just vanished.

-modesetting and -ati on the other hand just copy over the unknown bits into the xrandr mode structure, which sounds dubious at best:

      mode->Flags = kmode->flags; //& FLAG_BITS;

I've not checked what damage it can actually cause.

It looks like a few modes disappeared from the kernel's mode list as well, presumably because some cea modes in the list originated from DTDs and whanot so they don't have an aspect ratio and that causes add_alternate_cea_modes() to ignore them. So not populating an aspect ratio for cea modes originating from a source other than edid_cea_modes[] looks like another bug to me as well.

Quoted 7 lines
Quoted 6 lines

I am writing a patch series to cap the aspect ratio implementation under a drm_cap_hdmi2_aspect_ratios
This is how its going to work (inspired from the 2D/stereo series from damien L)

- Add a new capability hdmi2_ar

It should be just a generic "expose aspect ratio flags to userspace?"

Makes sense, in this way we can even revert the aspect_ratio property for HDMI connector, as discussed during
the code review sessions of this patch series. In this way, when kernel will expose the aspect ratios, it will either
do the aspect ratios as per EDID, or wont.

Quoted 20 lines
Quoted 13 lines

- by default parsing the new hdmi 2.0 aspect ratio will be disabled under check of this cap
- during bootup time, while initializing the display, a userspace can get_cap on the hdmi2_aspect_ratio
- If it wants HDMI 2.0 aspect ratio support, it will set the cap, and kernel will expose these aspect ratios

Quoted 7 lines

Another bug I think might be the ordering of the modes with aspect ratio specified. IIRC the spec says that the preferred aspect ratio should be listed first in the EDID, but I don't think we preserve that ordering in the final mode list. I guess we could fix that by somehow noting which aspect ratio is preferred and sort based on that, or we try to preserve the order from the EDID until we're ready to sort, and then do the sorting with a stable algorithm.

Quoted 7 lines

AFAIK The mode order and priority is decided and arranged in userspace, based on various factors like
- preferred mode.
- previously applied mode in previous sessions (like for android tvs)
- Bigger h/w vs better refresh rate ?
- Xserver applies its own algorithms to decide which mode should be shown first.

Quoted 8 lines

Xorg does sort on its own. But since it doesn't know anything about aspect ratios and whatnot I wouldn't rely on that for anything. I also wouldn't expect eg. wayland compositors to do their own sorting. And yeah, looks like weston at least doesn't do any sorting whatsoever.

Quoted 1 line

I dont think kernel needs to bother about it.

So I'm going to say that we in fact do need to bother.

Quoted 8 lines

IMHO, making policies for UI is not a part of kernel design, a UI manager (Hardware composed, X or Wayland) should take care of it, as they have access to much information (Like previously applied mode, user preference etc). When it comes to sorting of modes, the only general rule across drivers like FB, V4L2, I have seen is the first mode in the list should be preferred mode, which we are still keeping. And after that our probed_modes were
anyways not sorted now, so it doesn't matter further.

Quoted 2 lines

Having userspace be responsible for sorting the aspect ratios would perhaps require that userspace parses the EDID, which is pretty crazy.

Why ?
userspace has to just set cap for aspect ratio, and kernel can read EDID, parse the CEA block, populate the aspect ratios flags and add the modes (Just what this patch was doing, except the cap part) Once userspace has the getResources/getConnector call filled, it can access all the modes (with and without aspect) and do the sorting in any way it wants.

Quoted 7 lines

I guess it could try to deduce something from the physical aspect ratio of the display, but I'm not sure that's quite what we want either.

Also we already sort the modes in the kernel anyway, so it's not like we'd be doing something new by also considering the aspect ratios. I would at the very least want to avoid a totally random order between modes that differ only by the aspect ratio.

Path: get_connector -> probe_single_connector_mode -> drm_add_edid_modes Again, IMHO, we don't sort the modes in kernel, we populate modes in a particular order, which is:
(From drm_edid.c::drm_add_edid_modes)
##############################################################
/*
* EDID spec says modes should be preferred in this order:
* - preferred detailed mode
* - other detailed modes from base block
* - detailed modes from extension blocks
* - CVT 3-byte code modes
* - standard timing codes
* - established timing codes
* - modes inferred from GTF or CVT range information *
* We get this pretty much right.
*
* XXX order for additional mode types in extension blocks? */
num_modes += add_detailed_modes(connector, edid, quirks); num_modes += add_cvt_modes(connector, edid); num_modes += add_standard_modes(connector, edid); num_modes += add_established_modes(connector, edid); num_modes += add_cea_modes(connector, edid); num_modes += add_alternate_cea_modes(connector, edid); num_modes += add_displayid_detailed_modes(connector, edid);
###############################################################

Here the modes are added in the connector, in the same order they are arranged into their respective blocks in EDID.
But the order to read the block is a preferred order (no sorting).

Now, in this patch series, we are adding aspect ratio information in edid_cea_modes db, which is going to affect only add_cea/alternate_cea_modes() call, and the modes accordingly. Please let me know if I misunderstood something here.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

We explicitly sort the modes after this.

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Quoted 7 lines
Quoted 7 lines

Regards

Shashank

Quoted 2 lines
Quoted 2 lines

Regards
Shashank

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

If X server doesn't know what to do with aspect ratio flags, it can chose not to set the cap, and if HWC knows, it can chose to set. This is the same situation as 2D stereo modes
which are existing already.

Regards
Shashank

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#33 lore raw
Quoted 11 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?
-Daniel

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

Regards

Shashank

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 7 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Not really, with a kernel cap implementation, the code will be as it was before this patch series ( as good as revert ) And then when we want to enable it, we can add the corresponding Xserver patch.

I guess the current problem is if is breaks something in some userspace, but if I am loading the flags only when the cap is set, we should be good.

Regards
Shashank

Quoted 1 line

-Daniel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#35 lore raw
Quoted 18 lines · Shashank
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 7 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Quoted 7 lines

Not really, with a kernel cap implementation, the code will be as it was before this patch series ( as good as revert )
And then when we want to enable it, we can add the corresponding Xserver patch.

I guess the current problem is if is breaks something in some userspace, but if I am loading the flags only when the cap is set, we should be good.

This is not how new uabi gets merged, see:

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

Userspace must be ready, or it will not land. The entire point of my suggestion to just extend the display modes was to avoid the need for userspace, but since existing userspace tries to be too clever already, that didn't work out.
Thanks, Daniel

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

Hi,

Quoted 28 lines · Daniel Vetter
Quoted 18 lines · Shashank
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 7 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Quoted 7 lines

Not really, with a kernel cap implementation, the code will be as it was before this patch series ( as good as revert )
And then when we want to enable it, we can add the corresponding Xserver patch.

I guess the current problem is if is breaks something in some userspace, but if I am loading the flags only when the cap is set, we should be good.

This is not how new uabi gets merged, see:

Quoted 7 lines

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

Userspace must be ready, or it will not land. The entire point of my suggestion to just extend the display modes was to avoid the need for userspace, but since existing userspace tries to be too clever already, that didn't work out.
Thanks, Daniel

@Ville

I gave my tested by to these patches because I was facing the same scenario as Shashank: HDMI compliance. I believe we need to find a better way to handle this instead of just reverting. The HDMI spec is evolving so we also need to evolve. Of course that if this is breaking user space then we can revert and wait until we figure the best way to implement this.

Anyway, this is a wild guess but I think the reason you are loosing modes may be because of drm_mode_equal_no_clocks_no_stereo() which is always expecting a aspect ratio flag to be defined. If there isn't one defined then it will unconditionally return false, even if the modes are equal. Can you please test this patch and see if it fixes on your side? WARNING: Not compile tested

Best regards,
Jose Miguel Abreu

(quoted diff) +0 -0

b/drivers/gpu/drm/drm_modes.c
index ce6eeda..a7973a9 100644

drivers/gpu/drm/drm_modes.c +0 -0
@@ -971,6 +971,27 @@ bool drm_mode_equal_no_clocks(const struct

drm_display_mode *mode1, const struct
}
EXPORT_SYMBOL(drm_mode_equal_no_clocks);

+static bool drm_mode_par_valid(const struct drm_display_mode *mode) +{

+       switch (mode->picture_aspect_ratio) {
+       case HDMI_PICTURE_ASPECT_4_3:
+       case HDMI_PICTURE_ASPECT_16_9:
+       case HDMI_PICTURE_ASPECT_64_27:
+       case HDMI_PICTURE_ASPECT_256_135:

+ return true;
+ default:
+ return false;
+ }
+}
+
+static bool drm_mode_equal_par(const struct drm_display_mode *mode1,
+ const struct drm_display_mode *mode2)
+{
+ if (!drm_mode_par_valid(mode1) || !drm_mode_par_valid(mode2))
+ return true;
+ return mode1->picture_aspect_ratio ==
mode2->picture_aspect_ratio;
+}
+
/**
* drm_mode_equal_no_clocks_no_stereo - test modes for equality
* @mode1: first mode
@@ -995,7 +1016,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 &&
+           drm_mode_equal_par(mode1, mode2) &&
            (mode1->flags & ~DRM_MODE_FLAG_3D_MASK) ==
             (mode2->flags & ~DRM_MODE_FLAG_3D_MASK))
                return true;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#37 lore raw
Quoted 50 lines · Jose Abreu

Hi,

Quoted 28 lines · Daniel Vetter
Quoted 18 lines · Shashank
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 7 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Quoted 7 lines

Not really, with a kernel cap implementation, the code will be as it was before this patch series ( as good as revert )
And then when we want to enable it, we can add the corresponding Xserver patch.

I guess the current problem is if is breaks something in some userspace, but if I am loading the flags only when the cap is set, we should be good.

This is not how new uabi gets merged, see:

Quoted 7 lines

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

Userspace must be ready, or it will not land. The entire point of my suggestion to just extend the display modes was to avoid the need for userspace, but since existing userspace tries to be too clever already, that didn't work out.
Thanks, Daniel

@Ville

I gave my tested by to these patches because I was facing the same scenario as Shashank: HDMI compliance. I believe we need to find a better way to handle this instead of just reverting. The HDMI spec is evolving so we also need to evolve. Of course that if this is breaking user space then we can revert and wait until we figure the best way to implement this.

Quoted 6 lines

Anyway, this is a wild guess but I think the reason you are loosing modes may be because of drm_mode_equal_no_clocks_no_stereo() which is always expecting a aspect ratio flag to be defined. If there isn't one defined then it will unconditionally return false, even if the modes are equal.

I am well aware why we're losing modes. One reason is the mode equal checks in the kernel as you suspect, the other is simply userspace rejecting everything with the aspect ratio defined.

Quoted 2 lines

Can you please test this patch and see if it fixes on your side? WARNING: Not compile tested

I already did something like that earlier, except I rewrote the entire messy mode matching code to use a cleaner flag based approach:

git://github.com/vsyrjala/linux.git cea_f_vics

But that doesn't solve the userspace ABI issue, and there are still a lot of unanswered questions like:

- Should we define aspect ratios for modes not directly coming from edid_cea_modes[]?

I beleive the answer must be "yes" at least in the cases where the EDID lists the VIC even if we then skip adding the mode due to already having it on the list via from another source. Perhaps we want the aspect ratio even if the VIC wasn't directly specified?

- Should we or should we not specify a VIC in the AVI infoframe when the userspace doesn't support aspect ratio flags?

I would guess the answer is again "yes", and we should just pick the preferred aspect ratio for the mode. At least that's closer to what we've been doing up to now (except we just picked the first VIC, so we might have picked the non-preferred aspect ratio actually). At least having the VIC in the infoframe would seem like a safer option than not having it, in case there's some cheap ass hardware that can't do anything sensible without being hand fed a VIC.

- How we should handle the aspect ratio in mode sorting?

I think we want some sensible sorting order for these. Preferred aspect ratio first would seem like the obvious choice. I do realize that we don't sort based on 3D stereo flags either, but I thinking we probably should.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#38 lore raw

Regards
Shashank

Quoted 70 lines · Ville Syrjälä
Quoted 49 lines · Jose Abreu

Hi,

Quoted 28 lines · Daniel Vetter
Quoted 18 lines · Shashank
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 7 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Quoted 7 lines

Not really, with a kernel cap implementation, the code will be as it was before this patch series ( as good as revert )
And then when we want to enable it, we can add the corresponding Xserver patch.

I guess the current problem is if is breaks something in some userspace, but if I am loading the flags only when the cap is set, we should be good.

This is not how new uabi gets merged, see:

Quoted 7 lines

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

Userspace must be ready, or it will not land. The entire point of my suggestion to just extend the display modes was to avoid the need for userspace, but since existing userspace tries to be too clever already, that didn't work out.
Thanks, Daniel

@Ville

I gave my tested by to these patches because I was facing the same scenario as Shashank: HDMI compliance. I believe we need to find a better way to handle this instead of just reverting. The HDMI spec is evolving so we also need to evolve. Of course that if this is breaking user space then we can revert and wait until we figure the best way to implement this.

Quoted 6 lines

Anyway, this is a wild guess but I think the reason you are loosing modes may be because of drm_mode_equal_no_clocks_no_stereo() which is always expecting a aspect ratio flag to be defined. If there isn't one defined then it will unconditionally return false, even if the modes are equal.

I am well aware why we're losing modes. One reason is the mode equal checks in the kernel as you suspect, the other is simply userspace rejecting everything with the aspect ratio defined.

Quoted 2 lines

Can you please test this patch and see if it fixes on your side? WARNING: Not compile tested

I already did something like that earlier, except I rewrote the entire messy mode matching code to use a cleaner flag based approach:

git://github.com/vsyrjala/linux.git cea_f_vics

But that doesn't solve the userspace ABI issue, and there are still a lot of unanswered questions like:

Quoted 7 lines

- Should we define aspect ratios for modes not directly coming from edid_cea_modes[]?

I beleive the answer must be "yes" at least in the cases where the EDID lists the VIC even if we then skip adding the mode due to already having it on the list via from another source. Perhaps we want the aspect ratio even if the VIC wasn't directly specified?

Wouldn't this break the whole concept of VIC, which is supposed to point to a unique mode ?

Quoted 2 lines

- Should we or should we not specify a VIC in the AVI infoframe when the userspace doesn't support aspect ratio flags?

This is a requirement of HDMI compliance tests, if userspace supports/handles aspect ratio, it should set cap, and it will be set in kernel flags and we should load that in AV IF. Are you planning to suggest a better way, in which this can be done ?

Quoted 8 lines

I would guess the answer is again "yes", and we should just pick the preferred aspect ratio for the mode. At least that's closer to what we've been doing up to now (except we just picked the first VIC, so we might have picked the non-preferred aspect ratio actually). At least having the VIC in the infoframe would seem like a safer option than not having it, in case there's some cheap ass hardware that can't do anything sensible without being hand fed a VIC.

Quoted 6 lines

- How we should handle the aspect ratio in mode sorting?

I think we want some sensible sorting order for these. Preferred aspect ratio first would seem like the obvious choice. I do realize that we don't sort based on 3D stereo flags either, but I thinking we probably should.

What is the need of this sorting ? None of the standards define/suggest this. AFAIK, the requirement is that only the preferred mode should be notified to the userspace, if a system has to take a call, it can create its policy, if a user has to take a call, it can pick any from the list.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#39 lore raw
Quoted 76 lines · Shashank

Regards
Shashank

Quoted 73 lines · Ville Syrjälä
Quoted 49 lines · Jose Abreu

Hi,

Quoted 28 lines · Daniel Vetter
Quoted 18 lines · Shashank
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 7 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Quoted 7 lines

Not really, with a kernel cap implementation, the code will be as it was before this patch series ( as good as revert )
And then when we want to enable it, we can add the corresponding Xserver patch.

I guess the current problem is if is breaks something in some userspace, but if I am loading the flags only when the cap is set, we should be good.

This is not how new uabi gets merged, see:

Quoted 7 lines

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

Userspace must be ready, or it will not land. The entire point of my suggestion to just extend the display modes was to avoid the need for userspace, but since existing userspace tries to be too clever already, that didn't work out.
Thanks, Daniel

@Ville

I gave my tested by to these patches because I was facing the same scenario as Shashank: HDMI compliance. I believe we need to find a better way to handle this instead of just reverting. The HDMI spec is evolving so we also need to evolve. Of course that if this is breaking user space then we can revert and wait until we figure the best way to implement this.

Quoted 6 lines

Anyway, this is a wild guess but I think the reason you are loosing modes may be because of drm_mode_equal_no_clocks_no_stereo() which is always expecting a aspect ratio flag to be defined. If there isn't one defined then it will unconditionally return false, even if the modes are equal.

I am well aware why we're losing modes. One reason is the mode equal checks in the kernel as you suspect, the other is simply userspace rejecting everything with the aspect ratio defined.

Quoted 2 lines

Can you please test this patch and see if it fixes on your side? WARNING: Not compile tested

I already did something like that earlier, except I rewrote the entire messy mode matching code to use a cleaner flag based approach:

git://github.com/vsyrjala/linux.git cea_f_vics

But that doesn't solve the userspace ABI issue, and there are still a lot of unanswered questions like:

- Should we define aspect ratios for modes not directly coming from edid_cea_modes[]?

Quoted 6 lines
Quoted 4 lines

I beleive the answer must be "yes" at least in the cases where the EDID lists the VIC even if we then skip adding the mode due to already having it on the list via from another source. Perhaps we want the aspect ratio even if the VIC wasn't directly specified?

Wouldn't this break the whole concept of VIC, which is supposed to point to a unique mode ?

Not sure what you're asking. We're already filtering out duplicates.

Quoted 7 lines
Quoted 2 lines

- Should we or should we not specify a VIC in the AVI infoframe when the userspace doesn't support aspect ratio flags?

This is a requirement of HDMI compliance tests, if userspace supports/handles aspect ratio, it should set cap, and it will be set in kernel flags
and we should load that in AV IF. Are you planning to suggest a better way, in which this can be done ?

I was asking for the case where userspace doesn't specify the aspect ratio on account of not understanding what aspect ratios are.

Quoted 14 lines
Quoted 8 lines

I would guess the answer is again "yes", and we should just pick the preferred aspect ratio for the mode. At least that's closer to what we've been doing up to now (except we just picked the first VIC, so we might have picked the non-preferred aspect ratio actually). At least having the VIC in the infoframe would seem like a safer option than not having it, in case there's some cheap ass hardware that can't do anything sensible without being hand fed a VIC.

Quoted 6 lines

- How we should handle the aspect ratio in mode sorting?

I think we want some sensible sorting order for these. Preferred aspect ratio first would seem like the obvious choice. I do realize that we don't sort based on 3D stereo flags either, but I thinking we probably should.

Quoted 5 lines

What is the need of this sorting ? None of the standards define/suggest this. AFAIK, the requirement is that only the preferred mode should be notified
to the userspace, if a system has to take a call, it can create its policy, if a user has to take a call, it can pick any from the list.

Dumb userspace will just pick the first mode it sees that sort of matches what it wants. So we had better make sure that one has the more sensible aspect ratio choice.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#40 lore raw
In reply to Ville Syrjälä

I guess Daniel has already reverted the patches.

Now many I know who is going to define on what should be the right way to handle aspect ratios ?

Regards
Shashank

Quoted 89 lines · Ville Syrjälä
Quoted 49 lines · Jose Abreu

Hi,

Quoted 28 lines · Daniel Vetter
Quoted 18 lines · Shashank
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 7 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Quoted 7 lines

Not really, with a kernel cap implementation, the code will be as it was before this patch series ( as good as revert )
And then when we want to enable it, we can add the corresponding Xserver patch.

I guess the current problem is if is breaks something in some userspace, but if I am loading the flags only when the cap is set, we should be good.

This is not how new uabi gets merged, see:

Quoted 7 lines

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

Userspace must be ready, or it will not land. The entire point of my suggestion to just extend the display modes was to avoid the need for userspace, but since existing userspace tries to be too clever already, that didn't work out.
Thanks, Daniel

@Ville

I gave my tested by to these patches because I was facing the same scenario as Shashank: HDMI compliance. I believe we need to find a better way to handle this instead of just reverting. The HDMI spec is evolving so we also need to evolve. Of course that if this is breaking user space then we can revert and wait until we figure the best way to implement this.

Quoted 6 lines

Anyway, this is a wild guess but I think the reason you are loosing modes may be because of drm_mode_equal_no_clocks_no_stereo() which is always expecting a aspect ratio flag to be defined. If there isn't one defined then it will unconditionally return false, even if the modes are equal.

I am well aware why we're losing modes. One reason is the mode equal checks in the kernel as you suspect, the other is simply userspace rejecting everything with the aspect ratio defined.

Quoted 2 lines

Can you please test this patch and see if it fixes on your side? WARNING: Not compile tested

I already did something like that earlier, except I rewrote the entire messy mode matching code to use a cleaner flag based approach:

git://github.com/vsyrjala/linux.git cea_f_vics

But that doesn't solve the userspace ABI issue, and there are still a lot of unanswered questions like:

- Should we define aspect ratios for modes not directly coming from edid_cea_modes[]?

I beleive the answer must be "yes" at least in the cases where the EDID lists the VIC even if we then skip adding the mode due to already having it on the list via from another source. Perhaps we want the aspect ratio even if the VIC wasn't directly specified?

- Should we or should we not specify a VIC in the AVI infoframe when the userspace doesn't support aspect ratio flags?

I would guess the answer is again "yes", and we should just pick the preferred aspect ratio for the mode. At least that's closer to what we've been doing up to now (except we just picked the first VIC, so we might have picked the non-preferred aspect ratio actually). At least having the VIC in the infoframe would seem like a safer option than not having it, in case there's some cheap ass hardware that can't do anything sensible without being hand fed a VIC.

Quoted 7 lines

- How we should handle the aspect ratio in mode sorting?

I think we want some sensible sorting order for these. Preferred aspect ratio first would seem like the obvious choice. I do realize that we don't sort based on 3D stereo flags either, but I thinking we probably should.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#41 lore raw
In reply to Daniel Vetter
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 8 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Yeah I guess we'll need to push the revert to avoid the regression. Trying to put in new client caps and whatnot after -rc5 doesn't seem like a viable option to me.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#42 lore raw
Quoted 17 lines · Ville Syrjälä
Quoted 16 lines · Daniel Vetter
Quoted 11 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

Quoted 6 lines
Quoted 2 lines

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Yeah I guess we'll need to push the revert to avoid the regression. Trying to put in new client caps and whatnot after -rc5 doesn't seem like a viable option to me.

Yeah, a few days left to get userspace in line is just not enough. Agreed and reverts applied.

Thanks, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#43 lore raw
Quoted 21 lines · Daniel Vetter
Quoted 20 lines · Ville Syrjälä
Quoted 18 lines · Daniel Vetter
Quoted 11 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Quoted 7 lines
Quoted 3 lines

Yeah I guess we'll need to push the revert to avoid the regression. Trying to put in new client caps and whatnot after -rc5 doesn't seem like a viable option to me.

Yeah, a few days left to get userspace in line is just not enough. Agreed and reverts applied.

Is there any way we can add the new CEA modes and worry about handling the aspect ratio stuff later?

Alex
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#44 lore raw
Quoted 26 lines · Alex Deucher
Quoted 25 lines · Daniel Vetter
Quoted 23 lines · Ville Syrjälä
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 8 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Yeah I guess we'll need to push the revert to avoid the regression. Trying to put in new client caps and whatnot after -rc5 doesn't seem like a viable option to me.

Quoted 6 lines
Quoted 3 lines

Yeah, a few days left to get userspace in line is just not enough. Agreed and reverts applied.

Is there any way we can add the new CEA modes and worry about handling the aspect ratio stuff later?

I don't think there's any dependency between the two. Or am I overlooking something?

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#45 lore raw
In reply to Alex Deucher
Quoted 26 lines · Alex Deucher
Quoted 25 lines · Daniel Vetter
Quoted 23 lines · Ville Syrjälä
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

Quoted 8 lines
Quoted 2 lines

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Yeah I guess we'll need to push the revert to avoid the regression. Trying to put in new client caps and whatnot after -rc5 doesn't seem like a viable option to me.

Quoted 6 lines
Quoted 3 lines

Yeah, a few days left to get userspace in line is just not enough. Agreed and reverts applied.

Is there any way we can add the new CEA modes and worry about handling the aspect ratio stuff later?

The two reverts from Ville are just for the aspect ratio pass-thru stuff, new cea modes should still be around. So exactly what you're asking for. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#46 lore raw
Quoted 31 lines · Daniel Vetter
Quoted 30 lines · Alex Deucher
Quoted 28 lines · Daniel Vetter
Quoted 17 lines · Ville Syrjälä
Quoted 16 lines · Daniel Vetter
Quoted 11 lines · Shashank
Quoted 8 lines · Daniel Vetter
Quoted 5 lines · Shashank

In any case, I guess addition of a cap for aspect ratio should fix the current objections for this implementation.

And I will keep it 0 by default, so that no aspect ratio information is added until userspace sets the cap to 1 on its own.

Note that cap = needs new userspace.
-Daniel

I guess you mean a new libdrm, so yes, I will add this new cap in libdrm. Is that what you mean ?

Full stack solution, including enabling in an Xorg driver (or somewhere else, we also have drm_hwcomposer as an option).

Quoted 6 lines
Quoted 2 lines

And because that's probably going to take forever I'm leaning towards revert again. Ville?

Yeah I guess we'll need to push the revert to avoid the regression. Trying to put in new client caps and whatnot after -rc5 doesn't seem like a viable option to me.

Yeah, a few days left to get userspace in line is just not enough. Agreed and reverts applied.

Quoted 6 lines
Quoted 2 lines

Is there any way we can add the new CEA modes and worry about handling the aspect ratio stuff later?

The two reverts from Ville are just for the aspect ratio pass-thru stuff, new cea modes should still be around. So exactly what you're asking for. -Daniel

Great. Thanks!

Alex
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel