From patchwork Fri May 25 15:35:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayan Halder X-Patchwork-Id: 10427815 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 25E71602D8 for ; Fri, 25 May 2018 15:36:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C6E12974E for ; Fri, 25 May 2018 15:36:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 110FA29750; Fri, 25 May 2018 15:36:03 +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=ham 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 98CF42974E for ; Fri, 25 May 2018 15:36:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 777F86E93C; Fri, 25 May 2018 15:36:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0077.outbound.protection.outlook.com [104.47.2.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66AD96E93C for ; Fri, 25 May 2018 15:35:59 +0000 (UTC) Received: from e113505-lin.cambridge.arm.com (217.140.96.140) by VI1PR08MB3040.eurprd08.prod.outlook.com (2603:10a6:803:45::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.16; Fri, 25 May 2018 15:35:55 +0000 From: Ayan Kumar Halder To: liviu.dudau@arm.com, brian.starkey@arm.com, alexandru-cosmin.gheorghe@arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm: check_pixel_format() should return true if no modifiers are passed for a supported pixel format Date: Fri, 25 May 2018 16:35:41 +0100 Message-Id: <1527262541-13964-1-git-send-email-ayan.halder@arm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: CWXP265CA0063.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:2c::27) To VI1PR08MB3040.eurprd08.prod.outlook.com (2603:10a6:803:45::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB3040; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB3040; 3:kgg4fIjA7WVEE8IIId4RmcrrhP7iqJnaNz7p9if3u/4BTc5gT0deAI4VCkz2nVFgxY5YUB+ajOfozlhVAFeoVaX5/byLBAE5mNLc0QloUSEBblTWwod0hFgHPTkKHp2HmiLKv6noBwAszYfcP+PFEk+3XReyyLK0b+Lrs19plr1t5lN9eof7wDVGp+TIPbkE9/4YqC0AkWxceSFI3ltMPdXCTPauy67xvCmB6OEpMeRa1mDVtMAQcDObTqoNAByt; 25:CGLYvi4qw5NSIQrVD3LdVCeTt8z9PygvBWj+REyeEtkQPNGVVwNmToO296GyNOI7tmRTX3FxxHn3lwVSUzDZaScPtRTBERupVoZDi49bFVwt6atnXmgiEwhC+1Am7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V8CE4FFFDgSiYBLg9VUQl/BSJzI6iU4P1Jr1IjK9 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)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR08MB3040; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB3040; X-Forefront-PRVS: 06833C6A67 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(39380400002)(376002)(396003)(346002)(199004)(189003)(86362001)(2906002)(52116002)(6486002)(25786009)(81156014)(48376002)(81166006)(105586002)(316002)(26005)(6116002)(16526019)(106356001)(3846002)(16586007)(6666003)(50466002)(8936002)(53936002)(478600001)(36756003)(5660300001)(2616005)(8676002)(7736002)(386003)(1857600001)(68736007)(7696005)(305945005)(47776003)(97736004)(956004)(4326008)(66066001)(486006)(51416003)(50226002)(476003)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3040; 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; VI1PR08MB3040; 23:nkZQbeo8GqT1pQJWiXFcYF8d26UNhXn5TEqSCYgMy?= =?us-ascii?Q?BF8/e1Rvbv5JYNq6eNbXLGam7BhjryMdROvJC1CQvWnrAeRC/2ChaQ4zulzJ?= =?us-ascii?Q?4FgjECgm0xk5qW5+/XW59M8/0QgB7FqMkWecQF7d+CNnGvLZ/g5XSzQmCOZE?= =?us-ascii?Q?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7o7prs8PCJgDZiLX4Y4h+O5O9/+p9oWbbw3wIUkzL5JcfFa3N9m5zew= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB3040; 7:S5WZ5cGl0hXPwk28cZkO+OX2Q/e3SyUHj4WFM74B+9iJYytD39NjhRKcToGjy8jxH7dX5UqXaej4hvf4MwZ/bFSbBJtfe47z5pZdLa1gumovphraVDpyFEfiFP2amUO9WNmpyckHb4jFnIN/Jp6x3kI7ZdJLUIoo308o8jZRADiz61wqft3zrKwDvbcBfq37rHOaKCIenPOTczlJedqGGnPxMOwARyeskcrwDhPCdNm0No/RLh7lnr4+ScSNsEMo X-MS-Office365-Filtering-Correlation-Id: 9e681517-d2de-4c84-9941-08d5c2553523 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2018 15:35:55.7014 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e681517-d2de-4c84-9941-08d5c2553523 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3040 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: Ayan Kumar Halder , nd@arm.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If a plane supports a pixel format and the framebuffer does not pass any modifiers, then drm_plane_check_pixel_format() should always return true for the given format regardless of whether the plane supports any modifiers or not. Signed-off-by: Ayan Kumar Halder --- drivers/gpu/drm/drm_plane.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 6d2a6e4..873c084 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -564,6 +564,9 @@ int drm_plane_check_pixel_format(struct drm_plane *plane, if (!plane->modifier_count) return 0; + if (modifier == DRM_FORMAT_MOD_NONE) + return 0; + for (i = 0; i < plane->modifier_count; i++) { if (modifier == plane->modifiers[i]) break;