Message ID | 1464685714-30507-1-git-send-email-ville.syrjala@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
I can confirm that this v2 patch, combined with the change to the xorg driver is enough for X to report the correct display dimensions for my Surface 3 device. Thank you, Stephen On Tue, May 31, 2016 at 3:08 AM, <ville.syrjala@linux.intel.com> wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > The VBT has these mysterious H/V image sizes as part of the display > timings. Looking at some dumps those appear to be the physical > dimensions in mm. Which makes sense since the timing descriptor matches > the format used by EDID detailed timing descriptor, which defines these > as "H/V Addressable Video Image Size in mm". > > So let's use that information from the panel fixed mode to get the > physical dimensions for LVDS/eDP/DSI displays. And with that we can > fill out the display_info so that userspace can get at it via > GetConnector. > > v2: Use (hi<<8)|lo instead of broken (hi<<4)+lo > Handle LVDS and eDP too > > Cc: Stephen Just <stephenjust@gmail.com> > Tested-by: Stephen Just <stephenjust@gmail.com> (v1) > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96255 > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> >
Reviewed-by: Mika Kahola <mika.kahola@intel.com> On Tue, 2016-05-31 at 12:08 +0300, ville.syrjala@linux.intel.com wrote: > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > The VBT has these mysterious H/V image sizes as part of the display > timings. Looking at some dumps those appear to be the physical > dimensions in mm. Which makes sense since the timing descriptor matches > the format used by EDID detailed timing descriptor, which defines these > as "H/V Addressable Video Image Size in mm". > > So let's use that information from the panel fixed mode to get the > physical dimensions for LVDS/eDP/DSI displays. And with that we can > fill out the display_info so that userspace can get at it via > GetConnector. > > v2: Use (hi<<8)|lo instead of broken (hi<<4)+lo > Handle LVDS and eDP too > > Cc: Stephen Just <stephenjust@gmail.com> > Tested-by: Stephen Just <stephenjust@gmail.com> (v1) > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96255 > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/i915/intel_bios.c | 5 +++++ > drivers/gpu/drm/i915/intel_dp.c | 5 ++++- > drivers/gpu/drm/i915/intel_dsi.c | 3 +++ > drivers/gpu/drm/i915/intel_lvds.c | 2 ++ > drivers/gpu/drm/i915/intel_vbt_defs.h | 7 ++++--- > 5 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c > index 624e755e451f..2ddc469170cd 100644 > --- a/drivers/gpu/drm/i915/intel_bios.c > +++ b/drivers/gpu/drm/i915/intel_bios.c > @@ -139,6 +139,11 @@ fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode, > else > panel_fixed_mode->flags |= DRM_MODE_FLAG_NVSYNC; > > + panel_fixed_mode->width_mm = (dvo_timing->himage_hi << 8) | > + dvo_timing->himage_lo; > + panel_fixed_mode->height_mm = (dvo_timing->vimage_hi << 8) | > + dvo_timing->vimage_lo; > + > /* Some VBTs have bogus h/vtotal values */ > if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal) > panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1; > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index 096acbf04003..46f62beaf4fb 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -5370,8 +5370,11 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, > if (!fixed_mode && dev_priv->vbt.lfp_lvds_vbt_mode) { > fixed_mode = drm_mode_duplicate(dev, > dev_priv->vbt.lfp_lvds_vbt_mode); > - if (fixed_mode) > + if (fixed_mode) { > fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; > + connector->display_info.width_mm = fixed_mode->width_mm; > + connector->display_info.height_mm = fixed_mode->height_mm; > + } > } > mutex_unlock(&dev->mode_config.mutex); > > diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c > index cbe2537f26f4..c70132aa91d5 100644 > --- a/drivers/gpu/drm/i915/intel_dsi.c > +++ b/drivers/gpu/drm/i915/intel_dsi.c > @@ -1578,6 +1578,9 @@ void intel_dsi_init(struct drm_device *dev) > goto err; > } > > + connector->display_info.width_mm = fixed_mode->width_mm; > + connector->display_info.height_mm = fixed_mode->height_mm; > + > intel_panel_init(&intel_connector->panel, fixed_mode, NULL); > > intel_dsi_add_properties(intel_connector); > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c > index 56eb3bdcdb5c..62eaa895fe5b 100644 > --- a/drivers/gpu/drm/i915/intel_lvds.c > +++ b/drivers/gpu/drm/i915/intel_lvds.c > @@ -1082,6 +1082,8 @@ void intel_lvds_init(struct drm_device *dev) > fixed_mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode); > if (fixed_mode) { > fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; > + connector->display_info.width_mm = fixed_mode->width_mm; > + connector->display_info.height_mm = fixed_mode->height_mm; > goto out; > } > } > diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h > index 4f9799f025a9..68db9621f1f0 100644 > --- a/drivers/gpu/drm/i915/intel_vbt_defs.h > +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h > @@ -403,9 +403,10 @@ struct lvds_dvo_timing { > u8 vsync_off:4; > u8 rsvd0:6; > u8 hsync_off_hi:2; > - u8 h_image; > - u8 v_image; > - u8 max_hv; > + u8 himage_lo; > + u8 vimage_lo; > + u8 vimage_hi:4; > + u8 himage_hi:4; > u8 h_border; > u8 v_border; > u8 rsvd1:3;
On Tue, May 31, 2016 at 12:07:16PM -0000, Patchwork wrote: > == Series Details == > > Series: drm/i915: Extract physical display dimensions from VBT > URL : https://patchwork.freedesktop.org/series/8020/ > State : warning > > == Summary == > > Series 8020v1 drm/i915: Extract physical display dimensions from VBT > http://patchwork.freedesktop.org/api/1.0/series/8020/revisions/1/mbox > > Test gem_busy: > Subgroup basic-bsd: > pass -> DMESG-WARN (ro-ivb2-i7-3770) > Subgroup basic-parallel-bsd: > pass -> DMESG-WARN (ro-ivb2-i7-3770) All ivb fails are: [ 165.431177] BUG: using smp_processor_id() in preemptible [00000000] code: usb-storage/218 [ 165.431266] caller is debug_smp_processor_id+0x17/0x20 https://bugs.freedesktop.org/show_bug.cgi?id=96293 > Test gem_close_race: > Subgroup basic-process: > dmesg-warn -> PASS (ro-skl-i7-6700hq) All skl fails are: [ 248.037763] [drm:intel_pipe_update_start [i915]] *ERROR* Potential atomic update failure on pipe A https://bugs.freedesktop.org/show_bug.cgi?id=95632 > Test gem_ctx_exec: > Subgroup basic: > pass -> DMESG-WARN (ro-ivb2-i7-3770) > Test gem_exec_basic: > Subgroup gtt-bsd: > pass -> DMESG-WARN (ro-ivb2-i7-3770) > Subgroup readonly-render: > dmesg-warn -> PASS (ro-ivb2-i7-3770) > Test gem_exec_flush: > Subgroup basic-uc-prw-default: > pass -> DMESG-WARN (ro-skl-i7-6700hq) > Subgroup basic-uc-rw-default: > pass -> DMESG-WARN (ro-skl-i7-6700hq) > Test gem_exec_parse: > Subgroup basic-allowed: > pass -> DMESG-WARN (ro-ivb2-i7-3770) > Test gem_exec_store: > Subgroup basic-blt: > dmesg-warn -> PASS (ro-ivb2-i7-3770) > Subgroup basic-default: > dmesg-warn -> PASS (ro-ivb2-i7-3770) > Test gem_mmap_gtt: > Subgroup basic-small-copy: > dmesg-warn -> PASS (ro-skl-i7-6700hq) > Test gem_render_linear_blits: > Subgroup basic: > pass -> DMESG-WARN (ro-ivb2-i7-3770) > Test gem_storedw_loop: > Subgroup basic-bsd: > dmesg-warn -> PASS (ro-skl-i7-6700hq) > Test kms_addfb_basic: > Subgroup addfb25-x-tiled: > dmesg-warn -> PASS (ro-skl-i7-6700hq) > Subgroup addfb25-y-tiled-small: > dmesg-warn -> PASS (ro-skl-i7-6700hq) > Subgroup bad-pitch-0: > pass -> DMESG-WARN (ro-skl-i7-6700hq) > Subgroup bad-pitch-1024: > dmesg-warn -> PASS (ro-skl-i7-6700hq) > Subgroup bad-pitch-999: > pass -> DMESG-WARN (ro-skl-i7-6700hq) > Subgroup basic: > pass -> DMESG-WARN (ro-skl-i7-6700hq) > Subgroup too-high: > dmesg-warn -> PASS (ro-skl-i7-6700hq) > Subgroup unused-modifier: > pass -> DMESG-WARN (ro-skl-i7-6700hq) > Test kms_force_connector_basic: > Subgroup force-connector-state: > pass -> DMESG-WARN (ro-ivb2-i7-3770) > Test kms_psr_sink_crc: > Subgroup psr_basic: > dmesg-warn -> PASS (ro-skl-i7-6700hq) > > fi-bdw-i7-5557u total:102 pass:93 dwarn:0 dfail:0 fail:0 skip:8 > fi-bsw-n3050 total:209 pass:167 dwarn:0 dfail:0 fail:2 skip:40 > fi-byt-n2820 total:209 pass:168 dwarn:0 dfail:0 fail:3 skip:38 > fi-hsw-i7-4770k total:209 pass:190 dwarn:0 dfail:0 fail:0 skip:19 > fi-hsw-i7-4770r total:209 pass:186 dwarn:0 dfail:0 fail:0 skip:23 > fi-skl-i7-6700k total:209 pass:184 dwarn:0 dfail:0 fail:0 skip:25 > fi-snb-i7-2600 total:209 pass:170 dwarn:0 dfail:0 fail:0 skip:39 > ro-bdw-i5-5250u total:102 pass:93 dwarn:0 dfail:0 fail:0 skip:8 > ro-bdw-i7-5600u total:102 pass:75 dwarn:0 dfail:0 fail:0 skip:26 > ro-bsw-n3050 total:209 pass:168 dwarn:0 dfail:0 fail:2 skip:39 > ro-byt-n2820 total:209 pass:169 dwarn:0 dfail:0 fail:3 skip:37 > ro-hsw-i3-4010u total:209 pass:186 dwarn:0 dfail:0 fail:0 skip:23 > ro-hsw-i7-4770r total:102 pass:82 dwarn:0 dfail:0 fail:0 skip:19 > ro-ilk-i7-620lm total:1 pass:0 dwarn:0 dfail:0 fail:0 skip:0 > ro-ilk1-i5-650 total:204 pass:146 dwarn:0 dfail:0 fail:1 skip:57 > ro-ivb-i7-3770 total:102 pass:75 dwarn:0 dfail:0 fail:0 skip:26 > ro-ivb2-i7-3770 total:102 pass:41 dwarn:38 dfail:0 fail:0 skip:22 > ro-skl-i7-6700hq total:204 pass:173 dwarn:10 dfail:0 fail:0 skip:21 > ro-snb-i7-2620M total:102 pass:72 dwarn:0 dfail:0 fail:0 skip:29 > ro-bdw-i7-5557U failed to connect after reboot > > Results at /archive/results/CI_IGT_test/RO_Patchwork_1058/ > > 031f2bb drm-intel-nightly: 2016y-05m-30d-17h-51m-33s UTC integration manifest > f39da2f drm/i915: Extract physical display dimensions from VBT
On Thu, Jun 02, 2016 at 12:54:31PM +0300, Mika Kahola wrote: > Reviewed-by: Mika Kahola <mika.kahola@intel.com> Patch pushed to dinq. Thanks for the review, fast testing, and for the very nice bug report. > > On Tue, 2016-05-31 at 12:08 +0300, ville.syrjala@linux.intel.com wrote: > > From: Ville Syrjälä <ville.syrjala@linux.intel.com> > > > > The VBT has these mysterious H/V image sizes as part of the display > > timings. Looking at some dumps those appear to be the physical > > dimensions in mm. Which makes sense since the timing descriptor matches > > the format used by EDID detailed timing descriptor, which defines these > > as "H/V Addressable Video Image Size in mm". > > > > So let's use that information from the panel fixed mode to get the > > physical dimensions for LVDS/eDP/DSI displays. And with that we can > > fill out the display_info so that userspace can get at it via > > GetConnector. > > > > v2: Use (hi<<8)|lo instead of broken (hi<<4)+lo > > Handle LVDS and eDP too > > > > Cc: Stephen Just <stephenjust@gmail.com> > > Tested-by: Stephen Just <stephenjust@gmail.com> (v1) > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96255 > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > > --- > > drivers/gpu/drm/i915/intel_bios.c | 5 +++++ > > drivers/gpu/drm/i915/intel_dp.c | 5 ++++- > > drivers/gpu/drm/i915/intel_dsi.c | 3 +++ > > drivers/gpu/drm/i915/intel_lvds.c | 2 ++ > > drivers/gpu/drm/i915/intel_vbt_defs.h | 7 ++++--- > > 5 files changed, 18 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c > > index 624e755e451f..2ddc469170cd 100644 > > --- a/drivers/gpu/drm/i915/intel_bios.c > > +++ b/drivers/gpu/drm/i915/intel_bios.c > > @@ -139,6 +139,11 @@ fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode, > > else > > panel_fixed_mode->flags |= DRM_MODE_FLAG_NVSYNC; > > > > + panel_fixed_mode->width_mm = (dvo_timing->himage_hi << 8) | > > + dvo_timing->himage_lo; > > + panel_fixed_mode->height_mm = (dvo_timing->vimage_hi << 8) | > > + dvo_timing->vimage_lo; > > + > > /* Some VBTs have bogus h/vtotal values */ > > if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal) > > panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1; > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > > index 096acbf04003..46f62beaf4fb 100644 > > --- a/drivers/gpu/drm/i915/intel_dp.c > > +++ b/drivers/gpu/drm/i915/intel_dp.c > > @@ -5370,8 +5370,11 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, > > if (!fixed_mode && dev_priv->vbt.lfp_lvds_vbt_mode) { > > fixed_mode = drm_mode_duplicate(dev, > > dev_priv->vbt.lfp_lvds_vbt_mode); > > - if (fixed_mode) > > + if (fixed_mode) { > > fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; > > + connector->display_info.width_mm = fixed_mode->width_mm; > > + connector->display_info.height_mm = fixed_mode->height_mm; > > + } > > } > > mutex_unlock(&dev->mode_config.mutex); > > > > diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c > > index cbe2537f26f4..c70132aa91d5 100644 > > --- a/drivers/gpu/drm/i915/intel_dsi.c > > +++ b/drivers/gpu/drm/i915/intel_dsi.c > > @@ -1578,6 +1578,9 @@ void intel_dsi_init(struct drm_device *dev) > > goto err; > > } > > > > + connector->display_info.width_mm = fixed_mode->width_mm; > > + connector->display_info.height_mm = fixed_mode->height_mm; > > + > > intel_panel_init(&intel_connector->panel, fixed_mode, NULL); > > > > intel_dsi_add_properties(intel_connector); > > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c > > index 56eb3bdcdb5c..62eaa895fe5b 100644 > > --- a/drivers/gpu/drm/i915/intel_lvds.c > > +++ b/drivers/gpu/drm/i915/intel_lvds.c > > @@ -1082,6 +1082,8 @@ void intel_lvds_init(struct drm_device *dev) > > fixed_mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode); > > if (fixed_mode) { > > fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; > > + connector->display_info.width_mm = fixed_mode->width_mm; > > + connector->display_info.height_mm = fixed_mode->height_mm; > > goto out; > > } > > } > > diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h > > index 4f9799f025a9..68db9621f1f0 100644 > > --- a/drivers/gpu/drm/i915/intel_vbt_defs.h > > +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h > > @@ -403,9 +403,10 @@ struct lvds_dvo_timing { > > u8 vsync_off:4; > > u8 rsvd0:6; > > u8 hsync_off_hi:2; > > - u8 h_image; > > - u8 v_image; > > - u8 max_hv; > > + u8 himage_lo; > > + u8 vimage_lo; > > + u8 vimage_hi:4; > > + u8 himage_hi:4; > > u8 h_border; > > u8 v_border; > > u8 rsvd1:3; > > -- > Mika Kahola - Intel OTC
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 624e755e451f..2ddc469170cd 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c @@ -139,6 +139,11 @@ fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode, else panel_fixed_mode->flags |= DRM_MODE_FLAG_NVSYNC; + panel_fixed_mode->width_mm = (dvo_timing->himage_hi << 8) | + dvo_timing->himage_lo; + panel_fixed_mode->height_mm = (dvo_timing->vimage_hi << 8) | + dvo_timing->vimage_lo; + /* Some VBTs have bogus h/vtotal values */ if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal) panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1; diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 096acbf04003..46f62beaf4fb 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -5370,8 +5370,11 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, if (!fixed_mode && dev_priv->vbt.lfp_lvds_vbt_mode) { fixed_mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode); - if (fixed_mode) + if (fixed_mode) { fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; + connector->display_info.width_mm = fixed_mode->width_mm; + connector->display_info.height_mm = fixed_mode->height_mm; + } } mutex_unlock(&dev->mode_config.mutex); diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index cbe2537f26f4..c70132aa91d5 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c @@ -1578,6 +1578,9 @@ void intel_dsi_init(struct drm_device *dev) goto err; } + connector->display_info.width_mm = fixed_mode->width_mm; + connector->display_info.height_mm = fixed_mode->height_mm; + intel_panel_init(&intel_connector->panel, fixed_mode, NULL); intel_dsi_add_properties(intel_connector); diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 56eb3bdcdb5c..62eaa895fe5b 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -1082,6 +1082,8 @@ void intel_lvds_init(struct drm_device *dev) fixed_mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode); if (fixed_mode) { fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; + connector->display_info.width_mm = fixed_mode->width_mm; + connector->display_info.height_mm = fixed_mode->height_mm; goto out; } } diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h index 4f9799f025a9..68db9621f1f0 100644 --- a/drivers/gpu/drm/i915/intel_vbt_defs.h +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h @@ -403,9 +403,10 @@ struct lvds_dvo_timing { u8 vsync_off:4; u8 rsvd0:6; u8 hsync_off_hi:2; - u8 h_image; - u8 v_image; - u8 max_hv; + u8 himage_lo; + u8 vimage_lo; + u8 vimage_hi:4; + u8 himage_hi:4; u8 h_border; u8 v_border; u8 rsvd1:3;