* [PATCH] drm/edid: support Microsoft extension for HMDs and specialized monitors
@ 2021-12-13 18:47 Philipp Zabel
2021-12-28 10:08 ` Jani Nikula
2021-12-28 10:10 ` [PATCH] drm/edid: improve non-desktop quirk logging Jani Nikula
0 siblings, 2 replies; 6+ messages in thread
From: Philipp Zabel @ 2021-12-13 18:47 UTC (permalink / raw)
To: dri-devel; +Cc: Jakob Bornecrantz
Add minimal support for parsing VSDBs documented in Microsoft's "EDID
extension for head-mounted and specialized monitors" [1]. The version
field and the desktop usage flag can be used to set the non_desktop
connector property.
Remove the non-desktop quirk for devices that are verified to contain
the VSDB: HPN-3515 and LEN-B800. Presumably most of the other Windows
Mixed Reality headsets contain it as well, but there are ACR-7FCE and
SEC-5194 devices without it.
[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-extension
Tested with HPN-36C1 and LEN-B800.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
---
drivers/gpu/drm/drm_edid.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 12893e7be89b..baea65dfff7d 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -93,6 +93,8 @@ static int oui(u8 first, u8 second, u8 third)
/* Non desktop display (i.e. HMD) */
#define EDID_QUIRK_NON_DESKTOP (1 << 12)
+#define MICROSOFT_IEEE_OUI 0xca125c
+
struct detailed_mode_closure {
struct drm_connector *connector;
struct edid *edid;
@@ -212,9 +214,7 @@ static const struct edid_quirk {
/* Windows Mixed Reality Headsets */
EDID_QUIRK('A', 'C', 'R', 0x7fce, EDID_QUIRK_NON_DESKTOP),
- EDID_QUIRK('H', 'P', 'N', 0x3515, EDID_QUIRK_NON_DESKTOP),
EDID_QUIRK('L', 'E', 'N', 0x0408, EDID_QUIRK_NON_DESKTOP),
- EDID_QUIRK('L', 'E', 'N', 0xb800, EDID_QUIRK_NON_DESKTOP),
EDID_QUIRK('F', 'U', 'J', 0x1970, EDID_QUIRK_NON_DESKTOP),
EDID_QUIRK('D', 'E', 'L', 0x7fce, EDID_QUIRK_NON_DESKTOP),
EDID_QUIRK('S', 'E', 'C', 0x144a, EDID_QUIRK_NON_DESKTOP),
@@ -4222,6 +4222,17 @@ static bool cea_db_is_hdmi_forum_vsdb(const u8 *db)
return oui(db[3], db[2], db[1]) == HDMI_FORUM_IEEE_OUI;
}
+static bool cea_db_is_microsoft_vsdb(const u8 *db)
+{
+ if (cea_db_tag(db) != VENDOR_BLOCK)
+ return false;
+
+ if (cea_db_payload_len(db) != 21)
+ return false;
+
+ return oui(db[3], db[2], db[1]) == MICROSOFT_IEEE_OUI;
+}
+
static bool cea_db_is_vcdb(const u8 *db)
{
if (cea_db_tag(db) != USE_EXTENDED_TAG)
@@ -5149,6 +5160,25 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
drm_parse_hdmi_deep_color_info(connector, db);
}
+/*
+ * See EDID extension for head-mounted and specialized monitors, specified at:
+ * https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-extension
+ */
+static void drm_parse_microsoft_vsdb(struct drm_connector *connector,
+ const u8 *db)
+{
+ struct drm_display_info *info = &connector->display_info;
+ u8 version = db[4];
+ bool desktop_usage = db[5] & BIT(6);
+
+ /* Version 1 and 2 for HMDs, version 3 flags desktop usage explicitly */
+ if (version == 1 || version == 2 || (version == 3 && !desktop_usage))
+ info->non_desktop = 1;
+
+ drm_dbg_kms(connector->dev, "HMD or specialized display VSDB version %u: 0x%02x\n",
+ version, db[5]);
+}
+
static void drm_parse_cea_ext(struct drm_connector *connector,
const struct edid *edid)
{
@@ -5179,6 +5209,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
drm_parse_hdmi_vsdb_video(connector, db);
if (cea_db_is_hdmi_forum_vsdb(db))
drm_parse_hdmi_forum_vsdb(connector, db);
+ if (cea_db_is_microsoft_vsdb(db))
+ drm_parse_microsoft_vsdb(connector, db);
if (cea_db_is_y420cmdb(db))
drm_parse_y420cmdb_bitmap(connector, db);
if (cea_db_is_vcdb(db))
base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/edid: support Microsoft extension for HMDs and specialized monitors
2021-12-13 18:47 [PATCH] drm/edid: support Microsoft extension for HMDs and specialized monitors Philipp Zabel
@ 2021-12-28 10:08 ` Jani Nikula
2021-12-28 10:14 ` Jani Nikula
2021-12-28 10:10 ` [PATCH] drm/edid: improve non-desktop quirk logging Jani Nikula
1 sibling, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2021-12-28 10:08 UTC (permalink / raw)
To: Philipp Zabel, dri-devel; +Cc: Jakob Bornecrantz
On Mon, 13 Dec 2021, Philipp Zabel <philipp.zabel@gmail.com> wrote:
> Add minimal support for parsing VSDBs documented in Microsoft's "EDID
> extension for head-mounted and specialized monitors" [1]. The version
> field and the desktop usage flag can be used to set the non_desktop
> connector property.
>
> Remove the non-desktop quirk for devices that are verified to contain
> the VSDB: HPN-3515 and LEN-B800. Presumably most of the other Windows
> Mixed Reality headsets contain it as well, but there are ACR-7FCE and
> SEC-5194 devices without it.
>
> [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-extension
>
> Tested with HPN-36C1 and LEN-B800.
>
> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
> ---
> drivers/gpu/drm/drm_edid.c | 36 ++++++++++++++++++++++++++++++++++--
> 1 file changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 12893e7be89b..baea65dfff7d 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -93,6 +93,8 @@ static int oui(u8 first, u8 second, u8 third)
> /* Non desktop display (i.e. HMD) */
> #define EDID_QUIRK_NON_DESKTOP (1 << 12)
>
> +#define MICROSOFT_IEEE_OUI 0xca125c
> +
> struct detailed_mode_closure {
> struct drm_connector *connector;
> struct edid *edid;
> @@ -212,9 +214,7 @@ static const struct edid_quirk {
>
> /* Windows Mixed Reality Headsets */
> EDID_QUIRK('A', 'C', 'R', 0x7fce, EDID_QUIRK_NON_DESKTOP),
> - EDID_QUIRK('H', 'P', 'N', 0x3515, EDID_QUIRK_NON_DESKTOP),
> EDID_QUIRK('L', 'E', 'N', 0x0408, EDID_QUIRK_NON_DESKTOP),
> - EDID_QUIRK('L', 'E', 'N', 0xb800, EDID_QUIRK_NON_DESKTOP),
Nitpick, in general I'd prefer the quirk removal to be a separate patch,
but not a big issue here.
> EDID_QUIRK('F', 'U', 'J', 0x1970, EDID_QUIRK_NON_DESKTOP),
> EDID_QUIRK('D', 'E', 'L', 0x7fce, EDID_QUIRK_NON_DESKTOP),
> EDID_QUIRK('S', 'E', 'C', 0x144a, EDID_QUIRK_NON_DESKTOP),
> @@ -4222,6 +4222,17 @@ static bool cea_db_is_hdmi_forum_vsdb(const u8 *db)
> return oui(db[3], db[2], db[1]) == HDMI_FORUM_IEEE_OUI;
> }
>
> +static bool cea_db_is_microsoft_vsdb(const u8 *db)
> +{
> + if (cea_db_tag(db) != VENDOR_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) != 21)
> + return false;
> +
> + return oui(db[3], db[2], db[1]) == MICROSOFT_IEEE_OUI;
> +}
> +
> static bool cea_db_is_vcdb(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -5149,6 +5160,25 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
> drm_parse_hdmi_deep_color_info(connector, db);
> }
>
> +/*
> + * See EDID extension for head-mounted and specialized monitors, specified at:
> + * https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-extension
> + */
> +static void drm_parse_microsoft_vsdb(struct drm_connector *connector,
> + const u8 *db)
> +{
> + struct drm_display_info *info = &connector->display_info;
> + u8 version = db[4];
> + bool desktop_usage = db[5] & BIT(6);
> +
> + /* Version 1 and 2 for HMDs, version 3 flags desktop usage explicitly */
> + if (version == 1 || version == 2 || (version == 3 && !desktop_usage))
> + info->non_desktop = 1;
Nitpick, bool should be set to true instead of 1.
With this one fixed,
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
I'll also reply with a follow-up patch that I think improves the logging
between this and the quirk.
BR,
Jani.
> +
> + drm_dbg_kms(connector->dev, "HMD or specialized display VSDB version %u: 0x%02x\n",
> + version, db[5]);
> +}
> +
> static void drm_parse_cea_ext(struct drm_connector *connector,
> const struct edid *edid)
> {
> @@ -5179,6 +5209,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_hdmi_vsdb_video(connector, db);
> if (cea_db_is_hdmi_forum_vsdb(db))
> drm_parse_hdmi_forum_vsdb(connector, db);
> + if (cea_db_is_microsoft_vsdb(db))
> + drm_parse_microsoft_vsdb(connector, db);
> if (cea_db_is_y420cmdb(db))
> drm_parse_y420cmdb_bitmap(connector, db);
> if (cea_db_is_vcdb(db))
>
> base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] drm/edid: improve non-desktop quirk logging
2021-12-13 18:47 [PATCH] drm/edid: support Microsoft extension for HMDs and specialized monitors Philipp Zabel
2021-12-28 10:08 ` Jani Nikula
@ 2021-12-28 10:10 ` Jani Nikula
2022-01-23 10:27 ` Philipp Zabel
1 sibling, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2021-12-28 10:10 UTC (permalink / raw)
To: Philipp Zabel, dri-devel; +Cc: Jani Nikula, Jakob Bornecrantz
Improve non-desktop quirk logging if the EDID indicates non-desktop. If
both are set, note about redundant quirk. If there's no quirk but the
EDID indicates non-desktop, don't log non-desktop is set to 0.
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_edid.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 12893e7be89b..017c8598e84c 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5333,17 +5333,13 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
info->width_mm = edid->width_cm * 10;
info->height_mm = edid->height_cm * 10;
- info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
-
drm_get_monitor_range(connector, edid);
- DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
-
if (edid->revision < 3)
- return quirks;
+ goto out;
if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
- return quirks;
+ goto out;
drm_parse_cea_ext(connector, edid);
@@ -5363,7 +5359,7 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
/* Only defined for 1.4 with digital displays */
if (edid->revision < 4)
- return quirks;
+ goto out;
switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) {
case DRM_EDID_DIGITAL_DEPTH_6:
@@ -5401,6 +5397,13 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
drm_update_mso(connector, edid);
+out:
+ if (quirks & EDID_QUIRK_NON_DESKTOP) {
+ drm_dbg_kms(connector->dev, "Non-desktop display%s\n",
+ info->non_desktop ? " (redundant quirk)" : "");
+ info->non_desktop = true;
+ }
+
return quirks;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/edid: support Microsoft extension for HMDs and specialized monitors
2021-12-28 10:08 ` Jani Nikula
@ 2021-12-28 10:14 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2021-12-28 10:14 UTC (permalink / raw)
To: Philipp Zabel, dri-devel; +Cc: Jakob Bornecrantz
On Tue, 28 Dec 2021, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Mon, 13 Dec 2021, Philipp Zabel <philipp.zabel@gmail.com> wrote:
>> Add minimal support for parsing VSDBs documented in Microsoft's "EDID
>> extension for head-mounted and specialized monitors" [1]. The version
>> field and the desktop usage flag can be used to set the non_desktop
>> connector property.
>>
>> Remove the non-desktop quirk for devices that are verified to contain
>> the VSDB: HPN-3515 and LEN-B800. Presumably most of the other Windows
>> Mixed Reality headsets contain it as well, but there are ACR-7FCE and
>> SEC-5194 devices without it.
>>
>> [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-extension
>>
>> Tested with HPN-36C1 and LEN-B800.
>>
>> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
>> ---
>> drivers/gpu/drm/drm_edid.c | 36 ++++++++++++++++++++++++++++++++++--
>> 1 file changed, 34 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 12893e7be89b..baea65dfff7d 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -93,6 +93,8 @@ static int oui(u8 first, u8 second, u8 third)
>> /* Non desktop display (i.e. HMD) */
>> #define EDID_QUIRK_NON_DESKTOP (1 << 12)
>>
>> +#define MICROSOFT_IEEE_OUI 0xca125c
>> +
>> struct detailed_mode_closure {
>> struct drm_connector *connector;
>> struct edid *edid;
>> @@ -212,9 +214,7 @@ static const struct edid_quirk {
>>
>> /* Windows Mixed Reality Headsets */
>> EDID_QUIRK('A', 'C', 'R', 0x7fce, EDID_QUIRK_NON_DESKTOP),
>> - EDID_QUIRK('H', 'P', 'N', 0x3515, EDID_QUIRK_NON_DESKTOP),
>> EDID_QUIRK('L', 'E', 'N', 0x0408, EDID_QUIRK_NON_DESKTOP),
>> - EDID_QUIRK('L', 'E', 'N', 0xb800, EDID_QUIRK_NON_DESKTOP),
>
> Nitpick, in general I'd prefer the quirk removal to be a separate patch,
> but not a big issue here.
>
>> EDID_QUIRK('F', 'U', 'J', 0x1970, EDID_QUIRK_NON_DESKTOP),
>> EDID_QUIRK('D', 'E', 'L', 0x7fce, EDID_QUIRK_NON_DESKTOP),
>> EDID_QUIRK('S', 'E', 'C', 0x144a, EDID_QUIRK_NON_DESKTOP),
>> @@ -4222,6 +4222,17 @@ static bool cea_db_is_hdmi_forum_vsdb(const u8 *db)
>> return oui(db[3], db[2], db[1]) == HDMI_FORUM_IEEE_OUI;
>> }
>>
>> +static bool cea_db_is_microsoft_vsdb(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != VENDOR_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) != 21)
>> + return false;
>> +
>> + return oui(db[3], db[2], db[1]) == MICROSOFT_IEEE_OUI;
>> +}
>> +
>> static bool cea_db_is_vcdb(const u8 *db)
>> {
>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> @@ -5149,6 +5160,25 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
>> drm_parse_hdmi_deep_color_info(connector, db);
>> }
>>
>> +/*
>> + * See EDID extension for head-mounted and specialized monitors, specified at:
>> + * https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-extension
>> + */
>> +static void drm_parse_microsoft_vsdb(struct drm_connector *connector,
>> + const u8 *db)
>> +{
>> + struct drm_display_info *info = &connector->display_info;
>> + u8 version = db[4];
>> + bool desktop_usage = db[5] & BIT(6);
>> +
>> + /* Version 1 and 2 for HMDs, version 3 flags desktop usage explicitly */
>> + if (version == 1 || version == 2 || (version == 3 && !desktop_usage))
>> + info->non_desktop = 1;
>
> Nitpick, bool should be set to true instead of 1.
>
> With this one fixed,
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> I'll also reply with a follow-up patch that I think improves the logging
> between this and the quirk.
To elaborate, after your patch, the log will contain:
non_desktop set to 0
HMD or specialized display VSDB version ...
And it will be non-desktop.
I don't know, maybe you want to improve on my patch further, but you get
the idea.
BR,
Jani.
>
>
> BR,
> Jani.
>
>
>> +
>> + drm_dbg_kms(connector->dev, "HMD or specialized display VSDB version %u: 0x%02x\n",
>> + version, db[5]);
>> +}
>> +
>> static void drm_parse_cea_ext(struct drm_connector *connector,
>> const struct edid *edid)
>> {
>> @@ -5179,6 +5209,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>> drm_parse_hdmi_vsdb_video(connector, db);
>> if (cea_db_is_hdmi_forum_vsdb(db))
>> drm_parse_hdmi_forum_vsdb(connector, db);
>> + if (cea_db_is_microsoft_vsdb(db))
>> + drm_parse_microsoft_vsdb(connector, db);
>> if (cea_db_is_y420cmdb(db))
>> drm_parse_y420cmdb_bitmap(connector, db);
>> if (cea_db_is_vcdb(db))
>>
>> base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/edid: improve non-desktop quirk logging
2021-12-28 10:10 ` [PATCH] drm/edid: improve non-desktop quirk logging Jani Nikula
@ 2022-01-23 10:27 ` Philipp Zabel
2022-01-24 15:06 ` Jani Nikula
0 siblings, 1 reply; 6+ messages in thread
From: Philipp Zabel @ 2022-01-23 10:27 UTC (permalink / raw)
To: Jani Nikula; +Cc: Jakob Bornecrantz, dri-devel
On Tue, Dec 28, 2021 at 11:10 AM Jani Nikula <jani.nikula@intel.com> wrote:
>
> Improve non-desktop quirk logging if the EDID indicates non-desktop. If
> both are set, note about redundant quirk. If there's no quirk but the
> EDID indicates non-desktop, don't log non-desktop is set to 0.
>
> Cc: Philipp Zabel <philipp.zabel@gmail.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Thank you,
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
regards
Philipp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/edid: improve non-desktop quirk logging
2022-01-23 10:27 ` Philipp Zabel
@ 2022-01-24 15:06 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2022-01-24 15:06 UTC (permalink / raw)
To: Philipp Zabel; +Cc: Jakob Bornecrantz, dri-devel
On Sun, 23 Jan 2022, Philipp Zabel <philipp.zabel@gmail.com> wrote:
> On Tue, Dec 28, 2021 at 11:10 AM Jani Nikula <jani.nikula@intel.com> wrote:
>>
>> Improve non-desktop quirk logging if the EDID indicates non-desktop. If
>> both are set, note about redundant quirk. If there's no quirk but the
>> EDID indicates non-desktop, don't log non-desktop is set to 0.
>>
>> Cc: Philipp Zabel <philipp.zabel@gmail.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Thank you,
>
> Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
> Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Thanks for the review and testing, pushed to drm-misc-next after v2 of
your HMD EDID patches.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-01-24 15:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 18:47 [PATCH] drm/edid: support Microsoft extension for HMDs and specialized monitors Philipp Zabel
2021-12-28 10:08 ` Jani Nikula
2021-12-28 10:14 ` Jani Nikula
2021-12-28 10:10 ` [PATCH] drm/edid: improve non-desktop quirk logging Jani Nikula
2022-01-23 10:27 ` Philipp Zabel
2022-01-24 15:06 ` Jani Nikula
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.