}
static bool
-panfrost_should_linear_convert(struct panfrost_resource *prsrc,
+panfrost_should_linear_convert(struct panfrost_device *dev,
+ struct panfrost_resource *prsrc,
struct pipe_transfer *transfer)
{
if (prsrc->modifier_constant)
if (entire_overwrite)
++prsrc->modifier_updates;
- return prsrc->modifier_updates >= LAYOUT_CONVERT_THRESHOLD;
+ if (prsrc->modifier_updates >= LAYOUT_CONVERT_THRESHOLD) {
+ perf_debug(dev, "Transitioning to linear due to streaming usage");
+ return true;
+ } else {
+ return false;
+ }
}
static void
if (trans->staging.rsrc) {
if (transfer->usage & PIPE_MAP_WRITE) {
- if (panfrost_should_linear_convert(prsrc, transfer)) {
+ if (panfrost_should_linear_convert(dev, prsrc, transfer)) {
panfrost_bo_unreference(prsrc->image.data.bo);
if (prsrc->image.crc.bo)
if (prsrc->image.layout.modifier == DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED) {
assert(transfer->box.depth == 1);
- if (panfrost_should_linear_convert(prsrc, transfer)) {
+ if (panfrost_should_linear_convert(dev, prsrc, transfer)) {
panfrost_resource_setup(dev, prsrc, DRM_FORMAT_MOD_LINEAR,
prsrc->image.layout.format);
if (prsrc->image.layout.data_size > bo->size) {