From patchwork Fri Sep 20 11:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 11154291 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E08F21747 for ; Fri, 20 Sep 2019 11:43:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C913F207FC for ; Fri, 20 Sep 2019 11:43:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C913F207FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 614C06FCA4; Fri, 20 Sep 2019 11:43:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mblankhorst.nl (mblankhorst.nl [IPv6:2a02:2308::216:3eff:fe92:dfa3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A9C86FC9C for ; Fri, 20 Sep 2019 11:42:43 +0000 (UTC) From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Date: Fri, 20 Sep 2019 13:42:28 +0200 Message-Id: <20190920114235.22411-16-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190920114235.22411-1-maarten.lankhorst@linux.intel.com> References: <20190920114235.22411-1-maarten.lankhorst@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 16/23] drm/i915: Program planes in bigjoiner mode. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Now that we can program planes from the update_slave callback, and we have done all fb pinning correctly, it's time to program those planes as well. We use the update_slave callback as it allows us to use the separate states correctly. Signed-off-by: Maarten Lankhorst --- .../gpu/drm/i915/display/intel_atomic_plane.c | 53 +++++++++++++++++++ .../gpu/drm/i915/display/intel_atomic_plane.h | 2 + drivers/gpu/drm/i915/display/intel_display.c | 4 +- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index cc088676f0a2..5db091e4ad6a 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -366,6 +366,59 @@ void skl_update_planes_on_crtc(struct intel_atomic_state *state, } } +void icl_update_bigjoiner_planes_on_crtc(struct intel_atomic_state *state, + struct intel_crtc *crtc) +{ + struct intel_crtc_state *old_crtc_state = + intel_atomic_get_old_crtc_state(state, crtc); + struct intel_crtc_state *new_crtc_state = + intel_atomic_get_new_crtc_state(state, crtc); + struct skl_ddb_entry entries_y[I915_MAX_PLANES]; + struct skl_ddb_entry entries_uv[I915_MAX_PLANES]; + u32 update_mask = new_crtc_state->update_planes; + struct intel_plane *plane; + + memcpy(entries_y, old_crtc_state->wm.skl.plane_ddb_y, + sizeof(old_crtc_state->wm.skl.plane_ddb_y)); + memcpy(entries_uv, old_crtc_state->wm.skl.plane_ddb_uv, + sizeof(old_crtc_state->wm.skl.plane_ddb_uv)); + + while ((plane = skl_next_plane_to_commit(state, crtc, + entries_y, entries_uv, + &update_mask))) { + struct intel_plane_state *new_plane_state = + intel_atomic_get_new_plane_state(state, plane); + const struct intel_plane_state *master_plane_state; + + if (new_plane_state->base.visible) { + master_plane_state = + intel_atomic_get_new_plane_state(state, new_plane_state->bigjoiner_plane); + + intel_update_slave(plane, new_crtc_state, + master_plane_state, new_plane_state); + } else if (new_plane_state->slave) { + /* + * bigjoiner slave + planar slave. + * The correct sequence is to get from the planar slave to planar master, + * then to the master plane state for the master_plane_state. + */ + + struct intel_plane *linked = new_plane_state->linked_plane; + const struct intel_plane_state *uv_plane_state = + intel_atomic_get_new_plane_state(state, linked); + + linked = uv_plane_state->bigjoiner_plane; + master_plane_state = + intel_atomic_get_new_plane_state(state, linked); + + intel_update_slave(plane, new_crtc_state, + master_plane_state, new_plane_state); + } else { + intel_disable_plane(plane, new_crtc_state); + } + } +} + void i9xx_update_planes_on_crtc(struct intel_atomic_state *state, struct intel_crtc *crtc) { diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h index 901a50e6e2d3..1cffda2b50b5 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h @@ -30,6 +30,8 @@ void intel_plane_free(struct intel_plane *plane); struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane); void intel_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *state); +void icl_update_bigjoiner_planes_on_crtc(struct intel_atomic_state *state, + struct intel_crtc *crtc); void skl_update_planes_on_crtc(struct intel_atomic_state *state, struct intel_crtc *crtc); void i9xx_update_planes_on_crtc(struct intel_atomic_state *state, diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 06ceac4f1436..acb3c5974e99 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -14223,8 +14223,8 @@ static void intel_update_crtc(struct intel_crtc *crtc, commit_pipe_config(state, old_crtc_state, new_crtc_state); - if (new_crtc_state->bigjoiner) - {/* Not supported yet */} + if (new_crtc_state->bigjoiner_slave) + icl_update_bigjoiner_planes_on_crtc(state, crtc); else if (INTEL_GEN(dev_priv) >= 9) skl_update_planes_on_crtc(state, crtc); else