drm/i915: Pretend cursor is always on for ILK-style WM calculations
Subsystems (2)
PATCH 1/1 drm/i915: Pretend cursor is always on for ILK-style WM calculations
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
---
I'm traveling at the moment and don't have any HW access, so this patch is completely untested, but I think it will solve the issue being reported.
drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +10 -5
@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, +* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width =drm_rect_width (&pstate->dst) ?:64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Pretend cursor is always on for ILK-style WM calculations
== Summary ==
== Summary ==
Series 2975v1 drm/i915: Pretend cursor is always on for ILK-style WM calculations
http://patchwork.freedesktop.org/api/1.0/series/2975/revisions/1/mbox/
Test drv_module_reload_basic:
pass -> DMESG-WARN (ilk-hp8440p)
Test kms_flip:
Subgroup basic-flip-vs-dpms:
pass -> DMESG-WARN (ilk-hp8440p) UNSTABLE
Subgroup basic-plain-flip:
pass -> DMESG-WARN (ilk-hp8440p)
Test kms_pipe_crc_basic:
Subgroup nonblocking-crc-pipe-a:
pass -> DMESG-WARN (ilk-hp8440p)
Subgroup nonblocking-crc-pipe-a-frame-sequence:
pass -> DMESG-WARN (ilk-hp8440p)
Subgroup nonblocking-crc-pipe-b:
pass -> DMESG-WARN (ilk-hp8440p)
Subgroup nonblocking-crc-pipe-b-frame-sequence:
pass -> DMESG-WARN (ilk-hp8440p)
Subgroup read-crc-pipe-b-frame-sequence:
pass -> DMESG-WARN (ilk-hp8440p)
Subgroup suspend-read-crc-pipe-a:
pass -> FAIL (byt-nuc)
Subgroup suspend-read-crc-pipe-b:
pass -> DMESG-WARN (ilk-hp8440p)
pass -> FAIL (byt-nuc)
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> PASS (bsw-nuc-2)
skip -> FAIL (byt-nuc)bdw-nuci7 total:156 pass:147 dwarn:0 dfail:0 fail:0 skip:9 bdw-ultra total:159 pass:147 dwarn:0 dfail:0 fail:0 skip:12 bsw-nuc-2 total:159 pass:129 dwarn:0 dfail:0 fail:0 skip:30 byt-nuc total:159 pass:134 dwarn:0 dfail:0 fail:3 skip:22 hsw-brixbox total:159 pass:146 dwarn:0 dfail:0 fail:0 skip:13 ilk-hp8440p total:159 pass:102 dwarn:9 dfail:0 fail:0 skip:48 ivb-t430s total:159 pass:145 dwarn:0 dfail:0 fail:0 skip:14 skl-i5k-2 total:159 pass:144 dwarn:1 dfail:0 fail:0 skip:14 snb-dellxps total:159 pass:137 dwarn:0 dfail:0 fail:0 skip:22 snb-x220t total:159 pass:137 dwarn:0 dfail:0 fail:1 skip:21
Results at /archive/results/CI_IGT_test/Patchwork_1333/
6b1049b84dcd979f631d15b2ada325d8e5b2c4e1 drm-intel-nightly: 2016y-01m-29d-22h-50m-57s UTC integration manifest d2803db19c01d0f2f48793263da10ef0be3deebd drm/i915: Pretend cursor is always on for ILK-style WM calculations
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 30 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>---
I'm traveling at the moment and don't have any HW access, so this patch is completely untested, but I think it will solve the issue being reported.drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +0
-0@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,const struct intel_plane_state *pstate, uint32_t mem_value)
drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1808
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +7
-2{ -int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, +* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width =drm_rect_width (&pstate->dst) ?:64 ;
I don't think we can rely on that being correct when the plane is not visible. Also for the cursor, I'm not sure we should be even using the visible width of the plane when it's partially visible.
Quoted 21 lines
drivers/gpu/drm/i915/intel_pm.c +3
-3-if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */ Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
I can confirm that the proposed patch fixes the flicker problem on my system (openSuse Factory kernel 4.4.0-2-default), even though I had to slightly modify it to apply it to the current openSuse Factory sources).
Quoted 58 lines · Ville Syrjälä
Quoted 30 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>---
I'm traveling at the moment and don't have any HW access, so this patch is completely untested, but I think it will solve the issue being reported.drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +0
-0@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,const struct intel_plane_state *pstate, uint32_t mem_value)drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1808
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +7
-2{ -int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, +* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width =drm_rect_width (&pstate->dst) ?:64 ;I don't think we can rely on that being correct when the plane is not visible. Also for the cursor, I'm not sure we should be even using the visible width of the plane when it's partially visible.
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +3
-3-if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0/* Only for WM_LP. */ Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>---
I'm traveling at the moment and don't have any HW access, so this patch is completely untested, but I think it will solve the issue being reported.drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged,
Quoted 9 lines
drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1808
Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +4
-0+* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width =drm_rect_width (&pstate->dst) ?:64 ;I don't think we can rely on that being correct when the plane is not visible. Also for the cursor, I'm not sure we should be even using the visible width of the plane when it's partially visible.
But would this cause problems? I thought higher values were always "safe" (as long as they don't go over the maximums), just non-optimal since they translate to the level of FIFO data at which we start fetching more memory. Acording to the bspec we don't even need to ever program watermarks from the values setup by the BIOS if we're willing to live with non-optimal power/memory bandwidth usage.
The proper fix is definitely to re-merge the two-step watermark programming, but we still haven't tracked down why that patch upset the CI system yet (and I won't have time to look at that in depth until I'm done traveling). This seemed like a fairly safe/non-invasive temporary workaround for the user-visible issues. I'm open to other workarounds though if you have an idea for something that will work better.
Thanks.
Matt
Quoted 25 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_pm.c +3
-3-if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */ Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel OTC
Signature · 9 lines
Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 48 lines · Matt Roper
Quoted 37 lines · Ville Syrjälä
Quoted 36 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>---
I'm traveling at the moment and don't have any HW access, so this patch is completely untested, but I think it will solve the issue being reported.drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, Quoted 9 lines
drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1808
Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +4
-0+* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width =drm_rect_width (&pstate->dst) ?:64 ;I don't think we can rely on that being correct when the plane is not visible. Also for the cursor, I'm not sure we should be even using the visible width of the plane when it's partially visible.
Quoted 6 lines
But would this cause problems? I thought higher values were always "safe" (as long as they don't go over the maximums), just non-optimal since they translate to the level of FIFO data at which we start fetching more memory. Acording to the bspec we don't even need to ever program watermarks from the values setup by the BIOS if we're willing to live with non-optimal power/memory bandwidth usage.
I'd probablty just make it
width = visible ? crtc_w : 64;
to make it close to where we were before.
Quoted 45 lines
The proper fix is definitely to re-merge the two-step watermark programming, but we still haven't tracked down why that patch upset the CI system yet (and I won't have time to look at that in depth until I'm done traveling). This seemed like a fairly safe/non-invasive temporary workaround for the user-visible issues. I'm open to other workarounds though if you have an idea for something that will work better.
Thanks.
Matt
Quoted 25 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_pm.c +3
-3-if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */ Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel OTCSignature · 5 lines
Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
--- drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +10 -5
@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, +* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width = pstate->visible ? pstate->base.crtc_w :64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)
Quoted 36 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged,
drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1813
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-1+* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width = pstate->visible ? pstate->base.crtc_w :64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +
Stray whitespace.
Otherwise lgtm
Quoted 15 lines
drivers/gpu/drm/i915/intel_pm.c +1
-2return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */ Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)
Quoted 46 lines · Ville Syrjälä
Quoted 45 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +8
-3@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, +* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width = pstate->visible ? pstate->base.crtc_w :64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ;
Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1813
Quoted 1 line
drivers/gpu/drm/i915/intel_pm.c +1
-0+Stray whitespace.
Otherwise lgtm
Reviewed-by Ville Syrjälä <[email protected]>
Whitespace fixed and pushed to dinq. Also added a Cc: for -fixes since this is relevant to 4.5.
Thanks for the review.
Matt
Quoted 20 lines
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c +1
-2return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - cpp, mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */ Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel OTC
Signature · 9 lines
Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)
Quoted 51 lines · Matt Roper
Quoted 50 lines · Ville Syrjälä
Quoted 36 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1813
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-1+* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width = pstate->visible ? pstate->base.crtc_w :64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +Stray whitespace.
Quoted 7 lines
Quoted 2 lines
Otherwise lgtm
Reviewed-by Ville Syrjälä <[email protected]>Whitespace fixed and pushed to dinq. Also added a Cc: for -fixes since this is relevant to 4.5.
Thanks for the review.
Hm, I don't see the CI result for v2 of this patch anywhere. Is my mailer lossy?
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)
Quoted 55 lines · Daniel Vetter
Quoted 54 lines · Matt Roper
Quoted 52 lines · Ville Syrjälä
Quoted 36 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +3
-2@@ -1799,16 +1799,21 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,const struct intel_plane_state *pstate, uint32_t mem_value) { - int cpp = pstate->base.fb ? -drm_format_plane_cpp (pstate->base.fb->pixel_format,0 ) :0 ; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, drivers/gpu/drm/i915/intel_pm.c static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · line 1813
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-1+* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width = pstate->visible ? pstate->base.crtc_w :64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ; +Stray whitespace.
Otherwise lgtm
Reviewed-by Ville Syrjälä <[email protected]>
Quoted 8 lines
Quoted 4 lines
Whitespace fixed and pushed to dinq. Also added a Cc: for -fixes since this is relevant to 4.5.
Thanks for the review.
Hm, I don't see the CI result for v2 of this patch anywhere. Is my mailer lossy?
-Daniel
Looks like they were here:
https://lists.freedesktop.org/archives/intel-gfx/2016-February/086953.html
Matt
Quoted 4 lines
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 9 lines
Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)
In reply to Matt RoperDue to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
---
This patch is already merged to dinq, but did not cherry-pick cleanly to -fixes due to dependence on a separate s/bpp/cpp/ standardization patch. Here's a version of the patch that should apply to -fixes cleanly.
drivers/gpu/drm/i915/intel_pm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +9 -5
@@ -1783,16 +1783,20 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, const struct intel_plane_state *pstate, uint32_t mem_value) { - int bpp = pstate->base.fb ? pstate->base.fb->bits_per_pixel / 8 : 0; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, +* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width = pstate->visible ? pstate->base.crtc_w :64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ;return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - bpp, - mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: Pretend cursor is always on for ILK-style WM calculations (v2)
Quoted 18 lines · Matt Roper
Due to our lack of two-step watermark programming, our driver has historically pretended that the cursor plane is always on for the purpose of watermark calculations; this helps avoid serious flickering when the cursor turns off/on (e.g., when the user moves the mouse pointer to a different screen). That workaround was accidentally dropped as we started working toward atomic watermark updates. Since we still aren't quite there yet with two-stage updates, we need to resurrect the workaround and treat the cursor as always active.
v2: Tweak cursor width calculations slightly to more closely match the
logic we used before the atomic overhaul began. (Ville)Reported-by [email protected]Reported-by [email protected]Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93892
Quoted 8 lines
Fixes 43d59eda1 ("drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)")Signed-off-by Matt Roper <[email protected]>(cherry picked from commit b2435692dbb709d4c8ff3b2f2815c9b8423b72bb)---
This patch is already merged to dinq, but did not cherry-pick cleanly to -fixes due to dependence on a separate s/bpp/cpp/ standardization patch. Here's a version of the patch that should apply to -fixes cleanly.
Pushed to drm-intel-fixes, thanks for the patch.
BR,
Jani.
Quoted 34 lines
drivers/gpu/drm/i915/intel_pm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_pm.c +9
-5@@ -1783,16 +1783,20 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, const struct intel_plane_state *pstate, uint32_t mem_value) { - int bpp = pstate->base.fb ? pstate->base.fb->bits_per_pixel / 8 : 0; +/* +* We treat the cursor plane as always-on for the purposes of watermark +* calculation. Until we have two-stage watermark programming merged, +* this is necessary to avoid flickering. +*/ +int cpp =4 ; +int width = pstate->visible ? pstate->base.crtc_w :64 ; -if (!cstate->base.active || !pstate->visible) +if (!cstate->base.active)return 0 ;return ilk_wm_method2 (ilk_pipe_pixel_rate (cstate), cstate->base.adjusted_mode.crtc_htotal, -drm_rect_width (&pstate->dst), - bpp, - mem_value); + width, cpp, mem_value); }/* Only for WM_LP. */
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx