asahi: Respect linear strides

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086>
This commit is contained in:
Alyssa Rosenzweig 2021-05-31 03:33:05 +05:30 committed by Marge Bot
parent 118682dd83
commit e90d167d3d
1 changed files with 8 additions and 2 deletions

View File

@ -344,7 +344,10 @@ agx_create_sampler_view(struct pipe_context *pctx,
cfg.srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
cfg.unk_1 = rsrc->bo->ptr.gpu;
cfg.unk_2 = false;
cfg.stride = AGX_RT_STRIDE_TILED;
cfg.stride = (rsrc->modifier == DRM_FORMAT_MOD_LINEAR) ?
(rsrc->slices[0].line_stride - 16) :
AGX_RT_STRIDE_TILED;
}
/* Initialize base object */
@ -580,7 +583,10 @@ agx_set_framebuffer_state(struct pipe_context *pctx,
cfg.width = state->width;
cfg.height = state->height;
cfg.buffer = tex->bo->ptr.gpu;
cfg.stride = AGX_RT_STRIDE_TILED;
cfg.stride = (tex->modifier == DRM_FORMAT_MOD_LINEAR) ?
(tex->slices[0].line_stride - 4) :
AGX_RT_STRIDE_TILED;
};
}
}