mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 03:50:13 +01:00
asahi: Rename our fake twiddled DRM modifier
To account for non-64x64 tile sizes. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18167>
This commit is contained in:
parent
4ed9843a26
commit
1f89e67883
3 changed files with 7 additions and 7 deletions
|
|
@ -145,7 +145,7 @@ agx_select_modifier(const struct agx_resource *pres)
|
|||
return DRM_FORMAT_MOD_LINEAR;
|
||||
|
||||
/* Default to tiled */
|
||||
return DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER;
|
||||
return DRM_FORMAT_MOD_APPLE_TWIDDLED;
|
||||
}
|
||||
|
||||
static struct pipe_resource *
|
||||
|
|
@ -277,7 +277,7 @@ agx_transfer_map(struct pipe_context *pctx,
|
|||
pipe_resource_reference(&transfer->base.resource, resource);
|
||||
*out_transfer = &transfer->base;
|
||||
|
||||
if (rsrc->modifier == DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER) {
|
||||
if (rsrc->modifier == DRM_FORMAT_MOD_APPLE_TWIDDLED) {
|
||||
transfer->base.stride =
|
||||
util_format_get_stride(resource->format, box->width);
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ agx_transfer_unmap(struct pipe_context *pctx,
|
|||
|
||||
/* Tiling will occur in software from a staging cpu buffer */
|
||||
if ((transfer->usage & PIPE_MAP_WRITE) &&
|
||||
rsrc->modifier == DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER) {
|
||||
rsrc->modifier == DRM_FORMAT_MOD_APPLE_TWIDDLED) {
|
||||
assert(trans->map != NULL);
|
||||
|
||||
for (unsigned z = 0; z < transfer->box.depth; ++z) {
|
||||
|
|
@ -659,7 +659,7 @@ agx_flush_frontbuffer(struct pipe_screen *_screen,
|
|||
void *map = winsys->displaytarget_map(winsys, rsrc->dt, PIPE_USAGE_DEFAULT);
|
||||
assert(map != NULL);
|
||||
|
||||
if (rsrc->modifier == DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER) {
|
||||
if (rsrc->modifier == DRM_FORMAT_MOD_APPLE_TWIDDLED) {
|
||||
ail_detile(rsrc->bo->ptr.cpu, map, &rsrc->layout, 0, rsrc->dt_stride,
|
||||
0, 0, rsrc->base.width0, rsrc->base.height0);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ static enum agx_layout
|
|||
agx_translate_layout(uint64_t modifier)
|
||||
{
|
||||
switch (modifier) {
|
||||
case DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER:
|
||||
case DRM_FORMAT_MOD_APPLE_TWIDDLED:
|
||||
return AGX_LAYOUT_TWIDDLED;
|
||||
case DRM_FORMAT_MOD_LINEAR:
|
||||
return AGX_LAYOUT_LINEAR;
|
||||
|
|
@ -486,7 +486,7 @@ agx_create_sampler_view(struct pipe_context *pctx,
|
|||
if (rsrc->modifier == DRM_FORMAT_MOD_LINEAR) {
|
||||
cfg.stride = ail_get_linear_stride_B(&rsrc->layout, level) - 16;
|
||||
} else {
|
||||
assert(rsrc->modifier == DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER);
|
||||
assert(rsrc->modifier == DRM_FORMAT_MOD_APPLE_TWIDDLED);
|
||||
cfg.stride = AGX_RT_STRIDE_TILED;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ agx_device(struct pipe_screen *p)
|
|||
#ifndef DRM_FORMAT_MOD_LINEAR
|
||||
#define DRM_FORMAT_MOD_LINEAR 1
|
||||
#endif
|
||||
#define DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER (2)
|
||||
#define DRM_FORMAT_MOD_APPLE_TWIDDLED (2)
|
||||
|
||||
struct agx_resource {
|
||||
struct pipe_resource base;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue