drm/i915: Use intel_plane_data_rate for min_cdclk calculation
Subsystems (3)
PATCH v4 1/1 drm/i915: Use intel_plane_data_rate for min_cdclk calculation
There seems to be a bit of confusing redundancy in a way, how plane data rate/min cdclk are calculated.
In fact both min cdclk, pixel rate and plane data rate are all part of the same formula as per BSpec.
However currently we have intel_plane_data_rate, which is used to calculate plane data rate and which is also used in bandwidth calculations. However for calculating min_cdclk we have another piece of code, doing almost same calculation, but a bit differently and in a different place. However as both are actually part of same formula, probably would be wise to use plane data rate calculations as a basis anyway, thus avoiding code duplication and possible bugs related to this.
Another thing is that I've noticed that during min_cdclk calculations we account for plane scaling, while for plane data rate, we don't. crtc->pixel_rate seems to account only for pipe ratio, however it is clearly stated in BSpec that plane data rate also need to account plane ratio as well.
So what this commit does is:
- Adds a plane ratio calculation to intel_plane_data_rate
- Removes redundant calculations from skl_plane_min_cdclk which is used for gen9+ and now uses intel_plane_data_rate as a basis from there as well.
v2: - Don't use 64 division if not needed(Ville Syrjälä)
- Now use intel_plane_pixel_rate as a basis for calculations both at intel_plane_data_rate and skl_plane_min_cdclk(Ville Syrjälä)
v3: - Again fix the division macro
- Fix plane_pixel_rate to pixel_rate at intel_plane_pixel_rate callsites
v4: - Renamed skl_plane_ratio function back(Ville Syrjälä)
--- .../gpu/drm/i915/display/intel_atomic_plane.c | 28 ++++++++++++++++++- .../gpu/drm/i915/display/intel_atomic_plane.h | 3 ++ drivers/gpu/drm/i915/display/intel_sprite.c | 15 ++-------- 3 files changed, 32 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/display/intel_atomic_plane.c +27 -1
@@ -133,11 +133,37 @@ intel_plane_destroy_state(struct drm_plane *plane,kfree (plane_state); } +unsigned int intel_plane_pixel_rate (const struct intel_crtc_state *crtc_state, +const struct intel_plane_state *plane_state) +{ +unsigned int src_w, src_h, dst_w, dst_h; +struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane); + +if (plane->id ==PLANE_CURSOR ) +return crtc_state->pixel_rate; + + src_w =drm_rect_width (&plane_state->uapi.src) >>16 ; + src_h =drm_rect_height (&plane_state->uapi.src) >>16 ; + dst_w =drm_rect_width (&plane_state->uapi.dst); + dst_h =drm_rect_height (&plane_state->uapi.dst); + +/* Downscaling limits the maximum pixel rate */ + dst_w =min (src_w, dst_w); + dst_h =min (src_h, dst_h); + +WARN_ON (!dst_w || !dst_h); + +return DIV_ROUND_UP_ULL (mul_u32_u32 (crtc_state->pixel_rate, + src_w * src_h), + dst_w * dst_h); +} +unsigned int intel_plane_data_rate (const struct intel_crtc_state *crtc_state,const struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->hw.fb;unsigned int cpp; +unsigned int pixel_rate =intel_plane_pixel_rate (crtc_state, plane_state);if (!plane_state->uapi.visible)return 0 ;
@@ -153,7 +179,7 @@ unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,if (fb->format->is_yuv && fb->format->num_planes >1 ) cpp *=4 ; -return cpp * crtc_state->pixel_rate; +return pixel_rate * cpp; } int intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
drivers/gpu/drm/i915/display/intel_atomic_plane.h +3 -0
@@ -18,6 +18,9 @@ struct intel_plane_state;extern const struct drm_plane_helper_funcs intel_plane_helper_funcs; +unsigned int intel_plane_pixel_rate (const struct intel_crtc_state *crtc_state, +const struct intel_plane_state *plane_state); +unsigned int intel_plane_data_rate (const struct intel_crtc_state *crtc_state,const struct intel_plane_state *plane_state); void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
drivers/gpu/drm/i915/display/intel_sprite.c +2 -13
@@ -355,9 +355,8 @@ static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state, const struct intel_plane_state *plane_state) {struct drm_i915_private *dev_priv =to_i915 (plane_state->uapi.plane->dev); -unsigned int pixel_rate = crtc_state->pixel_rate; -unsigned int src_w, src_h, dst_w, dst_h;unsigned int num, den; +int pixel_rate =intel_plane_pixel_rate (crtc_state, plane_state);skl_plane_ratio (crtc_state, plane_state, &num, &den);
@@ -365,17 +364,7 @@ static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) den *=2 ; - src_w =drm_rect_width (&plane_state->uapi.src) >>16 ; - src_h =drm_rect_height (&plane_state->uapi.src) >>16 ; - dst_w =drm_rect_width (&plane_state->uapi.dst); - dst_h =drm_rect_height (&plane_state->uapi.dst); - -/* Downscaling limits the maximum pixel rate */ - dst_w =min (src_w, dst_w); - dst_h =min (src_h, dst_h); - -return DIV64_U64_ROUND_UP (mul_u32_u32 (pixel_rate * num, src_w * src_h), -mul_u32_u32 (den, dst_w * dst_h)); +return DIV_ROUND_UP (pixel_rate * num, den); } static unsigned int
Signature · 6 lines
2.24.1.485.gad05a3d8e5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Use intel_plane_data_rate for min_cdclk calculation (rev4)
== Series Details ==
== Series Details ==
Series: drm/i915: Use intel_plane_data_rate for min_cdclk calculation (rev4)
URL : https://patchwork.freedesktop.org/series/73718/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8008 -> Patchwork_16716
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_16716 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_16716, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_16716:
### IGT changes ###
#### Possible regressions ####
* igt@kms_force_connector_basic@force-load-detect:
- fi-blb-e6850: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-blb-e6850/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-blb-e6850/igt@[email protected]
- fi-bwr-2160: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-bwr-2160/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-bwr-2160/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* {igt@kms_busy@basic@flip}:
- fi-icl-guc: [PASS][5] -> [INCOMPLETE][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-icl-guc/igt@kms_busy@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-icl-guc/igt@kms_busy@[email protected]
- fi-hsw-4770: [PASS][7] -> [INCOMPLETE][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-hsw-4770/igt@kms_busy@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-hsw-4770/igt@kms_busy@[email protected]
- {fi-tgl-u}: [PASS][9] -> [INCOMPLETE][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-tgl-u/igt@kms_busy@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-tgl-u/igt@kms_busy@[email protected]
- {fi-kbl-7560u}: NOTRUN -> [INCOMPLETE][11]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-kbl-7560u/igt@kms_busy@[email protected]
- fi-cfl-guc: [PASS][12] -> [INCOMPLETE][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-cfl-guc/igt@kms_busy@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-cfl-guc/igt@kms_busy@[email protected]
- fi-bsw-n3050: [PASS][14] -> [INCOMPLETE][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-bsw-n3050/igt@kms_busy@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-bsw-n3050/igt@kms_busy@[email protected]
- fi-skl-guc: [PASS][16] -> [INCOMPLETE][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-skl-guc/igt@kms_busy@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-skl-guc/igt@kms_busy@[email protected]
- fi-ilk-650: [PASS][18] -> [INCOMPLETE][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-ilk-650/igt@kms_busy@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-ilk-650/igt@kms_busy@[email protected]
- fi-ivb-3770: [PASS][20] -> [INCOMPLETE][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-ivb-3770/igt@kms_busy@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-ivb-3770/igt@kms_busy@[email protected]
- fi-icl-y: [PASS][22] -> [INCOMPLETE][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-icl-y/igt@kms_busy@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-icl-y/igt@kms_busy@[email protected]
- fi-hsw-4770r: [PASS][24] -> [INCOMPLETE][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-hsw-4770r/igt@kms_busy@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-hsw-4770r/igt@kms_busy@[email protected]
- fi-skl-6700k2: [PASS][26] -> [INCOMPLETE][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-skl-6700k2/igt@kms_busy@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-skl-6700k2/igt@kms_busy@[email protected]
- fi-icl-u2: [PASS][28] -> [INCOMPLETE][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-icl-u2/igt@kms_busy@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-icl-u2/igt@kms_busy@[email protected]
- fi-cfl-8700k: [PASS][30] -> [INCOMPLETE][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-cfl-8700k/igt@kms_busy@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-cfl-8700k/igt@kms_busy@[email protected]
- {fi-tgl-dsi}: [PASS][32] -> [INCOMPLETE][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-tgl-dsi/igt@kms_busy@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-tgl-dsi/igt@kms_busy@[email protected]
- fi-snb-2520m: [PASS][34] -> [INCOMPLETE][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-snb-2520m/igt@kms_busy@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-snb-2520m/igt@kms_busy@[email protected]
- fi-icl-dsi: [PASS][36] -> [INCOMPLETE][37]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-icl-dsi/igt@kms_busy@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-icl-dsi/igt@kms_busy@[email protected]
- fi-bdw-5557u: [PASS][38] -> [INCOMPLETE][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-bdw-5557u/igt@kms_busy@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-bdw-5557u/igt@kms_busy@[email protected]
- fi-kbl-x1275: [PASS][40] -> [INCOMPLETE][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-kbl-x1275/igt@kms_busy@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-kbl-x1275/igt@kms_busy@[email protected]
- fi-cfl-8109u: [PASS][42] -> [INCOMPLETE][43]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-cfl-8109u/igt@kms_busy@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-cfl-8109u/igt@kms_busy@[email protected]
- fi-kbl-7500u: [PASS][44] -> [INCOMPLETE][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-kbl-7500u/igt@kms_busy@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-kbl-7500u/igt@kms_busy@[email protected]
- {fi-ehl-1}: [PASS][46] -> [INCOMPLETE][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-ehl-1/igt@kms_busy@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-ehl-1/igt@kms_busy@[email protected]
- fi-skl-lmem: [PASS][48] -> [INCOMPLETE][49]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-skl-lmem/igt@kms_busy@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-skl-lmem/igt@kms_busy@[email protected]
- fi-kbl-r: [PASS][50] -> [INCOMPLETE][51]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-kbl-r/igt@kms_busy@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-kbl-r/igt@kms_busy@[email protected]
Known issues
------------
Here are the changes found in Patchwork_16716 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s4-devices:
- fi-tgl-y: [PASS][52] -> [FAIL][53] ([CI#94])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-tgl-y/igt@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-tgl-y/igt@[email protected]
* igt@gem_mmap@basic:
- fi-tgl-y: [PASS][54] -> [DMESG-WARN][55] ([CI#94] / [i915#402])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-tgl-y/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-tgl-y/igt@[email protected]
* igt@kms_force_connector_basic@force-load-detect:
- fi-pnv-d510: [PASS][56] -> [INCOMPLETE][57] ([i915#299])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-pnv-d510/igt@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-pnv-d510/igt@[email protected]
- fi-gdg-551: [PASS][58] -> [INCOMPLETE][59] ([i915#172])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-gdg-551/igt@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-gdg-551/igt@[email protected]
#### Possible fixes ####
* igt@kms_addfb_basic@bad-pitch-0:
- fi-tgl-y: [DMESG-WARN][60] ([CI#94] / [i915#402]) -> [PASS][61]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8008/fi-tgl-y/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/fi-tgl-y/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[i915#172]: https://gitlab.freedesktop.org/drm/intel/issues/172
[i915#283]: https://gitlab.freedesktop.org/drm/intel/issues/283
[i915#299]: https://gitlab.freedesktop.org/drm/intel/issues/299
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
Participating hosts (52 -> 41)
------------------------------
Additional (2): fi-kbl-7560u fi-byt-n2820
Missing (13): fi-cml-u2 fi-ilk-m540 fi-hsw-4200u fi-hsw-peppy fi-skl-6770hq fi-glk-dsi fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-bsw-kefka fi-bdw-samus fi-byt-clapper fi-skl-6600u
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8008 -> Patchwork_16716
CI-20190529: 20190529
CI_DRM_8008: 13b6e2575f2c05722679bc1c9d0b97c13bde49a1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5469: 4f875016eb1ebc211b8aadb280ae16c7e6cdc8ba @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_16716: 78225fed01ce2584d4def8da9a541c4d689c3378 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
78225fed01ce drm/i915: Use intel_plane_data_rate for min_cdclk calculation
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16716/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx