drm/i915/display/psr: Calculate selective fetch plane registers
Subsystems (3)
PATCH v3 1/4 drm/i915/display/psr: Calculate selective fetch plane registers
Add the calculations to set plane selective fetch registers depending in the value of the area damaged.
It is still using the whole plane area as damaged but that will change in next patches.
v2:
- fixed new_plane_state->uapi.dst.y2 typo in intel_psr2_sel_fetch_update()
- do not shifthing new_plane_state->uapi.dst only src is in 16.16 format
BSpec: 55229
--- .../drm/i915/display/intel_display_types.h | 2 ++ drivers/gpu/drm/i915/display/intel_psr.c | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/display/intel_display_types.h +2 -0
@@ -604,6 +604,8 @@ struct intel_plane_state {u32 planar_slave;struct drm_intel_sprite_colorkey ckey; + +struct drm_rect psr2_sel_fetch_area; };struct intel_initial_plane_config {
drivers/gpu/drm/i915/display/intel_psr.c +16 -6
@@ -1185,6 +1185,7 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane, {struct drm_i915_private *dev_priv =to_i915 (plane->base.dev);enum pipe pipe = plane->pipe; +const struct drm_rect *clip;u32 val;if (!crtc_state->enable_psr2_sel_fetch)
@@ -1196,16 +1197,20 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane,if (!val || plane->id ==PLANE_CURSOR )return ; - val = plane_state->uapi.dst.y1 <<16 | plane_state->uapi.dst.x1; + clip = &plane_state->psr2_sel_fetch_area; + + val = (clip->y1 + plane_state->uapi.dst.y1) <<16 ; + val |= plane_state->uapi.dst.x1;intel_de_write_fw (dev_priv,PLANE_SEL_FETCH_POS (pipe, plane->id), val); - val = plane_state->color_plane[color_plane].y <<16 ; +/* TODO: consider tiling and auxiliary surfaces */ + val = (clip->y1 + plane_state->color_plane[color_plane].y) <<16 ; val |= plane_state->color_plane[color_plane].x;intel_de_write_fw (dev_priv,PLANE_SEL_FETCH_OFFSET (pipe, plane->id), val);/* Sizes are 0 based */ - val = ((drm_rect_height (&plane_state->uapi.src) >>16 ) -1 ) <<16 ; + val = (drm_rect_height (clip) -1 ) <<16 ; val |= (drm_rect_width (&plane_state->uapi.src) >>16 ) -1 ;intel_de_write_fw (dev_priv,PLANE_SEL_FETCH_SIZE (pipe, plane->id), val); }
@@ -1279,7 +1284,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,for_each_oldnew_intel_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { -struct drm_rect temp; +struct drm_rect *sel_fetch_area, temp;if (new_plane_state->uapi.crtc != crtc_state->uapi.crtc)continue ;
@@ -1302,8 +1307,13 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,* For now doing a selective fetch in the whole plane area, * optimizations will come in the future. */ - temp.y1 = new_plane_state->uapi.dst.y1; - temp.y2 = new_plane_state->uapi.dst.y2; + sel_fetch_area = &new_plane_state->psr2_sel_fetch_area; + sel_fetch_area->y1 = new_plane_state->uapi.src.y1 >>16 ; + sel_fetch_area->y2 = new_plane_state->uapi.src.y2 >>16 ; + + temp = *sel_fetch_area; + temp.y1 += new_plane_state->uapi.dst.y1; + temp.y2 += new_plane_state->uapi.dst.y2;clip_area_update (&pipe_clip, &temp); }
Signature · 6 lines
2.29.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 2/4 drm/i915/display: Split and export main surface calculation from skl_check_main_surface()
The calculation the offsets of the main surface will be needed by PSR2 selective fetch code so here splitting and exporting it.
No functional changes were done here.
v3: Rebased
--- drivers/gpu/drm/i915/display/intel_display.c | 78 ++++++++++++-------- drivers/gpu/drm/i915/display/intel_display.h | 2 + 2 files changed, 51 insertions(+), 29 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +49 -29
@@ -3817,33 +3817,19 @@ static int intel_plane_max_height(struct intel_plane *plane,return INT_MAX ; } -static int skl_check_main_surface (struct intel_plane_state *plane_state) +int skl_calc_main_surface_offset (const struct intel_plane_state *plane_state, +int *x,int *y,u32 *offset) {struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane);struct drm_i915_private *dev_priv =to_i915 (plane->base.dev);const struct drm_framebuffer *fb = plane_state->hw.fb; -unsigned int rotation = plane_state->hw.rotation; -int x = plane_state->uapi.src.x1 >>16 ; -int y = plane_state->uapi.src.y1 >>16 ; -int w =drm_rect_width (&plane_state->uapi.src) >>16 ; -int h =drm_rect_height (&plane_state->uapi.src) >>16 ; -int min_width =intel_plane_min_width (plane, fb,0 , rotation); -int max_width =intel_plane_max_width (plane, fb,0 , rotation); -int max_height =intel_plane_max_height (plane, fb,0 , rotation); -int aux_plane =intel_main_to_aux_plane (fb,0 ); -u32 aux_offset = plane_state->color_plane[aux_plane].offset; -u32 alignment, offset; +const int aux_plane =intel_main_to_aux_plane (fb,0 ); +const u32 aux_offset = plane_state->color_plane[aux_plane].offset; +const u32 alignment =intel_surf_alignment (fb,0 ); +const int w =drm_rect_width (&plane_state->uapi.src) >>16 ; -if (w > max_width || w < min_width || h > max_height) { -drm_dbg_kms (&dev_priv->drm, -"requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n" , - w, h, min_width, max_width, max_height); -return -EINVAL ; - } - -intel_add_fb_offsets (&x, &y, plane_state,0 ); - offset =intel_plane_compute_aligned_offset (&x, &y, plane_state,0 ); - alignment =intel_surf_alignment (fb,0 ); +intel_add_fb_offsets (x, y, plane_state,0 ); + *offset =intel_plane_compute_aligned_offset (x, y, plane_state,0 );if (drm_WARN_ON (&dev_priv->drm, alignment && !is_power_of_2 (alignment)))return -EINVAL ;
@@ -3852,9 +3838,10 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)* main surface offset, and it must be non-negative. Make * sure that is what we will get. */ -if (aux_plane && offset > aux_offset) - offset =intel_plane_adjust_aligned_offset (&x, &y, plane_state,0 , - offset, aux_offset & ~(alignment -1 )); +if (aux_plane && *offset > aux_offset) + *offset =intel_plane_adjust_aligned_offset (x, y, plane_state,0 , + *offset, + aux_offset & ~(alignment -1 ));/* * When using an X-tiled surface, the plane blows up
@@ -3865,18 +3852,51 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)if (fb->modifier ==I915_FORMAT_MOD_X_TILED ) {int cpp = fb->format->cpp[0 ]; -while ((x + w) * cpp > plane_state->color_plane[0 ].stride) { -if (offset ==0 ) { +while ((*x + w) * cpp > plane_state->color_plane[0 ].stride) { +if (*offset ==0 ) {drm_dbg_kms (&dev_priv->drm,"Unable to find suitable display surface offset due to X-tiling\n" );return -EINVAL ; } - offset =intel_plane_adjust_aligned_offset (&x, &y, plane_state,0 , - offset, offset - alignment); + *offset =intel_plane_adjust_aligned_offset (x, y, plane_state,0 , + *offset, + *offset - alignment); } } +return 0 ; +} + +static int skl_check_main_surface (struct intel_plane_state *plane_state) +{ +struct intel_plane *plane =to_intel_plane (plane_state->uapi.plane); +struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); +const struct drm_framebuffer *fb = plane_state->hw.fb; +const unsigned int rotation = plane_state->hw.rotation; +int x = plane_state->uapi.src.x1 >>16 ; +int y = plane_state->uapi.src.y1 >>16 ; +const int w =drm_rect_width (&plane_state->uapi.src) >>16 ; +const int h =drm_rect_height (&plane_state->uapi.src) >>16 ; +const int min_width =intel_plane_min_width (plane, fb,0 , rotation); +const int max_width =intel_plane_max_width (plane, fb,0 , rotation); +const int max_height =intel_plane_max_height (plane, fb,0 , rotation); +const int aux_plane =intel_main_to_aux_plane (fb,0 ); +const u32 alignment =intel_surf_alignment (fb,0 ); +u32 offset; +int ret; + +if (w > max_width || w < min_width || h > max_height) { +drm_dbg_kms (&dev_priv->drm, +"requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n" , + w, h, min_width, max_width, max_height); +return -EINVAL ; + } + + ret =skl_calc_main_surface_offset (plane_state, &x, &y, &offset); +if (ret) +return ret; +/* * CCS AUX surface doesn't have its own x/y offsets, we must make sure * they match with the main surface x/y offsets.
drivers/gpu/drm/i915/display/intel_display.h +2 -0
@@ -628,6 +628,8 @@ u32 skl_plane_ctl_crtc(const struct intel_crtc_state *crtc_state);u32 skl_plane_stride (const struct intel_plane_state *plane_state,int plane);int skl_check_plane_surface (struct intel_plane_state *plane_state); +int skl_calc_main_surface_offset (const struct intel_plane_state *plane_state, +int *x,int *y,u32 *offset);int i9xx_check_plane_surface (struct intel_plane_state *plane_state);int skl_format_to_fourcc (int format,bool rgb_order,bool alpha); unsigned int i9xx_plane_max_stride(struct intel_plane *plane,
Signature · 6 lines
2.29.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 3/4 drm/i915/display/psr: Program plane's calculated offset to plane SF register
In reply to José Roberto de SouzaIt programs Plane's calculated x, y, offset to Plane SF register. It does the calculation of x and y offsets using skl_calc_main_surface_offset().
v3: Update commit message
--- drivers/gpu/drm/i915/display/intel_psr.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_psr.c +10 -4
@@ -1186,7 +1186,8 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane,struct drm_i915_private *dev_priv =to_i915 (plane->base.dev);enum pipe pipe = plane->pipe;const struct drm_rect *clip; -u32 val; +u32 val, offset; +int ret, x, y;if (!crtc_state->enable_psr2_sel_fetch)return ;
@@ -1203,9 +1204,14 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane, val |= plane_state->uapi.dst.x1;intel_de_write_fw (dev_priv,PLANE_SEL_FETCH_POS (pipe, plane->id), val); -/* TODO: consider tiling and auxiliary surfaces */ - val = (clip->y1 + plane_state->color_plane[color_plane].y) <<16 ; - val |= plane_state->color_plane[color_plane].x; +/* TODO: consider auxiliary surfaces */ + x = plane_state->uapi.src.x1 >>16 ; + y = (plane_state->uapi.src.y1 >>16 ) + clip->y1; + ret =skl_calc_main_surface_offset (plane_state, &x, &y, &offset); +if (ret) +drm_warn_once (&dev_priv->drm,"skl_calc_main_surface_offset() returned %i\n" , + ret); + val = y <<16 | x;intel_de_write_fw (dev_priv,PLANE_SEL_FETCH_OFFSET (pipe, plane->id), val);
Signature · 6 lines
2.29.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 4/4 HAX/DO_NOT_MERGE_IT: drm/i915/display: Enable PSR2 selective fetch for testing
In reply to José Roberto de SouzaEnabling it to check if it causes regressions in CI but the feature is still not ready to be enabled by default.
--- drivers/gpu/drm/i915/i915_params.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_params.h +1 -1
@@ -54,7 +54,7 @@ struct drm_printer; param(int, enable_fbc, -1, 0600) \ param(int, enable_psr, -1, 0600) \ param(bool, psr_safest_params, false, 0600) \ - param(bool, enable_psr2_sel_fetch, false, 0600) \ + param(bool, enable_psr2_sel_fetch, true, 0600) \ param(int, disable_power_well, -1, 0400) \ param(int, enable_ips, 1, 0600) \param (int, invert_brightness,0 ,0600 ) \
Signature · 6 lines
2.29.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v3,1/4] drm/i915/display/psr: Calculate selective fetch plane registers
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [v3,1/4] drm/i915/display/psr: Calculate selective fetch plane registers
URL : https://patchwork.freedesktop.org/series/84350/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. +drivers/gpu/drm/i915/intel_wakeref.c:137:19: warning: context imbalance in 'wakeref_auto_timeout' - unexpected unlock
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [v3,1/4] drm/i915/display/psr: Calculate selective fetch plane registers
In reply to José Roberto de Souza== Series Details ==
== Series Details ==
Series: series starting with [v3,1/4] drm/i915/display/psr: Calculate selective fetch plane registers
URL : https://patchwork.freedesktop.org/series/84350/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_9399 -> Patchwork_19002
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_19002 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_19002, 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_19002/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_19002:
### IGT changes ###
#### Possible regressions ####
* igt@gem_exec_parallel@engines@fds:
- fi-skl-guc: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-skl-guc/igt@gem_exec_parallel@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-skl-guc/igt@gem_exec_parallel@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-tgl-y: [PASS][3] -> [FAIL][4] +2 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-y/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-y/igt@[email protected]
* igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
- fi-tgl-u2: [PASS][5] -> [FAIL][6] +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-u2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-u2/igt@[email protected]
New tests
---------
New tests have been introduced between CI_DRM_9399 and Patchwork_19002:
### New CI tests (1) ###
* boot:
- Statuses : 40 pass(s)
- Exec time: [0.0] s
Known issues
------------
Here are the changes found in Patchwork_19002 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_module_load@reload:
- fi-tgl-u2: [PASS][7] -> [DMESG-WARN][8] ([i915#402] / [k.org#205379])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-u2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-u2/igt@[email protected]
* igt@kms_chamelium@dp-crc-fast:
- fi-cml-u2: [PASS][9] -> [DMESG-WARN][10] ([i915#1982])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-cml-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-cml-u2/igt@[email protected]
* igt@kms_flip@basic-flip-vs-wf_vblank@b-edp1:
- fi-tgl-u2: [PASS][11] -> [DMESG-WARN][12] ([i915#402]) +12 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-u2/igt@kms_flip@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-u2/igt@kms_flip@[email protected]
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-a:
- fi-tgl-y: [PASS][13] -> [DMESG-WARN][14] ([i915#402]) +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-y/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-y/igt@[email protected]
* igt@kms_psr@primary_page_flip:
- fi-tgl-u2: [PASS][15] -> [SKIP][16] ([i915#668]) +3 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-u2/igt@kms_psr@primary_page_flip.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-u2/igt@kms_psr@primary_page_flip.html
#### Possible fixes ####
* igt@debugfs_test@read_all_entries:
- fi-tgl-y: [DMESG-WARN][17] ([i915#402]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-y/igt@debugfs_test@read_all_entries.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-y/igt@debugfs_test@read_all_entries.html
* igt@i915_selftest@live@gt_heartbeat:
- fi-kbl-soraka: [DMESG-FAIL][19] ([i915#541]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
* igt@kms_busy@basic@flip:
- fi-kbl-soraka: [DMESG-WARN][21] ([i915#1982]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-kbl-soraka/igt@kms_busy@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-kbl-soraka/igt@kms_busy@[email protected]
#### Warnings ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-tgl-y: [DMESG-WARN][23] ([i915#1982]) -> [DMESG-FAIL][24] ([i915#1982])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9399/fi-tgl-y/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/fi-tgl-y/igt@[email protected]
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#541]: https://gitlab.freedesktop.org/drm/intel/issues/541
[i915#668]: https://gitlab.freedesktop.org/drm/intel/issues/668
[k.org#205379]: https://bugzilla.kernel.org/show_bug.cgi?id=205379
Participating hosts (45 -> 40)
------------------------------
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_9399 -> Patchwork_19002
CI-20190529: 20190529
CI_DRM_9399: b3d976d7d7851bcfcd64b5d6c29672a9e2462442 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5873: b6321b58dcaa41ba1d28aced42d6b15dc3d49ca2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19002: 74d681449f00eba4e12f94be7bdb78bae2b4b467 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
74d681449f00 HAX/DO_NOT_MERGE_IT: drm/i915/display: Enable PSR2 selective fetch for testing 90e1271c4257 drm/i915/display/psr: Program plane's calculated offset to plane SF register 7ae9aa859087 drm/i915/display: Split and export main surface calculation from skl_check_main_surface() 49d9826c27c6 drm/i915/display/psr: Calculate selective fetch plane registers
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19002/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx