Skip to content

etnaviv: Fix padding for allocated resources for kmsro scanout

Daniel Abrecht requested to merge DPA/mesa:etnaviv-res-pad-fix into master

etna_resource_alloc takes a layout and a modifier parameter. It looks like the modifier is intended to be used if kmsro is used and it is a scanout resource, and the layout is used otherwise. These two parameters do not always match, etna_resource_create for example always always passes DRM_FORMAT_MOD_LINEAR to etna_resource_alloc regardless of the layout, such that it will be linear in the kmsro scanout case, but a better suited layout otherwise.

The problem is that in the kmsro scanout case, etna_resource_alloc may add padding based on the layout rather than the modifier parameter. This can lead to padding being added when it wouldn't have been necessary otherwise, and that can cause problems with mxsfb, which currently can't deal with additional padding.

This MR just sets the layout based on the modifier in etna_resource_alloc for the kmsro scanout case.

It may make sense to refactor etna_resource_alloc at some point and drop its modifier parameter, though.

Signed-off-by: default avatarDaniel Abrecht public@danielabrecht.ch

Merge request reports