uint32_t pitchalign = fd_screen(pscreen)->gmem_alignw * rsc->layout.cpp;
- /* use 64 pitchalign on a6xx where gmem_alignw is not right */
+ /* pitchalign is 64-bytes for linear formats on a6xx
+ * layout_resource_for_modifier will validate tiled pitch
+ */
if (is_a6xx(screen))
- pitchalign = 64 * rsc->layout.cpp;
+ pitchalign = 64;
if ((slice->pitch < align(prsc->width0 * rsc->layout.cpp, pitchalign)) ||
(slice->pitch & (pitchalign - 1)))
{
switch (modifier) {
case DRM_FORMAT_MOD_LINEAR:
+ /* The dri gallium frontend will pass DRM_FORMAT_MOD_INVALID to us
+ * when it's called through any of the non-modifier BO create entry
+ * points. Other drivers will determine tiling from the kernel or
+ * other legacy backchannels, but for freedreno it just means
+ * LINEAR. */
+ case DRM_FORMAT_MOD_INVALID:
return 0;
default:
return -1;