From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C6AC8BE7 for ; Thu, 19 Dec 2024 00:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734567643; cv=none; b=Hztnm7QJxEIaQkjINyZZUcwDSLpMwH7GwNdXWHc2LQmY8Qziz6Zj+WMUk/xQz5NtDRqmLQ06sbfhEZ035nL8MgzXc8VqC78OVIJ0lI9pUeShGs7X/Pi9vp/4AS/lfhQb6M081BZZGZGh3xsIiq4XX2Jq8pNlXVLP5ElQvl0XeQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734567643; c=relaxed/simple; bh=prf7TDv+ZzDSouCu7iNVMMGBrUlxtYagyWBsCIU10jw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gFNBJiAFwgRdax56xJKesNKski7F7bY52DIYxrEDEXymqp43nfJOT/C4fg4ev2bGtScdzplXT6wKH6xaBNAFSEDilgN4Us/UJGbqxzFyL08Cf/SuM4K4OZc3CUkfivDJQ222sVVejGmkOOjS84va4rVQntg9dK/Os+9wAikw6tU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=DqdWs9cT; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="DqdWs9cT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1734567639; bh=prf7TDv+ZzDSouCu7iNVMMGBrUlxtYagyWBsCIU10jw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DqdWs9cTuJssmnkhOBSaP5pwY5atJu0qGsKDKLYVsan1FWUpchSEAYhFUXFlLZVdV pqQjq7ltwSga3OiYxLPLiMfGdpXhitRajivPOk569zB9074OeBN2BAl4fNCqatyGLZ t7N6ibWIeXknCmUoIHpTa6Elec3cvy/3HsWCw0BGbQfNTC7L2J6Vk6k3Uo1LyrBZUW /WCjLiznEiBvWKomZkwPGzxdiYXtPqqkib/zam8rc4OxqEoqJELMPg8OYq63oISE3C USLj9nhiVpeG57RYi/LashR56C1LI7qWv4nqaCNxc9hWazj1hdsTXRnEbBs7VmoLUx u9W/9duGOIMSg== Received: from [192.168.7.37] (hlfxns017vw-47-55-142-63.dhcp-dynamic.fibreop.ns.bellaliant.net [47.55.142.63]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ericsmith) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3003E17E0DF0; Thu, 19 Dec 2024 01:20:38 +0100 (CET) Message-ID: Date: Wed, 18 Dec 2024 20:20:26 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm: add modifiers for MediaTek tiled formats To: Daniel Stone Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20241213184705.317138-1-eric.smith@collabora.com> Content-Language: en-US From: Eric Smith In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 18/12/2024 10.33, Daniel Stone wrote: >> +/* MediaTek layouts */ >> + >> +/* >> + * MediaTek Tiled Modifier >> + * This is a tiled layout using tiles of 16x32 pixels in a row-major layout. >> + * For chroma planes this becomes 16x16 tiles. >> + */ >> +#define DRM_FORMAT_MOD_MTK_16L_32S_TILE fourcc_mod_code(MTK, (1ULL << 0)) > I think this probably wants to be something like the tiling mode > defined in AMD/Arm modifiers, i.e. reserve a few bits in the range to > select the tile size, rather than using a single bit here. Thank you for taking the time, and for your suggestions. Are you thinking something along the lines of: /* MediaTek modifiers  * Bits  Parameter                Notes  * ----- ------------------------ ---------------------------------------------  *   3:0 TILE LAYOUT              Values are MTK_FMT_MOD_TILE_*  *   7:4 COMPRESSION              Values are MTK_FMT_MOD_COMPRESS_*  *  12:8 10 BIT LAYOUT            Values are MTK_FMT_MOD_10BIT_LAYOUT_*  *  */ #define DRM_FORMAT_MOD_MTK(__flags)        fourcc_mod_code(MTK, __flags) /*  * MediaTek Tiled Modifier  * The lowest 4 bits of the modifier is used to specify the tiling  * layout. Only the 16L_32S tiling is used for now, but we define an  * "untiled" version and leave room for future expansion.  */ #define MTK_FMT_MOD_TILE_MASK     0xf #define MTK_FMT_MOD_TILE_NONE     0x0 #define MTK_FMT_MOD_TILE_16L32S   0x1 /*  * Bits 4-7 specify compression options  */ #define MTK_FMT_MOD_COMPRESS_MASK (0xf << 4) #define MTK_FMT_MOD_COMPRESS_NONE (0x0 << 4) #define MTK_FMT_MOD_COMPRESS_V1   (0x1 << 4) /*  * Bits 8-11 specify how the bits of 10 bit formats are  * stored out in memory  */ #define MTK_FMT_MOD_10BIT_LAYOUT_MASK      (0xf << 8) #define MTK_FMT_MOD_10BIT_LAYOUT_PACKED    (0x0 << 8) #define MTK_FMT_MOD_10BIT_LAYOUT_LSBTILED  (0x1 << 8) #define MTK_FMT_MOD_10BIT_LAYOUT_LSBRASTER (0x2 << 8) Regards, Eric