Skip to contentSkip to conversation

drm/arm: use bpp instead of cpp for drm_format_info

PATCH In review Sandy Huang 2 participants 2 messages Sep 23, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 10/36 drm/arm: use bpp instead of cpp for drm_format_info

cpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp.

---
 drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 2 +-
 drivers/gpu/drm/arm/malidp_hw.c                         | 2 +-
 drivers/gpu/drm/arm/malidp_planes.c                     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +1 -1
index 3b0a70e..d02dfc6 100644
@@ -89,7 +89,7 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file,
 				    alignment_header);
 
 	kfb->afbc_size = kfb->offset_payload + n_blocks *
-			 ALIGN(info->cpp[0] * AFBC_SUPERBLK_PIXELS,
+			 ALIGN(info->bpp[0] / 8 * AFBC_SUPERBLK_PIXELS,
 			       AFBC_SUPERBLK_ALIGNMENT);
 	min_size = kfb->afbc_size + fb->offsets[0];
 	if (min_size > obj->size) {
drivers/gpu/drm/arm/malidp_hw.c +1 -1
index bd8265f..54be8d1 100644
@@ -384,7 +384,7 @@ static void malidp500_modeset(struct malidp_hw_device *hwdev, struct videomode *
 int malidp_format_get_bpp(u32 fmt)
 {
 	const struct drm_format_info *info = drm_format_info(fmt);
-	int bpp = info->cpp[0] * 8;
+	int bpp = info->bpp[0];
 
 	if (bpp == 0) {
 		switch (fmt) {
drivers/gpu/drm/arm/malidp_planes.c +1 -1
index 3c70a53..628f325 100644
@@ -225,7 +225,7 @@ bool malidp_format_mod_supported(struct drm_device *drm,
 
 	if (modifier & AFBC_SPLIT) {
 		if (!info->is_yuv) {
-			if (info->cpp[0] <= 2) {
+			if (info->bpp[0] <= 16) {
 				DRM_DEBUG_KMS("RGB formats <= 16bpp are not supported with SPLIT\n");
 				return false;
 			}
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 4 lines · Sandy Huang

cpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp.

Adding Ayan as well.

Best regards,
Liviu

Quoted 54 lines
---
 drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 2 +-
 drivers/gpu/drm/arm/malidp_hw.c                         | 2 +-
 drivers/gpu/drm/arm/malidp_planes.c                     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +1 -1
index 3b0a70e..d02dfc6 100644
@@ -89,7 +89,7 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file,
 				    alignment_header);
 
 	kfb->afbc_size = kfb->offset_payload + n_blocks *
-			 ALIGN(info->cpp[0] * AFBC_SUPERBLK_PIXELS,
+			 ALIGN(info->bpp[0] / 8 * AFBC_SUPERBLK_PIXELS,
 			       AFBC_SUPERBLK_ALIGNMENT);
 	min_size = kfb->afbc_size + fb->offsets[0];
 	if (min_size > obj->size) {
drivers/gpu/drm/arm/malidp_hw.c +1 -1
index bd8265f..54be8d1 100644
@@ -384,7 +384,7 @@ static void malidp500_modeset(struct malidp_hw_device *hwdev, struct videomode *
 int malidp_format_get_bpp(u32 fmt)
 {
 	const struct drm_format_info *info = drm_format_info(fmt);
-	int bpp = info->cpp[0] * 8;
+	int bpp = info->bpp[0];
 
 	if (bpp == 0) {
 		switch (fmt) {
drivers/gpu/drm/arm/malidp_planes.c +1 -1
index 3c70a53..628f325 100644
@@ -225,7 +225,7 @@ bool malidp_format_mod_supported(struct drm_device *drm,
 
 	if (modifier & AFBC_SPLIT) {
 		if (!info->is_yuv) {
-			if (info->cpp[0] <= 2) {
+			if (info->bpp[0] <= 16) {
 				DRM_DEBUG_KMS("RGB formats <= 16bpp are not supported with SPLIT\n");
 				return false;
 			}
Signature · 8 lines
2.7.4



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯