From patchwork Tue Jun 26 08:16:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6buE5a626ZKX?= X-Patchwork-Id: 10488235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 726EB602D8 for ; Tue, 26 Jun 2018 08:18:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57A1A27F90 for ; Tue, 26 Jun 2018 08:18:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49AF9281DB; Tue, 26 Jun 2018 08:18:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 039CB287B8 for ; Tue, 26 Jun 2018 08:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=DEU4znW2LyzHuZuYi4R1kjt5q0cR2WuS62rhUDa+RWI=; b=FYB iBWskNCqCAbpJpCs6Nyp6D84NfTTuETOYdxo7sVFHlfd6k2fj0WQb/PlWCINHZwVaDkjlz32wB81y CBkaphaOxUufAd9/K4m56JY14PeH1/qFT9g0UwJ9yVHNR2tLDlMG2gH09Qssmdb6kdrwAxYxeishf IDZ/yWHy0yDidhOCZo696jujN+2lPB5Nv8QvfGRw49bWJepidakTafwf0KCybISlkMc0zlPMxzhXd T5dwCpwfuO3dT7r/7tMZnE3/gJMYAY8eji6guzkCh466ui5aogNIwYVSI14njGGJlwX0Bp8GE1HRh A5Yd7gW39jWWBAx/JKJHfswgdTzcSRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXjB1-0001Hl-JE; Tue, 26 Jun 2018 08:18:15 +0000 Received: from regular1.263xmail.com ([211.150.99.130]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXjAg-00010o-Fl; Tue, 26 Jun 2018 08:18:11 +0000 Received: from hjc?rock-chips.com (unknown [192.168.167.233]) by regular1.263xmail.com (Postfix) with ESMTP id 2EDCFB1AD; Tue, 26 Jun 2018 16:17:32 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 471543E1; Tue, 26 Jun 2018 16:17:17 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: hjc@rock-chips.com X-FST-TO: dri-devel@lists.freedesktop.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: hjc@rock-chips.com X-UNIQUE-TAG: <4290c5e2179ea33f72c094655a260b4b> X-ATTACHMENT-NUM: 0 X-SENDER: hjc@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 8813II07W7; Tue, 26 Jun 2018 16:17:26 +0800 (CST) From: Sandy Huang To: dri-devel@lists.freedesktop.org, Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , David Airlie Subject: [PATCH] drm/rockchip: vop: fixup linebuffer mode calc error Date: Tue, 26 Jun 2018 16:16:44 +0800 Message-Id: <1530001004-25036-1-git-send-email-hjc@rock-chips.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180626_011754_724046_DB7769BB X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP linebuffer mode should be LB_YUV_3840X5 when width is bigger than 1280 in yuv mode. seperate yuv and rgb case make the scl_vop_cal_lb_mode() logic is clearer. Signed-off-by: Sandy Huang Link: https://patchwork.freedesktop.org/patch/msgid/1523960108-190541-1-git-send-email-hjc@rock-chips.com Reviewed-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h index 084acdd..fcb9104 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h @@ -331,16 +331,19 @@ static inline int scl_vop_cal_lb_mode(int width, bool is_yuv) { int lb_mode; - if (width > 2560) - lb_mode = LB_RGB_3840X2; - else if (width > 1920) - lb_mode = LB_RGB_2560X4; - else if (!is_yuv) - lb_mode = LB_RGB_1920X5; - else if (width > 1280) - lb_mode = LB_YUV_3840X5; - else - lb_mode = LB_YUV_2560X8; + if (is_yuv) { + if (width > 1280) + lb_mode = LB_YUV_3840X5; + else + lb_mode = LB_YUV_2560X8; + } else { + if (width > 2560) + lb_mode = LB_RGB_3840X2; + else if (width > 1920) + lb_mode = LB_RGB_2560X4; + else + lb_mode = LB_RGB_1920X5; + } return lb_mode; }