All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] drm: Create new structure for HDMI info
@ 2016-12-20 13:47 Shashank Sharma
  2016-12-20 13:47 ` [PATCH v2 2/2] drm: parse hf-vsdb Shashank Sharma
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Shashank Sharma @ 2016-12-20 13:47 UTC (permalink / raw)
  To: dri-devel, intel-gfx; +Cc: Daniel Vetter, Thierry Reding, Jose Abreu

This patch creates a new structure drm_hdmi_info (inspired from
drm_display_info). Driver will parse HDMI sink's advance capabilities
from HF-VSDB and populate this structure. This structure will be kept
and used as a sub-class within drm_display_info.

We are adding parsing of HF-VSDB In the next patch.

Cc: Thierry Reding <treding@nvidia.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Suggested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/drm_edid.c  |  6 ++--
 include/drm/drm_connector.h | 79 ++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 77 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 67d6a73..b552197 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3782,21 +3782,21 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 
 	if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
 		dc_bpc = 10;
-		info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_30;
+		info->hdmi_info.edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_30;
 		DRM_DEBUG("%s: HDMI sink does deep color 30.\n",
 			  connector->name);
 	}
 
 	if (hdmi[6] & DRM_EDID_HDMI_DC_36) {
 		dc_bpc = 12;
-		info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_36;
+		info->hdmi_info.edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_36;
 		DRM_DEBUG("%s: HDMI sink does deep color 36.\n",
 			  connector->name);
 	}
 
 	if (hdmi[6] & DRM_EDID_HDMI_DC_48) {
 		dc_bpc = 16;
-		info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_48;
+		info->hdmi_info.edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_48;
 		DRM_DEBUG("%s: HDMI sink does deep color 48.\n",
 			  connector->name);
 	}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 6e352a0..fba2b88 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -90,6 +90,76 @@ enum subpixel_order {
 };
 
 /**
+ * struct drm_hdmi_info - runtime data specific to a connected hdmi sink
+ *
+ * Describes a given hdmi display (e.g. CRT or flat panel) and its capabilities.
+ * Mostly refects the advanced features added in HDMI 2.0 specs and the deep
+ * color support. This is a sub-segment of struct drm_display_info and should be
+ * used within.
+ *
+ * For sinks which provide an EDID this can be filled out by calling
+ * drm_add_edid_modes().
+ */
+
+struct drm_hdmi_info {
+
+	/**
+	 * @edid_hdmi_dc_modes: Mask of supported hdmi deep color modes. Even
+	 * more stuff redundant with @bus_formats.
+	 */
+	u8 edid_hdmi_dc_modes;
+
+	/**
+	 * @edid_yuv420_dc_modes: bpc for deep color yuv420 encoding.
+	 * various sinks can support 10/12/16 bit per channel deep
+	 * color encoding. edid_yuv420_dc_modes = 0 means sink doesn't
+	 * support deep color yuv420 encoding.
+	 */
+	u8 edid_yuv420_dc_modes;
+
+
+#define DRM_HFVSDB_SCDC_SUPPORT	(1<<7)
+#define DRM_HFVSDB_SCDC_RR_CAP		(1<<6)
+#define DRM_HFVSDB_SCRAMBLING		(1<<3)
+#define DRM_HFVSDB_INDEPENDENT_VIEW	(1<<2)
+#define DRM_HFVSDB_DUAL_VIEW		(1<<1)
+#define DRM_HFVSDB_3D_OSD		(1<<0)
+
+	/**
+	 * @scdc_supported: Sink supports SCDC functionality.
+	 */
+	bool scdc_supported;
+
+	/**
+	 * @scdc_rr_cap: Sink has SCDC read request capability.
+	 */
+	bool scdc_rr_cap;
+
+	/**
+	 * @scrambling: Sync supports scrambling for <=340 Mcsc TMDS
+	 * char rates. Above 340 Mcsc rates, scrambling is always reqd.
+	 */
+	bool scrambling;
+
+	/**
+	 * @independent_view_3d: Sink supports 3d independent view signaling
+	 * in HF-VSIF.
+	 */
+	bool independent_view_3d;
+
+	/**
+	 * @dual_view_3d: Sink supports 3d dual view signaling in HF-VSIF.
+	 */
+	bool dual_view_3d;
+
+	/**
+	 * @osd_disparity_3d: Sink supports 3d osd disparity indication
+	 * in HF-VSIF.
+	 */
+	bool osd_disparity_3d;
+};
+
+/**
  * struct drm_display_info - runtime data about the connected sink
  *
  * Describes a given display (e.g. CRT or flat panel) and its limitations. For
@@ -179,15 +249,14 @@ struct drm_display_info {
 	bool dvi_dual;
 
 	/**
-	 * @edid_hdmi_dc_modes: Mask of supported hdmi deep color modes. Even
-	 * more stuff redundant with @bus_formats.
+	 * @cea_rev: CEA revision of the HDMI sink.
 	 */
-	u8 edid_hdmi_dc_modes;
+	u8 cea_rev;
 
 	/**
-	 * @cea_rev: CEA revision of the HDMI sink.
+	 * @ drm_hdmi_info: Capabilities of connected HDMI display
 	 */
-	u8 cea_rev;
+	struct drm_hdmi_info hdmi_info;
 };
 
 int drm_display_info_set_bus_formats(struct drm_display_info *info,
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/2] drm: parse hf-vsdb
  2016-12-20 13:47 [PATCH v2 1/2] drm: Create new structure for HDMI info Shashank Sharma
@ 2016-12-20 13:47 ` Shashank Sharma
  2016-12-20 14:35   ` Jose Abreu
  2016-12-20 14:19 ` [PATCH v2 1/2] drm: Create new structure for HDMI info Jose Abreu
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Shashank Sharma @ 2016-12-20 13:47 UTC (permalink / raw)
  To: dri-devel, intel-gfx; +Cc: Daniel Vetter, Thierry Reding, Jose Abreu

HDMI 2.0 / CEA-861-F specs define a new CEA extension data block,
called hdmi-forum vendor specific data block (HF-VSDB). This block
contains information about sink's support for HDMI 2.0 compliant
features. These features are:
    - Deep color YUV 420 support and BPC
    - 3D flags for
        - OSD Displarity
        - Dual view signaling
        - independent view signaling
    - SCDC support
    - Max TMDS char rate
    - Scrambling support

This patch adds a parser function for this block, and add flags to
indicate support for new features, in drm_display_info structure

V2:
- Addressed review comments from Thierry
	- remove len > 31 check
	- remove version check
	- fix duplicate values for macros of 36 and 30-bit depths
- Added a sub-class for HDMI related information within drm_display_info
  (Thierry, Daniel) and populated it with HF-VSDB specific info.

Cc: Thierry Reding <treding@nvidia.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++
 include/drm/drm_edid.h     |  5 ++++
 include/linux/hdmi.h       |  1 +
 3 files changed, 76 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b552197..59e04fb 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3224,6 +3224,23 @@ static int add_3d_struct_modes(struct drm_connector *connector, u16 structure,
 	return 0;
 }
 
+static bool cea_db_is_hf_vsdb(const u8 *db)
+{
+	u8 len;
+	int hfvsdb_id;
+
+	if (cea_db_tag(db) != VENDOR_BLOCK)
+		return false;
+
+	len = cea_db_payload_len(db);
+	if (len < 7)
+		return false;
+
+	hfvsdb_id = db[1] | (db[2] << 8) | (db[3] << 16);
+
+	return hfvsdb_id == HDMI_IEEE_OUI_HFVSDB;
+}
+
 static bool cea_db_is_hdmi_vsdb(const u8 *db)
 {
 	int hdmi_id;
@@ -3768,6 +3785,57 @@ bool drm_rgb_quant_range_selectable(struct edid *edid)
 }
 EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
 
+static void drm_parse_yuv420_deep_color_info(struct drm_connector *connector,
+						const u8 *db)
+{
+	struct drm_hdmi_info *info = &connector->display_info.hdmi_info;
+
+	if (db[7] & DRM_EDID_YUV420_DC_48)
+		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_48;
+	if (db[7] & DRM_EDID_YUV420_DC_36)
+		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_36;
+	if (db[7] & DRM_EDID_YUV420_DC_30)
+		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_30;
+
+	if (!info->edid_yuv420_dc_modes) {
+		DRM_DEBUG("%s: No YUV 420 deep color support in sink.\n",
+			  connector->name);
+		return;
+	}
+}
+
+static void
+drm_parse_hf_vsdb(struct drm_connector *connector, const u8 *db)
+{
+	struct drm_display_info *info = &connector->display_info;
+	struct drm_hdmi_info *hdmi_info = &info->hdmi_info;
+
+	if (db[5]) {
+		/*
+		 * If the sink supplies max tmds char rate in db,
+		 * the actual max tmds rate = db[5] * 5Mhz.
+		 */
+		info->max_tmds_clock = db[5] * 5000;
+		DRM_DEBUG_KMS("HF-VSDB: max TMDS clock %d kHz\n",
+		info->max_tmds_clock);
+	}
+
+	if (db[6] & DRM_HFVSDB_SCDC_SUPPORT)
+		hdmi_info->scdc_supported = true;
+	if (db[6] & DRM_HFVSDB_SCDC_RR_CAP)
+		hdmi_info->scdc_rr_cap = true;
+	if (db[6] & DRM_HFVSDB_SCRAMBLING)
+		hdmi_info->scrambling = true;
+	if (db[6] & DRM_HFVSDB_INDEPENDENT_VIEW)
+		hdmi_info->independent_view_3d = true;
+	if (db[6] & DRM_HFVSDB_DUAL_VIEW)
+		hdmi_info->dual_view_3d = true;
+	if (db[6] & DRM_HFVSDB_3D_OSD)
+		hdmi_info->osd_disparity_3d = true;
+
+	drm_parse_yuv420_deep_color_info(connector, db);
+}
+
 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
 					   const u8 *hdmi)
 {
@@ -3882,6 +3950,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 
 		if (cea_db_is_hdmi_vsdb(db))
 			drm_parse_hdmi_vsdb_video(connector, db);
+		if (cea_db_is_hf_vsdb(db))
+			drm_parse_hf_vsdb(connector, db);
 	}
 }
 
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 38eabf6..df606e3 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -212,6 +212,11 @@ struct detailed_timing {
 #define DRM_EDID_HDMI_DC_30               (1 << 4)
 #define DRM_EDID_HDMI_DC_Y444             (1 << 3)
 
+/* YUV 420 deep color modes */
+#define DRM_EDID_YUV420_DC_48		  (1 << 6)
+#define DRM_EDID_YUV420_DC_36		  (1 << 5)
+#define DRM_EDID_YUV420_DC_30		  (1 << 4)
+
 /* ELD Header Block */
 #define DRM_ELD_HEADER_BLOCK_SIZE	4
 
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index edbb4fc..2d4e9ef 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -35,6 +35,7 @@ enum hdmi_infoframe_type {
 };
 
 #define HDMI_IEEE_OUI 0x000c03
+#define HDMI_IEEE_OUI_HFVSDB 0xC45DD8
 #define HDMI_INFOFRAME_HEADER_SIZE  4
 #define HDMI_AVI_INFOFRAME_SIZE    13
 #define HDMI_SPD_INFOFRAME_SIZE    25
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/2] drm: Create new structure for HDMI info
  2016-12-20 13:47 [PATCH v2 1/2] drm: Create new structure for HDMI info Shashank Sharma
  2016-12-20 13:47 ` [PATCH v2 2/2] drm: parse hf-vsdb Shashank Sharma
@ 2016-12-20 14:19 ` Jose Abreu
  2016-12-21  3:49   ` Sharma, Shashank
  2016-12-20 14:45 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/2] " Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Jose Abreu @ 2016-12-20 14:19 UTC (permalink / raw)
  To: Shashank Sharma, dri-devel, intel-gfx
  Cc: Jose Abreu, Daniel Vetter, Thierry Reding

Hi Shashank,


On 20-12-2016 13:47, Shashank Sharma wrote:
> This patch creates a new structure drm_hdmi_info (inspired from
> drm_display_info). Driver will parse HDMI sink's advance capabilities
> from HF-VSDB and populate this structure. This structure will be kept
> and used as a sub-class within drm_display_info.

You populate the structure but I think you should add a helper to
reset it when there is a new EDID or when the previous EDID is no
longer valid. The same applies to other fields in
drm_display_info structure. I've had problems before because of
incorrect values in this structure.

> We are adding parsing of HF-VSDB In the next patch.
>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jose Abreu <joabreu@synopsys.com>
> Suggested-by: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c  |  6 ++--
>  include/drm/drm_connector.h | 79 ++++++++++++++++++++++++++++++++++++++++++---
>  2 files changed, 77 insertions(+), 8 deletions(-)
>

[snip]

>  
>  /**
> + * struct drm_hdmi_info - runtime data specific to a connected hdmi sink
> + *
> + * Describes a given hdmi display (e.g. CRT or flat panel) and its capabilities.
> + * Mostly refects the advanced features added in HDMI 2.0 specs and the deep
> + * color support. This is a sub-segment of struct drm_display_info and should be
> + * used within.
> + *
> + * For sinks which provide an EDID this can be filled out by calling
> + * drm_add_edid_modes().
> + */
> +
> +struct drm_hdmi_info {

[snip]

> +
> +	/**
> +	 * @edid_yuv420_dc_modes: bpc for deep color yuv420 encoding.
> +	 * various sinks can support 10/12/16 bit per channel deep
> +	 * color encoding. edid_yuv420_dc_modes = 0 means sink doesn't
> +	 * support deep color yuv420 encoding.
> +	 */
> +	u8 edid_yuv420_dc_modes;
> +
> +
> +#define DRM_HFVSDB_SCDC_SUPPORT	(1<<7)
> +#define DRM_HFVSDB_SCDC_RR_CAP		(1<<6)
> +#define DRM_HFVSDB_SCRAMBLING		(1<<3)
> +#define DRM_HFVSDB_INDEPENDENT_VIEW	(1<<2)
> +#define DRM_HFVSDB_DUAL_VIEW		(1<<1)
> +#define DRM_HFVSDB_3D_OSD		(1<<0)
> +
> +	/**
> +	 * @scdc_supported: Sink supports SCDC functionality.
> +	 */
> +	bool scdc_supported;
> +
> +	/**
> +	 * @scdc_rr_cap: Sink has SCDC read request capability.
> +	 */
> +	bool scdc_rr_cap;
> +
> +	/**
> +	 * @scrambling: Sync supports scrambling for <=340 Mcsc TMDS
> +	 * char rates. Above 340 Mcsc rates, scrambling is always reqd.
> +	 */
> +	bool scrambling;
> +
> +	/**
> +	 * @independent_view_3d: Sink supports 3d independent view signaling
> +	 * in HF-VSIF.
> +	 */
> +	bool independent_view_3d;
> +
> +	/**
> +	 * @dual_view_3d: Sink supports 3d dual view signaling in HF-VSIF.
> +	 */
> +	bool dual_view_3d;
> +
> +	/**
> +	 * @osd_disparity_3d: Sink supports 3d osd disparity indication
> +	 * in HF-VSIF.
> +	 */
> +	bool osd_disparity_3d;

Maybe you should only add these fields in the second patch.

Best regards,
Jose Miguel Abreu
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] drm: parse hf-vsdb
  2016-12-20 13:47 ` [PATCH v2 2/2] drm: parse hf-vsdb Shashank Sharma
@ 2016-12-20 14:35   ` Jose Abreu
  2016-12-21  3:54     ` Sharma, Shashank
  0 siblings, 1 reply; 11+ messages in thread
From: Jose Abreu @ 2016-12-20 14:35 UTC (permalink / raw)
  To: Shashank Sharma, dri-devel, intel-gfx
  Cc: Jose Abreu, Daniel Vetter, Thierry Reding

Hi Shashank,


On 20-12-2016 13:47, Shashank Sharma wrote:
> HDMI 2.0 / CEA-861-F specs define a new CEA extension data block,
> called hdmi-forum vendor specific data block (HF-VSDB). This block
> contains information about sink's support for HDMI 2.0 compliant
> features. These features are:
>     - Deep color YUV 420 support and BPC
>     - 3D flags for
>         - OSD Displarity
>         - Dual view signaling
>         - independent view signaling
>     - SCDC support
>     - Max TMDS char rate
>     - Scrambling support
>
> This patch adds a parser function for this block, and add flags to
> indicate support for new features, in drm_display_info structure
>
> V2:
> - Addressed review comments from Thierry
> 	- remove len > 31 check
> 	- remove version check
> 	- fix duplicate values for macros of 36 and 30-bit depths
> - Added a sub-class for HDMI related information within drm_display_info
>   (Thierry, Daniel) and populated it with HF-VSDB specific info.
>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jose Abreu <joabreu@synopsys.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/drm/drm_edid.h     |  5 ++++
>  include/linux/hdmi.h       |  1 +
>  3 files changed, 76 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index b552197..59e04fb 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3224,6 +3224,23 @@ static int add_3d_struct_modes(struct drm_connector *connector, u16 structure,
>  	return 0;
>  }
>  
> +static bool cea_db_is_hf_vsdb(const u8 *db)
> +{
> +	u8 len;
> +	int hfvsdb_id;
> +
> +	if (cea_db_tag(db) != VENDOR_BLOCK)
> +		return false;
> +
> +	len = cea_db_payload_len(db);
> +	if (len < 7)
> +		return false;
> +
> +	hfvsdb_id = db[1] | (db[2] << 8) | (db[3] << 16);
> +
> +	return hfvsdb_id == HDMI_IEEE_OUI_HFVSDB;
> +}
> +
>  static bool cea_db_is_hdmi_vsdb(const u8 *db)
>  {
>  	int hdmi_id;
> @@ -3768,6 +3785,57 @@ bool drm_rgb_quant_range_selectable(struct edid *edid)
>  }
>  EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
>  
> +static void drm_parse_yuv420_deep_color_info(struct drm_connector *connector,
> +						const u8 *db)
> +{
> +	struct drm_hdmi_info *info = &connector->display_info.hdmi_info;
> +
> +	if (db[7] & DRM_EDID_YUV420_DC_48)
> +		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_48;
> +	if (db[7] & DRM_EDID_YUV420_DC_36)
> +		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_36;
> +	if (db[7] & DRM_EDID_YUV420_DC_30)
> +		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_30;
> +
> +	if (!info->edid_yuv420_dc_modes) {
> +		DRM_DEBUG("%s: No YUV 420 deep color support in sink.\n",
> +			  connector->name);
> +		return;
> +	}
> +}
> +
> +static void
> +drm_parse_hf_vsdb(struct drm_connector *connector, const u8 *db)
> +{
> +	struct drm_display_info *info = &connector->display_info;
> +	struct drm_hdmi_info *hdmi_info = &info->hdmi_info;
> +
> +	if (db[5]) {
> +		/*
> +		 * If the sink supplies max tmds char rate in db,
> +		 * the actual max tmds rate = db[5] * 5Mhz.
> +		 */
> +		info->max_tmds_clock = db[5] * 5000;
> +		DRM_DEBUG_KMS("HF-VSDB: max TMDS clock %d kHz\n",
> +		info->max_tmds_clock);
> +	}
> +
> +	if (db[6] & DRM_HFVSDB_SCDC_SUPPORT)
> +		hdmi_info->scdc_supported = true;
> +	if (db[6] & DRM_HFVSDB_SCDC_RR_CAP)
> +		hdmi_info->scdc_rr_cap = true;
> +	if (db[6] & DRM_HFVSDB_SCRAMBLING)
> +		hdmi_info->scrambling = true;

According to spec you should also check if scdc is supported in
order to support scrambling.

> +	if (db[6] & DRM_HFVSDB_INDEPENDENT_VIEW)
> +		hdmi_info->independent_view_3d = true;
> +	if (db[6] & DRM_HFVSDB_DUAL_VIEW)
> +		hdmi_info->dual_view_3d = true;
> +	if (db[6] & DRM_HFVSDB_3D_OSD)
> +		hdmi_info->osd_disparity_3d = true;
> +
> +	drm_parse_yuv420_deep_color_info(connector, db);
> +}
> +
>  static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
>  					   const u8 *hdmi)
>  {
> @@ -3882,6 +3950,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>  
>  		if (cea_db_is_hdmi_vsdb(db))
>  			drm_parse_hdmi_vsdb_video(connector, db);
> +		if (cea_db_is_hf_vsdb(db))
> +			drm_parse_hf_vsdb(connector, db);
>  	}
>  }
>  
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 38eabf6..df606e3 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -212,6 +212,11 @@ struct detailed_timing {
>  #define DRM_EDID_HDMI_DC_30               (1 << 4)
>  #define DRM_EDID_HDMI_DC_Y444             (1 << 3)
>  
> +/* YUV 420 deep color modes */
> +#define DRM_EDID_YUV420_DC_48		  (1 << 6)
> +#define DRM_EDID_YUV420_DC_36		  (1 << 5)
> +#define DRM_EDID_YUV420_DC_30		  (1 << 4)

Hmm, I think this is wrong. According to spec DC 48 is at
position 2, DC 36 at position 1 and DC 30 at position 0.

> +
>  /* ELD Header Block */
>  #define DRM_ELD_HEADER_BLOCK_SIZE	4
>  
> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
> index edbb4fc..2d4e9ef 100644
> --- a/include/linux/hdmi.h
> +++ b/include/linux/hdmi.h
> @@ -35,6 +35,7 @@ enum hdmi_infoframe_type {
>  };
>  
>  #define HDMI_IEEE_OUI 0x000c03
> +#define HDMI_IEEE_OUI_HFVSDB 0xC45DD8

Lower case, because HDMI_IEEE_OUI is also lower case.

>  #define HDMI_INFOFRAME_HEADER_SIZE  4
>  #define HDMI_AVI_INFOFRAME_SIZE    13
>  #define HDMI_SPD_INFOFRAME_SIZE    25

Best regards,
Jose Miguel Abreu
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm: Create new structure for HDMI info
  2016-12-20 13:47 [PATCH v2 1/2] drm: Create new structure for HDMI info Shashank Sharma
  2016-12-20 13:47 ` [PATCH v2 2/2] drm: parse hf-vsdb Shashank Sharma
  2016-12-20 14:19 ` [PATCH v2 1/2] drm: Create new structure for HDMI info Jose Abreu
@ 2016-12-20 14:45 ` Patchwork
  2016-12-20 23:31 ` [Intel-gfx] [PATCH v2 1/2] " kbuild test robot
  2016-12-20 23:34 ` kbuild test robot
  4 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2016-12-20 14:45 UTC (permalink / raw)
  To: Shashank Sharma; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/2] drm: Create new structure for HDMI info
URL   : https://patchwork.freedesktop.org/series/17059/
State : success

== Summary ==

Series 17059v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/17059/revisions/1/mbox/

Test gem_sync:
        Subgroup basic-store-all:
                fail       -> PASS       (fi-ivb-3520m)

fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:247  pass:225  dwarn:1   dfail:0   fail:0   skip:21 
fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52 
fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:247  pass:227  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20 
fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32 

b8e68c1d31266b62356d578435246516c39de36b drm-tip: 2016y-12m-20d-12h-47m-27s UTC integration manifest
ba07cb6 drm: parse hf-vsdb
a545ffa drm: Create new structure for HDMI info

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3341/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Intel-gfx] [PATCH v2 1/2] drm: Create new structure for HDMI info
  2016-12-20 13:47 [PATCH v2 1/2] drm: Create new structure for HDMI info Shashank Sharma
                   ` (2 preceding siblings ...)
  2016-12-20 14:45 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/2] " Patchwork
@ 2016-12-20 23:31 ` kbuild test robot
  2016-12-20 23:34 ` kbuild test robot
  4 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2016-12-20 23:31 UTC (permalink / raw)
  To: Shashank Sharma
  Cc: intel-gfx, dri-devel, Jose Abreu, kbuild-all, Daniel Vetter,
	Thierry Reding

[-- Attachment #1: Type: text/plain, Size: 19511 bytes --]

Hi Shashank,

[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.9 next-20161220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Shashank-Sharma/drm-Create-new-structure-for-HDMI-info/20161221-065128
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: x86_64-randconfig-i0-201651 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/list.h:4,
                    from include/linux/agp_backend.h:33,
                    from include/drm/drmP.h:35,
                    from drivers/gpu/drm/radeon/radeon_connectors.c:26:
   drivers/gpu/drm/radeon/radeon_connectors.c: In function 'radeon_get_monitor_bpc':
>> drivers/gpu/drm/radeon/radeon_connectors.c:213:33: error: 'struct drm_display_info' has no member named 'edid_hdmi_dc_modes'
        if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
                                    ^
   include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
   drivers/gpu/drm/radeon/radeon_connectors.c:213:5: note: in expansion of macro 'if'
        if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
        ^
>> drivers/gpu/drm/radeon/radeon_connectors.c:213:33: error: 'struct drm_display_info' has no member named 'edid_hdmi_dc_modes'
        if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
                                    ^
   include/linux/compiler.h:149:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^
   drivers/gpu/drm/radeon/radeon_connectors.c:213:5: note: in expansion of macro 'if'
        if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
        ^
>> drivers/gpu/drm/radeon/radeon_connectors.c:213:33: error: 'struct drm_display_info' has no member named 'edid_hdmi_dc_modes'
        if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
                                    ^
   include/linux/compiler.h:160:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
   drivers/gpu/drm/radeon/radeon_connectors.c:213:5: note: in expansion of macro 'if'
        if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
        ^

vim +213 drivers/gpu/drm/radeon/radeon_connectors.c

771fe6b9 Jerome Glisse         2009-06-05   20   * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
771fe6b9 Jerome Glisse         2009-06-05   21   * OTHER DEALINGS IN THE SOFTWARE.
771fe6b9 Jerome Glisse         2009-06-05   22   *
771fe6b9 Jerome Glisse         2009-06-05   23   * Authors: Dave Airlie
771fe6b9 Jerome Glisse         2009-06-05   24   *          Alex Deucher
771fe6b9 Jerome Glisse         2009-06-05   25   */
760285e7 David Howells         2012-10-02  @26  #include <drm/drmP.h>
760285e7 David Howells         2012-10-02   27  #include <drm/drm_edid.h>
760285e7 David Howells         2012-10-02   28  #include <drm/drm_crtc_helper.h>
760285e7 David Howells         2012-10-02   29  #include <drm/drm_fb_helper.h>
9843ead0 Dave Airlie           2015-02-24   30  #include <drm/drm_dp_mst_helper.h>
760285e7 David Howells         2012-10-02   31  #include <drm/radeon_drm.h>
771fe6b9 Jerome Glisse         2009-06-05   32  #include "radeon.h"
1a626b68 Slava Grigorev        2014-12-01   33  #include "radeon_audio.h"
923f6848 Alex Deucher          2009-09-10   34  #include "atom.h"
771fe6b9 Jerome Glisse         2009-06-05   35  
10ebc0bc Dave Airlie           2012-09-17   36  #include <linux/pm_runtime.h>
47eb8f73 Lukas Wunner          2016-01-11   37  #include <linux/vga_switcheroo.h>
10ebc0bc Dave Airlie           2012-09-17   38  
9843ead0 Dave Airlie           2015-02-24   39  static int radeon_dp_handle_hpd(struct drm_connector *connector)
9843ead0 Dave Airlie           2015-02-24   40  {
9843ead0 Dave Airlie           2015-02-24   41  	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
9843ead0 Dave Airlie           2015-02-24   42  	int ret;
9843ead0 Dave Airlie           2015-02-24   43  
9843ead0 Dave Airlie           2015-02-24   44  	ret = radeon_dp_mst_check_status(radeon_connector);
9843ead0 Dave Airlie           2015-02-24   45  	if (ret == -EINVAL)
9843ead0 Dave Airlie           2015-02-24   46  		return 1;
9843ead0 Dave Airlie           2015-02-24   47  	return 0;
9843ead0 Dave Airlie           2015-02-24   48  }
d4877cf2 Alex Deucher          2009-12-04   49  void radeon_connector_hotplug(struct drm_connector *connector)
d4877cf2 Alex Deucher          2009-12-04   50  {
d4877cf2 Alex Deucher          2009-12-04   51  	struct drm_device *dev = connector->dev;
d4877cf2 Alex Deucher          2009-12-04   52  	struct radeon_device *rdev = dev->dev_private;
d4877cf2 Alex Deucher          2009-12-04   53  	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
d4877cf2 Alex Deucher          2009-12-04   54  
9843ead0 Dave Airlie           2015-02-24   55  	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
9843ead0 Dave Airlie           2015-02-24   56  		struct radeon_connector_atom_dig *dig_connector =
9843ead0 Dave Airlie           2015-02-24   57  			radeon_connector->con_priv;
9843ead0 Dave Airlie           2015-02-24   58  
9843ead0 Dave Airlie           2015-02-24   59  		if (radeon_connector->is_mst_connector)
9843ead0 Dave Airlie           2015-02-24   60  			return;
9843ead0 Dave Airlie           2015-02-24   61  		if (dig_connector->is_mst) {
9843ead0 Dave Airlie           2015-02-24   62  			radeon_dp_handle_hpd(connector);
9843ead0 Dave Airlie           2015-02-24   63  			return;
9843ead0 Dave Airlie           2015-02-24   64  		}
9843ead0 Dave Airlie           2015-02-24   65  	}
cbac9543 Alex Deucher          2011-07-11   66  	/* bail if the connector does not have hpd pin, e.g.,
cbac9543 Alex Deucher          2011-07-11   67  	 * VGA, TV, etc.
cbac9543 Alex Deucher          2011-07-11   68  	 */
cbac9543 Alex Deucher          2011-07-11   69  	if (radeon_connector->hpd.hpd == RADEON_HPD_NONE)
cbac9543 Alex Deucher          2011-07-11   70  		return;
cbac9543 Alex Deucher          2011-07-11   71  
d4877cf2 Alex Deucher          2009-12-04   72  	radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
d4877cf2 Alex Deucher          2009-12-04   73  
73104b5c Alex Deucher          2011-08-09   74  	/* if the connector is already off, don't turn it back on */
6e9f798d Daniel Vetter         2014-05-29   75  	/* FIXME: This access isn't protected by any locks. */
73104b5c Alex Deucher          2011-08-09   76  	if (connector->dpms != DRM_MODE_DPMS_ON)
73104b5c Alex Deucher          2011-08-09   77  		return;
73104b5c Alex Deucher          2011-08-09   78  
d5811e87 Alex Deucher          2011-08-13   79  	/* just deal with DP (not eDP) here. */
d5811e87 Alex Deucher          2011-08-13   80  	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
266dcba5 Jerome Glisse         2012-07-19   81  		struct radeon_connector_atom_dig *dig_connector =
266dcba5 Jerome Glisse         2012-07-19   82  			radeon_connector->con_priv;
266dcba5 Jerome Glisse         2012-07-19   83  
266dcba5 Jerome Glisse         2012-07-19   84  		/* if existing sink type was not DP no need to retrain */
266dcba5 Jerome Glisse         2012-07-19   85  		if (dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT)
266dcba5 Jerome Glisse         2012-07-19   86  			return;
7c3ed0fd Alex Deucher          2011-05-20   87  
266dcba5 Jerome Glisse         2012-07-19   88  		/* first get sink type as it may be reset after (un)plug */
266dcba5 Jerome Glisse         2012-07-19   89  		dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector);
266dcba5 Jerome Glisse         2012-07-19   90  		/* don't do anything if sink is not display port, i.e.,
266dcba5 Jerome Glisse         2012-07-19   91  		 * passive dp->(dvi|hdmi) adaptor
266dcba5 Jerome Glisse         2012-07-19   92  		 */
266dcba5 Jerome Glisse         2012-07-19   93  		if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
266dcba5 Jerome Glisse         2012-07-19   94  			int saved_dpms = connector->dpms;
266dcba5 Jerome Glisse         2012-07-19   95  			/* Only turn off the display if it's physically disconnected */
ca2ccde5 Jerome Glisse         2012-07-19   96  			if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
1e85e1d0 Alex Deucher          2011-05-20   97  				drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
ca2ccde5 Jerome Glisse         2012-07-19   98  			} else if (radeon_dp_needs_link_train(radeon_connector)) {
924f92bf Stephen Chandler Paul 2015-08-21   99  				/* Don't try to start link training before we
924f92bf Stephen Chandler Paul 2015-08-21  100  				 * have the dpcd */
924f92bf Stephen Chandler Paul 2015-08-21  101  				if (!radeon_dp_getdpcd(radeon_connector))
924f92bf Stephen Chandler Paul 2015-08-21  102  					return;
924f92bf Stephen Chandler Paul 2015-08-21  103  
ca2ccde5 Jerome Glisse         2012-07-19  104  				/* set it to OFF so that drm_helper_connector_dpms()
ca2ccde5 Jerome Glisse         2012-07-19  105  				 * won't return immediately since the current state
ca2ccde5 Jerome Glisse         2012-07-19  106  				 * is ON at this point.
ca2ccde5 Jerome Glisse         2012-07-19  107  				 */
ca2ccde5 Jerome Glisse         2012-07-19  108  				connector->dpms = DRM_MODE_DPMS_OFF;
5ba7ddf8 Alex Deucher          2011-10-03  109  				drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
ca2ccde5 Jerome Glisse         2012-07-19  110  			}
d5811e87 Alex Deucher          2011-08-13  111  			connector->dpms = saved_dpms;
d4877cf2 Alex Deucher          2009-12-04  112  		}
d4877cf2 Alex Deucher          2009-12-04  113  	}
266dcba5 Jerome Glisse         2012-07-19  114  }
d4877cf2 Alex Deucher          2009-12-04  115  
445282db Dave Airlie           2009-09-09  116  static void radeon_property_change_mode(struct drm_encoder *encoder)
445282db Dave Airlie           2009-09-09  117  {
445282db Dave Airlie           2009-09-09  118  	struct drm_crtc *crtc = encoder->crtc;
445282db Dave Airlie           2009-09-09  119  
445282db Dave Airlie           2009-09-09  120  	if (crtc && crtc->enabled) {
445282db Dave Airlie           2009-09-09  121  		drm_crtc_helper_set_mode(crtc, &crtc->mode,
f4510a27 Matt Roper            2014-04-01  122  					 crtc->x, crtc->y, crtc->primary->fb);
445282db Dave Airlie           2009-09-09  123  	}
445282db Dave Airlie           2009-09-09  124  }
eccea792 Alex Deucher          2012-03-26  125  
eccea792 Alex Deucher          2012-03-26  126  int radeon_get_monitor_bpc(struct drm_connector *connector)
eccea792 Alex Deucher          2012-03-26  127  {
eccea792 Alex Deucher          2012-03-26  128  	struct drm_device *dev = connector->dev;
eccea792 Alex Deucher          2012-03-26  129  	struct radeon_device *rdev = dev->dev_private;
eccea792 Alex Deucher          2012-03-26  130  	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
eccea792 Alex Deucher          2012-03-26  131  	struct radeon_connector_atom_dig *dig_connector;
eccea792 Alex Deucher          2012-03-26  132  	int bpc = 8;
ea292861 Mario Kleiner         2014-06-05  133  	int mode_clock, max_tmds_clock;
eccea792 Alex Deucher          2012-03-26  134  
eccea792 Alex Deucher          2012-03-26  135  	switch (connector->connector_type) {
eccea792 Alex Deucher          2012-03-26  136  	case DRM_MODE_CONNECTOR_DVII:
eccea792 Alex Deucher          2012-03-26  137  	case DRM_MODE_CONNECTOR_HDMIB:
eccea792 Alex Deucher          2012-03-26  138  		if (radeon_connector->use_digital) {
377bd8a9 Alex Deucher          2014-07-15  139  			if (drm_detect_hdmi_monitor(radeon_connector_edid(connector))) {
eccea792 Alex Deucher          2012-03-26  140  				if (connector->display_info.bpc)
eccea792 Alex Deucher          2012-03-26  141  					bpc = connector->display_info.bpc;
eccea792 Alex Deucher          2012-03-26  142  			}
eccea792 Alex Deucher          2012-03-26  143  		}
eccea792 Alex Deucher          2012-03-26  144  		break;
eccea792 Alex Deucher          2012-03-26  145  	case DRM_MODE_CONNECTOR_DVID:
eccea792 Alex Deucher          2012-03-26  146  	case DRM_MODE_CONNECTOR_HDMIA:
377bd8a9 Alex Deucher          2014-07-15  147  		if (drm_detect_hdmi_monitor(radeon_connector_edid(connector))) {
eccea792 Alex Deucher          2012-03-26  148  			if (connector->display_info.bpc)
eccea792 Alex Deucher          2012-03-26  149  				bpc = connector->display_info.bpc;
eccea792 Alex Deucher          2012-03-26  150  		}
eccea792 Alex Deucher          2012-03-26  151  		break;
eccea792 Alex Deucher          2012-03-26  152  	case DRM_MODE_CONNECTOR_DisplayPort:
eccea792 Alex Deucher          2012-03-26  153  		dig_connector = radeon_connector->con_priv;
eccea792 Alex Deucher          2012-03-26  154  		if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
eccea792 Alex Deucher          2012-03-26  155  		    (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) ||
377bd8a9 Alex Deucher          2014-07-15  156  		    drm_detect_hdmi_monitor(radeon_connector_edid(connector))) {
eccea792 Alex Deucher          2012-03-26  157  			if (connector->display_info.bpc)
eccea792 Alex Deucher          2012-03-26  158  				bpc = connector->display_info.bpc;
eccea792 Alex Deucher          2012-03-26  159  		}
eccea792 Alex Deucher          2012-03-26  160  		break;
eccea792 Alex Deucher          2012-03-26  161  	case DRM_MODE_CONNECTOR_eDP:
eccea792 Alex Deucher          2012-03-26  162  	case DRM_MODE_CONNECTOR_LVDS:
eccea792 Alex Deucher          2012-03-26  163  		if (connector->display_info.bpc)
eccea792 Alex Deucher          2012-03-26  164  			bpc = connector->display_info.bpc;
eccea792 Alex Deucher          2012-03-26  165  		else if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
319d1e14 Jani Nikula           2015-03-11  166  			const struct drm_connector_helper_funcs *connector_funcs =
eccea792 Alex Deucher          2012-03-26  167  				connector->helper_private;
eccea792 Alex Deucher          2012-03-26  168  			struct drm_encoder *encoder = connector_funcs->best_encoder(connector);
eccea792 Alex Deucher          2012-03-26  169  			struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
eccea792 Alex Deucher          2012-03-26  170  			struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
eccea792 Alex Deucher          2012-03-26  171  
eccea792 Alex Deucher          2012-03-26  172  			if (dig->lcd_misc & ATOM_PANEL_MISC_V13_6BIT_PER_COLOR)
eccea792 Alex Deucher          2012-03-26  173  				bpc = 6;
eccea792 Alex Deucher          2012-03-26  174  			else if (dig->lcd_misc & ATOM_PANEL_MISC_V13_8BIT_PER_COLOR)
eccea792 Alex Deucher          2012-03-26  175  				bpc = 8;
eccea792 Alex Deucher          2012-03-26  176  		}
eccea792 Alex Deucher          2012-03-26  177  		break;
eccea792 Alex Deucher          2012-03-26  178  	}
89b92339 Mario Kleiner         2014-05-05  179  
377bd8a9 Alex Deucher          2014-07-15  180  	if (drm_detect_hdmi_monitor(radeon_connector_edid(connector))) {
89b92339 Mario Kleiner         2014-05-05  181  		/* hdmi deep color only implemented on DCE4+ */
89b92339 Mario Kleiner         2014-05-05  182  		if ((bpc > 8) && !ASIC_IS_DCE4(rdev)) {
89b92339 Mario Kleiner         2014-05-05  183  			DRM_DEBUG("%s: HDMI deep color %d bpc unsupported. Using 8 bpc.\n",
72082093 Jani Nikula           2014-06-03  184  					  connector->name, bpc);
89b92339 Mario Kleiner         2014-05-05  185  			bpc = 8;
89b92339 Mario Kleiner         2014-05-05  186  		}
89b92339 Mario Kleiner         2014-05-05  187  
89b92339 Mario Kleiner         2014-05-05  188  		/*
89b92339 Mario Kleiner         2014-05-05  189  		 * Pre DCE-8 hw can't handle > 12 bpc, and more than 12 bpc doesn't make
89b92339 Mario Kleiner         2014-05-05  190  		 * much sense without support for > 12 bpc framebuffers. RGB 4:4:4 at
89b92339 Mario Kleiner         2014-05-05  191  		 * 12 bpc is always supported on hdmi deep color sinks, as this is
89b92339 Mario Kleiner         2014-05-05  192  		 * required by the HDMI-1.3 spec. Clamp to a safe 12 bpc maximum.
89b92339 Mario Kleiner         2014-05-05  193  		 */
89b92339 Mario Kleiner         2014-05-05  194  		if (bpc > 12) {
89b92339 Mario Kleiner         2014-05-05  195  			DRM_DEBUG("%s: HDMI deep color %d bpc unsupported. Using 12 bpc.\n",
72082093 Jani Nikula           2014-06-03  196  					  connector->name, bpc);
89b92339 Mario Kleiner         2014-05-05  197  			bpc = 12;
89b92339 Mario Kleiner         2014-05-05  198  		}
ea292861 Mario Kleiner         2014-06-05  199  
ea292861 Mario Kleiner         2014-06-05  200  		/* Any defined maximum tmds clock limit we must not exceed? */
2a272ca9 Ville Syrjälä         2016-09-28  201  		if (connector->display_info.max_tmds_clock > 0) {
ea292861 Mario Kleiner         2014-06-05  202  			/* mode_clock is clock in kHz for mode to be modeset on this connector */
ea292861 Mario Kleiner         2014-06-05  203  			mode_clock = radeon_connector->pixelclock_for_modeset;
ea292861 Mario Kleiner         2014-06-05  204  
ea292861 Mario Kleiner         2014-06-05  205  			/* Maximum allowable input clock in kHz */
2a272ca9 Ville Syrjälä         2016-09-28  206  			max_tmds_clock = connector->display_info.max_tmds_clock;
ea292861 Mario Kleiner         2014-06-05  207  
ea292861 Mario Kleiner         2014-06-05  208  			DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
ea292861 Mario Kleiner         2014-06-05  209  					  connector->name, mode_clock, max_tmds_clock);
ea292861 Mario Kleiner         2014-06-05  210  
ea292861 Mario Kleiner         2014-06-05  211  			/* Check if bpc is within clock limit. Try to degrade gracefully otherwise */
ea292861 Mario Kleiner         2014-06-05  212  			if ((bpc == 12) && (mode_clock * 3/2 > max_tmds_clock)) {
ea292861 Mario Kleiner         2014-06-05 @213  				if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
ea292861 Mario Kleiner         2014-06-05  214  					(mode_clock * 5/4 <= max_tmds_clock))
ea292861 Mario Kleiner         2014-06-05  215  					bpc = 10;
ea292861 Mario Kleiner         2014-06-05  216  				else

:::::: The code at line 213 was first introduced by commit
:::::: ea29286146db6c72683af76bc8297cebeeec6d13 drm/radeon: hdmi deep color modes must obey clock limit of sink.

:::::: TO: Mario Kleiner <mario.kleiner.de@gmail.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 20651 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/2] drm: Create new structure for HDMI info
  2016-12-20 13:47 [PATCH v2 1/2] drm: Create new structure for HDMI info Shashank Sharma
                   ` (3 preceding siblings ...)
  2016-12-20 23:31 ` [Intel-gfx] [PATCH v2 1/2] " kbuild test robot
@ 2016-12-20 23:34 ` kbuild test robot
  4 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2016-12-20 23:34 UTC (permalink / raw)
  To: Shashank Sharma
  Cc: intel-gfx, dri-devel, Jose Abreu, kbuild-all, Daniel Vetter,
	Thierry Reding

[-- Attachment #1: Type: text/plain, Size: 2248 bytes --]

Hi Shashank,

[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.9 next-20161220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Shashank-Sharma/drm-Create-new-structure-for-HDMI-info/20161221-065128
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: i386-randconfig-s1-201651 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c: In function 'amdgpu_connector_get_monitor_bpc':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:183:33: error: 'struct drm_display_info' has no member named 'edid_hdmi_dc_modes'
        if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
                                    ^

vim +183 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c

d38ceaf9 Alex Deucher 2015-04-20  177  
d38ceaf9 Alex Deucher 2015-04-20  178  			DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
d38ceaf9 Alex Deucher 2015-04-20  179  				  connector->name, mode_clock, max_tmds_clock);
d38ceaf9 Alex Deucher 2015-04-20  180  
d38ceaf9 Alex Deucher 2015-04-20  181  			/* Check if bpc is within clock limit. Try to degrade gracefully otherwise */
d38ceaf9 Alex Deucher 2015-04-20  182  			if ((bpc == 12) && (mode_clock * 3/2 > max_tmds_clock)) {
d38ceaf9 Alex Deucher 2015-04-20 @183  				if ((connector->display_info.edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_30) &&
d38ceaf9 Alex Deucher 2015-04-20  184  				    (mode_clock * 5/4 <= max_tmds_clock))
d38ceaf9 Alex Deucher 2015-04-20  185  					bpc = 10;
d38ceaf9 Alex Deucher 2015-04-20  186  				else

:::::: The code at line 183 was first introduced by commit
:::::: d38ceaf99ed015f2a0b9af3499791bd3a3daae21 drm/amdgpu: add core driver (v4)

:::::: TO: Alex Deucher <alexander.deucher@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33192 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/2] drm: Create new structure for HDMI info
  2016-12-20 14:19 ` [PATCH v2 1/2] drm: Create new structure for HDMI info Jose Abreu
@ 2016-12-21  3:49   ` Sharma, Shashank
  2016-12-21  9:32     ` Jose Abreu
  0 siblings, 1 reply; 11+ messages in thread
From: Sharma, Shashank @ 2016-12-21  3:49 UTC (permalink / raw)
  To: Jose Abreu, dri-devel, intel-gfx; +Cc: Daniel Vetter, Thierry Reding

Thanks for the review Jose.

My comments, inline.

Regards
Shashank
On 12/20/2016 7:49 PM, Jose Abreu wrote:
> Hi Shashank,
>
>
> On 20-12-2016 13:47, Shashank Sharma wrote:
>> This patch creates a new structure drm_hdmi_info (inspired from
>> drm_display_info). Driver will parse HDMI sink's advance capabilities
>> from HF-VSDB and populate this structure. This structure will be kept
>> and used as a sub-class within drm_display_info.
> You populate the structure but I think you should add a helper to
> reset it when there is a new EDID or when the previous EDID is no
> longer valid. The same applies to other fields in
> drm_display_info structure. I've had problems before because of
> incorrect values in this structure.
I agree, will add a clean-up function too, and will attach it with 
hot-unplug.
>> We are adding parsing of HF-VSDB In the next patch.
>>
>> Cc: Thierry Reding <treding@nvidia.com>
>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>> Cc: Jose Abreu <joabreu@synopsys.com>
>> Suggested-by: Thierry Reding <thierry.reding@gmail.com>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> ---
>>   drivers/gpu/drm/drm_edid.c  |  6 ++--
>>   include/drm/drm_connector.h | 79 ++++++++++++++++++++++++++++++++++++++++++---
>>   2 files changed, 77 insertions(+), 8 deletions(-)
>>
> [snip]
>
>>   
>>   /**
>> + * struct drm_hdmi_info - runtime data specific to a connected hdmi sink
>> + *
>> + * Describes a given hdmi display (e.g. CRT or flat panel) and its capabilities.
>> + * Mostly refects the advanced features added in HDMI 2.0 specs and the deep
>> + * color support. This is a sub-segment of struct drm_display_info and should be
>> + * used within.
>> + *
>> + * For sinks which provide an EDID this can be filled out by calling
>> + * drm_add_edid_modes().
>> + */
>> +
>> +struct drm_hdmi_info {
> [snip]
>
>> +
>> +	/**
>> +	 * @edid_yuv420_dc_modes: bpc for deep color yuv420 encoding.
>> +	 * various sinks can support 10/12/16 bit per channel deep
>> +	 * color encoding. edid_yuv420_dc_modes = 0 means sink doesn't
>> +	 * support deep color yuv420 encoding.
>> +	 */
>> +	u8 edid_yuv420_dc_modes;
>> +
>> +
>> +#define DRM_HFVSDB_SCDC_SUPPORT	(1<<7)
>> +#define DRM_HFVSDB_SCDC_RR_CAP		(1<<6)
>> +#define DRM_HFVSDB_SCRAMBLING		(1<<3)
>> +#define DRM_HFVSDB_INDEPENDENT_VIEW	(1<<2)
>> +#define DRM_HFVSDB_DUAL_VIEW		(1<<1)
>> +#define DRM_HFVSDB_3D_OSD		(1<<0)
>> +
>> +	/**
>> +	 * @scdc_supported: Sink supports SCDC functionality.
>> +	 */
>> +	bool scdc_supported;
>> +
>> +	/**
>> +	 * @scdc_rr_cap: Sink has SCDC read request capability.
>> +	 */
>> +	bool scdc_rr_cap;
>> +
>> +	/**
>> +	 * @scrambling: Sync supports scrambling for <=340 Mcsc TMDS
>> +	 * char rates. Above 340 Mcsc rates, scrambling is always reqd.
>> +	 */
>> +	bool scrambling;
>> +
>> +	/**
>> +	 * @independent_view_3d: Sink supports 3d independent view signaling
>> +	 * in HF-VSIF.
>> +	 */
>> +	bool independent_view_3d;
>> +
>> +	/**
>> +	 * @dual_view_3d: Sink supports 3d dual view signaling in HF-VSIF.
>> +	 */
>> +	bool dual_view_3d;
>> +
>> +	/**
>> +	 * @osd_disparity_3d: Sink supports 3d osd disparity indication
>> +	 * in HF-VSIF.
>> +	 */
>> +	bool osd_disparity_3d;
> Maybe you should only add these fields in the second patch.
I thought it was a good idea to introduce the new fields for which we 
are adding this new structure all together. Else this patch would just 
contain movement of few parameters from main structure to new one, and 
would look unnecessary.  Do you think so ?
>
> Best regards,
> Jose Miguel Abreu

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/2] drm: parse hf-vsdb
  2016-12-20 14:35   ` Jose Abreu
@ 2016-12-21  3:54     ` Sharma, Shashank
  0 siblings, 0 replies; 11+ messages in thread
From: Sharma, Shashank @ 2016-12-21  3:54 UTC (permalink / raw)
  To: Jose Abreu, dri-devel, intel-gfx; +Cc: Daniel Vetter, Thierry Reding

Regards

Shashank


On 12/20/2016 8:05 PM, Jose Abreu wrote:
> Hi Shashank,
>
>
> On 20-12-2016 13:47, Shashank Sharma wrote:
>> HDMI 2.0 / CEA-861-F specs define a new CEA extension data block,
>> called hdmi-forum vendor specific data block (HF-VSDB). This block
>> contains information about sink's support for HDMI 2.0 compliant
>> features. These features are:
>>      - Deep color YUV 420 support and BPC
>>      - 3D flags for
>>          - OSD Displarity
>>          - Dual view signaling
>>          - independent view signaling
>>      - SCDC support
>>      - Max TMDS char rate
>>      - Scrambling support
>>
>> This patch adds a parser function for this block, and add flags to
>> indicate support for new features, in drm_display_info structure
>>
>> V2:
>> - Addressed review comments from Thierry
>> 	- remove len > 31 check
>> 	- remove version check
>> 	- fix duplicate values for macros of 36 and 30-bit depths
>> - Added a sub-class for HDMI related information within drm_display_info
>>    (Thierry, Daniel) and populated it with HF-VSDB specific info.
>>
>> Cc: Thierry Reding <treding@nvidia.com>
>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>> Cc: Jose Abreu <joabreu@synopsys.com>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> ---
>>   drivers/gpu/drm/drm_edid.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++
>>   include/drm/drm_edid.h     |  5 ++++
>>   include/linux/hdmi.h       |  1 +
>>   3 files changed, 76 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index b552197..59e04fb 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3224,6 +3224,23 @@ static int add_3d_struct_modes(struct drm_connector *connector, u16 structure,
>>   	return 0;
>>   }
>>   
>> +static bool cea_db_is_hf_vsdb(const u8 *db)
>> +{
>> +	u8 len;
>> +	int hfvsdb_id;
>> +
>> +	if (cea_db_tag(db) != VENDOR_BLOCK)
>> +		return false;
>> +
>> +	len = cea_db_payload_len(db);
>> +	if (len < 7)
>> +		return false;
>> +
>> +	hfvsdb_id = db[1] | (db[2] << 8) | (db[3] << 16);
>> +
>> +	return hfvsdb_id == HDMI_IEEE_OUI_HFVSDB;
>> +}
>> +
>>   static bool cea_db_is_hdmi_vsdb(const u8 *db)
>>   {
>>   	int hdmi_id;
>> @@ -3768,6 +3785,57 @@ bool drm_rgb_quant_range_selectable(struct edid *edid)
>>   }
>>   EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
>>   
>> +static void drm_parse_yuv420_deep_color_info(struct drm_connector *connector,
>> +						const u8 *db)
>> +{
>> +	struct drm_hdmi_info *info = &connector->display_info.hdmi_info;
>> +
>> +	if (db[7] & DRM_EDID_YUV420_DC_48)
>> +		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_48;
>> +	if (db[7] & DRM_EDID_YUV420_DC_36)
>> +		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_36;
>> +	if (db[7] & DRM_EDID_YUV420_DC_30)
>> +		info->edid_yuv420_dc_modes |= DRM_EDID_YUV420_DC_30;
>> +
>> +	if (!info->edid_yuv420_dc_modes) {
>> +		DRM_DEBUG("%s: No YUV 420 deep color support in sink.\n",
>> +			  connector->name);
>> +		return;
>> +	}
>> +}
>> +
>> +static void
>> +drm_parse_hf_vsdb(struct drm_connector *connector, const u8 *db)
>> +{
>> +	struct drm_display_info *info = &connector->display_info;
>> +	struct drm_hdmi_info *hdmi_info = &info->hdmi_info;
>> +
>> +	if (db[5]) {
>> +		/*
>> +		 * If the sink supplies max tmds char rate in db,
>> +		 * the actual max tmds rate = db[5] * 5Mhz.
>> +		 */
>> +		info->max_tmds_clock = db[5] * 5000;
>> +		DRM_DEBUG_KMS("HF-VSDB: max TMDS clock %d kHz\n",
>> +		info->max_tmds_clock);
>> +	}
>> +
>> +	if (db[6] & DRM_HFVSDB_SCDC_SUPPORT)
>> +		hdmi_info->scdc_supported = true;
>> +	if (db[6] & DRM_HFVSDB_SCDC_RR_CAP)
>> +		hdmi_info->scdc_rr_cap = true;
>> +	if (db[6] & DRM_HFVSDB_SCRAMBLING)
>> +		hdmi_info->scrambling = true;
> According to spec you should also check if scdc is supported in
> order to support scrambling.
Agree, rare case but fairly possible.
>> +	if (db[6] & DRM_HFVSDB_INDEPENDENT_VIEW)
>> +		hdmi_info->independent_view_3d = true;
>> +	if (db[6] & DRM_HFVSDB_DUAL_VIEW)
>> +		hdmi_info->dual_view_3d = true;
>> +	if (db[6] & DRM_HFVSDB_3D_OSD)
>> +		hdmi_info->osd_disparity_3d = true;
>> +
>> +	drm_parse_yuv420_deep_color_info(connector, db);
>> +}
>> +
>>   static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
>>   					   const u8 *hdmi)
>>   {
>> @@ -3882,6 +3950,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>>   
>>   		if (cea_db_is_hdmi_vsdb(db))
>>   			drm_parse_hdmi_vsdb_video(connector, db);
>> +		if (cea_db_is_hf_vsdb(db))
>> +			drm_parse_hf_vsdb(connector, db);
>>   	}
>>   }
>>   
>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>> index 38eabf6..df606e3 100644
>> --- a/include/drm/drm_edid.h
>> +++ b/include/drm/drm_edid.h
>> @@ -212,6 +212,11 @@ struct detailed_timing {
>>   #define DRM_EDID_HDMI_DC_30               (1 << 4)
>>   #define DRM_EDID_HDMI_DC_Y444             (1 << 3)
>>   
>> +/* YUV 420 deep color modes */
>> +#define DRM_EDID_YUV420_DC_48		  (1 << 6)
>> +#define DRM_EDID_YUV420_DC_36		  (1 << 5)
>> +#define DRM_EDID_YUV420_DC_30		  (1 << 4)
> Hmm, I think this is wrong. According to spec DC 48 is at
> position 2, DC 36 at position 1 and DC 30 at position 0.
Oh, thanks for pointing this out, I dont know which version of spec did 
I refer to while I was writing the code (or may be It was too late in 
night :-))
>> +
>>   /* ELD Header Block */
>>   #define DRM_ELD_HEADER_BLOCK_SIZE	4
>>   
>> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
>> index edbb4fc..2d4e9ef 100644
>> --- a/include/linux/hdmi.h
>> +++ b/include/linux/hdmi.h
>> @@ -35,6 +35,7 @@ enum hdmi_infoframe_type {
>>   };
>>   
>>   #define HDMI_IEEE_OUI 0x000c03
>> +#define HDMI_IEEE_OUI_HFVSDB 0xC45DD8
> Lower case, because HDMI_IEEE_OUI is also lower case.
Sure.
>
>>   #define HDMI_INFOFRAME_HEADER_SIZE  4
>>   #define HDMI_AVI_INFOFRAME_SIZE    13
>>   #define HDMI_SPD_INFOFRAME_SIZE    25
> Best regards,
> Jose Miguel Abreu

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/2] drm: Create new structure for HDMI info
  2016-12-21  3:49   ` Sharma, Shashank
@ 2016-12-21  9:32     ` Jose Abreu
  2016-12-21 10:31       ` Sharma, Shashank
  0 siblings, 1 reply; 11+ messages in thread
From: Jose Abreu @ 2016-12-21  9:32 UTC (permalink / raw)
  To: Sharma, Shashank, Jose Abreu, dri-devel, intel-gfx
  Cc: Daniel Vetter, Thierry Reding

Hi Shashank,


On 21-12-2016 03:49, Sharma, Shashank wrote:
> Thanks for the review Jose.
>
> My comments, inline.
>
> Regards
> Shashank
> On 12/20/2016 7:49 PM, Jose Abreu wrote:
>> Hi Shashank,
>>
>>
>> On 20-12-2016 13:47, Shashank Sharma wrote:
>>> This patch creates a new structure drm_hdmi_info (inspired from
>>> drm_display_info). Driver will parse HDMI sink's advance
>>> capabilities
>>> from HF-VSDB and populate this structure. This structure will
>>> be kept
>>> and used as a sub-class within drm_display_info.
>> You populate the structure but I think you should add a helper to
>> reset it when there is a new EDID or when the previous EDID is no
>> longer valid. The same applies to other fields in
>> drm_display_info structure. I've had problems before because of
>> incorrect values in this structure.
> I agree, will add a clean-up function too, and will attach it
> with hot-unplug.
>>> We are adding parsing of HF-VSDB In the next patch.
>>>
>>> Cc: Thierry Reding <treding@nvidia.com>
>>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>>> Cc: Jose Abreu <joabreu@synopsys.com>
>>> Suggested-by: Thierry Reding <thierry.reding@gmail.com>
>>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>>> ---
>>>   drivers/gpu/drm/drm_edid.c  |  6 ++--
>>>   include/drm/drm_connector.h | 79
>>> ++++++++++++++++++++++++++++++++++++++++++---
>>>   2 files changed, 77 insertions(+), 8 deletions(-)
>>>
>> [snip]
>>
>>>     /**
>>> + * struct drm_hdmi_info - runtime data specific to a
>>> connected hdmi sink
>>> + *
>>> + * Describes a given hdmi display (e.g. CRT or flat panel)
>>> and its capabilities.
>>> + * Mostly refects the advanced features added in HDMI 2.0
>>> specs and the deep
>>> + * color support. This is a sub-segment of struct
>>> drm_display_info and should be
>>> + * used within.
>>> + *
>>> + * For sinks which provide an EDID this can be filled out by
>>> calling
>>> + * drm_add_edid_modes().
>>> + */
>>> +
>>> +struct drm_hdmi_info {
>> [snip]
>>
>>> +
>>> +    /**
>>> +     * @edid_yuv420_dc_modes: bpc for deep color yuv420
>>> encoding.
>>> +     * various sinks can support 10/12/16 bit per channel deep
>>> +     * color encoding. edid_yuv420_dc_modes = 0 means sink
>>> doesn't
>>> +     * support deep color yuv420 encoding.
>>> +     */
>>> +    u8 edid_yuv420_dc_modes;
>>> +
>>> +
>>> +#define DRM_HFVSDB_SCDC_SUPPORT    (1<<7)
>>> +#define DRM_HFVSDB_SCDC_RR_CAP        (1<<6)
>>> +#define DRM_HFVSDB_SCRAMBLING        (1<<3)
>>> +#define DRM_HFVSDB_INDEPENDENT_VIEW    (1<<2)
>>> +#define DRM_HFVSDB_DUAL_VIEW        (1<<1)
>>> +#define DRM_HFVSDB_3D_OSD        (1<<0)
>>> +
>>> +    /**
>>> +     * @scdc_supported: Sink supports SCDC functionality.
>>> +     */
>>> +    bool scdc_supported;
>>> +
>>> +    /**
>>> +     * @scdc_rr_cap: Sink has SCDC read request capability.
>>> +     */
>>> +    bool scdc_rr_cap;
>>> +
>>> +    /**
>>> +     * @scrambling: Sync supports scrambling for <=340 Mcsc
>>> TMDS
>>> +     * char rates. Above 340 Mcsc rates, scrambling is
>>> always reqd.
>>> +     */
>>> +    bool scrambling;
>>> +
>>> +    /**
>>> +     * @independent_view_3d: Sink supports 3d independent
>>> view signaling
>>> +     * in HF-VSIF.
>>> +     */
>>> +    bool independent_view_3d;
>>> +
>>> +    /**
>>> +     * @dual_view_3d: Sink supports 3d dual view signaling
>>> in HF-VSIF.
>>> +     */
>>> +    bool dual_view_3d;
>>> +
>>> +    /**
>>> +     * @osd_disparity_3d: Sink supports 3d osd disparity
>>> indication
>>> +     * in HF-VSIF.
>>> +     */
>>> +    bool osd_disparity_3d;
>> Maybe you should only add these fields in the second patch.
> I thought it was a good idea to introduce the new fields for
> which we are adding this new structure all together. Else this
> patch would just contain movement of few parameters from main
> structure to new one, and would look unnecessary.  Do you think
> so ?

Yes, I think it is better. And besides, in this patch you also
have to change the drivers that use drm_display_info structure to
use the newly created drm_hdmi_info instead so, the diff will be
bigger. If you don't do so we'll have build errors.

Best regards,
Jose Miguel Abreu

>>
>> Best regards,
>> Jose Miguel Abreu
>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/2] drm: Create new structure for HDMI info
  2016-12-21  9:32     ` Jose Abreu
@ 2016-12-21 10:31       ` Sharma, Shashank
  0 siblings, 0 replies; 11+ messages in thread
From: Sharma, Shashank @ 2016-12-21 10:31 UTC (permalink / raw)
  To: Jose Abreu, dri-devel, intel-gfx; +Cc: Daniel Vetter, Thierry Reding

Regards

Shashank


On 12/21/2016 3:02 PM, Jose Abreu wrote:
> Hi Shashank,
>
>
> On 21-12-2016 03:49, Sharma, Shashank wrote:
>> Thanks for the review Jose.
>>
>> My comments, inline.
>>
>> Regards
>> Shashank
>> On 12/20/2016 7:49 PM, Jose Abreu wrote:
>>> Hi Shashank,
>>>
>>>
>>> On 20-12-2016 13:47, Shashank Sharma wrote:
>>>> This patch creates a new structure drm_hdmi_info (inspired from
>>>> drm_display_info). Driver will parse HDMI sink's advance
>>>> capabilities
>>>> from HF-VSDB and populate this structure. This structure will
>>>> be kept
>>>> and used as a sub-class within drm_display_info.
>>> You populate the structure but I think you should add a helper to
>>> reset it when there is a new EDID or when the previous EDID is no
>>> longer valid. The same applies to other fields in
>>> drm_display_info structure. I've had problems before because of
>>> incorrect values in this structure.
>> I agree, will add a clean-up function too, and will attach it
>> with hot-unplug.
>>>> We are adding parsing of HF-VSDB In the next patch.
>>>>
>>>> Cc: Thierry Reding <treding@nvidia.com>
>>>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>>>> Cc: Jose Abreu <joabreu@synopsys.com>
>>>> Suggested-by: Thierry Reding <thierry.reding@gmail.com>
>>>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>>>> ---
>>>>    drivers/gpu/drm/drm_edid.c  |  6 ++--
>>>>    include/drm/drm_connector.h | 79
>>>> ++++++++++++++++++++++++++++++++++++++++++---
>>>>    2 files changed, 77 insertions(+), 8 deletions(-)
>>>>
>>> [snip]
>>>
>>>>      /**
>>>> + * struct drm_hdmi_info - runtime data specific to a
>>>> connected hdmi sink
>>>> + *
>>>> + * Describes a given hdmi display (e.g. CRT or flat panel)
>>>> and its capabilities.
>>>> + * Mostly refects the advanced features added in HDMI 2.0
>>>> specs and the deep
>>>> + * color support. This is a sub-segment of struct
>>>> drm_display_info and should be
>>>> + * used within.
>>>> + *
>>>> + * For sinks which provide an EDID this can be filled out by
>>>> calling
>>>> + * drm_add_edid_modes().
>>>> + */
>>>> +
>>>> +struct drm_hdmi_info {
>>> [snip]
>>>
>>>> +
>>>> +    /**
>>>> +     * @edid_yuv420_dc_modes: bpc for deep color yuv420
>>>> encoding.
>>>> +     * various sinks can support 10/12/16 bit per channel deep
>>>> +     * color encoding. edid_yuv420_dc_modes = 0 means sink
>>>> doesn't
>>>> +     * support deep color yuv420 encoding.
>>>> +     */
>>>> +    u8 edid_yuv420_dc_modes;
>>>> +
>>>> +
>>>> +#define DRM_HFVSDB_SCDC_SUPPORT    (1<<7)
>>>> +#define DRM_HFVSDB_SCDC_RR_CAP        (1<<6)
>>>> +#define DRM_HFVSDB_SCRAMBLING        (1<<3)
>>>> +#define DRM_HFVSDB_INDEPENDENT_VIEW    (1<<2)
>>>> +#define DRM_HFVSDB_DUAL_VIEW        (1<<1)
>>>> +#define DRM_HFVSDB_3D_OSD        (1<<0)
>>>> +
>>>> +    /**
>>>> +     * @scdc_supported: Sink supports SCDC functionality.
>>>> +     */
>>>> +    bool scdc_supported;
>>>> +
>>>> +    /**
>>>> +     * @scdc_rr_cap: Sink has SCDC read request capability.
>>>> +     */
>>>> +    bool scdc_rr_cap;
>>>> +
>>>> +    /**
>>>> +     * @scrambling: Sync supports scrambling for <=340 Mcsc
>>>> TMDS
>>>> +     * char rates. Above 340 Mcsc rates, scrambling is
>>>> always reqd.
>>>> +     */
>>>> +    bool scrambling;
>>>> +
>>>> +    /**
>>>> +     * @independent_view_3d: Sink supports 3d independent
>>>> view signaling
>>>> +     * in HF-VSIF.
>>>> +     */
>>>> +    bool independent_view_3d;
>>>> +
>>>> +    /**
>>>> +     * @dual_view_3d: Sink supports 3d dual view signaling
>>>> in HF-VSIF.
>>>> +     */
>>>> +    bool dual_view_3d;
>>>> +
>>>> +    /**
>>>> +     * @osd_disparity_3d: Sink supports 3d osd disparity
>>>> indication
>>>> +     * in HF-VSIF.
>>>> +     */
>>>> +    bool osd_disparity_3d;
>>> Maybe you should only add these fields in the second patch.
>> I thought it was a good idea to introduce the new fields for
>> which we are adding this new structure all together. Else this
>> patch would just contain movement of few parameters from main
>> structure to new one, and would look unnecessary.  Do you think
>> so ?
> Yes, I think it is better. And besides, in this patch you also
> have to change the drivers that use drm_display_info structure to
> use the newly created drm_hdmi_info instead so, the diff will be
> bigger. If you don't do so we'll have build errors.
>
> Best regards,
> Jose Miguel Abreu
Thanks, and yes, I will extend this patch to update other drivers using 
this structure.
Shashank
>>> Best regards,
>>> Jose Miguel Abreu

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-12-21 10:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-20 13:47 [PATCH v2 1/2] drm: Create new structure for HDMI info Shashank Sharma
2016-12-20 13:47 ` [PATCH v2 2/2] drm: parse hf-vsdb Shashank Sharma
2016-12-20 14:35   ` Jose Abreu
2016-12-21  3:54     ` Sharma, Shashank
2016-12-20 14:19 ` [PATCH v2 1/2] drm: Create new structure for HDMI info Jose Abreu
2016-12-21  3:49   ` Sharma, Shashank
2016-12-21  9:32     ` Jose Abreu
2016-12-21 10:31       ` Sharma, Shashank
2016-12-20 14:45 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/2] " Patchwork
2016-12-20 23:31 ` [Intel-gfx] [PATCH v2 1/2] " kbuild test robot
2016-12-20 23:34 ` kbuild test robot

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.