From patchwork Tue Jul 17 17:13:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayan Halder X-Patchwork-Id: 10530259 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 CD51760247 for ; Tue, 17 Jul 2018 17:14:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE672286B7 for ; Tue, 17 Jul 2018 17:14:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B07F328701; Tue, 17 Jul 2018 17:14:47 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6F58B286B7 for ; Tue, 17 Jul 2018 17:14:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ACEF6E827; Tue, 17 Jul 2018 17:14:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20084.outbound.protection.outlook.com [40.107.2.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id DCDC66E813; Tue, 17 Jul 2018 17:14:18 +0000 (UTC) Received: from e113505-lin.cambridge.arm.com (217.140.96.140) by AM5PR0801MB1377.eurprd08.prod.outlook.com (2603:10a6:203:1f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.19; Tue, 17 Jul 2018 17:14:16 +0000 From: Ayan Kumar Halder To: ayan.halder@arm.com, liviu.dudau@arm.com, brian.starkey@arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, intel-gfx@lists.freedesktop.org, hjc@rock-chips.com, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com, sre@kernel.org, bparrot@ti.com, peter.ujfalusi@ti.com, afd@ti.com, dri-devel@lists.freedesktop.org, maxime.ripard@bootlin.com, wens@csie.org, malidp@foss.arm.com Subject: [PATCH 5/5] drm/sun4i: Substitute sun4i_backend_format_is_yuv() with format->is_yuv Date: Tue, 17 Jul 2018 18:13:46 +0100 Message-Id: <1531847626-22248-5-git-send-email-ayan.halder@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531847626-22248-1-git-send-email-ayan.halder@arm.com> References: <1531847626-22248-1-git-send-email-ayan.halder@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: MRXP264CA0012.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:15::24) To AM5PR0801MB1377.eurprd08.prod.outlook.com (2603:10a6:203:1f::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba6022ea-fdd7-4067-feb1-08d5ec08bac0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB1377; X-Microsoft-Exchange-Di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wMTuZfAxj5GYBaF6Gsk3n6CSQrpnQFyGCyEYO8XPaAv/xLL0hUk=; 4:qm+t7c+HlPPwjoQcK+XdPVjKhdjKOcmKn2gHKCi5M2oZ21CIEEKOLmM9ZkqBvFX8psozpbjRIv/hzLzeX43/DLiEg+/vbmz0JQnTdxZ0XZ5qYN8bxEh0fciQktQE8+S6pV4n1+FdhHgVZUc1u+xEMKSvlBceVt+WWgW0Fbu1z4moFr1bn1omdUX2SzrXldli+jp331U/1ZBrP3lOtAmCubFkKCtG8UJHk1ymllL9SWMqZZ6dOsljKKFBl5lJ+Ch0FFvQ2ZO2QzHtdXoq65fBQKOcwWY46RZkO/8C1eBcICCrAacei60PQXDGOetgu9xA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:AM5PR0801MB1377; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1377; X-Forefront-PRVS: 073631BD3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(39860400002)(136003)(199004)(189003)(7416002)(316002)(305945005)(36756003)(5660300001)(76176011)(486006)(4326008)(446003)(50466002)(51416003)(48376002)(386003)(2906002)(52116002)(7696005)(476003)(53936002)(11346002)(2616005)(6486002)(66066001)(3846002)(575784001)(72206003)(68736007)(16586007)(478600001)(25786009)(956004)(105586002)(81156014)(8936002)(50226002)(26005)(86362001)(15760500003)(6116002)(47776003)(16526019)(8676002)(97736004)(14444005)(81166006)(7736002)(6666003)(106356001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1377; H:e113505-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1377; 23:q5nRHzn2AEAbzgji+cYbbmOK20yoK1ijegk6HYN?= =?us-ascii?Q?aK7+BoDuUHpqQbCyXD/6pEqgpHIZwiU7EJ6U1BQXlluQ3m7UWgy/VKM1Dw+s?= =?us-ascii?Q?o16Y2TmCR7458Z/heqEHqLAvsPV/1Z4xFxJjis+utZkcAADlpPYBVldfr+bP?= =?us-ascii?Q?XvV5ra9/QHCOoH/OY2vPm4QiFStRh6EpmezmqmChhdZNW0Rg227+BgSBAX8d?= =?us-ascii?Q?jBM0IIUfutq41fX2Cxbk61AugDUIwJrmPjZ/S0alJ7/pJTzc3T3i0ttBrxGg?= =?us-ascii?Q?2Kxb3fjMs/9XCHW0vgOVyLoLDRFe9WAy1NmQpi9kKNo2smmQjRMYckzFVa11?= =?us-ascii?Q?oyaZqic5LjHdzZCaZa71KjckjvTDTTww4m9DSJ9IBLZV9feq2irpJsguU8l8?= =?us-ascii?Q?VRF9j2Rtvo45HeKbl4JcCC+PuVJKPWtV5rbHF7lnkIHrcdMLm5cIFlii1UsT?= =?us-ascii?Q?YpFnwVkrDaLlGaTvQ9UWOgnbJyq4WOxCkHTC5MyCSAA20Ms0VAoYkk1A3Vcu?= =?us-ascii?Q?oEpLpVWo42JiBvMQtXb+apeRFyKYUsiiLx33JVysY0DVivdEIc4cSiI4ks67?= =?us-ascii?Q?bv4pBwsnX772IbcNP/rFrXP8v8pasbY+mFZM53uNkKusLMxy35dZ1df5WzWP?= =?us-ascii?Q?bMrbL2fpqiPKd4P5YLIIXrkm6NdC8ZREMSvd04kBtQB5/vYIXadrT5k2Mf5g?= =?us-ascii?Q?4dYqtgEScu2eZ5/B0xaFG61raQxkcvozaMHTNG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pk1cHDlrqlgv X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2018 17:14:16.3913 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba6022ea-fdd7-4067-feb1-08d5ec08bac0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1377 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP drm_format_info table has a field 'is_yuv' to denote if the format is yuv or not. The driver is expected to use this instead of having a function for the same purpose. Signed-off-by: Ayan Kumar halder --- drivers/gpu/drm/sun4i/sun4i_backend.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index de0a76d..d7950b5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -86,12 +86,6 @@ static inline bool sun4i_backend_format_is_packed_yuv422(uint32_t format) } } -static inline bool sun4i_backend_format_is_yuv(uint32_t format) -{ - return sun4i_backend_format_is_planar_yuv(format) || - sun4i_backend_format_is_packed_yuv422(format); -} - static void sun4i_backend_apply_color_correction(struct sunxi_engine *engine) { int i; @@ -304,7 +298,7 @@ int sun4i_backend_update_layer_formats(struct sun4i_backend *backend, SUN4I_BACKEND_ATTCTL_REG0_LAY_GLBALPHA_EN, val); - if (sun4i_backend_format_is_yuv(fb->format->format)) + if (fb->format->is_yuv) return sun4i_backend_update_yuv_format(backend, layer, plane); ret = sun4i_backend_drm_format_to_layer(fb->format->format, &val); @@ -384,7 +378,7 @@ int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend, */ paddr -= PHYS_OFFSET; - if (sun4i_backend_format_is_yuv(fb->format->format)) + if (fb->format->is_yuv) return sun4i_backend_update_yuv_buffer(backend, fb, paddr); /* Write the 32 lower bits of the address (in bits) */ @@ -502,7 +496,7 @@ static int sun4i_backend_atomic_check(struct sunxi_engine *engine, if (fb->format->has_alpha || (plane_state->alpha != DRM_BLEND_ALPHA_OPAQUE)) num_alpha_planes++; - if (sun4i_backend_format_is_yuv(fb->format->format)) { + if (fb->format->is_yuv) { DRM_DEBUG_DRIVER("Plane FB format is YUV\n"); num_yuv_planes++; }