drm/i915/adlp/fb: Prevent the mapping of redundant trailing padding NULL pages
So far the remapped view size in GTT/DPT was padded to the next aligned
offset unnecessarily after the last color plane with an unaligned size.
Remove the unnecessary padding.
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Fixes: 3d1adc3d64
("drm/i915/adlp: Add support for remapping CCS FBs")
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-3-imre.deak@intel.com
This commit is contained in:
@@ -620,9 +620,16 @@ unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0 ; i < ARRAY_SIZE(rem_info->plane); i++) {
|
for (i = 0 ; i < ARRAY_SIZE(rem_info->plane); i++) {
|
||||||
|
unsigned int plane_size;
|
||||||
|
|
||||||
|
plane_size = rem_info->plane[i].dst_stride * rem_info->plane[i].height;
|
||||||
|
if (plane_size == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (rem_info->plane_alignment)
|
if (rem_info->plane_alignment)
|
||||||
size = ALIGN(size, rem_info->plane_alignment);
|
size = ALIGN(size, rem_info->plane_alignment);
|
||||||
size += rem_info->plane[i].dst_stride * rem_info->plane[i].height;
|
|
||||||
|
size += plane_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
|
@@ -1396,6 +1396,9 @@ remap_pages(struct drm_i915_gem_object *obj,
|
|||||||
{
|
{
|
||||||
unsigned int row;
|
unsigned int row;
|
||||||
|
|
||||||
|
if (!width || !height)
|
||||||
|
return sg;
|
||||||
|
|
||||||
if (alignment_pad) {
|
if (alignment_pad) {
|
||||||
st->nents++;
|
st->nents++;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user