From patchwork Fri Oct 12 16:35:51 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: 10638851 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 657E9157A for ; Fri, 12 Oct 2018 16:36:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5121B2BEEE for ; Fri, 12 Oct 2018 16:36:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4190E2BF8D; Fri, 12 Oct 2018 16:36:23 +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 C9E1E2BEEE for ; Fri, 12 Oct 2018 16:36:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6013A6E48F; Fri, 12 Oct 2018 16:36:20 +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-ve1eur02on0618.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe06::618]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88C3E6E48F for ; Fri, 12 Oct 2018 16:36:18 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.51) 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.1228.24; Fri, 12 Oct 2018 16:36:15 +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, daniel.vetter@ffwll.ch, raymond.smith@arm.com, david.garbett@arm.com, lisa.wu@arm.com, matt.szczesiak@arm.com, charles.xu@arm.com, james.qian.wang@arm.com Subject: [PATCH v4 0/9] Add method to describe tile/bit_level_packed formats Date: Fri, 12 Oct 2018 17:35:51 +0100 Message-Id: <20181012163600.20331-1-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [217.140.106.51] X-ClientProxiedBy: CWLP265CA0200.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:4e::20) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ef65d95-6166-4f8e-3ac7-08d63060d44d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:ZwCSl2xZw/U6ipH0wy98xKPoFN5REumuBW+h6BZjJyOJp8pq1QlibubMHQK4d8ykmx2d+acX6e/A1TZXnJUO+RF9WSPPxo73R1UNBisGZYwGwfPAb3J1298GPrgjk6mk9DY3C2tVG9TY8maXEGcFeovjdbn7FYia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Jp3CMHKWPZPMnJn4EGGjyOfTUTBX3jBWUl5ymCNVKdagAZLYxww4jYfK+YMM1NI49gK0WRRrN0SjG9M43CMW+mGpoScsKL2lmTqz3O41sPRwsMVj+MtrM=; 4:S1yxVLCyH8H5vNvLVMDG42FFXn4h4s0J6Ql2aODOJ4ny7RGm7ENcrmvtz0Xg4Y4/02HQKjhwijuIVTfeRzQdp95Wd6HEn5tDT9V+8sqiI7p8NZkFoeAr21E71Skl2yqOQCk3j0bzlEcFBNccewJMTl+dZ1kialukvmjhRoIRBhk5DcFsZVdiKXtA053vdNhtwSdyCveQmDVTiaPpKPM2v0Cn2w7SspzN14ZaR1bpQcNoMHCMLdeutnmLXXiwa5tVfefQhbx6b3x+BOI4TcYFVfrsycwjFrTEMBn/wzjPZyNOC/GXJmXWXeRigXdg/4Ww X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(217544274631240); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(376002)(366004)(199004)(189003)(6306002)(25786009)(4326008)(81156014)(72206003)(966005)(106356001)(105586002)(81166006)(478600001)(5660300001)(47776003)(97736004)(26005)(8936002)(50226002)(66066001)(476003)(16526019)(6486002)(186003)(2906002)(8676002)(316002)(16586007)(7696005)(50466002)(956004)(2616005)(486006)(6666004)(7736002)(305945005)(52116002)(48376002)(68736007)(51416003)(86362001)(36756003)(53936002)(386003)(1076002)(3846002)(6116002)(6636002)(921003)(1121003); 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:pmURuY0moQrahelpzFah7ZYCflJtpcgI6pnEVCF?= GJeYR6wmeN+pHe5Aui0Rd5caNxmglDSy6aS/EYU7sEdINvg37E/n/WvbGm1oVKYLOIvYqjJ71zKzVTjh94r1Td1viGM2pp5j/CW/+L9z42W4rodtzZ1HTLgaibXI7dYf/AtJfo8v6eoGRsBRZy8py1Uj2OpdEBfBS4Jd4z0I/yZB7gYipoY3spy+7ljVdbEyIp3FhT+Mk9E4YH0shzcTcoRmRF03YerJhLd7RKLQhKhOOEKj5YUXF5d16i8qHxmhXcjwRzzgGjDS03g6scGgvIUiIqj4Q7BH8ScGLmdyLhePAVPFLUO7g2oQv1aGTzIA6W6w0fss58X66ifjk+iklS1/grG8KjPBsSVXMc0W1TaLSWg8QVBicC632qGSzwLZccdl9oGpbTrKChllnoSuZPveEpio5fSim4WdAYMBro+B4brTx0SLFSFJq/lInMNyRYe4S/LzMsHwaXveRcrmVWDgXubPtwwu6P9rdKHZH0zzJIBgHVY+pvd3Q0LibLzcm+pfID2G2imE9S7Z+FfNV3rjO17z28KEWCBpVpVn0z3K376L4NXGjqoSX07KviRkKodAb2ms5OmlUmGLKwzO7bDpe2nryvJ7o5LY2RsQhnXHmvFLz0ua3DsU0mOd6gDWnHYYo0cFeGA9I13a6yMveleaQi8vRyNtSSgFsm3LLAQy/N6mctx4VinOdnOLSbjuMvgDC2d94BUOqDqoEZd51S9TkrvepNte3FP0bsvKotO14i4B+8hmUFodLYlZfPfTLILV/NCBiWIxsYYt3fEBJsKOoxPDqOex/Y39tEhjdnaWew1fK9ZsCWE9S0e6E+m3Hv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8gtgB+Zm+q+g1ALG8NXDU/W97gRUGbljWDALlmFuuIdFyYQ1HQTFw+IBQli2R+jyiFJYN618k0iz+l3iYjFoC+q5JM6gI0NX312apekGADbtHD74VaYcAnVYcqJD1wjy0Mok7kq3DYd+zrdK/q8JsBb4QrNtlM+TXw==; 5:m21FXcc2k1n9TG//4VBgG0l5QqaGeTEZbtKlndnMmU1BxhBPr244VQsIvVOvgh+mXd2t/TXtKrsWoo0jiui5Tx+Uh/+s1TfBVDLeRpV2ocFmQtFup/06EOB3v99zywhO/BtOeBEe4DvKJzpPGuTK1hpNRX4ytwTX3+TwJKuk8Mg=; 7:3HUOSd3AA+dXcLtbokBmo0uSVvekMUVVEznTjqNv9yvtHbpBZNed578ATxR11SpGn4Fo5Vht4ekvYMsAS0rca04MI6rL3EvrUoyAACaVRlGlifYG3/v8+jQK9DTG7w+/DbTednKpwsyX5BudfErEaOTibo+VEkSOJirejtrzDhzZe7zAKkPaMtymDdXq+gut9zL6PqgItqun/+VUiekpBXjxJMs1Gy90HkRiym0XBO6xpJWHyHmqWohD5U+rk8m/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 16:36:15.2895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ef65d95-6166-4f8e-3ac7-08d63060d44d 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 Changes since v3: - added an utility function that computes the minimum pitch. - switched drm_format_info to in-line member documentation. - Cleanup/Improved the kernel doc. - Added selftests for: drm_format_info* helpers. There has been some discussion about extending drm core to handle linear tile formats, in the series sent by me here [1] and how to handle formats that are intended to be used just with modifiers(particularly AFBC modifiers) on Brian series [2] and on IRC here [3] and [4]. Hence, this big-merged series: Patch 1: Just a preparation patch that converts the drm_format_info kerneldoc to in-line documentation. Patches 2-4: handle tiled formats both in core and in malidp driver, this is done by extending drm_format_info with three new fields char_per_block, block_w, block_h and consistently handle in the generic code paths, both linear tiled formats and normal formats. What's different from [1] is the interpretation of pitch for tile formats which has been kept to be the same as for the other formats: pitch = average_chars_per_pixel * width. Patches 5-7: Introduce the YUV AFBC formats, the only thing noteworthy here is that cpp/char_per_block are set to 0 for formats where it's mandatory to be used together with a non-linear modifier and then that is used to bypass pitch check in framebuffer_check for formats that have cpp/char_per_block set to 0. Patches 8-9: A small fix for test-drm-helper module and adds self tests for drm_format_info* helpers. For the other touched functions we need a bit more infrastructure to be able to unittest/selftest them, since they need a stub drm_device and drm_file. As a side note, igt master branch doesn't seem to be using test-drm-helper.ko, so I just tested by loading/unloading the module manually. [1] https://lists.freedesktop.org/archives/dri-devel/2018-September/188245.html [2] https://lists.freedesktop.org/archives/dri-devel/2018-September/189620.html [3] https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&highlight_names=&date=2018-09-13&show_html=true [4] https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&highlight_names=&date=2018-09-14&show_html=true Alexandru Gheorghe (7): drm: fourcc: Convert drm_format_info kerneldoc to in-line member documentation drm/fourcc: Add char_per_block, block_w and block_h in drm_format_info drm/fourcc: Add fourcc for Mali linear tiled formats drm: mali-dp: Enable Mali-DP tiled buffer formats drm: Extend framebuffer_check to handle formats with cpp/char_per_block 0 drm/selftests: Add module_exit for test-drm-helper drm/selftests: Add tests for drm_format_info* helpers Brian Starkey (2): drm/fourcc: Add AFBC yuv fourccs for Mali drm/afbc: Add AFBC modifier usage documentation Documentation/gpu/afbc.rst | 233 +++++++++++++++ Documentation/gpu/drivers.rst | 1 + MAINTAINERS | 1 + drivers/gpu/drm/arm/malidp_hw.c | 14 +- drivers/gpu/drm/arm/malidp_planes.c | 23 +- drivers/gpu/drm/drm_fb_cma_helper.c | 21 +- drivers/gpu/drm/drm_fb_helper.c | 6 + drivers/gpu/drm/drm_fourcc.c | 87 ++++++ drivers/gpu/drm/drm_framebuffer.c | 11 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 2 +- .../gpu/drm/selftests/drm_helper_selftests.h | 3 + drivers/gpu/drm/selftests/test-drm-helper.c | 271 ++++++++++++++++++ include/drm/drm_fourcc.h | 89 +++++- include/uapi/drm/drm_fourcc.h | 31 ++ 14 files changed, 770 insertions(+), 23 deletions(-) create mode 100644 Documentation/gpu/afbc.rst