drm/i915: Enable scanline read for gen9 dsi
Subsystems (2)
PATCH 1/1 drm/i915: Enable scanline read for gen9 dsi
From: Uma Shankar <[email protected]>
For gen9 platforms, dsi timings are driven from port instead of pipe (unlike ddi). Thus, we can't rely on pipe registers to get the timing information. Even scanline register read will not be functional. This is causing vblank evasion logic to fail since it relies on scanline, causing atomic update failure warnings.
This patch uses pipe framestamp and current timestamp registers to calculate scanline. This is an indirect way to get the scanline. It helps resolve atomic update failure for gen9 dsi platforms.
v2: Addressed Ville and Daniel's review comments. Updated the register MACROs, handled race condition for register reads, extracted timings from the hwmode. Removed the dependency on crtc->config to get the encoder type.
v3: Made get scanline function generic
Credits-to: Ville Syrjälä <[email protected]>
--- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_irq.c | 7 +++++ drivers/gpu/drm/i915/i915_reg.h | 11 +++++++ drivers/gpu/drm/i915/intel_display.c | 60 ++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -4085,6 +4085,8 @@ void intel_sbi_write(struct drm_i915_private *dev_priv, u16 reg, u32 value,u32 vlv_flisdsi_read (struct drm_i915_private *dev_priv,u32 reg);void vlv_flisdsi_write (struct drm_i915_private *dev_priv,u32 reg,u32 val); +u32 gen9_get_scanline (struct intel_crtc *crtc); +/* intel_dpio_phy.c */ void bxt_port_to_phy_channel (struct drm_i915_private *dev_priv,enum port port,enum dpio_phy *phy,enum dpio_channel *ch);
drivers/gpu/drm/i915/i915_irq.c +7 -0
@@ -814,6 +814,7 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)struct drm_vblank_crtc *vblank;enum pipe pipe = crtc->pipe;int position, vtotal; +struct intel_encoder *encoder;if (!crtc->active)return -1 ;
@@ -825,6 +826,12 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)if (mode->flags &DRM_MODE_FLAG_INTERLACE ) vtotal /=2 ; +if (IS_BROXTON (dev_priv) ||IS_GEMINILAKE (dev_priv)) { +for_each_encoder_on_crtc (crtc->base.dev, &crtc->base, encoder) +if (encoder->type ==INTEL_OUTPUT_DSI ) +return gen9_get_scanline (crtc); + } +if (IS_GEN2 (dev_priv)) position =I915_READ_FW (PIPEDSL (pipe)) &DSL_LINEMASK_GEN2 ;else
drivers/gpu/drm/i915/i915_reg.h +11 -0
@@ -8806,6 +8806,17 @@ enum skl_power_gate {#define MIPIO_TXESC_CLK_DIV2 _MMIO(0x160008)#define GLK_TX_ESC_CLK_DIV2_MASK 0x3FF +/* Gen4+ Timestamp and Pipe Frame time stamp registers */ +#define GEN4_TIMESTAMP_CTR _MMIO(MCHBAR_MIRROR_BASE + 0x2358) +#define GEN7_TIMESTAMP_CTR _MMIO(0x44070) + +#define _PIPE_FRMTMSTMP_A 0x70048 +#define _PIPE_FRMTMSTMP_B 0x71048 +#define _IVB_PIPE_FRMTMSTMP_C 0x72048 +#define PIPE_FRMTMSTMP (pipe) \ + _MMIO_PIPE3((pipe), _PIPE_FRMTMSTMP_A, \ + _PIPE_FRMTMSTMP_B, _IVB_PIPE_FRMTMSTMP_C) +/* BXT MIPI clock controls */ #define BXT_MAX_VAR_OUTPUT_KHZ 39500
drivers/gpu/drm/i915/intel_display.c +60 -0
66 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Enable scanline read for gen9 dsi (rev5)
== Series Details ==
== Series Details ==
Series: drm/i915: Enable scanline read for gen9 dsi (rev5)
URL : https://patchwork.freedesktop.org/series/30032/
State : failure
== Summary ==
Series 30032v5 drm/i915: Enable scanline read for gen9 dsi
https://patchwork.freedesktop.org/api/1.0/series/30032/revisions/5/mbox/
Test chamelium:
Subgroup dp-crc-fast:
pass -> FAIL (fi-kbl-7500u) fdo#102514
Test gem_exec_reloc:
Subgroup basic-write-read:
pass -> DMESG-WARN (fi-kbl-7500u)
Subgroup basic-cpu-noreloc:
pass -> DMESG-WARN (fi-kbl-7500u)
Subgroup basic-gtt-cpu-noreloc:
pass -> DMESG-WARN (fi-kbl-7500u)
Test gem_exec_store:
Subgroup basic-all:
pass -> DMESG-WARN (fi-kbl-7500u)
Subgroup basic-blt:
pass -> DMESG-WARN (fi-kbl-7500u)
Test gem_exec_suspend:
Subgroup basic-s3:
pass -> INCOMPLETE (fi-kbl-7500u)
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
fail -> PASS (fi-snb-2600) fdo#100215fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:439s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:469s fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:418s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:520s fi-bwr-2160 total:289 pass:184 dwarn:0 dfail:0 fail:0 skip:105 time:277s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:506s fi-byt-j1900 total:289 pass:254 dwarn:1 dfail:0 fail:0 skip:34 time:494s fi-byt-n2820 total:289 pass:250 dwarn:1 dfail:0 fail:0 skip:38 time:493s fi-cfl-s total:289 pass:223 dwarn:34 dfail:0 fail:0 skip:32 time:541s fi-elk-e7500 total:289 pass:230 dwarn:0 dfail:0 fail:0 skip:59 time:423s fi-glk-2a total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:602s fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:430s fi-hsw-4770r total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:408s fi-ilk-650 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:431s fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:490s fi-ivb-3770 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:462s fi-kbl-7500u total:118 pass:94 dwarn:6 dfail:0 fail:1 skip:16 fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:580s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:594s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:456s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:754s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:493s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:473s fi-snb-2520m total:289 pass:251 dwarn:0 dfail:0 fail:0 skip:38 time:564s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:1 skip:39 time:417s
fi-pnv-d510 failed to connect after reboot
dee3ba3a8c8bc9b11aca9cddc4e47a17b15db7eb drm-tip: 2017y-09m-18d-15h-59m-43s UTC integration manifest 339491fd0466 drm/i915: Enable scanline read for gen9 dsi
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5734/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
kbuild test robot
build botreproduce:
Hi Uma,
[auto build test ERROR on drm-intel/for-linux-next]
[cannot apply to v4.14-rc1 next-20170918]
[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/Vidya-Srinivas/drm-i915-Enable-scanline-read-for-gen9-dsi/20170919-093116 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: i386-randconfig-i0-201738 (attached as .config) compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4 reproduce: # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/intel_display.o: In function `gen9_get_scanline':
>> intel_display.c:(.text+0x19130): undefined reference to `__umoddi3'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx