From patchwork Tue Mar 15 12:46:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 8587971 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 25D06C0553 for ; Tue, 15 Mar 2016 12:46:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3DEBE20304 for ; Tue, 15 Mar 2016 12:46:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 578DD202EC for ; Tue, 15 Mar 2016 12:46:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06B1F6E243; Tue, 15 Mar 2016 12:46:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.w1.samsung.com (mailout4.w1.samsung.com [210.118.77.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65D376E243 for ; Tue, 15 Mar 2016 12:46:27 +0000 (UTC) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O42000TEZHBGAA0@mailout4.w1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 15 Mar 2016 12:46:23 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-e4-56e8041f3045 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 7F.B2.21385.F1408E65; Tue, 15 Mar 2016 12:46:23 +0000 (GMT) Received: from amdc1061.digital.local ([106.116.147.88]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O42004X3ZHAKBA0@eusync4.samsung.com>; Tue, 15 Mar 2016 12:46:23 +0000 (GMT) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org, Daniel Vetter Subject: [PATCH 1/2] drm/atomic: use helper to get crtc state Date: Tue, 15 Mar 2016 13:46:00 +0100 Message-id: <1458045960-25193-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIJMWRmVeSWpSXmKPExsVy+t/xa7ryLC/CDL78Z7e4te4cq0XvuZNM FhtnrGe1WH5mHbPFla/v2SzWHrnL7sDmsXjPSyaP7d8esHrc7z7O5NG3ZRVjAEsUl01Kak5m WWqRvl0CV8bmc4/YCubyV2yaotbAeJ2ni5GTQ0LAROL8sSPsELaYxIV769m6GLk4hASWMkrM ubKVFcJpYpLY/u0oC0gVm4CmxN/NN4GqODhEBHwk7vU5g9QwC6xnlPi1o50ZpEZYwFbi8pL5 TCA1LAKqEm/PWIOEeQWcJd7Onw61TE7i5LHJrBMYuRcwMqxiFE0tTS4oTkrPNdIrTswtLs1L 10vOz93ECAmIrzsYlx6zOsQowMGoxMM7Q+p5mBBrYllxZe4hRgkOZiUR3ktML8KEeFMSK6tS i/Lji0pzUosPMUpzsCiJ887c9T5ESCA9sSQ1OzW1ILUIJsvEwSnVwGjj++3MfudEJ5Xb707J RLWv4ZDiuj7l7mS9d18Wm7x4vkldL+1SyFOR+bVdkaxr+zSywnTqeEOOiGbsnNK53e6/xdav ufoZ6qXmS7unbkzmXpDz7NjC/QyvV+oEXWq7vtxHOSate3Kl+czTb9gXNhY9q9uZG5RVHn/b 9tZ3xQWvb9qHyB7d56TEUpyRaKjFXFScCADSjp92BAIAAA== Cc: Andrzej Hajda , Marek Szyprowski , Bartlomiej Zolnierkiewicz X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DRM core provide helper to access crtc state. Signed-off-by: Andrzej Hajda Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 2b430b0..e1cbba6 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -67,7 +67,8 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, struct drm_crtc_state *crtc_state; if (plane->state->crtc) { - crtc_state = state->crtc_states[drm_crtc_index(plane->state->crtc)]; + crtc_state = drm_atomic_get_existing_crtc_state(state, + plane->state->crtc); if (WARN_ON(!crtc_state)) return; @@ -76,8 +77,8 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state, } if (plane_state->crtc) { - crtc_state = - state->crtc_states[drm_crtc_index(plane_state->crtc)]; + crtc_state = drm_atomic_get_existing_crtc_state(state, + plane_state->crtc); if (WARN_ON(!crtc_state)) return; @@ -366,8 +367,8 @@ mode_fixup(struct drm_atomic_state *state) if (!conn_state->crtc || !conn_state->best_encoder) continue; - crtc_state = - state->crtc_states[drm_crtc_index(conn_state->crtc)]; + crtc_state = drm_atomic_get_existing_crtc_state(state, + conn_state->crtc); /* * Each encoder has at most one connector (since we always steal @@ -666,7 +667,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) if (!old_conn_state->crtc) continue; - old_crtc_state = old_state->crtc_states[drm_crtc_index(old_conn_state->crtc)]; + old_crtc_state = drm_atomic_get_existing_crtc_state(old_state, + old_conn_state->crtc); if (!old_crtc_state->active || !drm_atomic_crtc_needs_modeset(old_conn_state->crtc->state))