From patchwork Thu Mar 19 04:33:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 6045841 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 C5D709F2A9 for ; Thu, 19 Mar 2015 04:34:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0719F204D3 for ; Thu, 19 Mar 2015 04:34:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B32D120465 for ; Thu, 19 Mar 2015 04:34:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6EE176E95B; Wed, 18 Mar 2015 21:34:00 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by gabe.freedesktop.org (Postfix) with ESMTP id 49D2A6E956 for ; Wed, 18 Mar 2015 21:33:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id 36E91600621 From: Daniel Stone To: dri-devel@lists.freedesktop.org Subject: [RFC PATCH 10/37] drm: armada: Use crtc->hwmode for adjusted mode Date: Thu, 19 Mar 2015 04:33:09 +0000 Message-Id: <1426739616-10635-10-git-send-email-daniels@collabora.com> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1426739616-10635-1-git-send-email-daniels@collabora.com> References: <1426739556-10429-1-git-send-email-daniels@collabora.com> <1426739616-10635-1-git-send-email-daniels@collabora.com> 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, T_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 crtc->hwmode contains the adjusted_mode from mode_set; no reason to overwrite crtc->mode (the user-specified mode) with this anymore. Signed-off-by: Daniel Stone --- drivers/gpu/drm/armada/armada_crtc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 42d2ffa..c74faf9 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -133,11 +133,11 @@ static void armada_drm_crtc_update(struct armada_crtc *dcrtc) * The non-inverted state of the sync signals is active high. * Setting these bits makes the appropriate signal active low. */ - if (dcrtc->crtc.mode.flags & DRM_MODE_FLAG_NCSYNC) + if (dcrtc->crtc.hwmode.flags & DRM_MODE_FLAG_NCSYNC) dumb_ctrl |= CFG_INV_CSYNC; - if (dcrtc->crtc.mode.flags & DRM_MODE_FLAG_NHSYNC) + if (dcrtc->crtc.hwmode.flags & DRM_MODE_FLAG_NHSYNC) dumb_ctrl |= CFG_INV_HSYNC; - if (dcrtc->crtc.mode.flags & DRM_MODE_FLAG_NVSYNC) + if (dcrtc->crtc.hwmode.flags & DRM_MODE_FLAG_NVSYNC) dumb_ctrl |= CFG_INV_VSYNC; if (dcrtc->dumb_ctrl != dumb_ctrl) { @@ -457,7 +457,7 @@ void armada_drm_crtc_enable_irq(struct armada_crtc *dcrtc, u32 mask) static uint32_t armada_drm_crtc_calculate_csc(struct armada_crtc *dcrtc) { - struct drm_display_mode *adj = &dcrtc->crtc.mode; + struct drm_display_mode *adj = &dcrtc->crtc.hwmode; uint32_t val = 0; if (dcrtc->csc_yuv_mode == CSC_YUV_CCIR709) @@ -531,8 +531,6 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc, drm_crtc_vblank_off(crtc); - crtc->mode = *adj; - val = dcrtc->dumb_ctrl & ~CFG_DUMB_ENA; if (val != dcrtc->dumb_ctrl) { dcrtc->dumb_ctrl = val; @@ -735,10 +733,10 @@ static int armada_drm_crtc_cursor_update(struct armada_crtc *dcrtc, bool reload) xoff = -dcrtc->cursor_x; xscr = 0; w -= min(xoff, w); - } else if (dcrtc->cursor_x + w > dcrtc->crtc.mode.hdisplay) { + } else if (dcrtc->cursor_x + w > dcrtc->crtc.hwmode.hdisplay) { xoff = 0; xscr = dcrtc->cursor_x; - w = max_t(int, dcrtc->crtc.mode.hdisplay - dcrtc->cursor_x, 0); + w = max_t(int, dcrtc->crtc.hwmode.hdisplay - dcrtc->cursor_x, 0); } else { xoff = 0; xscr = dcrtc->cursor_x; @@ -748,10 +746,10 @@ static int armada_drm_crtc_cursor_update(struct armada_crtc *dcrtc, bool reload) yoff = -dcrtc->cursor_y; yscr = 0; h -= min(yoff, h); - } else if (dcrtc->cursor_y + h > dcrtc->crtc.mode.vdisplay) { + } else if (dcrtc->cursor_y + h > dcrtc->crtc.hwmode.vdisplay) { yoff = 0; yscr = dcrtc->cursor_y; - h = max_t(int, dcrtc->crtc.mode.vdisplay - dcrtc->cursor_y, 0); + h = max_t(int, dcrtc->crtc.hwmode.vdisplay - dcrtc->cursor_y, 0); } else { yoff = 0; yscr = dcrtc->cursor_y;