From patchwork Tue Mar 15 11:38:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 8587441 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 686CC9F6E1 for ; Tue, 15 Mar 2016 11:38:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77813202AE for ; Tue, 15 Mar 2016 11:38:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9C9D02027D for ; Tue, 15 Mar 2016 11:38:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 338096E094; Tue, 15 Mar 2016 11:38:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A7676E094 for ; Tue, 15 Mar 2016 11:38:18 +0000 (UTC) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O420067BWBQ9690@mailout2.w1.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 15 Mar 2016 11:38:14 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-49-56e7f426acd5 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 75.B7.21385.624F7E65; Tue, 15 Mar 2016 11:38:14 +0000 (GMT) Received: from amdc1061.digital.local ([106.116.147.88]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O4200I10WBPDDC0@eusync1.samsung.com>; Tue, 15 Mar 2016 11:38:13 +0000 (GMT) From: Andrzej Hajda To: Inki Dae , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: fix adjusted_mode pointer in exynos_plane_mode_set Date: Tue, 15 Mar 2016 12:38:02 +0100 Message-id: <1458041882-10994-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOJMWRmVeSWpSXmKPExsVy+t/xy7pqX56HGVxaz2Rxa905VouNM9az Wlz5+p7NYtL9CSwWL+5dZLGYcX4fk8XaI3fZLWZMfsnmwOFxv/s4k0ffllWMHp83yQUwR3HZ pKTmZJalFunbJXBldF18wFjwj6dieu9dxgbGCdxdjJwcEgImEo2bZrBC2GISF+6tZ+ti5OIQ EljKKNH0ZhkLhNPEJDHp+0FmkCo2AU2Jv5tvsoHYIgIuEt9nLGYGKWIWaGeSmNjzlQkkISzg L3H15Q+gIg4OFgFViQ3t5iBhXgFniV9PHjNBbJOTOHlsMusERu4FjAyrGEVTS5MLipPSc430 ihNzi0vz0vWS83M3MUKC4+sOxqXHrA4xCnAwKvHwzpB6HibEmlhWXJl7iFGCg1lJhPfCJ6AQ b0piZVVqUX58UWlOavEhRmkOFiVx3pm73ocICaQnlqRmp6YWpBbBZJk4OKUaGCXOeP5kV/6V uZn72Jzyks/LEsvEBJZZH2SqmvbVt553m4dl8xpro7wukferpN/Yh3g8DhZfYTwvU3xhrNdD uzOSS2p38xyN+1G9Pn2J0buDzjommlu4fj/J6rwyxXPzU6HrKcYa21fpvv0XcYbxVeLJB2Gf H97qvq4UZV354Q93/kXGuZMzApVYijMSDbWYi4oTAXqQI+wKAgAA Cc: linux-samsung-soc@vger.kernel.org, Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Andrzej Hajda , Marek Szyprowski 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 exynos_plane_mode_set should use adjusted_mode from the same atomic state as plane state. Otherwise it will result in incorrect behavior in case crtc mode changes. The patch fixes bug with black console framebuffer in case of command mode panels. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index d8622723..50185ac 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -11,9 +11,10 @@ #include -#include -#include +#include #include +#include +#include #include "exynos_drm_drv.h" #include "exynos_drm_crtc.h" #include "exynos_drm_fb.h" @@ -57,11 +58,12 @@ static int exynos_plane_get_size(int start, unsigned length, unsigned last) } static void exynos_plane_mode_set(struct exynos_drm_plane_state *exynos_state) - { struct drm_plane_state *state = &exynos_state->base; - struct drm_crtc *crtc = exynos_state->base.crtc; - struct drm_display_mode *mode = &crtc->state->adjusted_mode; + struct drm_crtc *crtc = state->crtc; + struct drm_crtc_state *crtc_state = + drm_atomic_get_existing_crtc_state(state->state, crtc); + struct drm_display_mode *mode = &crtc_state->adjusted_mode; int crtc_x, crtc_y; unsigned int crtc_w, crtc_h; unsigned int src_x, src_y;