Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07464c7c authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Clean up skl+ PLANE_POS vs. scaler handling



On skl+ the scaler (when enabled) will take care of the plane output
position. Make the code less ugly by just setting crtc_x/y to 0
when the scaler is enabled.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181101150605.18235-6-ville.syrjala@linux.intel.com


Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 7b012bd6
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -492,6 +492,12 @@ skl_program_plane(struct intel_plane *plane,
	if (alpha < 0xff)
		keymsk |= PLANE_KEYMSK_ALPHA_ENABLE;

	/* The scaler will handle the output position */
	if (plane_state->scaler_id >= 0) {
		crtc_x = 0;
		crtc_y = 0;
	}

	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);

	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
@@ -537,14 +543,10 @@ skl_program_plane(struct intel_plane *plane,
		I915_WRITE_FW(PLANE_CUS_CTL(pipe, plane_id), cus_ctl);
	}

	if (plane_state->scaler_id >= 0) {
		if (!slave)
	if (!slave && plane_state->scaler_id >= 0)
		skl_program_scaler(plane, crtc_state, plane_state);

		I915_WRITE_FW(PLANE_POS(pipe, plane_id), 0);
	} else {
	I915_WRITE_FW(PLANE_POS(pipe, plane_id), (crtc_y << 16) | crtc_x);
	}

	I915_WRITE_FW(PLANE_CTL(pipe, plane_id), plane_ctl);
	I915_WRITE_FW(PLANE_SURF(pipe, plane_id),