public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Smith <eric.smith@collabora.com>
To: Daniel Stone <daniel@fooishbar.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	kernel@collabora.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: add modifiers for MediaTek tiled formats
Date: Wed, 18 Dec 2024 20:20:26 -0400	[thread overview]
Message-ID: <f9dd18f5-c239-4d96-b0e8-e11e9712fc8a@collabora.com> (raw)
In-Reply-To: <CAPj87rMT-YsUj2gyfoCUFUPx0BWxAhcz8LgvAhco0-JzhKeXxQ@mail.gmail.com>

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


  reply	other threads:[~2024-12-19  0:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 18:47 [PATCH] drm: add modifiers for MediaTek tiled formats eric.smith
2024-12-18 14:33 ` Daniel Stone
2024-12-19  0:20   ` Eric Smith [this message]
2024-12-19  9:18     ` Daniel Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9dd18f5-c239-4d96-b0e8-e11e9712fc8a@collabora.com \
    --to=eric.smith@collabora.com \
    --cc=airlied@gmail.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox