[PATCH] drm: malidp: Add the size of the superblocks when calculating total size for AFBC buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The size of the superblocks being added to the total AFBC buffer size
got lost in the upstreaming process. Add it back.

Cc: Ayan Kumar Halder <ayan.halder@xxxxxxx>
Signed-off-by: Liviu Dudau <liviu.dudau@xxxxxxx>
---
 drivers/gpu/drm/arm/malidp_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 90214851637f4..505f316a192ec 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -38,6 +38,7 @@
 
 #define MALIDP_CONF_VALID_TIMEOUT	250
 #define AFBC_HEADER_SIZE		16
+#define AFBC_SUPERBLK_ALIGNMENT		128
 
 static void malidp_write_gamma_table(struct malidp_hw_device *hwdev,
 				     u32 data[MALIDP_COEFFTAB_NUM_COEFFS])
@@ -336,7 +337,8 @@ malidp_verify_afbc_framebuffer_size(struct drm_device *dev,
 	afbc_superblock_size = info->cpp[0] * afbc_superblock_width *
 		afbc_superblock_height;
 
-	afbc_size = ALIGN(n_superblocks * AFBC_HEADER_SIZE, 128);
+	afbc_size = ALIGN(n_superblocks * AFBC_HEADER_SIZE, AFBC_SUPERBLK_ALIGNMENT);
+	afbc_size += n_superblocks * ALIGN(afbc_superblock_size, AFBC_SUPERBLK_ALIGNMENT);
 
 	if (mode_cmd->width * info->cpp[0] != mode_cmd->pitches[0]) {
 		DRM_DEBUG_KMS("Invalid value of pitch (=%u) should be same as width (=%u) * cpp (=%u)\n",
-- 
2.18.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux