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

From: Liviu Dudau
Date: Mon Sep 23 2019 - 09:50:03 EST


On Mon, Sep 23, 2019 at 08:46:23PM +0800, Sandy Huang wrote:
> cpp[BytePerPlane] can't describe the 10bit data format correctly,
> So we use bpp[BitPerPlane] to instead cpp.
>
> Signed-off-by: Sandy Huang <hjc@xxxxxxxxxxxxxx>

Adding Ayan as well.

Best regards,
Liviu

> ---
> 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(-)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
> index 3b0a70e..d02dfc6 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c
> index bd8265f..54be8d1 100644
> --- a/drivers/gpu/drm/arm/malidp_hw.c
> +++ b/drivers/gpu/drm/arm/malidp_hw.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index 3c70a53..628f325 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -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;
> }
> --
> 2.7.4
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
Â\_(ã)_/Â