From patchwork Thu Nov 1 15:11:29 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: 10664085 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 98158157A for ; Thu, 1 Nov 2018 15:11:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 881052BDE7 for ; Thu, 1 Nov 2018 15:11:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85E492C014; Thu, 1 Nov 2018 15:11:39 +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=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 A0C502BDE7 for ; Thu, 1 Nov 2018 15:11:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B8A26E3A8; Thu, 1 Nov 2018 15:11:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id F19166E392 for ; Thu, 1 Nov 2018 15:11:32 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:29 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:29 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 1/7] drm/fourcc: Add char_per_block, block_w and block_h in drm_format_info Thread-Topic: [RESEND v7 1/7] drm/fourcc: Add char_per_block, block_w and block_h in drm_format_info Thread-Index: AQHUcfUqhEfR7bf8GkSYVXKAgL3v9Q== Date: Thu, 1 Nov 2018 15:11:29 +0000 Message-ID: <20181101151051.1509-2-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:tIJL8sp23UOdBpwGFSWLZKP4KDH3Q+Vqf0vnLzN8AW5eVUXVjBlI0f2hEI9dfUnaVwTkRhfYBBkom/VvulbaKFGXo9aRgmDnEchC4fIcqHGl7pJVrO0loIMPQA51m+DPSiLRlBzPJRQP0QYPiKntAthrtbd12ZGBxSDFbMYNunUaewvjXQwBkqrtggTGtEXxwRriW506Havp4PIwzvgj3LlG1/4T8CzZQk4E0bPsbNp51uFdwqjnt2HlWvZi01o94TxyEVEFvLfWF5eH5kMUPfj1WXPG++uDYOtfW1oJGk5+ZkZ6g9M9cPqdGXjfpfM+G2cS6+NC/46Q2xdwGb/wo+zcI/24/zEkSneYXJWbGih3Ujw2vSdiiCTJy9LYGg9m4GaVuWRBX6aNKSKcbArryArUMmbvmvlQ26P+Fd2y/EGCrV7e6MFfBM0c3Wd/yUDjfe08YVGBLwLGjavbznwH4Q==; 5:+nVzNoz8YAkZHQNiuxPhug0CrAZd2jCdaLruSoqROHCY7908IsxmazTHAO6hvoecsxg6cW1PBjRC4KAaQO/JhW9YLgR5nPOM39xHqhDog811anGiWcYtAXKq2dwasnptPnFxjQ7Q4UVN+Tkxvl7+1Yh3ArqL1TYxY+neBfZ5b/k=; 7:IFUNMrVxWXoazb96yPz9XBBbwnX5kedPHgU1UycOE7SIGJiB4yZ6iqQk7yWsFyv1AZtghp33+pwVI+BD8PFgsQgYQzxTd7VphWWGPK5w6JQmLKkk9Lh1pshGGCuy9Oz/p5yfNQ2vOUuzas89qZ4aKQ== x-ms-office365-filtering-correlation-id: fb4c6a65-e747-4c84-73bf-08d6400c4cf3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(4744004)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(575784001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: hWV1UOEOWNBdB2chC7/+u8Y+qlVFEsAKFGRBX33tfdwMbMksOlChOH+PJqrTk3MjnY/w1CzowUdPY9C2yWGqqTwykvSvxizbpe9UGF8yJ01uf9cKhYelmmDAEr/ZYvmUIgiyJk6ZSTm3cS2cSVV6hKRA/5RO8VR+hZcYiZQakzXQFl/QQqcJvwCzaSiQk5h6b+VONr10xSPZeZgmwAZutEditt6Aqn2EpLil5+6ohFsLzcaE8WsR+i0J/Cg7QfxieY8XjyuCL2h2Gxx4Fa0s3JcsG+prKEK/ZS8xbqKetcZt36+pYdeHzy3OnJwCOTRDnepYhyGsni0aeiyRYT58g0Ikra1x7n1P7PQsH0D2B6w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb4c6a65-e747-4c84-73bf-08d6400c4cf3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:29.8535 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For some pixel formats .cpp structure in drm_format info it's not enough to describe the peculiarities of the pixel layout, for example tiled formats or packed formats at bit level. What's implemented here is to add three new members to drm_format_info that could describe such formats: - char_per_block[3] - block_w[3] - block_h[3] char_per_block will be put in a union alongside cpp, for transparent compatibility with the existing format descriptions. Regarding, block_w and block_h they are intended to be used through their equivalent getters drm_format_info_block_width / drm_format_info_block_height, the reason of the getters is to abstract the fact that for normal formats block_w and block_h will be unset/0, but the methods will be returning 1. Additionally, convenience function drm_format_info_min_pitch had been added that computes the minimum required pitch for a given pixel format and buffer width. Using that the following drm core functions had been updated to generically handle both block and non-block formats: - drm_fb_cma_get_gem_addr: for block formats it will just return the beginning of the block. - framebuffer_check: Use the newly added drm_format_info_min_pitch. - drm_gem_fb_create_with_funcs: Use the newly added drm_format_info_min_pitch. - In places where is not expecting to handle block formats, like fbdev helpers I just added some warnings in case the block width/height are greater than 1. Changes since v3: - Add helper function for computing the minimum required pitch. - Improve/cleanup documentation Reviewed-by: Brian Starkey Signed-off-by: Alexandru Gheorghe Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_cma_helper.c | 20 ++++++- drivers/gpu/drm/drm_fb_helper.c | 6 ++ drivers/gpu/drm/drm_fourcc.c | 62 ++++++++++++++++++++ drivers/gpu/drm/drm_framebuffer.c | 6 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 2 +- include/drm/drm_fourcc.h | 61 ++++++++++++++++++- 6 files changed, 148 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index fc2b42dd3dc6..b07ab3f613e0 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -72,7 +72,9 @@ struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj); /** - * drm_fb_cma_get_gem_addr() - Get physical address for framebuffer + * drm_fb_cma_get_gem_addr() - Get physical address for framebuffer, for pixel + * formats where values are grouped in blocks this will get you the beginning of + * the block * @fb: The framebuffer * @state: Which state of drm plane * @plane: Which plane @@ -87,6 +89,13 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, struct drm_gem_cma_object *obj; dma_addr_t paddr; u8 h_div = 1, v_div = 1; + u32 block_w = drm_format_info_block_width(fb->format, plane); + u32 block_h = drm_format_info_block_height(fb->format, plane); + u32 block_size = fb->format->char_per_block[plane]; + u32 sample_x; + u32 sample_y; + u32 block_start_y; + u32 num_hblocks; obj = drm_fb_cma_get_gem_obj(fb, plane); if (!obj) @@ -99,8 +108,13 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, v_div = fb->format->vsub; } - paddr += (fb->format->cpp[plane] * (state->src_x >> 16)) / h_div; - paddr += (fb->pitches[plane] * (state->src_y >> 16)) / v_div; + sample_x = (state->src_x >> 16) / h_div; + sample_y = (state->src_y >> 16) / v_div; + block_start_y = (sample_y / block_h) * block_h; + num_hblocks = sample_x / block_w; + + paddr += fb->pitches[plane] * block_start_y; + paddr += block_size * num_hblocks; return paddr; } diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 9b111e846847..8024524f0547 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1614,6 +1614,10 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, if (var->pixclock != 0 || in_dbg_master()) return -EINVAL; + if ((drm_format_info_block_width(fb->format, 0) > 1) || + (drm_format_info_block_height(fb->format, 0) > 1)) + return -EINVAL; + /* * Changes struct fb_var_screeninfo are currently not pushed back * to KMS, hence fail if different settings are requested. @@ -1988,6 +1992,8 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe { struct drm_framebuffer *fb = fb_helper->fb; + WARN_ON((drm_format_info_block_width(fb->format, 0) > 1) || + (drm_format_info_block_height(fb->format, 0) > 1)); info->pseudo_palette = fb_helper->pseudo_palette; info->var.xres_virtual = fb->width; info->var.yres_virtual = fb->height; diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 3934527e09dc..00c96dbdcad5 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -400,3 +400,65 @@ int drm_format_plane_height(int height, uint32_t format, int plane) return height / info->vsub; } EXPORT_SYMBOL(drm_format_plane_height); + +/** + * drm_format_info_block_width - width in pixels of block. + * @info: pixel format info + * @plane: plane index + * + * Returns: + * The width in pixels of a block, depending on the plane index. + */ +unsigned int drm_format_info_block_width(const struct drm_format_info *info, + int plane) +{ + if (!info || plane < 0 || plane >= info->num_planes) + return 0; + + if (!info->block_w[plane]) + return 1; + return info->block_w[plane]; +} +EXPORT_SYMBOL(drm_format_info_block_width); + +/** + * drm_format_info_block_height - height in pixels of a block + * @info: pixel format info + * @plane: plane index + * + * Returns: + * The height in pixels of a block, depending on the plane index. + */ +unsigned int drm_format_info_block_height(const struct drm_format_info *info, + int plane) +{ + if (!info || plane < 0 || plane >= info->num_planes) + return 0; + + if (!info->block_h[plane]) + return 1; + return info->block_h[plane]; +} +EXPORT_SYMBOL(drm_format_info_block_height); + +/** + * drm_format_info_min_pitch - computes the minimum required pitch in bytes + * @info: pixel format info + * @plane: plane index + * @buffer_width: buffer width in pixels + * + * Returns: + * The minimum required pitch in bytes for a buffer by taking into consideration + * the pixel format information and the buffer width. + */ +uint64_t drm_format_info_min_pitch(const struct drm_format_info *info, + int plane, unsigned int buffer_width) +{ + if (!info || plane < 0 || plane >= info->num_planes) + return 0; + + return DIV_ROUND_UP((u64)buffer_width * info->char_per_block[plane], + drm_format_info_block_width(info, plane) * + drm_format_info_block_height(info, plane)); +} +EXPORT_SYMBOL(drm_format_info_min_pitch); diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 3bf729d0aae5..6aca8a1ccdb6 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -195,20 +195,20 @@ static int framebuffer_check(struct drm_device *dev, for (i = 0; i < info->num_planes; i++) { unsigned int width = fb_plane_width(r->width, info, i); unsigned int height = fb_plane_height(r->height, info, i); - unsigned int cpp = info->cpp[i]; + u64 min_pitch = drm_format_info_min_pitch(info, i, width); if (!r->handles[i]) { DRM_DEBUG_KMS("no buffer object handle for plane %d\n", i); return -EINVAL; } - if ((uint64_t) width * cpp > UINT_MAX) + if (min_pitch > UINT_MAX) return -ERANGE; if ((uint64_t) height * r->pitches[i] + r->offsets[i] > UINT_MAX) return -ERANGE; - if (r->pitches[i] < width * cpp) { + if (r->pitches[i] < min_pitch) { DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index ded7a379ac35..acb466d25afc 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -171,7 +171,7 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file, } min_size = (height - 1) * mode_cmd->pitches[i] - + width * info->cpp[i] + + drm_format_info_min_pitch(info, i, width) + mode_cmd->offsets[i]; if (objs[i]->size < min_size) { diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index 345f11227e9e..bcb389f04618 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -69,8 +69,59 @@ struct drm_format_info { /** @num_planes: Number of color planes (1 to 3) */ u8 num_planes; - /** @cpp: Number of bytes per pixel (per plane) */ - u8 cpp[3]; + union { + /** + * @cpp: + * + * Number of bytes per pixel (per plane), this is aliased with + * @char_per_block. It is deprecated in favour of using the + * triplet @char_per_block, @block_w, @block_h for better + * describing the pixel format. + */ + u8 cpp[3]; + + /** + * @char_per_block: + * + * Number of bytes per block (per plane), where blocks are + * defined as a rectangle of pixels which are stored next to + * each other in a byte aligned memory region. Together with + * @block_w and @block_h this is used to properly describe tiles + * in tiled formats or to describe groups of pixels in packed + * formats for which the memory needed for a single pixel is not + * byte aligned. + * + * @cpp has been kept for historical reasons because there are + * a lot of places in drivers where it's used. In drm core for + * generic code paths the preferred way is to use + * @char_per_block, drm_format_info_block_width() and + * drm_format_info_block_height() which allows handling both + * block and non-block formats in the same way. + * + * For formats that are intended to be used only with non-linear + * modifiers both @cpp and @char_per_block must be 0 in the + * generic format table. Drivers could supply accurate + * information from their drm_mode_config.get_format_info hook + * if they want the core to be validating the pitch. + */ + u8 char_per_block[3]; + }; + + /** + * @block_w: + * + * Block width in pixels, this is intended to be accessed through + * drm_format_info_block_width() + */ + u8 block_w[3]; + + /** + * @block_h: + * + * Block height in pixels, this is intended to be accessed through + * drm_format_info_block_height() + */ + u8 block_h[3]; /** @hsub: Horizontal chroma subsampling factor */ u8 hsub; @@ -106,6 +157,12 @@ int drm_format_horz_chroma_subsampling(uint32_t format); int drm_format_vert_chroma_subsampling(uint32_t format); int drm_format_plane_width(int width, uint32_t format, int plane); int drm_format_plane_height(int height, uint32_t format, int plane); +unsigned int drm_format_info_block_width(const struct drm_format_info *info, + int plane); +unsigned int drm_format_info_block_height(const struct drm_format_info *info, + int plane); +uint64_t drm_format_info_min_pitch(const struct drm_format_info *info, + int plane, unsigned int buffer_width); const char *drm_get_format_name(uint32_t format, struct drm_format_name_buf *buf); #endif /* __DRM_FOURCC_H__ */ From patchwork Thu Nov 1 15:11:30 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: 10664087 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 ADFEE15E9 for ; Thu, 1 Nov 2018 15:11:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E2952C001 for ; Thu, 1 Nov 2018 15:11:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C8E22BFCC; Thu, 1 Nov 2018 15:11:41 +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=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 1F3CE2C014 for ; Thu, 1 Nov 2018 15:11:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D89B6E3AD; Thu, 1 Nov 2018 15:11:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8203E6E392 for ; Thu, 1 Nov 2018 15:11:33 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:30 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:30 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 2/7] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Topic: [RESEND v7 2/7] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Index: AQHUcfUrDXU7EaVFVEyngRjZtPu6yA== Date: Thu, 1 Nov 2018 15:11:30 +0000 Message-ID: <20181101151051.1509-3-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:vi2nVbOFIvxusex/J/t0BUbBP/1hByytdKkIiDZOI3N8CCZ0oMAKGg8eBRb5DM3Cs6BgjYIV54Q6eccEcAfm2u0V8VVxLIt1yHe7rKnn6wIq6QGuEyG/qp+l6xqiH9NDj+PzwfF1hT0Vauog/hE2yFIZReY0EuCESWGGWXJ2zBQXSCjSh+Wwod4QTT3xgY4+qko53aRZ5e7RTsCeKV8U3Xp8P71mIOvEEsFcgSEh/sejaj2e0EszjQ1lNEML/6VesFaMFCeqFi7j2eWNPxntiHB3Pt8BkvRq9/9im9Bxt6UVtNfN6thPN27NF5rSDUoGIfBToMIVNcT1+NEGo7Npe+1T+jPlTr72Tl5Wj7vFBcbqf7CijK1yqdd+wDv69ufnhyBWwXCquV8lvC1E8zmgvCBcE9vlNbQQkfOS4Q3rxc6UE9Q+BX9QUgSY04l4aee9bzWe85L9y3Bhvt8wmK5XUQ==; 5:4F4IrJM92h4Ry+WfMiAV0I9YIqNEFr+YtSe06zs22dRhd3U8IBa6PSxLgq95qlwGRp+FbflKQG2d0l6b83DeXp6y8nD+KB5VlKriWORRSRRDESruNQQMZp6ViG8P/yffgCSv0cd9P5Bl1TY5MqwpkGunQk7CMllVTxvDoaketh8=; 7:O9lLXvK63nu9XF+RF6p4LZb4F535Uuzv2AMBolhzHfJsLqmvWiVqFjf5VjTkbLhqsf3pwGNgg6DSfBWTDjWaNmVfWxQ5ZgX1ayga3fJZW4icnCFMsnHvnRzRrJgaiiYR2koXjBvaGEQiSClsvSFsOA== x-ms-office365-filtering-correlation-id: 1ee3f186-b613-492e-5d9c-08d6400c4d5c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(575784001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Osu47D3GEj/HVEnxhtYsbVJV0CxVJZszrTL1UJLXYViYgE2I8mUMPcIyng97OlN3on91VW6w8XQTrLDneZCgIKNzHsY7Xn809xByxI7lS9IMTDXbdJunu8Lg84oNc1Ntpnghr2JLGRY4QJgBhDCh06lzYK4pTUndATh3xNLxP7mlY7rauAPVQ5kFVJfMta21w3nCUSvxnZkrc+3/pzy5byvd3zN314iiMGNSvbYckO/viNhpusc+YynyAZYLp0pntuLaztxk79bmIhPxJB7g+NKCw9EimTZamuUAM95/xdCyeNS7lGbrGqpHSmJc+1fEiR3ye+wnp2xUNPFRHn3xNSqtHaJEZqc2kjZweTqYPt0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ee3f186-b613-492e-5d9c-08d6400c4d5c X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:30.4470 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Mali-DP implements a number of tiled yuv formats which are not currently described in drm_fourcc.h. This adds those definitions and describes their memory layout by using the newly added char_per_block, block_w, block_h. Reviewed-by: Brian Starkey Reviewed-by: Daniel Vetter Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/drm_fourcc.c | 12 ++++++++++++ include/uapi/drm/drm_fourcc.h | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 00c96dbdcad5..aaae6152ee5e 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -225,6 +225,18 @@ 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_Y0L0, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 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 0cd40ebfa1b1..e7e48f1f4a74 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -152,6 +152,20 @@ extern "C" { #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 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 * index 0 = RGB plane, same format as the corresponding non _A8 format has From patchwork Thu Nov 1 15:11:31 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: 10664095 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 82DF615E9 for ; Thu, 1 Nov 2018 15:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 715412BF6A for ; Thu, 1 Nov 2018 15:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F6AD2C026; Thu, 1 Nov 2018 15:11:53 +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=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 0291D2C00B for ; Thu, 1 Nov 2018 15:11:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CFF1D6E3D1; Thu, 1 Nov 2018 15:11:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 124E16E392 for ; Thu, 1 Nov 2018 15:11:34 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:31 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:31 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 3/7] drm: mali-dp: Enable Mali-DP tiled buffer formats Thread-Topic: [RESEND v7 3/7] drm: mali-dp: Enable Mali-DP tiled buffer formats Thread-Index: AQHUcfUr5NTlsCsWPki4/WCIPtdAxw== Date: Thu, 1 Nov 2018 15:11:31 +0000 Message-ID: <20181101151051.1509-4-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:7ssj3VS73THQtStZr/leOxQAijCVY1dfEPnzkHu3lHtmRzNfHIwpHyRG3pvOg1J9RC/EAzWUXsvyIBHdHo0OT2+X5DXB19+lLF+/WwauqFqeWpeS8RKpGbZg4Cvr16wGKhNo3BXlYuEHkqAJhh9Dmq3WHYIEiIY05F7VUMEO77RhMOTT6x2YKfDctLBypnbJqSv07zMBrET0DwIe9MVnd4tDt8Jd3qDYPyhP3FSwaxwUJ269SRMmXkqpBh8ok6xTFBo2b1HzL9X0No577wyF7GilN93jmxh9qWoPgv+wwmzLFiCqYNoiKVVtjpfO63JwIQYxRc8ljH/EY7myOhh0d+5plW2KRFGx8yALDnL0LYy0slcXrOOZZTGBBHWgRYXwnfXGTyDZi3v/L3DURjExlYeRjK9DMNcxW/YSm+YBSqL+kUPLGp44GsYjDGLVU40PSI5N04kfjf0DkZ5PATJTng==; 5:TM44Bdm/h1IPvFX4FeH4ftRTndtLH03iKpN5+tcuvC05WR5q3h3k75cRntvzgm+zOoRlPyrl+nWrU9hg30fjS6Li+8gnbhR6FaBc1D9izs9JSxGE9YS3VyTp7Z32tUQnFpkRGBrBv9UOS9n4Ua7nk5xV9fx1OgY6Iak7vFthpYI=; 7:vV4UFnL6usP7Qlb85z7b3U0mSAJ6hv7FM2eYanWrmj3UzpgPaEJ0V4athZ2NmRW/cS4sENDi1LqFet9WePuFUNcuDnmHJXaGxrhOe3CCnFQaJOXk3kry7prdzl5f2i4Oe2TiHx8ig16voqfPTMHCJw== x-ms-office365-filtering-correlation-id: 82f26211-4c53-4dd4-8cc2-08d6400c4db5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(45080400002)(68736007)(486006)(106356001)(6486002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(575784001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Lw/8DDvw3ZSuhLNT2nfjrDOwhjFylU2lXquaZ2HBGAbcE/q4Vzua2LspNKCOGbOXTs7fDMIzSncuSy6g9hUBNThARCQcZyzQLv/p4DDtSn0/0ER9iSNAsGT9JNB+n/Fuu19jzkmpbZIJht5+VINDJGzRUgkhcQI16MqIiLDz8Y11saXJP8emv8sLASBiJWm/8zN48dNcysFjg4nMs7TsxTBrQ8/amghqjq5+J8Ie92HpQUkpCVKQMdmhyBRqWSeNE1GzDysbRO82y0sM7ulNwKJbLEPb8bFu2aFs1qWU6wPJyb4br6hdgLJ+A/cQN75bc2G7hlD6uihcWA7YkMxgR5hzXhf6mbd4Ac216bfPECg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82f26211-4c53-4dd4-8cc2-08d6400c4db5 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:31.1086 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Enable the following formats - DRM_FORMAT_X0L0: DP650 - DRM_FORMAT_X0L2: DP550, DP650 Reviewed-by: Brian Starkey Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/arm/malidp_hw.c | 14 +++++++++++--- drivers/gpu/drm/arm/malidp_planes.c | 28 +++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c index 7aad7dd80d8c..b9bed1138fa3 100644 --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c @@ -77,12 +77,18 @@ static const struct malidp_format_id malidp500_de_formats[] = { { DRM_FORMAT_YUYV, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 2) }, \ { DRM_FORMAT_UYVY, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 3) }, \ { 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_X0L2, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(6, 6)} static const struct malidp_format_id malidp550_de_formats[] = { MALIDP_COMMON_FORMATS, }; +static const struct malidp_format_id malidp650_de_formats[] = { + MALIDP_COMMON_FORMATS, + { DRM_FORMAT_X0L0, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 4)}, +}; + static const struct malidp_layer malidp500_layers[] = { /* id, base address, fb pointer address base, stride offset, * yuv2rgb matrix offset, mmu control register offset, rotation_features @@ -630,6 +636,8 @@ static int malidp550_rotmem_required(struct malidp_hw_device *hwdev, u16 w, u16 case DRM_FORMAT_BGR565: case DRM_FORMAT_UYVY: case DRM_FORMAT_YUYV: + case DRM_FORMAT_X0L0: + case DRM_FORMAT_X0L2: bytes_per_col = 32; break; /* 16 lines at 1.5 bytes per pixel */ @@ -905,8 +913,8 @@ const struct malidp_hw malidp_device[MALIDP_MAX_DEVICES] = { MALIDP550_DC_IRQ_SE, .vsync_irq = MALIDP550_DC_IRQ_CONF_VALID, }, - .pixel_formats = malidp550_de_formats, - .n_pixel_formats = ARRAY_SIZE(malidp550_de_formats), + .pixel_formats = malidp650_de_formats, + .n_pixel_formats = ARRAY_SIZE(malidp650_de_formats), .bus_align_bytes = 16, }, .query_hw = malidp650_query_hw, diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 837a24d56675..c9a6d3e0cada 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -398,6 +398,7 @@ static int malidp_de_plane_check(struct drm_plane *plane, struct drm_framebuffer *fb; u16 pixel_alpha = state->pixel_blend_mode; int i, ret; + unsigned int block_w, block_h; if (!state->crtc || !state->fb) return 0; @@ -413,13 +414,26 @@ static int malidp_de_plane_check(struct drm_plane *plane, ms->n_planes = fb->format->num_planes; for (i = 0; i < ms->n_planes; i++) { u8 alignment = malidp_hw_get_pitch_align(mp->hwdev, rotated); - if (fb->pitches[i] & (alignment - 1)) { + + if ((fb->pitches[i] * drm_format_info_block_height(fb->format, i)) + & (alignment - 1)) { DRM_DEBUG_KMS("Invalid pitch %u for plane %d\n", fb->pitches[i], i); return -EINVAL; } } + block_w = drm_format_info_block_width(fb->format, 0); + block_h = drm_format_info_block_height(fb->format, 0); + if (fb->width % block_w || fb->height % block_h) { + DRM_DEBUG_KMS("Buffer width/height needs to be a multiple of tile sizes"); + return -EINVAL; + } + if ((state->src_x >> 16) % block_w || (state->src_y >> 16) % block_h) { + DRM_DEBUG_KMS("Plane src_x/src_y needs to be a multiple of tile sizes"); + return -EINVAL; + } + if ((state->crtc_w > mp->hwdev->max_line_size) || (state->crtc_h > mp->hwdev->max_line_size) || (state->crtc_w < mp->hwdev->min_line_size) || @@ -492,10 +506,18 @@ static void malidp_de_set_plane_pitches(struct malidp_plane *mp, num_strides = (mp->hwdev->hw->features & MALIDP_DEVICE_LV_HAS_3_STRIDES) ? 3 : 2; - for (i = 0; i < num_strides; ++i) - malidp_hw_write(mp->hwdev, pitches[i], + /* + * The drm convention for pitch is that it needs to cover width * cpp, + * but our hardware wants the pitch/stride to cover all rows included + * in a tile. + */ + for (i = 0; i < num_strides; ++i) { + unsigned int block_h = drm_format_info_block_height(mp->base.state->fb->format, i); + + malidp_hw_write(mp->hwdev, pitches[i] * block_h, mp->layer->base + mp->layer->stride_offset + i * 4); + } } static const s16 From patchwork Thu Nov 1 15:11:31 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: 10664091 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 F3543157A for ; Thu, 1 Nov 2018 15:11:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E34332BF83 for ; Thu, 1 Nov 2018 15:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6EBE2C02E; Thu, 1 Nov 2018 15:11:45 +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=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 75FD72C03C for ; Thu, 1 Nov 2018 15:11:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 404B06E3AF; Thu, 1 Nov 2018 15:11:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 970CE6E392 for ; Thu, 1 Nov 2018 15:11:34 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:31 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:31 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 4/7] drm: Extend framebuffer_check to handle formats with cpp/char_per_block 0 Thread-Topic: [RESEND v7 4/7] drm: Extend framebuffer_check to handle formats with cpp/char_per_block 0 Thread-Index: AQHUcfUr8T4hS6Q7kEKSCwfi4KyA7A== Date: Thu, 1 Nov 2018 15:11:31 +0000 Message-ID: <20181101151051.1509-5-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:G2dCr1AA7s5DOYhfYTC5pBk+t5Z2Qk4wsFp/2lk1dpWGo0Y5sIzKGB0L+9vlGB/TLwE00kJgG1igz+bQlksgnxHty22pSwPNkjep3nLBEs4OMIKQFelk8u2CztJfa6plhNTdfsDsPG7nwFVcKB3SLCa34LrAuwOiFAJwyqTTY3jsJSs6+lBfoE1Dsnhcd2/B9UykPJ+FZfJHF24+x74svgJF6fTQM7yxTC220OTH39wrR9UHsq2nNN8J5vufiRrr9EvVbYIo8ujxC1cnoKI21ZE5gGYLL/8yANg1xh5BDRsD4DN8i+8FN/uLaZayWHENmEugXnFTELBHJhBf78vWBZuv/R4Kw8gR5XpH8v+isgzNzRhz+bEmADrQFAFs/6hiifq0wrab/WeM28AtBGRXnAq29z4+uK1UasCYHqbcWtZlke/bjhvB/BDipnuTUAOrJg8zFmKY3r1ckSqDBznBsw==; 5:eN+e5Cc+dUA06uydDBHivrtxZZFhCTcyaGiurupIMnw/AnW4jrNHfNPmifbN1eVi6a1kX70x80sua7mPFiblz+4lfzSkhpZc7lAuH0F+KK9NOKwRaatR69NuBXY4ZwDwtz7UM8DU9lsJQOJmV6RhpQs1tKpmXgQDc0PavQ7d5SM=; 7:tBxPJy5z9UC4FCWNeAwK6joq6RzqqwwpG493sFlp6IutL437NmMy2md6VJjylxnYiuMApf5jeddR+tkqNWOONEE2Cns35hWEq6VqfQEWPjgs5zW1sb3V137YdB+d0Z4UbPDw5wPiDdOKFfs77axlqw== x-ms-office365-filtering-correlation-id: 981386ab-c94d-4084-f377-08d6400c4e1a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(6306002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(71200400001)(72206003)(5660300001)(966005)(8676002)(81166006)(14454004)(186003)(14444005)(5024004)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 7KC+qGHdQmZa+bUaWcsx1pO0PtiSLNXWpdG/gqxcQa6mXM9cIw5VTwvBQWlGcoaHC4dT2KGuD3ZFROupBuct0SFL7k787ITT3DHD9Q831KT0sbyoRCXzBMUYnqquXuEqBeN9dXsnfmWoqNmH3Lx6epXwmREd0gOcKghPZlgkee2YBCwzGih5YXHZl4CqB7KUR5YZGpb+fc2lEtntDJRaHk7cUD7CQG2sZwEHogU1qgAQ0ScCgypb+RmfcJ5JNV9Z6s+MVflBa6iKyPVGz6IvtF+Ps6C4mPUB2Rpdqj3sLJl0aegCMPFKpHS3RLs4cC7F5QinNjtqmM048NYr5K0q+LW62cJLZD+qkQP0JN2Nfh8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 981386ab-c94d-4084-f377-08d6400c4e1a X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:31.7010 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For formats that are supported only with non-linear modifiers it doesn't make to much sense to define cpp or char_per_block, so that will be set to 0. This patch adds a restriction to force having a modifier attached when cpp/char_per_block is 0, and to bypass checking the pitch restriction. This had been discussed here. [1] https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&highlight_names=&date=2018-09-13&show_html=true Reviewed-by: Brian Starkey Signed-off-by: Alexandru Gheorghe Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_framebuffer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 6aca8a1ccdb6..167c1c4544af 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -195,8 +195,14 @@ static int framebuffer_check(struct drm_device *dev, for (i = 0; i < info->num_planes; i++) { unsigned int width = fb_plane_width(r->width, info, i); unsigned int height = fb_plane_height(r->height, info, i); + unsigned int block_size = info->char_per_block[i]; u64 min_pitch = drm_format_info_min_pitch(info, i, width); + if (!block_size && (r->modifier[i] == DRM_FORMAT_MOD_LINEAR)) { + DRM_DEBUG_KMS("Format requires non-linear modifier for plane %d\n", i); + return -EINVAL; + } + if (!r->handles[i]) { DRM_DEBUG_KMS("no buffer object handle for plane %d\n", i); return -EINVAL; @@ -208,7 +214,7 @@ static int framebuffer_check(struct drm_device *dev, if ((uint64_t) height * r->pitches[i] + r->offsets[i] > UINT_MAX) return -ERANGE; - if (r->pitches[i] < min_pitch) { + if (block_size && r->pitches[i] < min_pitch) { DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i); return -EINVAL; } From patchwork Thu Nov 1 15:11:32 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: 10664093 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 95E99157A for ; Thu, 1 Nov 2018 15:11:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83CDF2BFB4 for ; Thu, 1 Nov 2018 15:11:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FD6A2C010; Thu, 1 Nov 2018 15:11:49 +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=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 940982C023 for ; Thu, 1 Nov 2018 15:11:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 222B76E3B9; Thu, 1 Nov 2018 15:11:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 288326E3AE for ; Thu, 1 Nov 2018 15:11:35 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:32 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:32 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 5/7] drm/selftests: Add tests for drm_format_info* helpers Thread-Topic: [RESEND v7 5/7] drm/selftests: Add tests for drm_format_info* helpers Thread-Index: AQHUcfUs9cdno0W8T0qLgJ80Ecgwjg== Date: Thu, 1 Nov 2018 15:11:32 +0000 Message-ID: <20181101151051.1509-6-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:EtdKhYVRbUf4dJHgM//hhbOEgIeDdcHcBOj1kHOBkhs6nhAlwgQEpvpj5CtbgQh+QM7B5yfrmk59gK4EVO6Q7kM/Htugx8pEHbG/wJXPdbWNq0gRnKI0KJjcp3wC0ZhpIwWey9IZP4hlhX1pSge5tCrQbxriGpIjgl6j1Y3/JfzvBfM5wdwQfCcEp/m0BrRHSfMtvjbI6qyohPAsDR3wnzlyf+Mf0DkpJqfVfqcM+ZWdHasSudSJHX2HAdboLAzQLRBDN93CATNs0XceOECuVvOodl2Brmxd44uLtLlaWVi+OUhe4BYogHH8b7mzfzeqU7e5h32Muek8R1i74p7bHtPp3mE8Ab4vuEJLLWcEye8zSj5fQnOoAvhAtKtUKaS5fHGFpbu5iYHM+c5h3zoDI6Z6qYVVgv1lNvU6nGgLBUou4LISnl5o89VikeTS2d2LMDYfVwyjgDa0By/cQHzejA==; 5:HM+/Z+5mKpffcqHuKv7DKAeCkWTpTwRb3yJLwDivC+f577eAG/Xjz+7xlmfOUOrM5ubp/PwvyfWsUmJDR23cp2PfNGp7X2UgT3Nbe5z4m3uwACeKp8nrinnbqnK/MgP8Y7+Z1I558qG/pmee6bN1Z61ingnGMQMXLMiii/fQEbw=; 7:b0JHNcy4+UOUXM+sC/Fi6scO5CirnuhJlWhuvEn5z9+mkSIzSpZFfrRKa/wc8B4w6mFUGst9N2fsejn6Wk4F/WxW4ifeQVC9LEyJoflQki3gDsT36JNJyz4jhpiWcmZ1Gktr4gLC04kY08mwYOEU9A== x-ms-office365-filtering-correlation-id: 415d2aa5-91bb-4123-45f0-08d6400c4e76 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(4744004)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(575784001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(14444005)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: O/ZZ2jQ/HgaDYKDSaAWJpboBCnM3wbIkdYG+ntgqxcUW9ryLh/OSA3zuLnlUSmy7UyK98ybsxu3Llg4BTFzIEi9JPTAxnlVvHYGy5A7hE645sWbOFUKMAhfKFNUIEFiJTEkNvGQaD0E0yLAz2C+rnejknxDOe0p1zMJ4BAoSP8GLLWWAxZ9GlIQJUXfYYlE9xRD/KLmW/actPov+KaC8QJfkH0QoksWKr95eUeioIWMqcFcLQrbRm+thXRvk7sZ+5AvKHY0ZuTj2DfR6hSXaAd9sjy9dV3RqelqTs9+YrRhxVy9oV/IubAw/iMgNT7ZqB05Z037kqa5NjZsiTSEI4VRn8fnvd2yA4avt2/pPMOg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 415d2aa5-91bb-4123-45f0-08d6400c4e76 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:32.4677 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add selftests for the following newly added functions: - drm_format_info_block_width - drm_format_info_block_height - drm_format_info_min_pitch Signed-off-by: Alexandru Gheorghe Reviewed-by: Daniel Vetter --- drivers/gpu/drm/selftests/Makefile | 3 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 3 + drivers/gpu/drm/selftests/test-drm_format.c | 280 ++++++++++++++++++ .../drm/selftests/test-drm_modeset_common.h | 3 + 4 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/selftests/test-drm_format.c diff --git a/drivers/gpu/drm/selftests/Makefile b/drivers/gpu/drm/selftests/Makefile index 7e6581921da0..07b4f88b422a 100644 --- a/drivers/gpu/drm/selftests/Makefile +++ b/drivers/gpu/drm/selftests/Makefile @@ -1,3 +1,4 @@ -test-drm_modeset-y := test-drm_modeset_common.o test-drm_plane_helper.o +test-drm_modeset-y := test-drm_modeset_common.o test-drm_plane_helper.o \ + test-drm_format.o obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o diff --git a/drivers/gpu/drm/selftests/drm_modeset_selftests.h b/drivers/gpu/drm/selftests/drm_modeset_selftests.h index 9771290ed228..4e203ac8c134 100644 --- a/drivers/gpu/drm/selftests/drm_modeset_selftests.h +++ b/drivers/gpu/drm/selftests/drm_modeset_selftests.h @@ -7,3 +7,6 @@ * Tests are executed in order by igt/drm_selftests_helper */ selftest(check_plane_state, igt_check_plane_state) +selftest(check_drm_format_block_width, igt_check_drm_format_block_width) +selftest(check_drm_format_block_height, igt_check_drm_format_block_height) +selftest(check_drm_format_min_pitch, igt_check_drm_format_min_pitch) diff --git a/drivers/gpu/drm/selftests/test-drm_format.c b/drivers/gpu/drm/selftests/test-drm_format.c new file mode 100644 index 000000000000..c5e212afa27a --- /dev/null +++ b/drivers/gpu/drm/selftests/test-drm_format.c @@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Test cases for the drm_format functions + */ + +#define pr_fmt(fmt) "drm_format: " fmt + +#include +#include + +#include + +#include "test-drm_modeset_common.h" + +int igt_check_drm_format_block_width(void *ignored) +{ + const struct drm_format_info *info = NULL; + + /* Test invalid arguments */ + FAIL_ON(drm_format_info_block_width(info, 0) != 0); + FAIL_ON(drm_format_info_block_width(info, -1) != 0); + FAIL_ON(drm_format_info_block_width(info, 1) != 0); + + /* Test 1 plane format */ + info = drm_format_info(DRM_FORMAT_XRGB4444); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_width(info, 0) != 1); + FAIL_ON(drm_format_info_block_width(info, 1) != 0); + FAIL_ON(drm_format_info_block_width(info, -1) != 0); + + /* Test 2 planes format */ + info = drm_format_info(DRM_FORMAT_NV12); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_width(info, 0) != 1); + FAIL_ON(drm_format_info_block_width(info, 1) != 1); + FAIL_ON(drm_format_info_block_width(info, 2) != 0); + FAIL_ON(drm_format_info_block_width(info, -1) != 0); + + /* Test 3 planes format */ + info = drm_format_info(DRM_FORMAT_YUV422); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_width(info, 0) != 1); + FAIL_ON(drm_format_info_block_width(info, 1) != 1); + FAIL_ON(drm_format_info_block_width(info, 2) != 1); + FAIL_ON(drm_format_info_block_width(info, 3) != 0); + FAIL_ON(drm_format_info_block_width(info, -1) != 0); + + /* Test a tiled format */ + info = drm_format_info(DRM_FORMAT_X0L0); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_width(info, 0) != 2); + FAIL_ON(drm_format_info_block_width(info, 1) != 0); + FAIL_ON(drm_format_info_block_width(info, -1) != 0); + + return 0; +} + +int igt_check_drm_format_block_height(void *ignored) +{ + const struct drm_format_info *info = NULL; + + /* Test invalid arguments */ + FAIL_ON(drm_format_info_block_height(info, 0) != 0); + FAIL_ON(drm_format_info_block_height(info, -1) != 0); + FAIL_ON(drm_format_info_block_height(info, 1) != 0); + + /* Test 1 plane format */ + info = drm_format_info(DRM_FORMAT_XRGB4444); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_height(info, 0) != 1); + FAIL_ON(drm_format_info_block_height(info, 1) != 0); + FAIL_ON(drm_format_info_block_height(info, -1) != 0); + + /* Test 2 planes format */ + info = drm_format_info(DRM_FORMAT_NV12); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_height(info, 0) != 1); + FAIL_ON(drm_format_info_block_height(info, 1) != 1); + FAIL_ON(drm_format_info_block_height(info, 2) != 0); + FAIL_ON(drm_format_info_block_height(info, -1) != 0); + + /* Test 3 planes format */ + info = drm_format_info(DRM_FORMAT_YUV422); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_height(info, 0) != 1); + FAIL_ON(drm_format_info_block_height(info, 1) != 1); + FAIL_ON(drm_format_info_block_height(info, 2) != 1); + FAIL_ON(drm_format_info_block_height(info, 3) != 0); + FAIL_ON(drm_format_info_block_height(info, -1) != 0); + + /* Test a tiled format */ + info = drm_format_info(DRM_FORMAT_X0L0); + FAIL_ON(!info); + FAIL_ON(drm_format_info_block_height(info, 0) != 2); + FAIL_ON(drm_format_info_block_height(info, 1) != 0); + FAIL_ON(drm_format_info_block_height(info, -1) != 0); + + return 0; +} + +int igt_check_drm_format_min_pitch(void *ignored) +{ + const struct drm_format_info *info = NULL; + + /* Test invalid arguments */ + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + + /* Test 1 plane 8 bits per pixel format */ + info = drm_format_info(DRM_FORMAT_RGB332); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) != 1); + FAIL_ON(drm_format_info_min_pitch(info, 0, 2) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, 640) != 640); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1024) != 1024); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1920) != 1920); + FAIL_ON(drm_format_info_min_pitch(info, 0, 4096) != 4096); + FAIL_ON(drm_format_info_min_pitch(info, 0, 671) != 671); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) != + (uint64_t)UINT_MAX); + FAIL_ON(drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)) != + (uint64_t)(UINT_MAX - 1)); + + /* Test 1 plane 16 bits per pixel format */ + info = drm_format_info(DRM_FORMAT_XRGB4444); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, 2) != 4); + FAIL_ON(drm_format_info_min_pitch(info, 0, 640) != 1280); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1024) != 2048); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1920) != 3840); + FAIL_ON(drm_format_info_min_pitch(info, 0, 4096) != 8192); + FAIL_ON(drm_format_info_min_pitch(info, 0, 671) != 1342); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) != + (uint64_t)UINT_MAX * 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)) != + (uint64_t)(UINT_MAX - 1) * 2); + + /* Test 1 plane 24 bits per pixel format */ + info = drm_format_info(DRM_FORMAT_RGB888); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) != 3); + FAIL_ON(drm_format_info_min_pitch(info, 0, 2) != 6); + FAIL_ON(drm_format_info_min_pitch(info, 0, 640) != 1920); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1024) != 3072); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1920) != 5760); + FAIL_ON(drm_format_info_min_pitch(info, 0, 4096) != 12288); + FAIL_ON(drm_format_info_min_pitch(info, 0, 671) != 2013); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) != + (uint64_t)UINT_MAX * 3); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX - 1) != + (uint64_t)(UINT_MAX - 1) * 3); + + /* Test 1 plane 32 bits per pixel format */ + info = drm_format_info(DRM_FORMAT_ABGR8888); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) != 4); + FAIL_ON(drm_format_info_min_pitch(info, 0, 2) != 8); + FAIL_ON(drm_format_info_min_pitch(info, 0, 640) != 2560); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1024) != 4096); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1920) != 7680); + FAIL_ON(drm_format_info_min_pitch(info, 0, 4096) != 16384); + FAIL_ON(drm_format_info_min_pitch(info, 0, 671) != 2684); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) != + (uint64_t)UINT_MAX * 4); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX - 1) != + (uint64_t)(UINT_MAX - 1) * 4); + + /* Test 2 planes format */ + info = drm_format_info(DRM_FORMAT_NV12); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 2, 0) != 0); + + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) != 1); + FAIL_ON(drm_format_info_min_pitch(info, 1, 1) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, 2) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 1, 1) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, 640) != 640); + FAIL_ON(drm_format_info_min_pitch(info, 1, 320) != 640); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1024) != 1024); + FAIL_ON(drm_format_info_min_pitch(info, 1, 512) != 1024); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1920) != 1920); + FAIL_ON(drm_format_info_min_pitch(info, 1, 960) != 1920); + FAIL_ON(drm_format_info_min_pitch(info, 0, 4096) != 4096); + FAIL_ON(drm_format_info_min_pitch(info, 1, 2048) != 4096); + FAIL_ON(drm_format_info_min_pitch(info, 0, 671) != 671); + FAIL_ON(drm_format_info_min_pitch(info, 1, 336) != 672); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) != + (uint64_t)UINT_MAX); + FAIL_ON(drm_format_info_min_pitch(info, 1, UINT_MAX / 2 + 1) != + (uint64_t)UINT_MAX + 1); + FAIL_ON(drm_format_info_min_pitch(info, 0, (UINT_MAX - 1)) != + (uint64_t)(UINT_MAX - 1)); + FAIL_ON(drm_format_info_min_pitch(info, 1, (UINT_MAX - 1) / 2) != + (uint64_t)(UINT_MAX - 1)); + + /* Test 3 planes 8 bits per pixel format */ + info = drm_format_info(DRM_FORMAT_YUV422); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 2, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 3, 0) != 0); + + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) != 1); + FAIL_ON(drm_format_info_min_pitch(info, 1, 1) != 1); + FAIL_ON(drm_format_info_min_pitch(info, 2, 1) != 1); + FAIL_ON(drm_format_info_min_pitch(info, 0, 2) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 1, 2) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 2, 2) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, 640) != 640); + FAIL_ON(drm_format_info_min_pitch(info, 1, 320) != 320); + FAIL_ON(drm_format_info_min_pitch(info, 2, 320) != 320); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1024) != 1024); + FAIL_ON(drm_format_info_min_pitch(info, 1, 512) != 512); + FAIL_ON(drm_format_info_min_pitch(info, 2, 512) != 512); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1920) != 1920); + FAIL_ON(drm_format_info_min_pitch(info, 1, 960) != 960); + FAIL_ON(drm_format_info_min_pitch(info, 2, 960) != 960); + FAIL_ON(drm_format_info_min_pitch(info, 0, 4096) != 4096); + FAIL_ON(drm_format_info_min_pitch(info, 1, 2048) != 2048); + FAIL_ON(drm_format_info_min_pitch(info, 2, 2048) != 2048); + FAIL_ON(drm_format_info_min_pitch(info, 0, 671) != 671); + FAIL_ON(drm_format_info_min_pitch(info, 1, 336) != 336); + FAIL_ON(drm_format_info_min_pitch(info, 2, 336) != 336); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) != + (uint64_t)UINT_MAX); + FAIL_ON(drm_format_info_min_pitch(info, 1, UINT_MAX / 2 + 1) != + (uint64_t)UINT_MAX / 2 + 1); + FAIL_ON(drm_format_info_min_pitch(info, 2, UINT_MAX / 2 + 1) != + (uint64_t)UINT_MAX / 2 + 1); + FAIL_ON(drm_format_info_min_pitch(info, 0, (UINT_MAX - 1) / 2) != + (uint64_t)(UINT_MAX - 1) / 2); + FAIL_ON(drm_format_info_min_pitch(info, 1, (UINT_MAX - 1) / 2) != + (uint64_t)(UINT_MAX - 1) / 2); + FAIL_ON(drm_format_info_min_pitch(info, 2, (UINT_MAX - 1) / 2) != + (uint64_t)(UINT_MAX - 1) / 2); + + /* Test tiled format */ + info = drm_format_info(DRM_FORMAT_X0L2); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) != 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) != 0); + + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) != 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, 2) != 4); + FAIL_ON(drm_format_info_min_pitch(info, 0, 640) != 1280); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1024) != 2048); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1920) != 3840); + FAIL_ON(drm_format_info_min_pitch(info, 0, 4096) != 8192); + FAIL_ON(drm_format_info_min_pitch(info, 0, 671) != 1342); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) != + (uint64_t)UINT_MAX * 2); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX - 1) != + (uint64_t)(UINT_MAX - 1) * 2); + + return 0; +} diff --git a/drivers/gpu/drm/selftests/test-drm_modeset_common.h b/drivers/gpu/drm/selftests/test-drm_modeset_common.h index b0065a2eb067..592a6581b189 100644 --- a/drivers/gpu/drm/selftests/test-drm_modeset_common.h +++ b/drivers/gpu/drm/selftests/test-drm_modeset_common.h @@ -14,5 +14,8 @@ #define FAIL_ON(x) FAIL((x), "%s", "FAIL_ON(" __stringify(x) ")\n") int igt_check_plane_state(void *ignored); +int igt_check_drm_format_block_width(void *ignored); +int igt_check_drm_format_block_height(void *ignored); +int igt_check_drm_format_min_pitch(void *ignored); #endif From patchwork Thu Nov 1 15:11:32 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: 10664089 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 A58A2157A for ; Thu, 1 Nov 2018 15:11:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97B6A2C000 for ; Thu, 1 Nov 2018 15:11:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BF622C026; Thu, 1 Nov 2018 15:11:43 +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=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 393722C047 for ; Thu, 1 Nov 2018 15:11:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1EB06E3B1; Thu, 1 Nov 2018 15:11:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC99A6E3AF for ; Thu, 1 Nov 2018 15:11:35 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:33 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:33 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 6/7] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled Thread-Topic: [RESEND v7 6/7] drm: Add macro to export functions only when CONFIG_DRM_DEBUG_SELFTEST is enabled Thread-Index: AQHUcfUsbc4V7cVdK0eueIxoYz3Tkg== Date: Thu, 1 Nov 2018 15:11:32 +0000 Message-ID: <20181101151051.1509-7-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:OKeHkVzJt2U7kFWrDc9CzOBD1cJrtwnUJdx4THLxrKKOndxByKiP9+ELSAJNDN/VmTFfKdAOzOseCM1fjsaglj4trNXkN8ZzCs5zANeZGlqxs0RKvFjJ2+ZS2diRNfr4bHXmf7JQBfoFlafWtdiD5ajw5eItwDLaa+EHh4BuTu+pp9l5+gCFstlqxGTEVn7scoDbR6pXYKOWG+zmYxNgAfymKZMDWXFEJ807wVRhoacB3y9RnPoFt9HamEvy6pqAziXjJx/AHGLZV89SOUMsoNnbjYsKcVAskME/OycMRxLr9GcQZcY3JHMXB6MCe1+1KDT1+2Rjz2W+AMnd+/JnwSJNc+wQZzPzfFFdH8UIZHi/fzCVypkjhCXkuck0lZM0LC3Rb1x/YhUp0OVMjuhHAVvRnEq7hsk+DiTQCPUqh+KFCRyPH8/aAEWQ6cNwAKhfk8cqHXi5qN/ZJ66YazGX8g==; 5:B52FO0dRbF20nG7bDpNaEEoIc9XCcWP7KKy/Ll1IQqZi6ykAeHuytFeXwEHzaIT3m+BFL5madNS+uEZ/n2MLGPZBiC4tQrPsCruv36j5qpJ3Yw6AqDoqoUsPhwqmJYAOwPtHkujXBUKeYHDwcO/NuSkFbAdycd0wD2XK/O07wCA=; 7:sysX1Tcs5IF2Zn62kyQZzNl0VNVQjRlBpPIxE2B159jeqzH+sU04r85/dQfS2qk3JNNEM1ZbQkjTi31ilOZ+DlDgutwhcYeL4ue6Ld0oUwIQv6LbaUr0xhDFGXPFf/Hz2S35lcPkr5G8EcJNCfTj8g== x-ms-office365-filtering-correlation-id: e1350706-753b-425f-2712-08d6400c4eee x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(14444005)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LmeqD8LdA2p1VQDdr6anEEnsO/Cuv7lu2E5AG+p0l328i0cVXqzTX3GWIaWPRVHIh6ASkydi4uinjoKx2lyqeHabfR3BJ2qtqDILA55+W5igi/y+AnvVzm9iOnxfpvJ+KAjoD9u7unV1HeHspFSbexQ2ylHkipyTIelNYdyxGfo0EsUMFBxOeDjSWQZ7uO3Z56XchbeHnpn4A2NXoBye8Da0e4wUS2YwBpZH/gRA61J6T4ZXxrxpEelKA7rwqAyOsySoEQzRqf+Rt1A3RulhmqLyDvQn02WedjjSbLZzQLH2CqBt7vylZIsUxV+6BTc86s0Ot+fFSbmNrR0h9Wgdd6YcPDnLj9vv2i8K9kVLcbk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1350706-753b-425f-2712-08d6400c4eee X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:32.9941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If we want to be able to write drmselftests for non-static core functions that are not intended to be used by drivers we need this functions to be exported. This adds a macro that is tied of CONFIG_DRM_DEBUG_SELFTEST, and uses that to export drm_internal_framebuffer_create, in order for subsequent patches to be able to test it. Signed-off-by: Alexandru Gheorghe Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_framebuffer.c | 1 + include/drm/drmP.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 167c1c4544af..fcaea8f50513 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -323,6 +323,7 @@ drm_internal_framebuffer_create(struct drm_device *dev, return fb; } +EXPORT_SYMBOL_FOR_TESTS_ONLY(drm_internal_framebuffer_create); /** * drm_mode_addfb2 - add an FB to the graphics configuration diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 05350424a4d3..514beb2d483a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -110,4 +110,10 @@ static inline bool drm_can_sleep(void) return true; } +#if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE) +#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x) +#else +#define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) +#endif + #endif From patchwork Thu Nov 1 15:11:33 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: 10664097 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 349D915E9 for ; Thu, 1 Nov 2018 15:12:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 218672BF94 for ; Thu, 1 Nov 2018 15:12:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15C6B2BFEE; Thu, 1 Nov 2018 15:12: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=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 EFEFB2C002 for ; Thu, 1 Nov 2018 15:12:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D68446E3E4; Thu, 1 Nov 2018 15:11:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3C6016E3AF for ; Thu, 1 Nov 2018 15:11:36 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:33 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:33 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 7/7] drm/selftests: Add tests for drm_internal_framebuffer_create Thread-Topic: [RESEND v7 7/7] drm/selftests: Add tests for drm_internal_framebuffer_create Thread-Index: AQHUcfUskdvcSRtfeE2bzxk9bl1AIw== Date: Thu, 1 Nov 2018 15:11:33 +0000 Message-ID: <20181101151051.1509-8-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:BXLYFYODr9uYtwICiuSZ98tr7PheBxLb6FpWGVsP1hfOsMx7YG2P7aprTIehbQlfeSC0e2caHA7JDpoAHLIoa9SrgJsHDCrpos7ni91UecHogSI5ljnwWBxO1ELDI1T30J3zoqhMJSowLs+9BqzLnlR+i5kAcD/1uF/fYf10e8cPiCwzyKmg6QngY6Ug900o3YKeGO2gISZH/rxCkIXAINQC7WGe9AFZLmkbyzMT2PHE/kReaSpD9rR7mr+p4Q+/76JWGG5NHW/VAp20/DJPhSndUpWJ7TCY7rrapfshg1XqH/jgjBYk08Aapc4fTGGHgGzF116qoIGIr7XjtSrq4+SccJ1cPAFHmqvptMRP6ztZZzoCH6vvV+AFNUc6ZCakjSedWbYN4vlIGM+mywWhwlQRiXDa46KNcGQzUzwSOHqZJf4d6M/9FjVjnbrtGOFRDIIm1jJzI4AhSTSMUTLeRA==; 5:FER24PzBWjbxBewHkx7x43Y+X+9ek6GcWuMjthZGPPblOy6FgNPch1GEiLuVLoHvGvXfm4Ul0KjKk05FKTf+PNcSSNVY5KZ3qcsGgkF7shMD9UyA6qvx1JljCCSu+4ZqzlGTuBD8WI9vNcuF6EDsl71TRvMuS88lir8U6eFAn9s=; 7:DrieKuyNOdYMWoO++tq5FeB1rWILLxmAycjII0n3y4gPiK0kjHB+u56YdQ4W3ojRdBWiRIBzGU+QpJ5tcRbdr1Ul5bCuBcCV65V9p2iXoZNItB2SqCM8cJJLzcMQhuWgjB5ezlWvtsY07czlJlsB3Q== x-ms-office365-filtering-correlation-id: 20401e28-a961-4365-f79f-08d6400c4f3a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(53936002)(53946003)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(4744004)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(575784001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(14444005)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rhy3ABl+4u+dza7a4bI5GKcQxyau7Wuc+XSy2+oj88tMcr6FvtJEpy94vufI2ZwiKqBTCf0JVRJVDwD2tCEErOo/y25icF1D2SOPLF3KCNu3jc1Zb71hcfMc5JbQAHzOD9p6hHaph/hRZh1CPWMX1hS5zPKymXVdJv8Gyq4febwglz2GQfn/H4UTqQzTsx9abjZt4cK1C+BhekCaWuOoAIU6P47Lhv34eJN1UiirDEBwVVdrxE/29uc+8s0Au3pUNplYjBIrSXGSRjyFpeHvT+0VaO/W0DZY2NJxs+b+WYVLUSEI2khuUMEGd0KWHAhe01x5aUCfgZMUCsJKIBXYuHXjWW99Zu0+oco+sCoWpc4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20401e28-a961-4365-f79f-08d6400c4f3a X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:33.6967 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add tests that verify that drm_internal_framebuffer_create creates buffers correctly by creating a dummy drm_device with a mock function for the fb_create callback. To decide if a buffer has been created or not it just checks if fb_create callback has been called for the particular drm_mode_fb_cmd2 that's being tested. Signed-off-by: Alexandru Gheorghe Reviewed-by: Daniel Vetter --- drivers/gpu/drm/selftests/Makefile | 2 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 1 + .../gpu/drm/selftests/test-drm_framebuffer.c | 344 ++++++++++++++++++ .../drm/selftests/test-drm_modeset_common.h | 1 + 4 files changed, 347 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/selftests/test-drm_framebuffer.c diff --git a/drivers/gpu/drm/selftests/Makefile b/drivers/gpu/drm/selftests/Makefile index 07b4f88b422a..383d8d6c5847 100644 --- a/drivers/gpu/drm/selftests/Makefile +++ b/drivers/gpu/drm/selftests/Makefile @@ -1,4 +1,4 @@ test-drm_modeset-y := test-drm_modeset_common.o test-drm_plane_helper.o \ - test-drm_format.o + test-drm_format.o test-drm_framebuffer.o obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o diff --git a/drivers/gpu/drm/selftests/drm_modeset_selftests.h b/drivers/gpu/drm/selftests/drm_modeset_selftests.h index 4e203ac8c134..92601defd8f6 100644 --- a/drivers/gpu/drm/selftests/drm_modeset_selftests.h +++ b/drivers/gpu/drm/selftests/drm_modeset_selftests.h @@ -10,3 +10,4 @@ selftest(check_plane_state, igt_check_plane_state) selftest(check_drm_format_block_width, igt_check_drm_format_block_width) selftest(check_drm_format_block_height, igt_check_drm_format_block_height) selftest(check_drm_format_min_pitch, igt_check_drm_format_min_pitch) +selftest(check_drm_framebuffer_create, igt_check_drm_framebuffer_create) diff --git a/drivers/gpu/drm/selftests/test-drm_framebuffer.c b/drivers/gpu/drm/selftests/test-drm_framebuffer.c new file mode 100644 index 000000000000..3098435678af --- /dev/null +++ b/drivers/gpu/drm/selftests/test-drm_framebuffer.c @@ -0,0 +1,344 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Test cases for the drm_framebuffer functions + */ + +#include +#include "../drm_crtc_internal.h" + +#include "test-drm_modeset_common.h" + +#define MIN_WIDTH 4 +#define MAX_WIDTH 4096 +#define MIN_HEIGHT 4 +#define MAX_HEIGHT 4096 + +struct drm_framebuffer_test { + int buffer_created; + struct drm_mode_fb_cmd2 cmd; + const char *name; +}; + +static struct drm_framebuffer_test createbuffer_tests[] = { +{ .buffer_created = 1, .name = "ABGR8888 normal sizes", + .cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .pitches = { 4 * 600, 0, 0 }, + } +}, +{ .buffer_created = 1, .name = "ABGR8888 max sizes", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + } +}, +{ .buffer_created = 1, .name = "ABGR8888 pitch greater than min required", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .pitches = { 4 * MAX_WIDTH + 1, 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 pitch less than min required", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .pitches = { 4 * MAX_WIDTH - 1, 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Invalid width", + .cmd = { .width = MAX_WIDTH + 1, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .pitches = { 4 * (MAX_WIDTH + 1), 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Invalid buffer handle", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 0, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "No pixel format", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = 0, + .handles = { 1, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Width 0", + .cmd = { .width = 0, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Height 0", + .cmd = { .width = MAX_WIDTH, .height = 0, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Out of bound height * pitch combination", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX - 1, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + } +}, +{ .buffer_created = 1, .name = "ABGR8888 Large buffer offset", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + } +}, +{ .buffer_created = 1, .name = "ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 }, + .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + } +}, +{ .buffer_created = 1, .name = "ABGR8888 Valid buffer modifier", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 }, .pitches = { 4 * MAX_WIDTH, 0, 0 }, + .flags = DRM_MODE_FB_MODIFIERS, .modifier = { AFBC_FORMAT_MOD_YTR, 0, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 }, + .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, 0, 0 }, + } +}, +{ .buffer_created = 1, .name = "ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 }, + .pitches = { 4 * MAX_WIDTH, 4 * MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + .pitches = { 4 * MAX_WIDTH, 4 * MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 1, .name = "NV12 Normal sizes", + .cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .pitches = { 600, 600, 0 }, + } +}, +{ .buffer_created = 1, .name = "NV12 Max sizes", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .pitches = { MAX_WIDTH, MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 0, .name = "NV12 Invalid pitch", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .pitches = { MAX_WIDTH, MAX_WIDTH - 1, 0 }, + } +}, +{ .buffer_created = 0, .name = "NV12 Invalid modifier/misssing DRM_MODE_FB_MODIFIERS flag", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .modifier = { DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, 0, 0 }, + .pitches = { MAX_WIDTH, MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 0, .name = "NV12 different modifier per-plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, 0, 0 }, + .pitches = { MAX_WIDTH, MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 1, .name = "NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, 0 }, + .pitches = { MAX_WIDTH, MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 0, .name = "NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .modifier = { DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, + DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, 0 }, + .pitches = { MAX_WIDTH, MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 0, .name = "NV12 Modifier for inexistent plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, DRM_FORMAT_MOD_SAMSUNG_64_32_TILE, + DRM_FORMAT_MOD_SAMSUNG_64_32_TILE }, + .pitches = { MAX_WIDTH, MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 0, .name = "NV12 Handle for inexistent plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS, .pitches = { MAX_WIDTH, MAX_WIDTH, 0 }, + } +}, +{ .buffer_created = 1, .name = "NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS", + .cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_NV12, + .handles = { 1, 1, 1 }, .pitches = { 600, 600, 600 }, + } +}, +{ .buffer_created = 1, .name = "YVU420 Normal sizes", + .cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS, + .pitches = { 600, 300, 300 }, + } +}, +{ .buffer_created = 1, .name = "YVU420 DRM_MODE_FB_MODIFIERS set without modifier", + .cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .pitches = { 600, 300, 300 }, + } +}, +{ .buffer_created = 1, .name = "YVU420 Max sizes", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), + DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 0, .name = "YVU420 Invalid pitch", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2) - 1, + DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 1, .name = "YVU420 Different pitches", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2) + 1, + DIV_ROUND_UP(MAX_WIDTH, 2) + 7 }, + } +}, +{ .buffer_created = 1, .name = "YVU420 Different buffer offsets/pitches", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .offsets = { MAX_WIDTH, MAX_WIDTH + MAX_WIDTH * MAX_HEIGHT, + MAX_WIDTH + 2 * MAX_WIDTH * MAX_HEIGHT }, + .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2) + 1, DIV_ROUND_UP(MAX_WIDTH, 2) + 7 }, + } +}, +{ .buffer_created = 0, .name = "YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .modifier = { AFBC_FORMAT_MOD_SPARSE, 0, 0 }, + .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 0, .name = "YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .modifier = { AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE, 0 }, + .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 0, .name = "YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE, 0 }, + .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 1, .name = "YVU420 Valid modifier", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE }, + .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 0, .name = "YVU420 Different modifiers per plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE | AFBC_FORMAT_MOD_YTR, + AFBC_FORMAT_MOD_SPARSE }, + .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 0, .name = "YVU420 Modifier for inexistent plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YVU420, + .handles = { 1, 1, 1 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE, + AFBC_FORMAT_MOD_SPARSE }, + .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), DIV_ROUND_UP(MAX_WIDTH, 2) }, + } +}, +{ .buffer_created = 1, .name = "X0L2 Normal sizes", + .cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 0, 0 }, .pitches = { 1200, 0, 0 } + } +}, +{ .buffer_created = 1, .name = "X0L2 Max sizes", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 0, 0 }, .pitches = { 2 * MAX_WIDTH, 0, 0 } + } +}, +{ .buffer_created = 0, .name = "X0L2 Invalid pitch", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 0, 0 }, .pitches = { 2 * MAX_WIDTH - 1, 0, 0 } + } +}, +{ .buffer_created = 1, .name = "X0L2 Pitch greater than minimum required", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 0, 0 }, .pitches = { 2 * MAX_WIDTH + 1, 0, 0 } + } +}, +{ .buffer_created = 0, .name = "X0L2 Handle for inexistent plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 1, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + .pitches = { 2 * MAX_WIDTH + 1, 0, 0 } + } +}, +{ .buffer_created = 1, .name = "X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 0, 0 }, .offsets = { 0, 0, 3 }, + .pitches = { 2 * MAX_WIDTH + 1, 0, 0 } + } +}, +{ .buffer_created = 0, .name = "X0L2 Modifier without DRM_MODE_FB_MODIFIERS set", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 0, 0 }, .pitches = { 2 * MAX_WIDTH + 1, 0, 0 }, + .modifier = { AFBC_FORMAT_MOD_SPARSE, 0, 0 }, + } +}, +{ .buffer_created = 1, .name = "X0L2 Valid modifier", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_X0L2, + .handles = { 1, 0, 0 }, .pitches = { 2 * MAX_WIDTH + 1, 0, 0 }, + .modifier = { AFBC_FORMAT_MOD_SPARSE, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + } +}, +{ .buffer_created = 0, .name = "X0L2 Modifier for inexistent plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, + .pixel_format = DRM_FORMAT_X0L2, .handles = { 1, 0, 0 }, + .pitches = { 2 * MAX_WIDTH + 1, 0, 0 }, + .modifier = { AFBC_FORMAT_MOD_SPARSE, AFBC_FORMAT_MOD_SPARSE, 0 }, + .flags = DRM_MODE_FB_MODIFIERS, + } +}, +}; + +static struct drm_framebuffer *fb_create_mock(struct drm_device *dev, + struct drm_file *file_priv, + const struct drm_mode_fb_cmd2 *mode_cmd) +{ + int *buffer_created = dev->dev_private; + *buffer_created = 1; + return ERR_PTR(-EINVAL); +} + +static int execute_drm_mode_fb_cmd2(struct drm_mode_fb_cmd2 *r) +{ + int buffer_created = 0; + struct drm_framebuffer *fb; + struct drm_mode_config_funcs mock_config_funcs = { + .fb_create = fb_create_mock, + }; + struct drm_device mock_drm_device = { + .mode_config = { + .min_width = MIN_WIDTH, + .max_width = MAX_WIDTH, + .min_height = MIN_HEIGHT, + .max_height = MAX_HEIGHT, + .allow_fb_modifiers = true, + .funcs = &mock_config_funcs, + }, + .dev_private = &buffer_created + }; + + fb = drm_internal_framebuffer_create(&mock_drm_device, r, NULL); + return buffer_created; +} + +int igt_check_drm_framebuffer_create(void *ignored) +{ + int i = 0; + + for (i = 0; i < ARRAY_SIZE(createbuffer_tests); i++) { + FAIL(createbuffer_tests[i].buffer_created != + execute_drm_mode_fb_cmd2(&createbuffer_tests[i].cmd), + "Test %d: \"%s\" failed\n", i, createbuffer_tests[i].name); + } + + return 0; +} diff --git a/drivers/gpu/drm/selftests/test-drm_modeset_common.h b/drivers/gpu/drm/selftests/test-drm_modeset_common.h index 592a6581b189..d5df5bd51b05 100644 --- a/drivers/gpu/drm/selftests/test-drm_modeset_common.h +++ b/drivers/gpu/drm/selftests/test-drm_modeset_common.h @@ -17,5 +17,6 @@ int igt_check_plane_state(void *ignored); int igt_check_drm_format_block_width(void *ignored); int igt_check_drm_format_block_height(void *ignored); int igt_check_drm_format_min_pitch(void *ignored); +int igt_check_drm_framebuffer_create(void *ignored); #endif