diff mbox series

[08/10] drm/i915: Do not add all planes when checking scalers on glk+

Message ID 20190821133221.29456-9-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Bigjoiner preparations. | expand

Commit Message

Maarten Lankhorst Aug. 21, 2019, 1:32 p.m. UTC
We cannot switch between HQ and normal mode on GLK+, so only
add planes on platforms where it makes sense.

We could probably restrict it even more to only add when scaler
users toggles between 1 and 2, but lets just leave it for now.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ville Syrjala Sept. 10, 2019, 9:44 a.m. UTC | #1
On Wed, Aug 21, 2019 at 03:32:19PM +0200, Maarten Lankhorst wrote:
> We cannot switch between HQ and normal mode on GLK+, so only
> add planes on platforms where it makes sense.
> 
> We could probably restrict it even more to only add when scaler
> users toggles between 1 and 2, but lets just leave it for now.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
> index d267dd39475d..c442e9762ce7 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
> @@ -418,6 +418,11 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
>  			 */
>  			if (!plane) {
>  				struct drm_plane_state *state;
> +
> +				/* No need to reprogram, we're not changing scaling mode */
> +				if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
> +					continue;
> +

This whole function is kinda nasty. Should probably
rewrite the whole thing...

add_active_planes() {
	for_each_plane_on_crtc() {
		if (!active)
			continue;
		get_plane_state();
		update_planes |= plane;
	}
}

update_scalers()
{
	if (can_use_hq(old) != can_use_hq(new))
		add_active_planes();

	setup_scaler(crtc);

	for_each_plane_in_state()
		setup_scaler(plane);
}

or something like that?

Still doing the setup_scaler() perhaps a bit needlessly sometimes
but maybe it'd be good enough.

Also looks like the current code is missing the update_planes
bitmask update?


>  				plane = drm_plane_from_index(&dev_priv->drm, i);
>  				state = drm_atomic_get_plane_state(drm_state, plane);
>  				if (IS_ERR(state)) {
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
index d267dd39475d..c442e9762ce7 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic.c
@@ -418,6 +418,11 @@  int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
 			 */
 			if (!plane) {
 				struct drm_plane_state *state;
+
+				/* No need to reprogram, we're not changing scaling mode */
+				if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
+					continue;
+
 				plane = drm_plane_from_index(&dev_priv->drm, i);
 				state = drm_atomic_get_plane_state(drm_state, plane);
 				if (IS_ERR(state)) {