From patchwork Thu Jul 26 14:10:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10545945 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 97B991822 for ; Thu, 26 Jul 2018 14:10:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8678C2B3B5 for ; Thu, 26 Jul 2018 14:10:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83DDF2B407; Thu, 26 Jul 2018 14:10: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 E6B092B428 for ; Thu, 26 Jul 2018 14:10:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DBC56E760; Thu, 26 Jul 2018 14:10:55 +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-db5eur01on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::61b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BDAB6E760 for ; Thu, 26 Jul 2018 14:10:52 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Thu, 26 Jul 2018 14:10:49 +0000 From: Alexandru Gheorghe To: seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, ayan.halder@arm.com Subject: [PATCH 1/3] drm/fourcc: Add malidp yuv formats Date: Thu, 26 Jul 2018 15:10:03 +0100 Message-Id: <20180726141005.8321-2-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> References: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6782f02-a473-46a6-5030-08d5f3019757 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:rEhQKJ/OgeX850niTfb0zoVvwrpYVwgN0Mb4+thx3VUK+YHTsFEwNZ04QfVJQERI/YoD0iDVaG45BKlHdEHNeibg2gX8Lr+fUC5PODj/rqxC48YmXc4Mn2PKF1csKBmn2Xgt0V0bG6OOjmotcZCctdXfyh3lZxjEXw7aiM1gzpAr2XpDaV35BbRb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ixIIw1PEp4/9QA==; 4:ybwSrJrrZhXoCk98WVOeTLhiLU3hIRwjz8qRfpfwkOC5uJH8tPsRpmO2C6U+2XCZI4Hp14tF9rAopW3GYfQ8tMiixa21TqXlcaU0RCx4qKko0aKMVoo5/an4e5gf1YhVQXWBwn4y4tMPktZSkF4tMasgasFIYlAIZOynIH2yThU3aRnJu6C9NwrtaEeEkhr+267WAxwZdgnivbBzS6zHSHsVQqFaFenTjS6vNa3zh8HXtEaaqbqP+KAXH/tzb9YRZTpOenlhWomAK0hZ0/kXDUfclosTi7+TxGHOTbg3hFNi5M1VhVWz0wpDj6Bg7cix 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)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(366004)(396003)(199004)(189003)(6486002)(7696005)(51416003)(16586007)(47776003)(52116002)(316002)(36756003)(956004)(11346002)(476003)(446003)(386003)(486006)(2616005)(76176011)(66066001)(86362001)(575784001)(478600001)(16526019)(186003)(26005)(14444005)(53936002)(72206003)(48376002)(8936002)(4326008)(81156014)(81166006)(5660300001)(6666003)(7736002)(305945005)(25786009)(8676002)(50466002)(50226002)(68736007)(106356001)(3846002)(6116002)(6636002)(97736004)(1076002)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2545; H:e114479-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; AM5PR0802MB2545; 23:TG/0rmpzRiVo3Dbhm+V7B7NXBIAJhNOfIKoBpK4?= PzINJx1dQQAEY7YKR/DK8PwmfXObYXFOv8CTyqMCdiEX5S6J3vsb80Y+r8t8zAjw9Y6xrWrtj1uMeopBdwVsWXmEuwrZ6Xbz8+awQgRo9TkEk805z036KiAKeZXlZqx3lrTc+hy0IhtJ7/4kikgdFhCovAiF80m+9HxGWPtq9M6f4ZOW9ugLBdFsjivc6L+JPQSB7Wr5Ic3Fpe+X+EMavMptqOv2TPbm0TkVRcEswKSV2lkOPIo33pd5o+fP9QHTdyJ+qvORs3cL0O9ykFpA8qBlRBBNVHaiKeQGHnHotYLmnroq3+FxJKHDV5z9HH0UJoIQnY3iYWv87Y8Hv7FLGZfG/YNATeE9JbM/0BSwgFEqT/kBv5jN3Fixk8gwLOYsKtxs+5JownqNrsq869A9B6FZZnL+y2kiCeBcVzq1vUvkgZm9eE7BucCpaAuQQOsrL8AyIrMRQQj1WE5nQ76eOjJ/jf3KWvqsac7nN40AXF6CuFU8cODqjfbeEzNlyEMRrr0Kq+uNwFwkaxuazf8/JJXYxQ1D4elW8j2JS5N40C98Mg29yHl6nZIi1RloPMKgCKHFE3tDDj34v7vvqRER1Y9bKst5gspM75sL256hSquavM/RrE8RbgVCntjPgSxjNo79uqp5Yx39GjXhMsZf4lidIViYpoyQTBJXWiNi9D7uBA3VUvz93ZyFvcybKn4KHzOoqoWgarC0UNpjOQY5x5BLCDUc0ZN2/NGXRMWsOWEhJUGTWytqxz0gU6IYcj3KPvHJQqUpW1hWr3kH/BiLTVCsBzl79lO2kDmbsfXV+Y/WoyoG1SVb1mhQkfwHAV5Fuet661LQFafI9dEcVAsuVi+YonbJGXtMeD0eUL3jEGfdDfr3ZB4Q0dTpFLed2LcR5dclfSsLX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uFArqVDTwcyeItmV0iRxYFmjEsUkHtaQYBhggYpUrHdTPc385l4e8oBEw7NhnRV5B5zomvDi1N3PWratgl4iDSkJo+b654wLKsod3KsrFje1H/QD8jpKjyT9MQ==; 5:x9PeAsEiW05e1G3lPqcKDbvdrqLqNHaWjQmpbmWKPpcfDhN0KLHgp9OBxhJGn6EwuF9UwSGjTimaC+jW/YOQPkdxAeNkWsPq1EGwKhOtQ4A/VR9kl9zfa3ESus+dH5vxW55HpcFSziBCYt/d5GiafaCqf4Dh+X5NAWCCLiHptjM=; 7:m8utLsltD3c/XT6kS6OggXheLYJO3DhTqMWxJ/alUULZYtxemu/2daj7W8VBoo0RfPXxBlCHUvN5VIwlk9s+OBfqw2YB5TlcdBb96pZI6RdZpt+oH791PX6Gz9kO9igNzqQg1JGx3dcZZ/r40FiM9Vf645rb1+uHi4+4OTgClmrvoFqziP3vLHwT73BUkL5Oop1d7iyEDbZCQU+Nv7ma4Roqprh5zg/TUVq8/tnowEPO3zZfTHYzcEtCsHfAu9Ws SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 14:10:49.9735 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6782f02-a473-46a6-5030-08d5f3019757 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2545 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, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Malidp implements a number of yuv buffer formats which are not currently described in drm_fourcc.h. This adds those definitions and describes their memory layout. Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/drm_fourcc.c | 7 +++++++ include/uapi/drm/drm_fourcc.h | 27 ++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 35c1e2742c27..18bb960e9943 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -173,6 +173,13 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_XYUV8888, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_XVYU2101010, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_P010, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, }; unsigned int i; diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index d43949b5bb3e..ba2fd9e9815d 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -105,13 +105,31 @@ extern "C" { #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ -/* packed YCbCr */ +/* packed YCbCr422 */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ #define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ +/* packed YCbCr444 */ #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ +#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */ +#define DRM_FORMAT_XVYU2101010 fourcc_code('V', 'U', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian */ + +/* + * packed YCbCr420 2x2 tiled formats + * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile + */ + +/* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ +#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0') +/* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ +#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0') + +/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ +#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2') +/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ +#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2') /* * 2 plane RGB + A @@ -141,6 +159,13 @@ extern "C" { #define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ +/* + * Each sample packed into the top 10 bits of a 16-bit word. + * Y plane: [63:0] Y3:0:Y2:0:Y1:0:Y0:0, 10:6:10:6:10:6:10:6 + * CrCb plane: [63:0] Cr2:0:Cb2:0:Cr0:0:Cb0:0, 10:6:10:6:10:6:10:6 + */ +#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane */ + /* * 3 plane YCbCr * index 0: Y plane, [7:0] Y From patchwork Thu Jul 26 14:10:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10545947 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 C5EF414E0 for ; Thu, 26 Jul 2018 14:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B50672B3E6 for ; Thu, 26 Jul 2018 14:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B27032B411; Thu, 26 Jul 2018 14:11:00 +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 4E06A2B422 for ; Thu, 26 Jul 2018 14:11:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 533D76E75A; Thu, 26 Jul 2018 14:10:59 +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-db5eur01on060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::60b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80B966E760 for ; Thu, 26 Jul 2018 14:10:54 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Thu, 26 Jul 2018 14:10:52 +0000 From: Alexandru Gheorghe To: seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, ayan.halder@arm.com Subject: [PATCH 2/3] drm: Make drm_gem_fb_alloc available for drivers to use Date: Thu, 26 Jul 2018 15:10:04 +0100 Message-Id: <20180726141005.8321-3-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> References: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b80d59f5-5159-4929-c757-08d5f30198b5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:v3UmXfh5UXri8TwrMHVQPsuDTKWmMOA2ewmYC9KdTGRpRSHN+Cmqy5ru0obwnDkA/qw7DPb4B8YDP4Kf57B372ITufRpfpo/Fumj8YbpzVWNQakZcawfZH1rMR2PYS7iyldoRh3igTE1NSRtlzjnDsgfxC0t5bavjiXcLBJ1tidd2plO/A9qPDRFGFBJw9/YUfw7USyHCk3f/S+MJKQRXl9Exx9KFZhR8WZELdTJ6XWvmPijuH+z9DeewrHer+cL; 25:LKg+kVl9jFVAGv6Ro3Z7BCNxnpeosa7/0vr673Xp4OwKBUWls8k6F5CM48Oq8DeCNnRixXcmmoUv2gNhk5/hPch4G2sLzkP0kT2FlVgh7vWZIRXwnyD1ds7+TUuy3HVGUfnt2qNktz9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PHkOwwhKKXA4X/WEjurTq58B7tilZjK4sWCj2a0IFB207j0tAg8SxrYItfRo2MJjoWr/fYZJWpuWBUl0Rk2TMRKG2oWnB0yU/Ozk7jMtu5b+b6BYy 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)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(366004)(396003)(199004)(189003)(6486002)(7696005)(51416003)(16586007)(47776003)(52116002)(316002)(36756003)(956004)(11346002)(476003)(446003)(386003)(486006)(2616005)(76176011)(66066001)(86362001)(478600001)(16526019)(186003)(26005)(14444005)(53936002)(72206003)(48376002)(8936002)(4326008)(81156014)(81166006)(5660300001)(6666003)(7736002)(305945005)(25786009)(8676002)(50466002)(50226002)(68736007)(106356001)(3846002)(6116002)(6636002)(97736004)(1076002)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2545; H:e114479-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; AM5PR0802MB2545; 23:H74DURphrbvHHQBoYK2rJfbKonBw0KRmzN8pP2N?= 1+MZ7W8vbiyMfXXVQL+Wb/2Cl+rS1LcJNyXLb11mLjp+32aeFGkKDEWSGAyMI3H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/IyNznAQxFXw9pA=; 7:H388GkvoJiXK3fcR5bKIJfXMWFqsEEdpwkZfTIf/xznbOBtdbGoY1HSi8v+D0UDjfo9WzJrT34GO6NRQFUgtACDfgHFFl7kwv6DQU0HI7J1BWG8gfvcVtqh5rnpqp8aqkmizFwTiUp0N8UuvTnVn6p3xEUkocRmAUgvoHZcixZuWFX57rzXz9G15v2jBLnTbLMViJOx2it+hExFs/zqZ8ZrE03a51Hevzcn3sKVFf1KoXN+n0yKUYE6dE+sx97q4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 14:10:52.2860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b80d59f5-5159-4929-c757-08d5f30198b5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2545 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, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some drivers can't use drm_gem_fb_create, so instead of copying the logic that does the framebuffer allocation allow them to use core drm_gem_fb_alloc. Signed-off-by: Alexandru Gheorghe Acked-by: Liviu Dudau --- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++- include/drm/drm_gem_framebuffer_helper.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index 2810d4131411..64eddf5a1bd9 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -57,7 +57,7 @@ struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb, } EXPORT_SYMBOL_GPL(drm_gem_fb_get_obj); -static struct drm_framebuffer * +struct drm_framebuffer * drm_gem_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **obj, unsigned int num_planes, @@ -85,6 +85,7 @@ drm_gem_fb_alloc(struct drm_device *dev, return fb; } +EXPORT_SYMBOL_GPL(drm_gem_fb_alloc); /** * drm_gem_fb_destroy - Free GEM backed framebuffer diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h index a38de7eb55b4..d20c1356000a 100644 --- a/include/drm/drm_gem_framebuffer_helper.h +++ b/include/drm/drm_gem_framebuffer_helper.h @@ -14,6 +14,11 @@ struct drm_simple_display_pipe; struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb, unsigned int plane); +struct drm_framebuffer * +drm_gem_fb_alloc(struct drm_device *dev, + const struct drm_mode_fb_cmd2 *mode_cmd, + struct drm_gem_object **obj, unsigned int num_planes, + const struct drm_framebuffer_funcs *funcs); void drm_gem_fb_destroy(struct drm_framebuffer *fb); int drm_gem_fb_create_handle(struct drm_framebuffer *fb, struct drm_file *file, unsigned int *handle); From patchwork Thu Jul 26 14:10:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10545949 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 3D32314E0 for ; Thu, 26 Jul 2018 14:11:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C7302B3E2 for ; Thu, 26 Jul 2018 14:11:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 204AE2B423; Thu, 26 Jul 2018 14:11: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 59DA82B414 for ; Thu, 26 Jul 2018 14:11:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C62A46E764; Thu, 26 Jul 2018 14:10:59 +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-db5eur01on0088.outbound.protection.outlook.com [104.47.2.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id D86456E75A for ; Thu, 26 Jul 2018 14:10:57 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Thu, 26 Jul 2018 14:10:55 +0000 From: Alexandru Gheorghe To: seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, ayan.halder@arm.com Subject: [PATCH 3/3] drm: mali-dp: Enable mali specific buffer formats Date: Thu, 26 Jul 2018 15:10:05 +0100 Message-Id: <20180726141005.8321-4-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> References: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 53ffee1c-3fc8-4358-7347-08d5f3019a8b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:IZJE8Acvv1PrL5+kV/dYQdGaciwdPjAXdT3Oqt4xnqSz+Q5zEc55M7AcrxEqDXT60XWbJVHETTYADnB9eSOBN3XdVVKqmDkrUkHRCe2xEEQXRi7M+dnNF8baeLmZ4HA9uTko4MHxYA1ZdIHTLzofHhWUPquWGOGHLt5DT4zGIUM+EY0mpaXpKB0zGMxWOvu92unUIq+qEu+rrVgieMONjFlOw4Vfp3qmO0xShMU9xEX49HzSCtkZGuQkrZ5YVrhd; 25:61Q0Awx78P76l/l0spbR11som9nHk5QkMXgqgiJGBg8lWxMETpDOp0LVWMuV0K7+yC31o9XNxKPsQ+UTH637JOTYjFoxz0twaTItOa1n2dgAwrMIJN9xeZ1OpUuLqxK/9HXW5mOYliMdailHG/Fvyrrhd1/XGF4TPV64BxSaG5xRFrK+PX8LuBaN1sZh2mCym5uk5QXG3G70BzqqpLgSRm3rvUD/J0EIs9u2/lBdPedkVyxp9gmn4gjpGLwAuDjzsuEFOx6liFsJttsWlutX/blDcw422AdBooXBEUdSpAY/gGZzIgkA/Md4Mv+dLtLxIohmkdXXjn6NOBMOAQU6UA==; 31:sVn7fYo/5ikWooeFx5tprO1oKvTHKV15gZA4eobkyd7eUl3mL7a1blvsSEy0oyBiC6YwWacpQHm4uL+o5+kysjoRBDWnTpcPXX1QHXkSmoOtBFWs20AWO+G4zpqUrgFlukwgnyaG+nKrlrTHVeoxE7VbHlthkDdoNb9qeOItEJ3xjlJpfN2/iIHpqZ/DaH66P/EGJb0vDlfMjEs7P7ml5/UI7jkyNPFbNGhEosTQolE= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2545: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 20:p1EbpHoMvgrI72Qanr/FcNRQUTOCFVppp/paq7rmNrF7FOM7TJxTrwaUYoFJtEff0U6JkseOLJxJ7txxjanLNAR9FCyky/DPLG7HINmDsaSo/WtccTpo35LiXqYLa6wHr5y3foBqtSi066n/9SXEeRnnTGMAtDW0FeBU6r7XUiUHUqz1dlXf4L7yv1+7vgmd+wb9nsJSGCtxNYor5heqIFsOCoPpfeDDcTarLGwG+afcyT12Eu8rqGEYGSs7ONbfD7YlVrbrefFMGx34Eci0abKWlaCYXCn8XykamObDCEXrzyHosjll8MiBkgV+bhVKl1P3zcLKwALW12igPj8F0Q==; 4:L26vJa657k9weLmJ3mk8Deav2oE406CKfOwGJFGksCMlj9uwiXSczTq6cexcf/yqXUJ0wXjPAySbzY3JhDhrqYyVyXPszzGQ2+pRNpyEEX3OgUWjLyRePCgDpo4pwYdjCZ1ACDgmwfUoJL80786nfw37S2onDM/p4tdERjch8tjwC/Ixbd5U5MiqEYlMQqCPPMeVpGze8B1DpmAw2xD6TliA9WMrlHSvD8G5CXyLICv6L0MQbD1hPEmSRmVbZ02BmtByQ0hZxxd/+u6biNpn+x88P+uUAgFvRiVMBoz8nRcBwmvZlgRGy+/Mg4gcOn7LYG55AyITQN8GdpzAMfuXH/fiGDhLRSNR2ckfJ4XQxek= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(366004)(396003)(199004)(189003)(6486002)(7696005)(51416003)(16586007)(47776003)(52116002)(316002)(36756003)(45080400002)(956004)(11346002)(476003)(446003)(386003)(486006)(2616005)(76176011)(66066001)(86362001)(575784001)(478600001)(16526019)(186003)(26005)(14444005)(53936002)(72206003)(48376002)(8936002)(4326008)(81156014)(81166006)(5660300001)(6666003)(7736002)(305945005)(25786009)(8676002)(50466002)(50226002)(68736007)(106356001)(3846002)(6116002)(6636002)(97736004)(1076002)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2545; H:e114479-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; AM5PR0802MB2545; 23:7pToAZh0U715Qnpmjr4cNYxGsP5N+C35wm8o+nA?= mJWS0jlrKaap681aoiuQfgreyze9/KfxesNWyCGdEvY+gYzPs7Ei+kugRMP65unpJTW2qJK345pFBnOVFO4+aoeP+q3uowtFz4nsGF407zW95EdsDyUnEcOFzZCY0RcNjYPgotk6up96ZMzeuSScdpmCU14jdmEXhcJu7K1BGOvVW7n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4D/uQQne0IYvc0Sa9DwrUJS4r7IDdiuTOIVhZiVMDK4GH9ulHxlJPqsrnvbwcomOM2FUPDxZEe2V+P4cgd6WirLthqrqCEppJ5OiVgH6AMuHm69HvXoL9SNd6ItGxhvo85S/OaKyPitofvAzUdKXJeJesz00sBw0VhKIKi057Tyr10uzfquqL5gXtMMuTqPZydStPj+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 14:10:55.3484 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53ffee1c-3fc8-4358-7347-08d5f3019a8b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2545 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, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Enable the following formats - DRM_FORMAT_XYUV8888 - DRM_FORMAT_XVYU2101010 - DRM_FORMAT_X0L0 - DRM_FORMAT_X0L2 - DRM_FORMAT_P010 All formats respect the rules checked by core framebuffer_check except DRM_FORMAT_X0L0 and DRM_FORMAT_X0L2 for which we neeed to take into consideration that it's a 2x2 tiled format, so the following things need special handling: 1) PITCH: needs to cover two rows. 2) GEM_SIZE: the core formula (drm_gem_fb_create_with_funcs) that checks min_object size doesn't work anymore, so I added special check in driver for X0L0 and X0L2. 3) SOURCE_CROPPING: drm_fb_cma_get_gem_addr doesn't properly retrieves start address, so I added the right formula for DRM_FORMAT_X0L0 and DRM_FORMAT_X0L2 inside the driver. Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/arm/malidp_drv.c | 65 ++++++++++++++++++++++++++++- drivers/gpu/drm/arm/malidp_hw.c | 7 +++- drivers/gpu/drm/arm/malidp_planes.c | 52 +++++++++++++++++++---- 3 files changed, 114 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 5b7260557391..6745c4639dd4 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -258,8 +258,71 @@ static const struct drm_mode_config_helper_funcs malidp_mode_config_helpers = { .atomic_commit_tail = malidp_atomic_commit_tail, }; +static const struct drm_framebuffer_funcs malidp_gem_fb_funcs = { + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, +}; + +struct drm_framebuffer * +malidp_fb_create(struct drm_device *dev, struct drm_file *file, + const struct drm_mode_fb_cmd2 *mode_cmd) +{ + if (mode_cmd->pixel_format == DRM_FORMAT_X0L2 || + mode_cmd->pixel_format == DRM_FORMAT_X0L0) { + const struct drm_format_info *info; + struct drm_gem_object *obj; + struct drm_framebuffer *fb = NULL; + const unsigned int tile_size = 2; + unsigned int min_size; + + info = drm_format_info(mode_cmd->pixel_format & + ~DRM_FORMAT_BIG_ENDIAN); + /* + * Pitch needs to take into consideration that we are dealing + * with a tiled 2x2 format, so the pitch/stride need to cover + * both rows + */ + if (mode_cmd->pitches[0] < mode_cmd->width * info->cpp[0] * + tile_size) { + struct drm_format_name_buf format_name; + + drm_get_format_name(mode_cmd->pixel_format, + &format_name); + DRM_DEBUG_KMS("Invalid pitch for format %s", + format_name.str); + return ERR_PTR(-EINVAL); + } + obj = drm_gem_object_lookup(file, mode_cmd->handles[0]); + if (!obj) { + DRM_DEBUG_KMS("Failed to lookup GEM object\n"); + fb = ERR_PTR(-ENOENT); + goto err_gem_object_put; + } + min_size = mode_cmd->height / tile_size * mode_cmd->pitches[0]; + if (obj->size < min_size) { + drm_gem_object_put_unlocked(obj); + DRM_DEBUG_KMS("Object size is less than minimum" + " required\n"); + fb = ERR_PTR(-EINVAL); + goto err_gem_object_put; + } + + fb = drm_gem_fb_alloc(dev, mode_cmd, &obj, 1, + &malidp_gem_fb_funcs); + if (IS_ERR(fb)) + goto err_gem_object_put; + return fb; + + err_gem_object_put: + drm_gem_object_put_unlocked(obj); + return fb; + } + + return drm_gem_fb_create(dev, file, mode_cmd); +} + static const struct drm_mode_config_funcs malidp_mode_config_funcs = { - .fb_create = drm_gem_fb_create, + .fb_create = malidp_fb_create, .output_poll_changed = drm_fb_helper_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c index c94a4422e0e9..472cae76e19b 100644 --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c @@ -74,10 +74,15 @@ static const struct malidp_format_id malidp500_de_formats[] = { { DRM_FORMAT_ABGR1555, DE_VIDEO1 | DE_GRAPHICS1 | DE_VIDEO2, MALIDP_ID(4, 1) }, \ { DRM_FORMAT_RGB565, DE_VIDEO1 | DE_GRAPHICS1 | DE_VIDEO2, MALIDP_ID(4, 2) }, \ { DRM_FORMAT_BGR565, DE_VIDEO1 | DE_GRAPHICS1 | DE_VIDEO2, MALIDP_ID(4, 3) }, \ + { DRM_FORMAT_XYUV8888, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 0) }, \ { DRM_FORMAT_YUYV, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 2) }, \ { DRM_FORMAT_UYVY, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 3) }, \ + { DRM_FORMAT_X0L0, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 4)}, \ { DRM_FORMAT_NV12, DE_VIDEO1 | DE_VIDEO2 | SE_MEMWRITE, MALIDP_ID(5, 6) }, \ - { DRM_FORMAT_YUV420, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 7) } + { DRM_FORMAT_YUV420, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 7) }, \ + { DRM_FORMAT_XVYU2101010, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(6, 0)}, \ + { DRM_FORMAT_X0L2, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(6, 6)}, \ + { DRM_FORMAT_P010, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(6, 7)} static const struct malidp_format_id malidp550_de_formats[] = { MALIDP_COMMON_FORMATS, diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 29409a65d864..11fbac3ced81 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -211,7 +211,17 @@ static int malidp_de_plane_check(struct drm_plane *plane, (state->crtc_w < mp->hwdev->min_line_size) || (state->crtc_h < mp->hwdev->min_line_size)) return -EINVAL; - + /* + * Tiled formats DRM_FORMAT_X0L2 and DRM_FORMAT_X0L0 + * can be cropped only at multiple of tile dimension + * which is 2. + */ + if ((fb->format->format == DRM_FORMAT_X0L2 || + fb->format->format == DRM_FORMAT_X0L0) && + ((state->src_x >> 16) % 2 || (state->src_y >> 16) % 2)) { + DRM_DEBUG_KMS("Invalid crop values"); + return -EINVAL; + } /* * DP550/650 video layers can accept 3 plane formats only if * fb->pitches[1] == fb->pitches[2] since they don't have a @@ -321,6 +331,38 @@ static void malidp_de_set_color_encoding(struct malidp_plane *plane, } } +static void malidp_set_plane_base_addr(struct drm_framebuffer *fb, + struct malidp_plane *mp, + int plane_index) +{ + dma_addr_t paddr; + u16 ptr; + struct drm_plane *plane = &mp->base; + + ptr = mp->layer->ptr + (plane_index << 4); + + if (fb->format->format == DRM_FORMAT_X0L2 || + fb->format->format == DRM_FORMAT_X0L0) { + struct drm_gem_cma_object *obj; + int tile_size = 2; + + obj = drm_fb_cma_get_gem_obj(fb, plane_index); + if (WARN_ON(!obj)) + return; + paddr = obj->paddr + fb->offsets[plane_index]; + paddr += fb->format->cpp[plane_index] * + (plane->state->src_x >> 16) * tile_size; + paddr += (fb->pitches[plane_index] / tile_size) * + (plane->state->src_y >> 16); + + } else + paddr = drm_fb_cma_get_gem_addr(fb, plane->state, + plane_index); + + malidp_hw_write(mp->hwdev, lower_32_bits(paddr), ptr); + malidp_hw_write(mp->hwdev, upper_32_bits(paddr), ptr + 4); +} + static void malidp_de_plane_update(struct drm_plane *plane, struct drm_plane_state *old_state) { @@ -343,13 +385,7 @@ static void malidp_de_plane_update(struct drm_plane *plane, malidp_hw_write(mp->hwdev, val, mp->layer->base); for (i = 0; i < ms->n_planes; i++) { - /* calculate the offset for the layer's plane registers */ - u16 ptr = mp->layer->ptr + (i << 4); - dma_addr_t fb_addr = drm_fb_cma_get_gem_addr(plane->state->fb, - plane->state, i); - - malidp_hw_write(mp->hwdev, lower_32_bits(fb_addr), ptr); - malidp_hw_write(mp->hwdev, upper_32_bits(fb_addr), ptr + 4); + malidp_set_plane_base_addr(plane->state->fb, mp, i); } malidp_de_set_plane_pitches(mp, ms->n_planes, plane->state->fb->pitches);