Message ID | 1482241650-14435-1-git-send-email-shashank.sharma@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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
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
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
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
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 >
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
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,
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(-)