drm/i915/skl: Assume no scaling is available when things are not as expected
Subsystems (2)
PATCH v2 1/1 drm/i915/skl: Assume no scaling is available when things are not as expected
From: Tvrtko Ursulin <[email protected]>
Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere in the code.
It is more robust and safe to assume no scaling is possible in this case with no other downsides since it will also WARN_ON_ONCE so that this definitely gets noticed.
Call it an assert to help new platform bring-up in simulation.
v2: Better commit msg and use WARN_ON_ONCE to signify the unexpectedness.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -13439,7 +13439,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state crtc_clock = crtc_state->base.adjusted_mode.crtc_clock; cdclk =to_intel_atomic_state (crtc_state->base.state)->cdclk; -if (!crtc_clock || !cdclk) +if (!crtc_clock || !cdclk ||WARN_ON_ONCE (cdclk < crtc_clock))return DRM_PLANE_HELPER_NO_SCALING ;/*
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 24 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
Cdclk <
crtc_clockis not allowed and suggests a different problem elsewhere in the code.It is more robust and safe to assume no scaling is possible in this case with no other downsides since it will also
WARN_ON_ONCEso that this definitely gets noticed.Call it an assert to help new platform bring-up in simulation.
v2: Better commit msg and use
WARN_ON_ONCEto signify the unexpectedness.Signed-off-by Tvrtko Ursulin <[email protected]>Cc Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state · line 13442
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1
-1@@ -13439,7 +13439,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state crtc_clock = crtc_state->base.adjusted_mode.crtc_clock; cdclk =to_intel_atomic_state (crtc_state->base.state)->cdclk; -if (!crtc_clock || !cdclk) +if (!crtc_clock || !cdclk ||WARN_ON_ONCE (cdclk < crtc_clock))
I'm thinking the zero crtc_clock check should also be inside the WARN. And you could drop the !cdclk part since the < already covers it.
With those:
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +0
-0return DRM_PLANE_HELPER_NO_SCALING ;/* Signature · 1 line
1.9.1
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 1/1 drm/i915/skl: Assume no scaling is available when things are not as expected
From: Tvrtko Ursulin <[email protected]>
Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere in the code.
It is more robust and safe to assume no scaling is possible in this case with no other downsides since it will also WARN_ON_ONCE so that this definitely gets noticed.
Call it an assert to help new platform bring-up in simulation.
v2: Better commit msg and use WARN_ON_ONCE to signify the unexpectedness.
v3: Move zero crtc_clock check under the warn. (Ville)
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -13436,7 +13436,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state crtc_clock = crtc_state->base.adjusted_mode.crtc_clock; cdclk =to_intel_atomic_state (crtc_state->base.state)->cdclk; -if (!crtc_clock || !cdclk) +if (WARN_ON_ONCE (!crtc_clock || cdclk < crtc_clock))return DRM_PLANE_HELPER_NO_SCALING ;/*
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedQuoted 11 lines · Tvrtko Ursulin
From: Tvrtko Ursulin <[email protected]>
Cdclk <
crtc_clockis not allowed and suggests a different problem elsewhere in the code.It is more robust and safe to assume no scaling is possible in this case with no other downsides since it will also
WARN_ON_ONCEso that this definitely gets noticed.Call it an assert to help new platform bring-up in simulation.
Quoted 7 lines
v2: Better commit msg and use
WARN_ON_ONCEto signify the unexpectedness.v3: Move zero
crtc_clockcheck under the warn. (Ville)Signed-off-by Tvrtko Ursulin <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>Cc Ville Syrjälä <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 24 lines
--- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +1
-1@@ -13436,7 +13436,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state crtc_clock = crtc_state->base.adjusted_mode.crtc_clock; cdclk =to_intel_atomic_state (crtc_state->base.state)->cdclk; -if (!crtc_clock || !cdclk) +if (WARN_ON_ONCE (!crtc_clock || cdclk < crtc_clock))return DRM_PLANE_HELPER_NO_SCALING ;/* Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx