From patchwork Mon Sep 24 18:43:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satish Kumar Nagireddy X-Patchwork-Id: 10613507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C34213A4 for ; Tue, 25 Sep 2018 07:13:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B8129B12 for ; Tue, 25 Sep 2018 07:13:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E54B229B13; Tue, 25 Sep 2018 07:13:57 +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 955A228346 for ; Tue, 25 Sep 2018 07:13:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA12F6E2FD; Tue, 25 Sep 2018 07:12:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0089.outbound.protection.outlook.com [104.47.33.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A3276E32E for ; Mon, 24 Sep 2018 18:43:49 +0000 (UTC) Received: from SN4PR0201CA0068.namprd02.prod.outlook.com (2603:10b6:803:20::30) by BN7PR02MB5107.namprd02.prod.outlook.com (2603:10b6:408:22::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 24 Sep 2018 18:43:47 +0000 Received: from SN1NAM02FT048.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::206) by SN4PR0201CA0068.outlook.office365.com (2603:10b6:803:20::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1164.22 via Frontend Transport; Mon, 24 Sep 2018 18:43:47 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT048.mail.protection.outlook.com (10.152.72.202) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1185.13 via Frontend Transport; Mon, 24 Sep 2018 18:43:47 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:55909 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g4Vpi-0008Pp-V9 for dri-devel@lists.freedesktop.org; Mon, 24 Sep 2018 11:43:46 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g4Vpd-0002zz-R3 for dri-devel@lists.freedesktop.org; Mon, 24 Sep 2018 11:43:41 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8OIhYMM013012; Mon, 24 Sep 2018 11:43:34 -0700 Received: from [172.19.2.102] (helo=xsjanandash50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g4VpW-0002zf-EK; Mon, 24 Sep 2018 11:43:34 -0700 From: Satish Kumar Nagireddy To: Subject: [RFC PATCH] drm: Add new fb flags to pass interlaced alternate field information Date: Mon, 24 Sep 2018 11:43:33 -0700 Message-ID: <1537814613-18017-1-git-send-email-satish.nagireddy.nagireddy@xilinx.com> X-Mailer: git-send-email 2.1.1 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(39860400002)(136003)(2980300002)(438002)(189003)(199004)(47776003)(316002)(16586007)(9786002)(36386004)(81156014)(305945005)(476003)(81166006)(486006)(7696005)(126002)(14444005)(48376002)(8936002)(426003)(50226002)(50466002)(2616005)(356003)(26005)(8676002)(336012)(77096007)(6916009)(186003)(2906002)(72206003)(106002)(51416003)(4326008)(106466001)(107886003)(63266004)(5660300001)(2351001)(36756003)(478600001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR02MB5107; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT048; 1:a+7YVqp7TzDXmkL1zMYZFiF8Pbpjt1A1dQ9Dmjlq2HctdqdAS/rOAObAJPBNwz/IVTlUgNECF2QAwai9B9ioMSFpY4UukWNx7Hz5mzzI9XADaT0eUUPu5x3Q0MiVvBpf MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a2dc647-1538-4a8b-e04d-08d6224da9c3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BN7PR02MB5107; X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5107; 3:JoJrxjp9xQHUjw0r7fi1lwujt8L/vTg79wSsITe3fE+gY8e3N4AMSJvPPuHbAls2j1UAIgIqZDkoZcgBI0LnTlCz0OUG6H3KDRi86UcyONFa5MZ+Wl81SjNNXi1iDO6fbqpWZvD5ri2qpyn4RSIMbro/hrxamgM7VVLf4odVH7GZh2vj75vzDEXNSd7JgHJwxKJ9zjx57+XV55S9Kxv0GTl0zqSjWuMvT9nV2uHTdwXV0J2WA8kSh0ypypSLaWfjsfvzJrx0hT/xO0Po9Z1ffZ4a7vbanpnTomJsqjeS76yIFyjkFFxiq9azwlygeAvOpp8Q+9LH/wypxn17JIbIaSjy0EDPxWV67EsV3krDjAs=; 25:ElNTb+MWD2pSkFHQ6VGhetD28EkVdCnQKxqw3BR7Fr/80242lKCRa8Tp8fsybCyfxoqBQoBA0tGGjrYLo4GwmM7lg9N5LMENTs7rwpzXkHCS4dakHzKpRGc8mg5kdhj8X/00kfG2n5n1TNbDVw1lw+Ojfagm+kK4tUQcFUl4+MwCLUAQPfm6BeCLCgPciPYSmunRf9gPlH4XDuDE81VNLeGpvuaKnfvHlGUZ3yW8Z/usgSK8tlDkkp2+F9Y/FznLIo7AXiSvvacdtiL2HuYVJZcJB9GgZOPSjkKDNwFnVxzTs8N9s42WaNFeGWbfVuRDOOCVkzUcIBu9Z5gEOM0cSQ== X-MS-TrafficTypeDiagnostic: BN7PR02MB5107: X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5107; 31:k2njvrpqqUy+bgGPHwuSq1Jr1Qg4GPll9cT9yl6MweqGxRWP8kYQN0UoeMzqy+dQKRCbmPJhkG+nWIL/VUzVN5GA2qv4ZgZwNCuFf6leKo66C+Fu3YhbZ/DFM0ON7SuKQkbZDzV2cS4TnUCd9hBOX/euk3h+7IFBc3KmCyA/xbi4ar3cYK/gmRbf6xRGNuM4ReMS6WiQO6WnGpb2Ojag8Ah0Ry1t7NezhpCY7AESJ9A=; 20:bZvCrxdjYC3PxKVgFIrLaYDaYHqarp9ERyCSG0UO0GREMfpQ8bE/XD98zBJpqiglusOBYZq4yL7BumffKExbDr/+2Pr0vH1RTc66xXl5m5ubj7diehUcLqUygDc3fqNwqofBiB+hnUuYD29tdZMpMvL8/6pHqzgQxed+6iwtRXxbeH/kEfMGWdQPbk+Co2rFWtdauOvMXEmPEqmoZ5o+Jp7ok7iirTNaM1OiD84nWRloOs+EfrtLP04peb4qkkDVXAbAqdff0ZHYrg0idlqZ3ifECvq1U+tEWC6VeuBt9sjiGWCv1LGUtMjQ7pQJ+tYzuY+cAzS89KfYAKHbGm2GCST+Jh3cIL71/M1WIqLuCw8HW0JZj3R8TgNFop9fhEeNUStTlfkLznxyj77HbpN34DnancvmsBQdr9x5UznXDts0JvD9SGuX/4f5wj4DwPV7wk6uBioM0TT0c0Ow1OOp6nnJ4O+plxP4D3AtaKoBQbLGydoZ8i5bkO4IEmvdQptw X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(3231355)(944501410)(52105095)(3002001)(10201501046)(6055026)(149066)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051); SRVR:BN7PR02MB5107; BCL:0; PCL:0; RULEID:; SRVR:BN7PR02MB5107; X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5107; 4:onfw/mqflsJVXx2nwbkWMeZnIyAfLK7QK+d59KaP63DSrN1CLGVta66zyDNssDm0O3HCBNzfacETxjy7s3W9G3Eo6eNsvtJfz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n71mXvli74jgm131B1vmGM24UMiItOvoZceaWdh+aBr8bKTCYBRM7b9b+Ldiyw+2EhYN7a7qbUUi1pLjv6KNet5ubANl0hiuGGBgMqtwwAK1wFR82J+jgAkFbvyfUItU8eNzJJHVbOt4VoWTESlTCO6DkSUzJ2REBHqDjqVYbKsKRnACUIKt7w9ija1rOFLe000VKI33h5X3Dv9ggkio+fKMYWthuNszngQofduSTlQGDnnjPfM/9FjZT0d0s0okWtGT35z8aLzgW8e+sCpbNtzxKQHUb063dlkQzm677ss+730rXbj65qw8gmhUQ+pA== X-Microsoft-Antispam-Message-Info: bqgNJtEYYZ8pS7/E7fIF3B80YXeFrPfUU00Ysi0W7mobng11wi/hqw0EnC57j4YZ6DnW4xLe8ZZxSK3pYdB+7/drFlHdjbQaf0YSTOb2SbsNgdLB5XyxCUxfLfQTeAkayD8zgig6AR0Y9zhU2BAvGZibSPZe9+p14vHER2KVGux4tAoGu9hRbZhBnUaottY/MX95t4NqbIdj4HwwOPWmEDTJUmneUn4IiLRHEG16QP2toggdBJeVlaJPStsSYMePa77PjSsdrFHuqyv1I81ZeNCoc/GC0MzrZWwmwKFn/330yiaVxul28ei6JOp2LGYuIv6uLJafspUV1TFXi911cidxT494WHeQaOExUECfo2g= X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5107; 6:7Ccj3JR3/I9iez2QyN4Yy22Tst6cGjZaFLD4HWD3BypONLRdJNbX4z61igoGikrpAecfs8ea7p+9uCowIVdhRq924OXgr4sRUiLlhwGtzIT4cZarR3a51jQqvL+dk3evGcotmO34VmMi14JxiR++xduuPi7YNNwakUi/g286BhbzaRtLUkWFqLruiCHzTS+3GbG2qo6yX7D1cuP95RPUggkFn/nJOLAC6EDMpssdlqi+CZfZx/33uvlogl47sGAHBjdKvJLrtctLlv6K7myGfPgtoO9DCtgTjcuhxaKLyzSkKM2zwsx2x1//ZVei+UysZj7Z5y8eWPJ/4YCzWZjwuCYHn4Qb5CYUcChShAc1tssr3BZNBrDl0t5CJhNXNhNtSrmxBfmRazHUcFWo8Q39NygCnBZN3rhk0ou6eMm4+l5Tjxz7l+NX6AL4hcbyTKAxJDaG00nJDsyS8alYOrILfA==; 5:QR26EzjI/fP2sOSU1wVL2UZDKOVXlrg7oQJSU/xhFkayPEJzxhNYTTnlgiNkf5edh/pto98Eo/7HMSHTh/nyVciUp5HevmbIRSeJMtyo/FaI9D1bk6aNpWpl+XafM41fCVpM/SM1RMw8azGnGiPtH/REh0W/RztbGp868U/wUzA=; 7:wxvcYW9hRsAdmHjtinWcNArEcsBGCRl9f4d4abHVLjhBzR8+UIMbrmPhaW/gtUcJDlIU1n50qW/77USOpc+l44MxZgWFx5XfEmuwZHZ7H1LyPr2iNdUIHydDcFPZrgI1RYLmnZrDW3mUxatYZPwtOr+hgJMOIHpuMuMaHkkB39i/+sLyFjPt0bjPYq/0NffPZ3dGcZj+0EnBTZ2baK9mFMHz/wAB7RfhUzhN6S6INolLjQnJkFiTSXkA1JulRiBN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2018 18:43:47.4266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a2dc647-1538-4a8b-e04d-08d6224da9c3 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB5107 X-Mailman-Approved-At: Tue, 25 Sep 2018 07:11:35 +0000 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: Satish Kumar Nagireddy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds two new framebuffer flags, so that application can communicate alternate interlaced field information to DRM. This patch also modifies the validation of framebuffer flags in DRM core framework. This is to ensure that application is setting the right framebuffer flags. Signed-off-by: Satish Kumar Nagireddy --- drivers/gpu/drm/drm_framebuffer.c | 3 ++- include/uapi/drm/drm_mode.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 28a0108..d330256 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -241,7 +241,8 @@ drm_internal_framebuffer_create(struct drm_device *dev, struct drm_framebuffer *fb; int ret; - if (r->flags & ~(DRM_MODE_FB_INTERLACED | DRM_MODE_FB_MODIFIERS)) { + if (r->flags & ~(DRM_MODE_FB_INTERLACED | DRM_MODE_FB_MODIFIERS | + DRM_MODE_FB_ALTERNATE_TOP | DRM_MODE_FB_ALTERNATE_BOTTOM)) { DRM_DEBUG_KMS("bad framebuffer flags 0x%08x\n", r->flags); return ERR_PTR(-EINVAL); } diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index ce7efe2..b857ed4 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -388,6 +388,8 @@ struct drm_mode_fb_cmd { #define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ #define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ +#define DRM_MODE_FB_ALTERNATE_TOP (1<<2) /* for alternate top field */ +#define DRM_MODE_FB_ALTERNATE_BOTTOM (1<<3) /* for alternate bottom field */ struct drm_mode_fb_cmd2 { __u32 fb_id;